Actions

SCHG How-to

Difference between revisions of "Make an Alternative Title Screen"

From Sonic Retro

(Alternative Title Screen Guide by JcFerggy)
 
(Redone to preserve tabs (use quote on an IPB post next time when you copypasta shit))
Line 1: Line 1:
This is a guide that [[JcFerggy]] wrote, so if you use it, please credit him.
+
''(Guide originally written by [[JcFerggy]])''
  
 
Using the June 2005 Disassembly of Sonic 1, open up sonic1.asm. First search for "Nem_GHZ_1st:". You should see something like this:
 
Using the June 2005 Disassembly of Sonic 1, open up sonic1.asm. First search for "Nem_GHZ_1st:". You should see something like this:
 +
 
<asm>; ---------------------------------------------------------------------------
 
<asm>; ---------------------------------------------------------------------------
 
; Compressed graphics - primary patterns and block mappings
 
; Compressed graphics - primary patterns and block mappings
 
; ---------------------------------------------------------------------------
 
; ---------------------------------------------------------------------------
Blk16_GHZ:   incbin   map16\ghz.bin
+
Blk16_GHZ: incbin map16\ghz.bin
        even
+
even
Nem_GHZ_1st:   incbin   artnem\8x8ghz1.bin; GHZ primary patterns
+
Nem_GHZ_1st: incbin artnem\8x8ghz1.bin; GHZ primary patterns
        even
+
even
Nem_GHZ_2nd:   incbin   artnem\8x8ghz2.bin; GHZ secondary patterns
+
Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin; GHZ secondary patterns
        even
+
even
Blk256_GHZ:   incbin   map256\ghz.bin
+
Blk256_GHZ: incbin map256\ghz.bin
        even
+
even
Blk16_LZ:   incbin   map16\lz.bin
+
Blk16_LZ: incbin map16\lz.bin
        even
+
even
Nem_LZ:       incbin   artnem\8x8lz.bin; LZ primary patterns
+
Nem_LZ: incbin artnem\8x8lz.bin; LZ primary patterns
        even</asm>
+
even</asm>
 
Next, copy the "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st", and change "GHZ" to "TS". It should look something like this:
 
Next, copy the "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st", and change "GHZ" to "TS". It should look something like this:
 +
 
<asm>; ---------------------------------------------------------------------------
 
<asm>; ---------------------------------------------------------------------------
 
; Compressed graphics - primary patterns and block mappings
 
; Compressed graphics - primary patterns and block mappings
 
; ---------------------------------------------------------------------------
 
; ---------------------------------------------------------------------------
Blk16_GHZ:   incbin   map16\ghz.bin
+
Blk16_GHZ: incbin map16\ghz.bin
        even
+
even
Nem_GHZ_1st:   incbin   artnem\8x8ghz1.bin; GHZ primary patterns
+
Nem_GHZ_1st: incbin artnem\8x8ghz1.bin; GHZ primary patterns
        even
+
even
Nem_GHZ_2nd:   incbin   artnem\8x8ghz2.bin; GHZ secondary patterns
+
Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin; GHZ secondary patterns
        even
+
even
Blk256_GHZ:   incbin   map256\ghz.bin
+
Blk256_GHZ: incbin map256\ghz.bin
        even
+
even
Blk16_TS:   incbin   map16\ts.bin
+
Blk16_TS: incbin map16\ts.bin
        even
+
even
Nem_TS_1st:   incbin   artnem\8x8ts1.bin; GHZ primary patterns
+
Nem_TS_1st: incbin artnem\8x8ts1.bin; GHZ primary patterns
        even
+
even
Blk256_TS:   incbin   map256\ts.bin
+
Blk256_TS: incbin map256\ts.bin
        even
+
even
Blk16_LZ:   incbin   map16\lz.bin
+
Blk16_LZ: incbin map16\lz.bin
        even</asm>
+
even</asm>
 +
Now search for "Title_LoadText:". You should see this
  
Now search for "Title_LoadText:". You should see this:
 
 
<asm>Title_LoadText:
 
<asm>Title_LoadText:
        move.w   (a5)+,(a6)
+
move.w (a5)+,(a6)
        dbf   d1,Title_LoadText; load uncompressed text patterns
+
dbf d1,Title_LoadText; load uncompressed text patterns
  
        move.b   #0,($FFFFFE30).w; clear lamppost counter
+
move.b #0,($FFFFFE30).w; clear lamppost counter
        move.w   #0,($FFFFFE08).w; disable debug item placement   mode
+
move.w #0,($FFFFFE08).w; disable debug item placement mode
        move.w   #0,($FFFFFFF0).w; disable debug mode
+
move.w #0,($FFFFFFF0).w; disable debug mode
        move.w   #0,($FFFFFFEA).w
+
move.w #0,($FFFFFFEA).w
        move.w   #0,($FFFFFE10).w; set level to   GHZ (00)
+
move.w #0,($FFFFFE10).w; set level to GHZ (00)
        move.w   #0,($FFFFF634).w; disable pallet cycling
+
move.w #0,($FFFFF634).w; disable pallet cycling
        bsr.w   LevelSizeLoad
+
bsr.w LevelSizeLoad
        bsr.w   DeformBgLayer
+
bsr.w DeformBgLayer
        lea   ($FFFFB000).w,a1
+
lea ($FFFFB000).w,a1
        lea   (Blk16_GHZ).l,a0; load   GHZ 16x16 mappings
+
lea (Blk16_GHZ).l,a0; load GHZ 16x16 mappings
        move.w   #0,d0
+
move.w #0,d0
        bsr.w   EniDec
+
bsr.w EniDec
        lea   (Blk256_GHZ).l,a0; load GHZ 256x256 mappings
+
lea (Blk256_GHZ).l,a0; load GHZ 256x256 mappings
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        bsr.w   KosDec
+
bsr.w KosDec
        bsr.w   LevelLayoutLoad
+
bsr.w LevelLayoutLoad
        bsr.w   Pal_FadeFrom
+
bsr.w Pal_FadeFrom
        move   #$2700,sr
+
move #$2700,sr
        bsr.w   ClearScreen
+
bsr.w ClearScreen
        lea   ($C00004).l,a5
+
lea ($C00004).l,a5
        lea   ($C00000).l,a6
+
lea ($C00000).l,a6
        lea   ($FFFFF708).w,a3
+
lea ($FFFFF708).w,a3
        lea   ($FFFFA440).w,a4
+
lea ($FFFFA440).w,a4
        move.w   #$6000,d2
+
move.w #$6000,d2
        bsr.w   LoadTilesFromStart2
+
bsr.w LoadTilesFromStart2
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        lea   (Eni_Title).l,a0; load   title screen mappings
+
lea (Eni_Title).l,a0; load title screen mappings
        move.w   #0,d0
+
move.w #0,d0
        bsr.w   EniDec
+
bsr.w EniDec
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        move.l   #$42060003,d0
+
move.l #$42060003,d0
        moveq   #$21,d1
+
moveq #$21,d1
        moveq   #$15,d2
+
moveq #$15,d2
        bsr.w   ShowVDPGraphics
+
bsr.w ShowVDPGraphics
        move.l   #$40000000,($C00004).l
+
move.l #$40000000,($C00004).l
        lea   (Nem_GHZ_1st).l,a0; load GHZ patterns
+
lea (Nem_GHZ_1st).l,a0; load GHZ patterns
        bsr.w   NemDec
+
bsr.w NemDec
        moveq   #1,d0; load title screen pallet
+
moveq #1,d0; load title screen pallet
        bsr.w   PalLoad1
+
bsr.w PalLoad1
        move.b   #$8A,d0; play title screen music
+
move.b #$8A,d0; play title screen music
        bsr.w   PlaySound_Special
+
bsr.w PlaySound_Special
        move.b   #0,($FFFFFFFA).w; disable debug mode
+
move.b #0,($FFFFFFFA).w; disable debug mode
        move.w   #$178,($FFFFF614).w; run title   screen for $178   frames
+
move.w #$178,($FFFFF614).w; run title screen for $178 frames
        lea   ($FFFFD080).w,a1
+
lea ($FFFFD080).w,a1
        moveq   #0,d0
+
moveq #0,d0
        move.w   #7,d1</asm>
+
move.w #7,d1</asm>
 
In there you will see things relating to "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st". Change them from "GHZ" to "TS" also. You should now have something that looks like this:
 
In there you will see things relating to "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st". Change them from "GHZ" to "TS" also. You should now have something that looks like this:
 +
 
<asm>Title_LoadText:
 
<asm>Title_LoadText:
        move.w   (a5)+,(a6)
+
move.w (a5)+,(a6)
        dbf   d1,Title_LoadText; load uncompressed text patterns
+
dbf d1,Title_LoadText; load uncompressed text patterns
  
        move.b   #0,($FFFFFE30).w; clear lamppost counter
+
move.b #0,($FFFFFE30).w; clear lamppost counter
        move.w   #0,($FFFFFE08).w; disable debug item placement   mode
+
move.w #0,($FFFFFE08).w; disable debug item placement mode
        move.w   #0,($FFFFFFF0).w; disable debug mode
+
move.w #0,($FFFFFFF0).w; disable debug mode
        move.w   #0,($FFFFFFEA).w
+
move.w #0,($FFFFFFEA).w
        move.w   #0,($FFFFFE10).w; set level to   GHZ (00)
+
move.w #0,($FFFFFE10).w; set level to GHZ (00)
        move.w   #0,($FFFFF634).w; disable pallet cycling
+
move.w #0,($FFFFF634).w; disable pallet cycling
        bsr.w   LevelSizeLoad
+
bsr.w LevelSizeLoad
        bsr.w   DeformBgLayer
+
bsr.w DeformBgLayer
        lea   ($FFFFB000).w,a1
+
lea ($FFFFB000).w,a1
        lea   (Blk16_TS).l,a0; load   GHZ 16x16 mappings
+
lea (Blk16_TS).l,a0; load GHZ 16x16 mappings
        move.w   #0,d0
+
move.w #0,d0
        bsr.w   EniDec
+
bsr.w EniDec
        lea   (Blk256_TS).l,a0; load GHZ 256x256 mappings
+
lea (Blk256_TS).l,a0; load GHZ 256x256 mappings
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        bsr.w   KosDec
+
bsr.w KosDec
        bsr.w   LevelLayoutLoad
+
bsr.w LevelLayoutLoad
        bsr.w   Pal_FadeFrom
+
bsr.w Pal_FadeFrom
        move   #$2700,sr
+
move #$2700,sr
        bsr.w   ClearScreen
+
bsr.w ClearScreen
        lea   ($C00004).l,a5
+
lea ($C00004).l,a5
        lea   ($C00000).l,a6
+
lea ($C00000).l,a6
        lea   ($FFFFF708).w,a3
+
lea ($FFFFF708).w,a3
        lea   ($FFFFA440).w,a4
+
lea ($FFFFA440).w,a4
        move.w   #$6000,d2
+
move.w #$6000,d2
        bsr.w   LoadTilesFromStart2
+
bsr.w LoadTilesFromStart2
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        lea   (Eni_Title).l,a0; load   title screen mappings
+
lea (Eni_Title).l,a0; load title screen mappings
        move.w   #0,d0
+
move.w #0,d0
        bsr.w   EniDec
+
bsr.w EniDec
        lea   ($FF0000).l,a1
+
lea ($FF0000).l,a1
        move.l   #$42060003,d0
+
move.l #$42060003,d0
        moveq   #$21,d1
+
moveq #$21,d1
        moveq   #$15,d2
+
moveq #$15,d2
        bsr.w   ShowVDPGraphics
+
bsr.w ShowVDPGraphics
        move.l   #$40000000,($C00004).l
+
move.l #$40000000,($C00004).l
        lea   (Nem_TS_1st).l,a0; load GHZ patterns
+
lea (Nem_TS_1st).l,a0; load GHZ patterns
        bsr.w   NemDec
+
bsr.w NemDec
        moveq   #1,d0; load title screen pallet
+
moveq #1,d0; load title screen pallet
        bsr.w   PalLoad1
+
bsr.w PalLoad1
        move.b   #$8A,d0; play title screen music
+
move.b #$8A,d0; play title screen music
        bsr.w   PlaySound_Special
+
bsr.w PlaySound_Special
        move.b   #0,($FFFFFFFA).w; disable debug mode
+
move.b #0,($FFFFFFFA).w; disable debug mode
        move.w   #$178,($FFFFF614).w; run title   screen for $178   frames
+
move.w #$178,($FFFFF614).w; run title screen for $178 frames
        lea   ($FFFFD080).w,a1
+
lea ($FFFFD080).w,a1
        moveq   #0,d0
+
moveq #0,d0
        move.w   #7,d1</asm>
+
move.w #7,d1</asm>
 
Now, you will be able to load another set of files, but as of yet, you don't have any. Go into "artnem" and make a copy of "8x8ghz1.bin" and "8x8ghz2.bin" and rename them to "8x8ts1.bin" and "8x8ts2.bin". Do the same thing in "map16" and "map256", making a copy of the GHZ files, and renaming them to TS.
 
Now, you will be able to load another set of files, but as of yet, you don't have any. Go into "artnem" and make a copy of "8x8ghz1.bin" and "8x8ghz2.bin" and rename them to "8x8ts1.bin" and "8x8ts2.bin". Do the same thing in "map16" and "map256", making a copy of the GHZ files, and renaming them to TS.
  
 
Now those TS files you just made will be your new background. You have to edit them the same way you do the regular GHZ files. Also, your new background will still have the layout of your GHZ background, That means the same chunk numbers have to be used. Also, if you want to load the files in SonED2, you need a new project file, so make a copy of an already exsisting one, and replace everything that is in there with this:
 
Now those TS files you just made will be your new background. You have to edit them the same way you do the regular GHZ files. Also, your new background will still have the layout of your GHZ background, That means the same chunk numbers have to be used. Also, if you want to load the files in SonED2, you need a new project file, so make a copy of an already exsisting one, and replace everything that is in there with this:
<code>Type: 1   
 
  
Zone ID:   0
+
<pre>Type: 1
Act ID:     0
+
 
 +
Zone ID: 0
 +
Act ID: 0
  
 
Object Def: objdef\s1obj
 
Object Def: objdef\s1obj
Line 159: Line 163:
 
BG Layout: ..\levels\ghzbg.bin
 
BG Layout: ..\levels\ghzbg.bin
  
Objects:       ..\objpos\blank.bin
+
Objects:   ..\objpos\blank.bin
  
 
Palettes-
 
Palettes-
  
Number of files: 1
+
Number of files: 1
  
 
   Palette 1-
 
   Palette 1-
  
   Start index:       0
+
   Start index:   0
 
   Number of entries: 64
 
   Number of entries: 64
   File:             ..\pallet\title.bin
+
   File:   ..\pallet\title.bin
  
Angle Array:             ..\collide\anglemap.bin
+
Angle Array: ..\collide\anglemap.bin
Collision Array:         ..\collide\colarray_n.bin
+
Collision Array: ..\collide\colarray_n.bin
 
Rotated Collision Array: ..\collide\colarray_r.bin
 
Rotated Collision Array: ..\collide\colarray_r.bin
  
 
Collision Index 1: ..\collide\blank.bin
 
Collision Index 1: ..\collide\blank.bin
  
-EOF-</code>
+
-EOF-</pre>
 +
 
 
And that should be everything to get you on your way.
 
And that should be everything to get you on your way.
 
[[Category:SCHG How-tos]]
 

Revision as of 14:28, 2 January 2008

(Guide originally written by JcFerggy)

Using the June 2005 Disassembly of Sonic 1, open up sonic1.asm. First search for "Nem_GHZ_1st:". You should see something like this:

<asm>; ---------------------------------------------------------------------------

Compressed graphics - primary patterns and block mappings
---------------------------------------------------------------------------

Blk16_GHZ: incbin map16\ghz.bin even Nem_GHZ_1st: incbin artnem\8x8ghz1.bin; GHZ primary patterns even Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin; GHZ secondary patterns even Blk256_GHZ: incbin map256\ghz.bin even Blk16_LZ: incbin map16\lz.bin even Nem_LZ: incbin artnem\8x8lz.bin; LZ primary patterns even</asm> Next, copy the "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st", and change "GHZ" to "TS". It should look something like this:

<asm>; ---------------------------------------------------------------------------

Compressed graphics - primary patterns and block mappings
---------------------------------------------------------------------------

Blk16_GHZ: incbin map16\ghz.bin even Nem_GHZ_1st: incbin artnem\8x8ghz1.bin; GHZ primary patterns even Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin; GHZ secondary patterns even Blk256_GHZ: incbin map256\ghz.bin even Blk16_TS: incbin map16\ts.bin even Nem_TS_1st: incbin artnem\8x8ts1.bin; GHZ primary patterns even Blk256_TS: incbin map256\ts.bin even Blk16_LZ: incbin map16\lz.bin even</asm> Now search for "Title_LoadText:". You should see this

<asm>Title_LoadText: move.w (a5)+,(a6) dbf d1,Title_LoadText; load uncompressed text patterns

move.b #0,($FFFFFE30).w; clear lamppost counter move.w #0,($FFFFFE08).w; disable debug item placement mode move.w #0,($FFFFFFF0).w; disable debug mode move.w #0,($FFFFFFEA).w move.w #0,($FFFFFE10).w; set level to GHZ (00) move.w #0,($FFFFF634).w; disable pallet cycling bsr.w LevelSizeLoad bsr.w DeformBgLayer lea ($FFFFB000).w,a1 lea (Blk16_GHZ).l,a0; load GHZ 16x16 mappings move.w #0,d0 bsr.w EniDec lea (Blk256_GHZ).l,a0; load GHZ 256x256 mappings lea ($FF0000).l,a1 bsr.w KosDec bsr.w LevelLayoutLoad bsr.w Pal_FadeFrom move #$2700,sr bsr.w ClearScreen lea ($C00004).l,a5 lea ($C00000).l,a6 lea ($FFFFF708).w,a3 lea ($FFFFA440).w,a4 move.w #$6000,d2 bsr.w LoadTilesFromStart2 lea ($FF0000).l,a1 lea (Eni_Title).l,a0; load title screen mappings move.w #0,d0 bsr.w EniDec lea ($FF0000).l,a1 move.l #$42060003,d0 moveq #$21,d1 moveq #$15,d2 bsr.w ShowVDPGraphics move.l #$40000000,($C00004).l lea (Nem_GHZ_1st).l,a0; load GHZ patterns bsr.w NemDec moveq #1,d0; load title screen pallet bsr.w PalLoad1 move.b #$8A,d0; play title screen music bsr.w PlaySound_Special move.b #0,($FFFFFFFA).w; disable debug mode move.w #$178,($FFFFF614).w; run title screen for $178 frames lea ($FFFFD080).w,a1 moveq #0,d0 move.w #7,d1</asm> In there you will see things relating to "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st". Change them from "GHZ" to "TS" also. You should now have something that looks like this:

<asm>Title_LoadText: move.w (a5)+,(a6) dbf d1,Title_LoadText; load uncompressed text patterns

move.b #0,($FFFFFE30).w; clear lamppost counter move.w #0,($FFFFFE08).w; disable debug item placement mode move.w #0,($FFFFFFF0).w; disable debug mode move.w #0,($FFFFFFEA).w move.w #0,($FFFFFE10).w; set level to GHZ (00) move.w #0,($FFFFF634).w; disable pallet cycling bsr.w LevelSizeLoad bsr.w DeformBgLayer lea ($FFFFB000).w,a1 lea (Blk16_TS).l,a0; load GHZ 16x16 mappings move.w #0,d0 bsr.w EniDec lea (Blk256_TS).l,a0; load GHZ 256x256 mappings lea ($FF0000).l,a1 bsr.w KosDec bsr.w LevelLayoutLoad bsr.w Pal_FadeFrom move #$2700,sr bsr.w ClearScreen lea ($C00004).l,a5 lea ($C00000).l,a6 lea ($FFFFF708).w,a3 lea ($FFFFA440).w,a4 move.w #$6000,d2 bsr.w LoadTilesFromStart2 lea ($FF0000).l,a1 lea (Eni_Title).l,a0; load title screen mappings move.w #0,d0 bsr.w EniDec lea ($FF0000).l,a1 move.l #$42060003,d0 moveq #$21,d1 moveq #$15,d2 bsr.w ShowVDPGraphics move.l #$40000000,($C00004).l lea (Nem_TS_1st).l,a0; load GHZ patterns bsr.w NemDec moveq #1,d0; load title screen pallet bsr.w PalLoad1 move.b #$8A,d0; play title screen music bsr.w PlaySound_Special move.b #0,($FFFFFFFA).w; disable debug mode move.w #$178,($FFFFF614).w; run title screen for $178 frames lea ($FFFFD080).w,a1 moveq #0,d0 move.w #7,d1</asm> Now, you will be able to load another set of files, but as of yet, you don't have any. Go into "artnem" and make a copy of "8x8ghz1.bin" and "8x8ghz2.bin" and rename them to "8x8ts1.bin" and "8x8ts2.bin". Do the same thing in "map16" and "map256", making a copy of the GHZ files, and renaming them to TS.

Now those TS files you just made will be your new background. You have to edit them the same way you do the regular GHZ files. Also, your new background will still have the layout of your GHZ background, That means the same chunk numbers have to be used. Also, if you want to load the files in SonED2, you need a new project file, so make a copy of an already exsisting one, and replace everything that is in there with this:

Type: 1	

Zone ID:	0
Act ID:	 0

Object Def: objdef\s1obj

8x8 Tiles: ..\artnem\8x8ts.bin

16x16 Tiles:   ..\map16\ts.bin

256x256 Tiles: ..\map256\ts.bin

FG Layout: ..\levels\blank.bin
BG Layout: ..\levels\ghzbg.bin

Objects:	   ..\objpos\blank.bin

Palettes-

 Number of files: 1

  Palette 1-

   Start index:	   0
   Number of entries: 64
   File:			  ..\pallet\title.bin

Angle Array:			 ..\collide\anglemap.bin
Collision Array:		 ..\collide\colarray_n.bin
Rotated Collision Array: ..\collide\colarray_r.bin

Collision Index 1: ..\collide\blank.bin

-EOF-

And that should be everything to get you on your way.