Difference between revisions of "Fix Sonic 2 Sega Screen"
From Sonic Retro
BSonirachi (talk | contribs) (marked for cleanup) |
(Fixed grammar(might still have some cracks), and fixed some spots of formatting) |
||
Line 3: | Line 3: | ||
==Github== | ==Github== | ||
− | If you have ported in sprites from other | + | If you have ported in sprites from other Sonic games or other games in general, you may have noticed the Sega screen is messed up. |
+ | |||
+ | Make a copy of the Sonic 2 sprites, mappings, and dplcs for Sonic. | ||
+ | |||
+ | Now in s2.asm | ||
+ | |||
+ | Find this line of code for Sonic's art. | ||
− | |||
− | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
Line 19: | Line 23: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Right after the art import for Sonic add in. | |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
;--------------------------------------------------------------------- | ;--------------------------------------------------------------------- | ||
Line 27: | Line 33: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Now right below this section of code. | |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
;-------------------------------------------------------------------------------------- | ;-------------------------------------------------------------------------------------- | ||
Line 35: | Line 43: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Add this line of code | |
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
;-------------------------------------------------------------------------------------- | ;-------------------------------------------------------------------------------------- | ||
Line 42: | Line 51: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Now replace this | + | Now replace this line of code. |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
Line 56: | Line 67: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | With this line of code. | |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
;-------------------------------------------------------------------------------------- | ;-------------------------------------------------------------------------------------- | ||
Line 73: | Line 86: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | But now, if you have other sprites, you will notice that the sonic sprites are messed up, to fix that, go to <syntaxhighlight lang="asm"> LoadSonicDymPLC_Part2</syntaxhighlight> and change this. | |
− | change this | + | |
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
LoadSonicDynPLC_Part2: | LoadSonicDynPLC_Part2: | ||
Line 89: | Line 103: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | To this | |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
LoadSonicDynPLC_Part2: | LoadSonicDynPLC_Part2: | ||
Line 104: | Line 120: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | change this | + | Now change this |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
ObjB0_Init: | ObjB0_Init: | ||
Line 133: | Line 151: | ||
− | + | To this | |
+ | |||
+ | |||
<syntaxhighlight lang="asm"> | <syntaxhighlight lang="asm"> | ||
ObjB0_Init: | ObjB0_Init: | ||
Line 168: | Line 188: | ||
{{S2Howtos}} | {{S2Howtos}} | ||
− | |||
− |
Revision as of 17:23, 19 April 2022
This article needs cleanup. This article needs to be edited to conform to a higher standard of article quality. |
Guide By RobiWanKenobi
Github
If you have ported in sprites from other Sonic games or other games in general, you may have noticed the Sega screen is messed up.
Make a copy of the Sonic 2 sprites, mappings, and dplcs for Sonic.
Now in s2.asm
Find this line of code for Sonic's art.
;---------------------------------------------------------------------------------------
; Uncompressed art
; Patterns for Sonic ; ArtUnc_50000:
;---------------------------------------------------------------------------------------
align $20
ArtUnc_Sonic: BINCLUDE "art/uncompressed/Sonic's art.bin"
;---------------------------------------------------------------------
Right after the art import for Sonic add in.
;---------------------------------------------------------------------
align $20
ArtUnc_SegaSonic: BINCLUDE "art/uncompressed/SegaSonic.bin"
;---------------------------------------------------------------------------------------
Now right below this section of code.
;--------------------------------------------------------------------------------------
; Sprite Mappings
; Sonic ; MapUnc_6FBE0: SprTbl_Sonic:
;--------------------------------------------------------------------------------------
Add this line of code
;--------------------------------------------------------------------------------------
Mapunc_SegaSonic: BINCLUDE "mappings/sprite/SegaSonicMap.bin"
;--------------------------------------------------------------------------------------
Now replace this line of code.
;--------------------------------------------------------------------------------------
; Sprite Dynamic Pattern Reloading
; Sonic DPLCs ; MapRUnc_714E0:
;--------------------------------------------------------------------------------------
; WARNING: the build script needs editing if you rename this label
; or if you move Sonic's running frame to somewhere else than frame $2D
;Sega Screen Sonic
MapRUnc_Sonic: BINCLUDE "mappings/spriteDPLC/Sonic.bin"
;--------------------------------------------------------------------------------------
With this line of code.
;--------------------------------------------------------------------------------------
; Sprite Dynamic Pattern Reloading
; Sonic DPLCs ; MapRUnc_714E0:
;--------------------------------------------------------------------------------------
; WARNING: the build script needs editing if you rename this label
; or if you move Sonic's running frame to somewhere else than frame $2D
;Sega Screen Sonic
MapRUnc_Sonic: BINCLUDE "mappings/spriteDPLC/SegaSonic.bin"
;--------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------
;Sonic's ingame sprites
MapRUnc_Sonic3: BINCLUDE "mappings/spriteDPLC/Sonic.bin"
;--------------------------------------------------------------------------------------
LoadSonicDymPLC_Part2
LoadSonicDynPLC_Part2:
cmp.b (Sonic_LastLoadedDPLC).w,d0
beq.s return_1B89A
move.b d0,(Sonic_LastLoadedDPLC).w
lea (MapRUnc_Sonic).l,a2
add.w d0,d0
adda.w (a2,d0.w),a2
move.w (a2)+,d5
subq.w #1,d5
bmi.s return_1B89A
move.w #tiles_to_bytes(ArtTile_ArtUnc_Sonic),d4
To this
LoadSonicDynPLC_Part2:
cmp.b (Sonic_LastLoadedDPLC).w,d0
beq.s return_1B89A
move.b d0,(Sonic_LastLoadedDPLC).w
lea (MapRUnc_Sonic3).l,a2
add.w d0,d0
adda.w (a2,d0.w),a2
move.w (a2)+,d5
subq.w #1,d5
bmi.s return_1B89A
move.w #tiles_to_bytes(ArtTile_ArtUnc_Sonic),d4
Now change this
ObjB0_Init:
bsr.w LoadSubObject
move.w #$1E8,x_pixel(a0)
move.w #$F0,y_pixel(a0)
move.w #$B,objoff_2A(a0)
move.w #2,(SegaScr_VInt_Subrout).w
bset #0,render_flags(a0)
bset #0,status(a0)
; Initialize streak horizontal offsets for Sonic going left.
; 9 full lines (8 pixels) + 6 pixels, 2-byte interleaved entries for PNT A and PNT B
lea (Horiz_Scroll_Buf + 2 * 2 * (9 * 8 + 6)).w,a1
lea Streak_Horizontal_offsets(pc),a2
moveq #0,d0
moveq #$22,d6 ; Number of streaks-1
- move.b (a2)+,d0
add.w d0,(a1)
addq.w #2 * 2 * 2,a1 ; Advance to next streak 2 pixels down
dbf d6,-
lea off_3A294(pc),a1 ; pointers to mapping DPLC data
lea (ArtUnc_Sonic).l,a3
lea (Chunk_Table).l,a5
moveq #4-1,d5 ; there are 4 mapping frames to loop over
To this
ObjB0_Init:
bsr.w LoadSubObject
move.w #$1E8,x_pixel(a0)
move.w #$F0,y_pixel(a0)
move.w #$B,objoff_2A(a0)
move.w #2,(SegaScr_VInt_Subrout).w
bset #0,render_flags(a0)
bset #0,status(a0)
; Initialize streak horizontal offsets for Sonic going left.
; 9 full lines (8 pixels) + 6 pixels, 2-byte interleaved entries for PNT A and PNT B
lea (Horiz_Scroll_Buf + 2 * 2 * (9 * 8 + 6)).w,a1
lea Streak_Horizontal_offsets(pc),a2
moveq #0,d0
moveq #$22,d6 ; Number of streaks-1
- move.b (a2)+,d0
add.w d0,(a1)
addq.w #2 * 2 * 2,a1 ; Advance to next streak 2 pixels down
dbf d6,-
lea off_3A294(pc),a1 ; pointers to mapping DPLC data
lea (ArtUnc_SegaSonic).l,a3
lea (Chunk_Table).l,a5
moveq #4-1,d5 ; there are 4 mapping frames to loop over
if done right, it works, even with sonic 3 sprites.
This is from a rom hack that uses this fix, but, I am able to use stock sonic 2 for it too