Basic Memory Card Example

Programming examples for the Psy-Q SDK
Post Reply
User avatar
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 349
Joined: April 10th, 2013, 3:47 pm
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Skype: lameguy64
Location: Philippines

Basic Memory Card Example

Post by LameGuy64 » April 2nd, 2015, 6:11 pm

I was going to release this example last year but I forgot where I placed it until now. Unlike the memory card examples that came with the Psy-Q SDK which used _bu_init() and open() which tends to be unreliable, this one uses libmcrd which is a lot more reliable and is easier to use.

This example demonstrates the basics of handling Memory Cards such as detecting whether or not a card is attached, listing the files inside a card and creating a test save block. It does not display the title names and icons of save blocks though but it shouldn't be too difficult to implement it yourself.
(3.46 KiB) Downloaded 360 times
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: December 28th, 2018, 6:49 am
I am a: Gamedev Enthusiast
PlayStation Model: SCPH-101
Want to Find: Gamedev info
Looking to: Make games, I hope
Location: Greece

Re: Basic Memory Card Example

Post by kostasvs » January 13th, 2019, 1:51 am

Sorry for the old bump (AFAIK there's no rule against it). In case anyone needs a psymake-compatible "makefile.mak", here's what worked for me:

Code: Select all

# -----------------------------------------
#       PlayStation 1 Psy-Q Makefile
# -----------------------------------------

	del memcard.exe
	del memcard.cpe
	ccpsx -Xo$80010000 -O3 -Wall memcard.c -omemcard.cpe
	cpe2x /ce memcard.cpe
If you get "Symbol [...] not defined" errors, you must add "libmcrd.lib" in the second line of C:\psyq\bin\PSYQ.INI. The one in "C:\psyq\psyq\PSYQ.INI" did not have any effect for me.

Finally, if you are testing with PSXeven, you have to "format" your memory cards using Tools --> Memcard Manager --> Format. The example tries to format them, but the changes don't seem to remain in the emulator if you don't format the cards manually.

LameGuy64, thank you so much for all your examples and posts. They have helped me a lot, and I'm sure they've helped everyone else too.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests