PSn00b Debugger - Homebrew debugger for retail consoles

Downloadable items posted by PSXDEV members are within this forum.
Post Reply
User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

PSn00b Debugger - Homebrew debugger for retail consoles

Post by LameGuy64 » December 12th, 2018, 2:15 pm

This is a PlayStation debugger I made entirely from scratch, debugging programs on real hardware is no longer exclusive to official development hardware with PSn00b Debugger as it works on retail units with a modchip and a serial cable of some sort preferably one that uses a 3.3v USB TTL serial adapter.

PSn00b Debugger Features:
  • Instruction trace.
  • Run to cursor.
  • MIPS disassembler.
  • Register preview.
  • Remote memory browser.
  • Remote reset.
  • Supports PS-EXE, CPE and ELF format executables.
  • Supports SN symbol files (does not support ELF symbols yet).
  • Resolve program address to source line and vice versa.
  • Bookmarks.
  • Built-in serial message window.
  • Data access breakpoint.
  • Data watchpoints.
Currently, the debugger only supports communications through the serial interface and does not support Xplorer nor PAR communication interfaces. Still need to do research on achieving reliable communications with the Xplorer's parallel interface.

Screenshot:
Image

Demonstration video with some insight to how my debugger works:
[BBvideo=560,315]https://youtube.com/watch?v=YSgkBlS0oGs[/BBvideo]

Download and source code of PSn00b Debugger can be found on github.

You will also need LITELOAD 1.1 or newer as my debugger only works on that. You can find an ISO and cartridge ROM version of it in this forum thread.
You do not have the required permissions to view the files attached to this post.
Last edited by LameGuy64 on October 30th, 2019, 12:07 pm, edited 1 time in total.
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.

rama3
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: Apr 16, 2017

Post by rama3 » December 13th, 2018, 6:41 am

Very impressive work!
Software development isn't my PSX niche, but knowing that single step debugging is now possible is great :)

Regarding your efforts with the parallel port:
Developers for PSX quickly reach out to this port when they want more speed. Sometimes it works out, sometimes it doesn't.
In any case, it will require an expansion card with some custom software installed on it.
Next, people will need to source a legacy parallel COM port cable (and/or build adapter hardware with address and data lines).
Then it's still not enough, a PCI adapter card (or an ancient PC) is required for the cable...

Suffice it to say, the "easy speed" route via the expansion port is actually quite a burden to use.

So, what else can we do?
Have you looked into the actual limitations of the serial port yet? (I haven't :p)
How fast can the symbol rate be, and does the PSX bus support moving more data?
If there are untapped reserves there, then quite often the need to drive a serial cable limits what can be achieved.
However, if you simply attached a USB to TTL bridge directly at the port, then the more efficient USB protocol eliminates that issue :)

If really no one has tested those limits yet, there could be a lot of untapped speed there.
At maybe 4x the current "limit", it may be fast enough to be convenient.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » December 13th, 2018, 12:28 pm

Well, there are actually some new motherboards as recent as Socket 1151 and AM4 still being made with parallel ports on it usually as a pin header that you can connect the same DB25 connectors from an old AT machine to. My i5 4590 rig for example has such a header and I can actually use my Xplorer on it even under Win7 thanks to orion's inpout32 port of catflap. I have a PCIE legacy I/O card that has 2 serial and a parallel port and it uses the CH384 chipset but i haven't tested that yet. Using the Xplorer's parallel interface is pretty tricky in my experience because it involves a lot of bit banging and sometimes careful timing.

I should correct you a bit that the PAR (and Gameshark except the Pro version) are the only cheat cartridges that require a special 'comms-link' card for it and its DB25 header is not parallel port compatible but it has the advantage of being a full 8-bit comms bus instead of the 8-bits in, 3 bits out that Xplorer has but that's due to limitations of the bi-directional parallel port interface. There is CommLinkUSB and XlinkUSB but its closed sourced rubbish so I can't make use of them in my debugger project. danhans42's Raspberry Pi based efforts for the Xplorer look promising if he decides to release sources of it.

Faster transfer speeds could be achieved by means of building a custom comms interface that communicates through USB and featuring a sizable buffer that can be DMA'd but that would require using an FPGA. I imagine speeds would be on par if not faster than reading from CD which has a maximum transfer rate of about 300KB/s.
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
Squaresoft74
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 303
Joined: Jan 07, 2016
PlayStation Model: SCPH-7502
Location: France
Contact:

Post by Squaresoft74 » December 13th, 2018, 12:55 pm

Nice to see such tool being developed, many thanks for this ! :clap
LameGuy64 wrote: December 12th, 2018, 2:15 pmCurrently, the debugger only supports communications through the serial interface and does not support Xplorer nor PAR communication interfaces. Still need to do research on achieving reliable communications with the Xplorer's parallel interface.
Maybe try contacting Nocash and see if he could help you here ?
His Expansion ROM with no$psx is now my primary setup to upload exe at great speed and it works fine up to Windows 10 x86.
Would be great if you could get similar results with your LITELOAD/PSn00b Debugger setup. :praise
rama3 wrote: December 13th, 2018, 6:41 am Then it's still not enough, a PCI adapter card (or an ancient PC) is required for the cable...
On my side, I'm using a not that old Dell Latitude E6540 laptop, with its docking station I separately bought for 10 € in a refurbished hardware store. ! :mrgreen:

So i think it's still possible to have modern hardware working for this kind of things without having to spend too much money.

Except maybe for the Xploder/Xplorer itself getting ridiculously expensive on ebay since the last three years if you don't already have one... :roll:

Until Nocash's stuff got released my main problem for my usage was more with the old tools not properly working (or at all) with modern OS.
So if LameGuy64 can get his tools to work with such setups, that would be very welcomed. ;)

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » December 14th, 2018, 8:16 am

my 2cents:
Anything that requires old hardware is counter productive, even if it's faster.
Accessibility is more important then usability etc.
Net Yaroze comms cable, PS link cable, AR/Xplorer, old ISA/PCI slots & cards, and physical parallel and serial ports just make it harder.
Anything that interfaces with USB is the way to go IMO
As long as the 2 wire USB serial mod works and is maintained as a base, then it's all good!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » January 23rd, 2019, 11:59 am

Just released a small 0.26b update that fixes some bugs on the disassembler and a bug on the memory browser when you save a project with the bookmarks window open.

I'm thinking of getting proper Linux support working on the debugger so I can start implementing support for ELF symbols.
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
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » January 27th, 2019, 9:19 pm

LameGuy64, Is 3 contacts enough to use it? Or not all 8 are bypassed?

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » January 27th, 2019, 11:55 pm

My debugger does not require any handshaking so Tx, Rx and Ground is typically enough.
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
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » January 27th, 2019, 11:59 pm

LameGuy64, All right. Thank you very much.

User avatar
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » August 19th, 2019, 12:20 am

How to printf output to message window of this debugger? since I wrote( printf("LoadData Complete"); ), they don’t want to be displayed in it.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » August 19th, 2019, 7:36 pm

You need to do AddSIO(115200) to replace the BIOS tty driver with a serial driver, so tty messages from printf are sent out to serial.
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
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » August 19th, 2019, 8:29 pm

LameGuy64 wrote: August 19th, 2019, 7:36 pm You need to do AddSIO(115200) to replace the BIOS tty driver with a serial driver, so tty messages from printf are sent out to serial.
libsio added on project, psx-exe program not compile.
You do not have the required permissions to view the files attached to this post.

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 19th, 2019, 11:48 pm

Edit "PSYQ.INI" in the BIN directory and make sure the library (libsio.lib) is defined.
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
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » August 19th, 2019, 11:57 pm

Shadow wrote: August 19th, 2019, 11:48 pm Edit "PSYQ.INI" in the BIN directory and make sure the library (libsio.lib) is defined.
Thank, it's working)

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » October 30th, 2019, 12:15 pm

I've forgotten to post about an update of this debugger I released last month. I improved the debug interface a bit, rewrote the debug kernel for ARMIPS, improved comms protocol, added single data access breakpoint and data watchpoints.

I plan to implement Commslink support soon once my bi-directional parallel port based adapter is working the way I wanted. CommslinkUSB is useless for this project because there's zero source code on how to use it and I don't have any Teensy boards to make my own, so parallel port it is and it should work with CH384 based serial+parallel port PCIE cards as they support bi-directional mode from my tests.
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
sickle
Verified
C Programming Expert
C Programming Expert
Posts: 257
Joined: Jul 17, 2013
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Post by sickle » February 19th, 2020, 8:43 am

This is kinda amazing, can't wait to use it.
Fantastic work!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest