Code debugging without real hardware

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Post Reply
jman
Rookie Programmer
Rookie Programmer
Posts: 110
Joined: Aug 13, 2013

Code debugging without real hardware

Post by jman » August 17th, 2013, 8:02 am

Hello,

I'm moving the first steps with some sample code with the Psy-Q SDK.
I've never approached console development, so I wonder if it is possible to debug one's code (e.g. printf() statements) when code is run inside an emulator. Tried epsxe and xebra but none of them prints anywhere my printf()s. Xebra has a debug window but I don't have clear how making use of it.
Alternatively, shall I use FntPrint()?

Thanks for any suggestion!

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » August 18th, 2013, 12:53 am

To my knowledge only no$psx directs stdout to debug window. For other emulators you will have to use FntPrint().
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

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

Post by Shadow » August 18th, 2013, 1:40 pm

Virus Total reports it mainly as a trojan, but I trust no$cash and the emulator is excellent.

It is better than PSXFIN (PSx) and ePSXe, but it still doesn't beat XEBRA by Dr. Hell.
Some games work better under XEBRA than than do on NO$PSX, so NO$CASH has some tweaking to do ;)

https://www.virustotal.com/en/file/dc73 ... 376793443/

To debug, click 'Window' -> 'Debug Messages'.
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
LocoMJ
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Nov 20, 2014
I am a: programmer, electronic engineer
Contact:

Post by LocoMJ » January 26th, 2017, 7:28 pm

Sorry for updating this post but I'm very interested in the topic.

Yesterday I installed PSYQ and I played with some examples. But my question is, how could I debug the code? What's the minimum tools/hardware I need?

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 » January 26th, 2017, 7:42 pm

To actually debug properly, you need an official Sony development kit, such as the DTL-H2000, H2500 or 2700. For basic debugging, printf's under NO$PSX works, but if you want something easier, you'll need CAETLA on an Xplorer/Xploder cartridge.
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
LocoMJ
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Nov 20, 2014
I am a: programmer, electronic engineer
Contact:

Post by LocoMJ » January 26th, 2017, 8:16 pm

Thanks for the info, Shadow.

I have a FX explorer, so I'll flash it :)
For the moment, I'll do some tests with PSY-Q and I'll write you an email telling something more.

Xavi92
Verified
C Programming Expert
C Programming Expert
Posts: 161
Joined: Oct 06, 2012
PlayStation Model: SCPH-5502
Contact:

Post by Xavi92 » January 27th, 2017, 9:17 am

PCSX-R also allows console output. Just activate these two check boxes on "CPU Config" window:

Image

Could it be possible to modify PCSX-R's source code to allow ELF files with debugging symbols so as to run it using GDB? :shrug

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 6th, 2018, 7:17 pm

Yes, that's very much possible but it's a bit of work to do so.
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.

riyasathe
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Mar 18, 2019
Contact:

Post by riyasathe » March 18th, 2019, 5:21 pm

Excellent information here. Great post. Thanks for such a helpful share!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests