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

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), 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, 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
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

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

ycelik
Curious PSXDEV User
Curious PSXDEV User
Posts: 20
Joined: Sep 02, 2018

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
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

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

ycelik
Curious PSXDEV User
Curious PSXDEV User
Posts: 20
Joined: Sep 02, 2018

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