Actions

SCHG How-to

Difference between revisions of "Display the Press Start Button text"

From Sonic Retro

(Created page with '{{GuideBy|Quickman}} I've finally isolated precisely why the PRESS START BUTTON (PSB) text doesn't appear on the Sonic 1 title screen, and given …')
 
(Rewritten so it's not just an excact copy of the forum topic)
Line 1: Line 1:
 
{{GuideBy|Quickman}}
 
{{GuideBy|Quickman}}
  
I've finally isolated precisely why the PRESS START BUTTON (PSB) text doesn't appear on the [[Sonic the Hedgehog (16-bit)|Sonic 1]] title screen, and given the nature I suspect it to be a bug in Sonic Team's original code. (You may now be shocked.)
+
In the Sonic 1 is an object for a PRESS START BUTTON message on the title screen. However, in the final version it's not there. Well, not really. It is there, but it's invisible. To fix that you simply need to go to '''Title_LoadText:'''. Find this piece of code:
 +
<asm> lea ($FFFFD080).w,a1
 +
moveq #0,d0
 +
move.w #7,d1
  
Now, the PSB object is initialised in object RAM slot $D080 on line 3237 of the disassembly I'm currently using (modified by [[Pu7o]] to work on Linux; it's just under the label Title_ClrObjRam2, in case it's not the same line in an unmodified Sonic 1 disassembly). That same chunk of RAM is previously used for the SONIC TEAM PRESENTS (STP) object earlier in the TitleScreen routine (line 3162, adjust as necessary).
+
Title_ClrObjRam2:
 +
move.l d0,(a1)+
 +
dbf d1,Title_ClrObjRam2
 +
 
 +
move.b #$E,($FFFFD040).w ; load big Sonic object</asm>
 +
And replace it with this:
 +
<asm> lea ($FFFFD080).w,a1
 +
 
 +
Title_ClrObjRam2:
 +
jsr DeleteObject2
 +
move.b #$E,($FFFFD040).w ; load big Sonic object</asm>
 +
 
 +
And now you should be able to see this message:
 +
 
 +
[[File:S1-PressStart.png]]
  
The reason the PSB text doesn't appear is because the STP object scribbles in object RAM, but the TitleScreen routine only clears the top $1C bytes. Any data between $D09C and $D0A0 previously touched by the STB object is unmodified. This, I suspect, is why the PSB text fails to appear, and it's a surprisingly difficult bug to track down without really scrutinising the code and a few quite remarkable deductions.
 
  
The correction is simple enough; delete the object RAM for the object at $D080 more thoroughly. Here's the replacement I made. (Lines are prefixed diff-style - a minus indicates a deleted line, a plus indicates an inserted line.)
+
Original statement by [[Quickman]] on the {{linkRetro|topic=10240|title=Forums}}:
 +
{{quote|I've finally isolated precisely why the PRESS START BUTTON (PSB) text doesn't appear on the [[Sonic the Hedgehog (16-bit)|Sonic 1]] title screen, and given the nature I suspect it to be a bug in Sonic Team's original code. (You may now be shocked.)
  
<asm>
+
Now, the PSB object is initialised in object RAM slot $D080 on line 3237 of the disassembly I'm currently using (modified by [[Pu7o]] to work on Linux; it's just under the label Title_ClrObjRam2, in case it's not the same line in an unmodified Sonic 1 disassembly). That same chunk of RAM is previously used for the SONIC TEAM PRESENTS (STP) object earlier in the TitleScreen routine (line 3162, adjust as necessary).
  lea   ($FFFFD080).w,a1
 
-   moveq  #0,d0
 
-   move.w  #7,d1
 
  
-Title_ClrObjRam2:
+
The reason the PSB text doesn't appear is because the STP object scribbles in object RAM, but the TitleScreen routine only clears the top $1C bytes. Any data between $D09C and $D0A0 previously touched by the STB object is unmodified. This, I suspect, is why the PSB text fails to appear, and it's a surprisingly difficult bug to track down without really scrutinising the code and a few quite remarkable deductions.
-   move.l  d0,(a1)+
 
-   dbf d1,Title_ClrObjRam2
 
  
+   jsr DeleteObject2
+
The correction is simple enough; delete the object RAM for the object at $D080 more thoroughly. |2=[[Quickman]]}}
          move.b  #$E,($FFFFD040).w; load big Sonic object</asm>
 
 
[[Category:SCHG How-tos|Display the Press Start Button text]]
 
[[Category:SCHG How-tos|Display the Press Start Button text]]

Revision as of 07:45, 9 October 2009

(Original guide by Quickman)

In the Sonic 1 is an object for a PRESS START BUTTON message on the title screen. However, in the final version it's not there. Well, not really. It is there, but it's invisible. To fix that you simply need to go to Title_LoadText:. Find this piece of code: <asm> lea ($FFFFD080).w,a1 moveq #0,d0 move.w #7,d1

Title_ClrObjRam2: move.l d0,(a1)+ dbf d1,Title_ClrObjRam2

move.b #$E,($FFFFD040).w ; load big Sonic object</asm> And replace it with this: <asm> lea ($FFFFD080).w,a1

Title_ClrObjRam2: jsr DeleteObject2 move.b #$E,($FFFFD040).w ; load big Sonic object</asm>

And now you should be able to see this message:

S1-PressStart.png


Original statement by Quickman on the
Sonic Retro
Forums
:
I've finally isolated precisely why the PRESS START BUTTON (PSB) text doesn't appear on the Sonic 1 title screen, and given the nature I suspect it to be a bug in Sonic Team's original code. (You may now be shocked.)

Now, the PSB object is initialised in object RAM slot $D080 on line 3237 of the disassembly I'm currently using (modified by Pu7o to work on Linux; it's just under the label Title_ClrObjRam2, in case it's not the same line in an unmodified Sonic 1 disassembly). That same chunk of RAM is previously used for the SONIC TEAM PRESENTS (STP) object earlier in the TitleScreen routine (line 3162, adjust as necessary).

The reason the PSB text doesn't appear is because the STP object scribbles in object RAM, but the TitleScreen routine only clears the top $1C bytes. Any data between $D09C and $D0A0 previously touched by the STB object is unmodified. This, I suspect, is why the PSB text fails to appear, and it's a surprisingly difficult bug to track down without really scrutinising the code and a few quite remarkable deductions.

The correction is simple enough; delete the object RAM for the object at $D080 more thoroughly.

Quickman