VAG Example (VAG DEMO)
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
VAG Example (VAG DEMO)
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
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
- bizarro2011
- Serious PSXDEV User
- Posts: 118
- Joined: Mar 27, 2012
- Location: Brazil
see how to create and use vag the beginning

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

[youtube]http://www.youtube.com/watch?v=RuZbFmGlJxo[/youtube]
This demo doesn't play anything.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
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.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
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
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
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.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
Where do I find these examples?
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
Perhaps in the samples directory? 
Try looking for CDSAMPLE.ZIP. That should have the code you need.
If you can't find it, I will upload it for you.

Try looking for CDSAMPLE.ZIP. That should have the code you need.
If you can't find it, I will upload it for you.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
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.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
No, search for it in the Psy-Q SDK...
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
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?
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
- John
- Curious PSXDEV User
- Posts: 19
- Joined: Sep 19, 2013
- I am a: Programmer, Computers repairman.
- Motto: Impossible Is Nothing
- PlayStation Model: SCPH-5502
- Location: Italy
- Contact:
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 

I'm confused. Nowhere in your code does it mention the sound and how to play it.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
- John
- Curious PSXDEV User
- Posts: 19
- Joined: Sep 19, 2013
- I am a: Programmer, Computers repairman.
- Motto: Impossible Is Nothing
- PlayStation Model: SCPH-5502
- Location: Italy
- Contact:
The sound its named "jump.vag" you can play it with vagedit.exe, you can find it in "psyq\bin\VAGedit"Chris wrote:I'm confused. Nowhere in your code does it mention the sound and how to play it.
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

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.
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.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
- MrQuetch
- Active PSXDEV User
- Posts: 42
- Joined: Apr 01, 2018
- I am a: Programmer and artist.
- Motto: You can accomplish anything.
- Location: United States
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.
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
What's the error you're getting?
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2691
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
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.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
Who is online
Users browsing this forum: No registered users and 3 guests