[Sonic 1] Alternate Title Screen

Discussion in 'Tutorials Archive' started by JcFerggy, Dec 7, 2007.

Thread Status:
Not open for further replies.
  1. JcFerggy

    JcFerggy Well-Known Member Member

    Joined:
    Aug 9, 2007
    Messages:
    53
    Location:
    Nova Scotia, Canada
    This tutorial will teach you how to make your title screen load alternate art. If used, please give me credit.


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



    Code:
    ; ---------------------------------------------------------------------------
    
    ; 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
    Next, copy the "Blk16_GHZ", "Blk256_GHZ", and "Nem_GHZ_1st", and change "GHZ" to "TS". It should look something like this:





    Code:
    ; ---------------------------------------------------------------------------
    
    ; 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
    Now search for "Title_LoadText:". You should see this





    Code:
    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
    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:





    Code:
    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
    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:





    Code:
    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-

    You have to use the 8x8's in the first half of the file, since it only loads the 8x8ts1, and not both of them, so if you load it, and some tiles looked messed up, try moving them closer to the start. And that should be everything to get you an your way.
     
    Last edited by a moderator: Dec 9, 2007
  2. Shadow Fire

    Shadow Fire Well-Known Member Member

    Joined:
    Aug 6, 2007
    Messages:
    303
    This is a wonderful tutorial.


    Tutorial archived.
     
    Last edited by a moderator: Dec 9, 2007
  3. JcFerggy

    JcFerggy Well-Known Member Member

    Joined:
    Aug 9, 2007
    Messages:
    53
    Location:
    Nova Scotia, Canada
    Oh, and I forgot to mention that you have to use the 8x8's in the first half of the file, since it only loads the 8x8ts1, and not both of them.
     
Thread Status:
Not open for further replies.