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

Re: VAG Example (VAG DEMO)

Post by Shadow » April 5th, 2018, 11:06 am

Again, there are no CD-ROM load functions. It won't work unless you code them in. It was written for use with CAETLA or CATFLAP since the VAG file is loaded directly into memory.
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, 12:18 pm

Shadow wrote:
April 5th, 2018, 11:06 am
Again, there are no CD-ROM load functions. It won't work unless you code them in. It was written for use with CAETLA or CATFLAP since the VAG file is loaded directly into memory.
My apologies. I understand that. What I meant to ask was how I would go about coding them in?

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 5th, 2018, 1:39 pm

I think there's an example of how to load from the CD somewhere on the forums. If not, code one up yourself or use the code from some of the homebrew programs.

You're looking for the function(s) "CdRead", "CdRead2" or "CdReadFile".
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.

ycelik
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: September 2nd, 2018, 10:19 am

Re: VAG Example (VAG DEMO)

Post by ycelik » November 26th, 2018, 1:10 am

First of all, Shadow, thanks for the example.
I only have one question about the sample: I can only seem to make it work with a limited amount of files.
I do alter the VAG_DATA_SIZE according to the .vag file in question; however, I just cannot hear anything.
The included pedobear.vag file works. However, any other file I offer does not; even the LION.VAG and GUITAR.VAG files included in the official SDK data folder.
On the other hand, very peculiar, the ui4.vag included in Orion's psxlib does play. Moreover, if I take his .wav file and convert it to another vag file via Vagedit, it still works (as of yet only tested on emulators).
There is no rhyme or reason to why I cannot get things to work with my own .vag files or the official .vag files.(the included test.vag also does not work).
All files are in mono and 22 khz.

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 » November 26th, 2018, 4:14 am

The files in the SDK may be corrupted. Also, be sure you're not exceeding the memory limit or addressing scheme. Best to also use VAGTOOL to play them back to see if they work. Otherwise, make your own from WAV files using VAGTOOL and try that.
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.

ycelik
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: September 2nd, 2018, 10:19 am

Re: VAG Example (VAG DEMO)

Post by ycelik » November 26th, 2018, 6:45 pm

You know, I had thought of the possibility of corrupt SDK Vag files, and therefore tried to convert a .wav file I had to .Vag with the Vagedit tool. However, that also did not work. Anyhow, after your comment I gave it another go with different .wav files, and, what do you know: it worked. Finally! The last element missing in my game: sound. Anyways, thanks for the comment.
Shadow wrote:
November 26th, 2018, 4:14 am
The files in the SDK may be corrupted. Also, be sure you're not exceeding the memory limit or addressing scheme. Best to also use VAGTOOL to play them back to see if they work. Otherwise, make your own from WAV files using VAGTOOL and try that.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest