Sonic and Sega Retro Message Board: Sonic Pocket Adventure's Debug Mode - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Sonic Pocket Adventure's Debug Mode

#1 User is offline SANiK 

Posted 23 January 2011 - 01:39 PM

  • Posts: 408
  • Joined: 21-September 04
  • Gender:Male
  • Wiki edits:6
What is the scientific reason that Sonic Pocket Adventure / SPA enters debug mode when using an emulator? I have the actual hardware and pressing Options at the SEGA screen does not work. It might be that debug mode is removed from my build if there are others capable of entering debug mode without an emulator. So are there?

Debug mode's activation is often cited as an emulator bug. Did anyone look into it further? The most prominent Sonic Pocket Adventure hacking was done by Rolken in this thread, but being in 2006 it seems his efforts are long dead and so are the links.

#2 User is offline MathUser 

Posted 23 January 2011 - 01:40 PM

  • 3rd top wiki contributor
  • Posts: 2038
  • Joined: 09-November 05
  • Gender:Male
  • Wiki edits:14,865
You are a tech member, can't you find that out for yourself?

#3 User is offline DigitalDuck 

Posted 23 January 2011 - 01:44 PM

  • Arriving four years late.
  • Posts: 4607
  • Joined: 23-June 08
  • Gender:Male
  • Location:Lincs, UK
  • Project:TurBoa, S1RL
QUOTE (MathUser @ Jan 23 2011, 06:40 PM)
You are a tech member, can't you find that out for yourself?


Protip: Not all Tech Members are good at everything.

#4 User is offline Sik 

Posted 23 January 2011 - 01:44 PM

  • Sik is pronounced as "seek", not as "sick".
  • Posts: 6719
  • Joined: 17-March 06
  • Gender:Male
  • Project:being an asshole =P
  • Wiki edits:11
Not everybody has worked on the NGPC, MathUser...

But yeah, I believe it's a bug because only shitty emulators let you enter that menu. I wonder if there's some hardware status that isn't being set properly...

#5 User is offline SANiK 

Posted 23 January 2011 - 01:55 PM

  • Posts: 408
  • Joined: 21-September 04
  • Gender:Male
  • Wiki edits:6
QUOTE (MathUser @ Jan 23 2011, 01:40 PM)
You are a tech member, can't you find that out for yourself?


Research takes time and so does getting adjusted to a machine's environment. The first step is to pool the community's knowledge.

QUOTE (Sik @ Jan 23 2011, 01:44 PM)
But yeah, I believe it's a bug because only shitty emulators let you enter that menu. I wonder if there's some hardware status that isn't being set properly...


NGPC emulator documentation mentions a watchdog timer in the NGPC that has to be written to with 0x4E every 100ms otherwise the NGPC resets. I remember in one of the emulators, clicking outside the window and coming back caused it to enter a sort of floating debug mode. A guess here is that the emulator screws up the timing somehow, and if the game detects that the system operates without needing to inform the watchdog, then it might think its running on a development station.


#6 User is offline Overlord 

Posted 23 January 2011 - 04:19 PM

  • Substitute Meerkovo IT Chief
  • Posts: 16572
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
QUOTE (MathUser @ Jan 23 2011, 06:40 PM)
You are a tech member, can't you find that out for yourself?

Wow, that was incredibly dickish and uncalled for. Enjoy your day's holiday.

#7 User is offline GerbilSoft 

Posted 23 January 2011 - 04:36 PM

  • RickRotate'd.
  • Posts: 2802
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:5,000 + one spin
QUOTE (SANiK @ Jan 23 2011, 01:39 PM)
What is the scientific reason that Sonic Pocket Adventure / SPA enters debug mode when using an emulator? I have the actual hardware and pressing Options at the SEGA screen does not work. It might be that debug mode is removed from my build if there are others capable of entering debug mode without an emulator. So are there?

Debug mode's activation is often cited as an emulator bug. Did anyone look into it further? The most prominent Sonic Pocket Adventure hacking was done by Rolken in this thread, but being in 2006 it seems his efforts are long dead and so are the links.

I believe the debug mode only triggers in one emulator, "RAPE". (Either that or "LAME" - they're both hacks of each other, or something like that.) Mednafen doesn't trigger it. (EDIT: djohe tells me that RacePSP also triggers it, so maybe it's a misdocumented hardware quirk that's being emulated incorrectly by some emulators?)

There's a high barrier of entry with regards to SPA because of the NGPC's unusual CPU, a Toshiba TLCS900H. I don't know if there's any disassemblers available for the TLCS900H, or if the system uses bankswitching or not. (Bankswitching would significantly complicate any sort of disassembly.)
This post has been edited by GerbilSoft: 23 January 2011 - 05:00 PM

#8 User is offline Mikel 

Posted 23 January 2011 - 05:55 PM

  • Drown in Despair!
  • Posts: 494
  • Joined: 21-December 03
  • Gender:Male
  • Location:Oklahoma
  • Project:MUGEN Stuff
  • Wiki edits:2,699
QUOTE (GerbilSoft @ Jan 23 2011, 03:36 PM)
QUOTE (SANiK @ Jan 23 2011, 01:39 PM)
What is the scientific reason that Sonic Pocket Adventure / SPA enters debug mode when using an emulator? I have the actual hardware and pressing Options at the SEGA screen does not work. It might be that debug mode is removed from my build if there are others capable of entering debug mode without an emulator. So are there?

Debug mode's activation is often cited as an emulator bug. Did anyone look into it further? The most prominent Sonic Pocket Adventure hacking was done by Rolken in this thread, but being in 2006 it seems his efforts are long dead and so are the links.

I believe the debug mode only triggers in one emulator, "RAPE". (Either that or "LAME" - they're both hacks of each other, or something like that.) Mednafen doesn't trigger it. (EDIT: djohe tells me that RacePSP also triggers it, so maybe it's a misdocumented hardware quirk that's being emulated incorrectly by some emulators?)

There's a high barrier of entry with regards to SPA because of the NGPC's unusual CPU, a Toshiba TLCS900H. I don't know if there's any disassemblers available for the TLCS900H, or if the system uses bankswitching or not. (Bankswitching would significantly complicate any sort of disassembly.)


NeoPocott, another old NGPC emulator also triggers Debug mode.

I guess I will post this video here, which I think will go well with the Game Secrets:Sonic Pocket Adventure page:


This post has been edited by Mikel: 23 January 2011 - 05:56 PM

#9 User is offline Rolken 

Posted 23 January 2011 - 06:04 PM

  • Posts: 301
  • Joined: 29-July 06
  • Gender:Male
  • Location:San Francisco, CA
  • Wiki edits:1
I was mostly hacking to get maps, which are up at TSC. I don't know where any of the technical stuff or spritesheets or so forth are anymore. Sorry. But at least I did give copious enough documentation there that you could probably reconstruct everything I did if you really wanted to. I'll take a look at some of my older laptops to see if I still have any of the old stuff around, but I make no promises.

I vaguely remember looking into the debug weirdness but it's been too long for me to remember what I figured out, if anything.

And I looked for the disassembler I originally used but it looks like it's gone offline by now too, which kinda sucks. Oh well.

And dicks like MathUser are why I left this place (until getting a friendly email a few minutes ago). Can't even have a coherent goddamn conversation around here without somebody gratuitously shitting in the punch bowl. A one day holiday isn't really sending much of a message.

edit: and I'm PRETTY sure the NGPC did not use bankswitching but don't bet money on it @ Gerbil
This post has been edited by Rolken: 23 January 2011 - 06:05 PM

#10 User is offline SANiK 

Posted 23 January 2011 - 06:22 PM

  • Posts: 408
  • Joined: 21-September 04
  • Gender:Male
  • Wiki edits:6
QUOTE (Overlord @ Jan 23 2011, 04:19 PM)
QUOTE (MathUser @ Jan 23 2011, 06:40 PM)
You are a tech member, can't you find that out for yourself?

Wow, that was incredibly dickish and uncalled for. Enjoy your day's holiday.


:off-topic: I think he was just misinformed? Just like a pencil artist is not the same as a digital artist, he probably just doesn't know how one machine may vary greatly from another machine. Just unban him and let it slide. It's not like I was offended anyways. :off-topic:

QUOTE (GerbilSoft @ Jan 23 2011, 04:36 PM)
I believe the debug mode only triggers in one emulator, "RAPE". (Either that or "LAME" - they're both hacks of each other, or something like that.) Mednafen doesn't trigger it. (EDIT: djohe tells me that RacePSP also triggers it, so maybe it's a misdocumented hardware quirk that's being emulated incorrectly by some emulators?)


According to http://info.sonicretro.org/Game_Secrets:So...ocket_Adventure R.A.P.E, Neopocott, and the PSP emulator RacePSP are the ones that have this debug mode access.

QUOTE (GerbilSoft @ Jan 23 2011, 04:36 PM)
There's a high barrier of entry with regards to SPA because of the NGPC's unusual CPU, a Toshiba TLCS900H. I don't know if there's any disassemblers available for the TLCS900H, or if the system uses bankswitching or not. (Bankswitching would significantly complicate any sort of disassembly.)


From reading briefly about the system, it seems bank switching is only used for roms greater than 2MB. Sonic Pocket Adventure is 2MB.

There were assemblers and disassemblers floating around. The big year in Neo Geo Pocket development was 2003. After that things just started 404ing. Although, the NeoPop core has a disassembler component, http://neopop.emuxhaven.net/NeoPop-Src-Core-0.71.zip
See "Core\TLCS-900h\TLCS900h_disassemble.c"
Mednafen uses the NeoPop core.

A possible approach may be to do what Nemesis did with Sonic 2 and have the emulator track the instruction branches by modifying the source code of an existing emulator and playing the game for a while in order to create an accurate disassembly.

edit:
QUOTE (Rolken)
(until getting a friendly email a few minutes ago).

That was fast!
This post has been edited by SANiK: 23 January 2011 - 06:26 PM

#11 User is offline Rolken 

Posted 23 January 2011 - 06:30 PM

  • Posts: 301
  • Joined: 29-July 06
  • Gender:Male
  • Location:San Francisco, CA
  • Wiki edits:1
QUOTE (SANiK @ Jan 23 2011, 05:22 PM)
From reading briefly about the system, it seems bank switching is only used for roms greater than 2MB. Sonic Pocket Adventure is 2MB.

Heh, that's convenient.

I looked through my most recently discarded laptop and turned up bupkis, which means if I have anything it's stuck away who knows where and I probably won't find it any time soon. Sorry.

#12 User is offline Skeledroid 

Posted 23 January 2011 - 06:36 PM

  • Posts: 227
  • Joined: 17-November 06
  • Gender:Male
  • Wiki edits:1
it's probably something simple like a certain value upon initialization

#13 User is offline SANiK 

Posted 23 January 2011 - 08:40 PM

  • Posts: 408
  • Joined: 21-September 04
  • Gender:Male
  • Wiki edits:6
Okay. I figured it out. Take a hex editor, open up the Sonic Pocket Adventure rom, and change byte 0x1F of the rom to 0xFF. This enables developer mode for the rom.
Emulators like RAPE automatically change that byte for games. NeoPop does not do it, hence why the Debug mode switch does not work in NeoPop.

Rom offset 0x1F in the NGPC rom header is the 32bit initial PC value. The NGPC only addresses from 0x000000 to 0xFFFFFF leaving the top byte unused. So developers use the top byte as a dev-mode switch instead since 0x??###### becomes 0x######

Anyone have a NGPC with a NGPC flash cart that wants to give the above modification a try on actual hardware for the hell of it?
This post has been edited by SANiK: 23 January 2011 - 08:59 PM

#14 User is offline Skeledroid 

Posted 24 January 2011 - 01:46 AM

  • Posts: 227
  • Joined: 17-November 06
  • Gender:Male
  • Wiki edits:1
yeah, it's not expecting FF as the initialized value as suspected.

if you do it on the real hardware you're just creating an emulator's error by altering the game. that's kind of backwards as far as the issue?
This post has been edited by olaf: 24 January 2011 - 01:49 AM

#15 User is offline Tweaker 

Posted 24 January 2011 - 01:59 AM

  • Posts: 12389
  • Joined: 27-June 04
  • Gender:Male
Wow. I've been waiting over 8 years for a way to trigger debug mode in that game at will. Fantastic job!

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users