Page 1 of 2

VAG Example (VAG DEMO)

Posted: October 2nd, 2012, 7:52 pm
by Shadow

VAG DEMO

Username: Shadow
Project Title: VAG DEMO
Time to Complete: 2 hours
SDK: PSY-Q
Genre: Example
Latest Release: Version 1.0
In Development: No
Initial Release Date: 02-OCT-2012
Last Date Updated: 02-OCT-2012
Controller: -
Players: -
Memory Card: 0 Block
Languages: Eng
Region: -
Burn and Play: -
Executable Included: No
Source Included: Yes

This is an example of how to play VAG audio from the SPU RAM with DMA.
You will need to upload to the correct address the .VAG file you have selected (by default, it is pedobear.vag).
This can be seen in go.bat.

As soon as it loads the .EXE, the audio will start playing on a loop.
Edit the go.bat file and upload.bat files as needed for your PlayStation 1 development setup.
You will need PSY-Q to compile / build the .EXE obviously.
I hope you find this example useful as much as I did.

Source Code: http://psxdev.net/homebrew/files/vagdemo.zip

Re: VAG Example (VAG DEMO)

Posted: April 23rd, 2013, 10:21 am
by bizarro2011
see how to create and use vag the beginning

Image

[youtube]http://www.youtube.com/watch?v=RuZbFmGlJxo[/youtube]

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 8:39 am
by Chris
This demo doesn't play anything.

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 12:36 pm
by Shadow
It works, but you need to upload the VAG to the specified address. If you don't have the developer tools to do so, you will need to code in CD-ROM logic to copy it into RAM.

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 6:16 pm
by Chris
I am still very new to PSX programming. What do I need to do to upload the VAG to an address? Wouldn't this do that?

Code: Select all

#define VAG_DATA_SIZE  490784-48          // the total byte file size of the VAG file
#define VAG1_DRAM_ADDR 0x80100030L        // sound source address | 0x80180030L for test.vag | 0x80100030L for pedobear.vag
#define MALLOC_MAX 3

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 7:20 pm
by Shadow
No, that's is just defining what address to use. There is nothing in the RAM, so that's why it's failing. Upload to that address (or whatever address you wish) via the CD-ROM. The logic isn't that hard to code, and there are plenty of examples from Sony.

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 7:34 pm
by Chris
Where do I find these examples?

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 8:59 pm
by Shadow
Perhaps in the samples directory? :roll:
Try looking for CDSAMPLE.ZIP. That should have the code you need.
If you can't find it, I will upload it for you.

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 9:09 pm
by Chris
I typed in "CDSAMPLE.ZIP" in the search button up top and the only thing that came up was the post that you just made about it.

Re: VAG Example (VAG DEMO)

Posted: December 4th, 2014, 9:36 pm
by Shadow
No, search for it in the Psy-Q SDK...

Re: VAG Example (VAG DEMO)

Posted: December 5th, 2014, 12:13 am
by Chris
I found it but I don't understand any of it. It has 6 examples, none of which mention sound. What section of the code would I need to make the VAG file play?

Re: VAG Example (VAG DEMO)

Posted: December 5th, 2014, 1:35 am
by John
Hi Chris, you can download a little software i have uploaded here:http://www.psxdev.net/forum/viewtopic.php?f=66&t=686 source code its included, you can see how it is coded for make the "jump.vag" works, its the only sound used in that software, so you can't be lost. Well I guess :)

Re: VAG Example (VAG DEMO)

Posted: December 5th, 2014, 2:49 am
by Chris
I'm confused. Nowhere in your code does it mention the sound and how to play it.

Re: VAG Example (VAG DEMO)

Posted: December 5th, 2014, 3:32 am
by John
Chris wrote:I'm confused. Nowhere in your code does it mention the sound and how to play it.
The sound its named "jump.vag" you can play it with vagedit.exe, you can find it in "psyq\bin\VAGedit"
Just open auto.scr with notepad and you will find the link to it.

If you want to play it in game, just load FLY_LITTLE_BAT.bin with an emulator and jump in game with :cross

Maybe you should read some docs before to go ahead with .vag files or understanding the SPU.
See carefully the psyq-sdk its full of informations.

Re: VAG Example (VAG DEMO)

Posted: March 20th, 2015, 5:34 am
by Chris
I must have something missing, like some file I need to make a program with sound. I compiled Fly Little Bat, and it doesn't have any sound in it.

Re: VAG Example (VAG DEMO)

Posted: April 4th, 2018, 5:03 am
by MrQuetch
Hi Shadow. I know this thread is around five years old, but I'm trying to run this program in "no$psx"; I receive and error message before I get a black screen. Is this normal? I assume it's not. What am I doing wrong? Any help is appreciated. Thanks.

Re: VAG Example (VAG DEMO)

Posted: April 4th, 2018, 12:49 pm
by Shadow
What's the error you're getting?

Re: VAG Example (VAG DEMO)

Posted: April 4th, 2018, 2:18 pm
by MrQuetch
Shadow wrote: April 4th, 2018, 12:49 pm What's the error you're getting?
"Symbolic Info File Corrupt, Line 1".

To be honest, I'm not sure what that means. Is it referring to the source code or machine code?
The screen is black though, and the emulator is still up.

Re: VAG Example (VAG DEMO)

Posted: April 4th, 2018, 6:44 pm
by Shadow
This is a program for developers. It won't work on an emulator since it has no CD-ROM loading routines, and the code isn't meant for public use.

Re: VAG Example (VAG DEMO)

Posted: April 5th, 2018, 4:08 am
by MrQuetch
Shadow wrote: April 4th, 2018, 6:44 pm This is a program for developers. It won't work on an emulator since it has no CD-ROM loading routines, and the code isn't meant for public use.
Hmmm... So, what should I do then? Is my best bet testing the game on real hardware with a burned CD?