Best Way To Debug Saturn BIOS?

slinga

Established Member
Hey all,

I'm attempting to debug something in the Saturn BIOS itself. Normally I would use Yabause and set breakpoints on the BIOS, but it appears Yabause is not correctly emulating the features I need. Are there any ways to debug a live Saturn? Any other emulators you recommend? I had a preference for Yabause because I could mess with the source. Thanks in advance.
 
slinga said:
Hey all,

I'm attempting to debug something in the Saturn BIOS itself. Normally I would use Yabause and set breakpoints on the BIOS, but it appears Yabause is not correctly emulating the features I need. Are there any ways to debug a live Saturn? Any other emulators you recommend? I had a preference for Yabause because I could mess with the source. Thanks in advance.

I have GDB support in my library so debugging on real hardware is there. But the way I implemented breakpoints, you won't be able to debug the BIOS. If you make use of the UBC, then I believe it would be completely possible to debug the BIOS.

Here's how:

Modify libyaul to have the GDB stub code running somewhere the BIOS won't muck it up, then if you have UBC support (there is some placeholder code already checked in), then all you have to do is set a breakpoint within GDB (use the start address of the BIOS). From there, jump to the BIOS.

You'll automatically break at the very beginning of the BIOS. But you might still have trouble since the Saturn will potentially be initializing some hardware you'll be using.

You're better off adding the stuff you need in Yabause and sending patches to Guillaume and CyberWarriorX.
 
Wow amazed by the quick response, didn't think there was much activity here anymore.

I guess I should clarify, I'm trying to debug/understand some code in the Player itself, i.e. the screen you get to when you boot the Saturn without a disk. I'm under the impression the code for the Player is stored, compressed, in the BIOS image. I'll start looking into libyaul.

Also what's UBC?
 
slinga said:
Wow amazed by the quick response, didn't think there was much activity here anymore.

I guess I should clarify, I'm trying to debug/understand some code in the Player itself, i.e. the screen you get to when you boot the Saturn without a disk. I'm under the impression the code for the Player is stored, compressed, in the BIOS image. I'll start looking into libyaul.

Same idea. I think it is. If you're going to debug that, then I don't think the BIOS will get in your way.

slinga said:
Also what's UBC?

User Break Controller
 
mrkotfw said:
I have GDB support in my library so debugging on real hardware is there. But the way I implemented breakpoints, you won't be able to debug the BIOS. If you make use of the UBC, then I believe it would be completely possible to debug the BIOS.

Here's how:

Modify libyaul to have the GDB stub code running somewhere the BIOS won't muck it up, then if you have UBC support (there is some placeholder code already checked in), then all you have to do is set a breakpoint within GDB (use the start address of the BIOS). From there, jump to the BIOS.

You'll automatically break at the very beginning of the BIOS. But you might still have trouble since the Saturn will potentially be initializing some hardware you'll be using.

You're better off adding the stuff you need in Yabause and sending patches to Guillaume and CyberWarriorX.

When going to multiplayer screen, it seems that BIOS clears UBC registers, preventing it from using user break.

-> The UBC sample you provided to me last summer worked fine within test program range, but stopped from functioning after

calling (**(volatile void(**)(void))0x600026C)(); "exit to multiplayer" function.

(I didn't investigated further, and there is probably some trick allowing UBC running in BIOS)

PS : it is good to see news from libyaul and from you
smile.gif


Does your dev cart still working fine ? If not, I can give you another one.
 
cafe-alpha said:
When going to multiplayer screen, it seems that BIOS clears UBC registers, preventing it from using user break.

-> The UBC sample you provided to me last summer worked fine within test program range, but stopped from functioning after

calling (**(volatile void(**)(void))0x600026C)(); "exit to multiplayer" function.

(I didn't investigated further, and there is probably some trick allowing UBC running in BIOS)

PS : it is good to see news from libyaul and from you
smile.gif
/>

Does your dev cart still working fine ? If not, I can give you another one.

Oh, ouch. That's the starting address of the CD player. Maybe you can break right before it initializes it and somehow branch (change PC) past it? Is the CD player running straight from ROM or is it copied to H-WRAM? If it is, you can simply patch it.

Yes, it still works great. I'm using it right now. Thanks!
 
mrkotfw said:
Oh, ouch. That's the starting address of the CD player. Maybe you can break right before it initializes it and somehow branch (change PC) past it? Is the CD player running straight from ROM or is it copied to H-WRAM? If it is, you can simply patch it.

From what I remember, CD player wasn't running from ROM, so patching it would be possible ... looking at action replay game load code would help, but I gave up in trying to disassemble action replay firmware.

If you got more informations about using UBC, feel free to share them with me
smile.gif
/>/>

mrkotfw said:
Yes, it still works great. I'm using it right now. Thanks!

Great ! Your cart was my first one and actually the first time I was soldering SMD chips.

I feel relieved it still works and happy you are still using it too.
 
this is one of the only ways I know how to test anything to do with the bios
comms link card and cable with 4-in-1 AR .. will let you test run functions or subroutines in the bios and also allow you to collect information left behind after test-running the function. heres how I was able to testrun a few patches using sat.exe (included in Saturn orbit): boot the Saturn with ar/gameshark and comms-link cable plugged in stay on the menu select screen, then upload the bios to the Saturn... 'sat 06004000 thebios.bin' after the bin is in the saturns memory you can execute a function/routine by uploading a single word with the execute command on sat.exe 'sat.exe -x 060712A stsl.bin' how to get stsl.bin with a dos command. 'echo O" > stsl.bin' this example runs the cd security check from a us Saturn bios. the information used for this function will remain in the memory after the function has been executed above address 06004000 you can use action.exe or sat to view the results of your tests
 
Back
Top