VAG Example (VAG DEMO)

Programming examples for the Psy-Q SDK
User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

User avatar
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: March 27th, 2012, 9:09 pm
Skype: abernardo2011
Location: Brazil

Re: VAG Example (VAG DEMO)

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

see how to create and use vag the beginning

Image

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

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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

This demo doesn't play anything.

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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

Where do I find these examples?

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Chris
Active PSXDEV User
Active PSXDEV User
Posts: 47
Joined: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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: September 19th, 2013, 4:16 am
I am a: Programmer, Computers repairman.
Motto: Impossible Is Nothing
PlayStation Model: SCPH-5502
Want to Find: Nostalgia
Looking to: Learn till i can
Location: Italy
Contact:

Re: VAG Example (VAG DEMO)

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

Hi Chris, you can download a little software i have uploaded here: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: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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: September 19th, 2013, 4:16 am
I am a: Programmer, Computers repairman.
Motto: Impossible Is Nothing
PlayStation Model: SCPH-5502
Want to Find: Nostalgia
Looking to: Learn till i can
Location: Italy
Contact:

Re: VAG Example (VAG DEMO)

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: July 3rd, 2013, 4:38 am
Location: USA
Contact:

Re: VAG Example (VAG DEMO)

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
Curious PSXDEV User
Curious PSXDEV User
Posts: 23
Joined: April 1st, 2018, 9:34 am
Motto: You can accomplish anything.
Looking to: Create professional homebrew.
Location: United States

Re: VAG Example (VAG DEMO)

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
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

User avatar
MrQuetch
Curious PSXDEV User
Curious PSXDEV User
Posts: 23
Joined: April 1st, 2018, 9:34 am
Motto: You can accomplish anything.
Looking to: Create professional homebrew.
Location: United States

Re: VAG Example (VAG DEMO)

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
Admin / PSXDEV
Admin / PSXDEV
Posts: 2233
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: VAG Example (VAG DEMO)

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), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

User avatar
MrQuetch
Curious PSXDEV User
Curious PSXDEV User
Posts: 23
Joined: April 1st, 2018, 9:34 am
Motto: You can accomplish anything.
Looking to: Create professional homebrew.
Location: United States

Re: VAG Example (VAG DEMO)

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 2 guests