VAG Example (VAG DEMO)

Programming examples for the Psy-Q SDK
User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

VAG Example (VAG DEMO)

Post by Shadow » October 2nd, 2012, 7:52 pm


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.

User avatar
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: Mar 27, 2012
Location: Brazil

Post by bizarro2011 » April 23rd, 2013, 10:21 am

see how to create and use vag the beginning

Image

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

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 4th, 2014, 8:39 am

This demo doesn't play anything.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » December 4th, 2014, 12:36 pm

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.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 4th, 2014, 6:16 pm

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

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » December 4th, 2014, 7:20 pm

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.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 4th, 2014, 7:34 pm

Where do I find these examples?

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » December 4th, 2014, 8:59 pm

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.
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.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 4th, 2014, 9:09 pm

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.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » December 4th, 2014, 9:36 pm

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.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 5th, 2014, 12:13 am

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?

User avatar
John
Curious PSXDEV User
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:

Post by John » December 5th, 2014, 1:35 am

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 :)

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » December 5th, 2014, 2:49 am

I'm confused. Nowhere in your code does it mention the sound and how to play it.

User avatar
John
Curious PSXDEV User
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:

Post by John » December 5th, 2014, 3:32 am

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.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: Jul 03, 2013
Location: USA
Contact:

Post by Chris » March 20th, 2015, 5:34 am

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.

User avatar
MrQuetch
Active PSXDEV User
Active PSXDEV User
Posts: 42
Joined: Apr 01, 2018
I am a: Programmer and artist.
Motto: You can accomplish anything.
Location: United States

Post by MrQuetch » April 4th, 2018, 5:03 am

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.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » April 4th, 2018, 12:49 pm

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.

User avatar
MrQuetch
Active PSXDEV User
Active PSXDEV User
Posts: 42
Joined: Apr 01, 2018
I am a: Programmer and artist.
Motto: You can accomplish anything.
Location: United States

Post by MrQuetch » April 4th, 2018, 2:18 pm

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.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » 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.
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.

User avatar
MrQuetch
Active PSXDEV User
Active PSXDEV User
Posts: 42
Joined: Apr 01, 2018
I am a: Programmer and artist.
Motto: You can accomplish anything.
Location: United States

Post by MrQuetch » April 5th, 2018, 4:08 am

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests