Jump to content

  •  

Photo

How to put a custom background in S1's Level Select


  • This topic is locked This topic is locked
19 replies to this topic

#1 Gardeguey

Gardeguey

    Bye. find me on other places like YT or dA

  • Pro User
  • 69 posts
  • Gender:Male
  • Location:Nvo. Laredo
  • Interests:Programming (68k), ROM hacking, Gardevoir/Lopunny <3 and Maryoku Yummy

Posted 01 September 2011 - 07:01 AM

Like this...

Posted Image Posted Image

Well, Hi again, here's another guide from me.


You'll need:
  • ImaGenesis
  • IrfanView
  • The Sega Data Compressor

Instructions:

1. Find a picture, any pic you want (I recommend one which doesn't use much colors, and closest to fit on screen), I'm gonna use this one for example:
http://i.imgur.com/JEbkh.jpg


2. Run IrfanView

Open the picture
Click on "Image" -> "Resize/Resample"
Set Width to: 320 and Height to: 224 (don't forget to uncheck: "Peserver aspect ratio")

Now click "Image" -> "Decrease color Depth..."
Set to "16 Colors (4BPP)" [And leave "Use Floyd-Steinberg dithering" checked, for better results]

See if it looks good, then Save the pic, it should look like this:
Posted Image


3. Run ImaGenesis
  • Open the optimized pic
  • Click on "Mode" -> "15 color [...] 8x8 tiles, Optimized" (Second option)
  • Click on "Actions" -> "Quantize Now" (or press F5) [Remember, the Genesis has limited colors]
  • Click on "Actions" again, and save the respective files (Tile data, Pallette data and Tile map)
I'm gonna put them in a folder called LS_BG (more organized, but you can do it in your style)




This is what you should have now in "LS_BG":
GFX_u.bin
Map_u.bin
Pal.bin

The Art and Mappings will be compressed to save space in ROM


4. Run The Sega Data Compressor

Click on "Nemesis" set the input file ("GFX_u.bin") and set the output file ("GFX.bin"), click on "Compress"
Click on "Enigma", do the same thing as the GFX but this time for the Mappings ("Map_u.bin" to "Map.bin", and click "Compress")


5. Open sonic1.asm

Replace:

moveq	#2,d0

		bsr.w	PalLoad2	; load level select pallet

		lea	($FFFFCC00).w,a1

		moveq	#0,d0

		move.w	#$DF,d1

 

Title_ClrScroll:

		move.l	d0,(a1)+

		dbf	d1,Title_ClrScroll ; fill scroll data with 0

 

		move.l	d0,($FFFFF616).w

		move	#$2700,sr

		lea	($C00000).l,a6

		move.l	#$60000003,($C00004).l

		move.w	#$3FF,d1

 

Title_ClrVram:

		move.l	d0,(a6)

		dbf	d1,Title_ClrVram ; fill	VRAM with 0

 

		bsr.w	LevSelTextLoad

With:

jsr	Pal_FadeFrom		;Fade-out is necesarry now

 

		moveq	#2,d0

		bsr.w	PalLoad1

 

		lea	($FFFF0000).l,a1

		lea	(Eni_LevSel).l,a0

		move.w	#1,d0

		jsr	EniDec

			lea	($FFFF0000).l,a1

		move.l	#$40000003,d0

		moveq	#39,d1

		moveq	#29,d2

		jsr	ShowVDPGraphics

 

		move.l	#$40200000,($C00004).l

		lea	(Nem_LevSel).l,a0

		jsr	NemDec

 

		lea	($FFFFCC00).w,a1

		moveq	#0,d0

		move.w	#$DF,d1

 

@ClrScroll:

		move.l	d0,(a1)+

		dbf	d1,@ClrScroll

 

		lea	($FFFFD000).w,a1

		moveq	#0,d0

		move.w	#$7FF,d1

 

@ClrObjRam:

		move.l	d0,(a1)+

		dbf	d1,@ClrObjRam

 

		lea	($FFFFF628).w,a1

		moveq	#0,d0

		move.w	#$15,d1

 

@ClrVars:

		move.l	d0,(a1)+

		dbf	d1,@ClrVars

 

		lea	($FFFFF700).w,a1

		moveq	#0,d0

		move.w	#$3F,d1

 

@ClrVars2:

		move.l	d0,(a1)+

		dbf	d1,@ClrVars2

 

		lea	($FFFFFE60).w,a1

		moveq	#0,d0

		move.w	#$47,d1

@ClrVars3:

		move.l	d0,(a1)+

		dbf	d1,@ClrVars3

 

		lea	($FFFFF800).w,a1

		moveq	#0,d0

		move.w	#$7F,d1

@ClrSprTable:

		move.l	d0,(a1)+

		dbf	d1,@ClrSprTable

 

		move.l	#0,($FFFFF616).w	;Clean VScroll

 

		move	#$2700,sr

	

			lea	($C00000).l,a6

		move.l	#$60000003,($C00004).l

		move.w	#$3FF,d1

@ClearBG:

		move.l	d0,(a6)

		dbf	d1,@ClearBG

 

		bsr.w	LevSelTextLoad

 

		jsr	Pal_FadeTo


Next:

add these before "EndOfRom":

(again, in your style)

Nem_LevSel:		incbin	"LS_BG/GFX.bin"

			even

Eni_LevSel		incbin	"LS_BG/Map.bin"

			even

Don't forget the pallet, too.

Find:

Pal_LevelSel:	incbin	pallet\levelsel.bin

Replace with:

Pal_LevelSel:	incbin	"LS_BG\Pal.bin"

			even


THE RESULT:
Posted Image

NOTE: results may vary (ex. if takes a lot to show the BG, too much GFX in VRAM and random colors in the font)


Don't forget to give credit to me for this guide
...And the other people who made the tools

Edited by GenesisFan64, 01 September 2011 - 11:06 PM.

  • 1

#2 Blazer

Blazer

    Bumpin

  • Member
  • 328 posts
  • Gender:Male
  • Location:Middletown, deleware

Posted 01 September 2011 - 03:08 PM

well this looks interesting. though some of the sample pics do look nice, do they all use a 16 color limit or did you find a way to extend it somehow?

edit: never mind I see that it uses 15 colors.

Edited by Xero, 01 September 2011 - 07:43 PM.

  • 0

#3 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 01 September 2011 - 07:06 PM

Nice guide, is it possible to do this in Sonic 2? I know it's different because it's streched or something in S2.
  • 0

#4 Gardeguey

Gardeguey

    Bye. find me on other places like YT or dA

  • Pro User
  • 69 posts
  • Gender:Male
  • Location:Nvo. Laredo
  • Interests:Programming (68k), ROM hacking, Gardevoir/Lopunny <3 and Maryoku Yummy

Posted 01 September 2011 - 09:11 PM

Nice guide, is it possible to do this in Sonic 2? I know it's different because it's streched or something in S2.


Yes. (and it's not streched btw)
Posted Image

Do the same steps exept the last one, here's for Sonic 2:

Find the label: "MenuScreen_LevelSelect" and add this:

lea	($FFFF0000).l,a1

		lea	(Eni_LevSel).l,a0

		move.w	#$2140,d0

		jsr	EniDec

		lea	($FFFF0000).l,a1

		move.l	#$60000003,d0

		moveq	#39,d1

		moveq	#29,d2

		jsr	ShowVDPGraphics

 

		move.l	#$68000000,($C00004).l

		lea	(Nem_LevSel).l,a0

		jsr	NemDec

Next, find:

moveq	#$26,d0

	bsr.w	PalLoad1

Add this after "PalLoad1":

lea	(Pal_LevSel).l,a0

				lea	(Second_palette_Line2).l,a1

		move.w	#$F,d0

MenuScreen_PalLoop:

		move.w	(a0)+,(a1)+

		dbf	d0,MenuScreen_PalLoop

Then binclude the files, put these before the comment "; end of 'ROM' "

Nem_LevSel:		binclude	"LS_BG/GFX.bin"
even

Eni_LevSel: binclude "LS_BG/Map.bin"
even

Pal_LevSel: binclude "LS_BG/Pal.bin"
even

Edited by GenesisFan64, 02 September 2011 - 01:36 AM.

  • 1

#5 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 01 September 2011 - 10:32 PM

That's wierd, I tried this, and in ImaGenesis, when tried saving tiles, I got this:

Run-time error 33. Component 'richtx32.ocx' or one of it dependencies is missng.


I downloaded the missing dll file and stuck it in the System32 folder (and the ImaGenesis folder just in case) and I still get the same error.

Windows 7 problem maybe?

EDIT: Got it to work, tried Windows XP mode and didn't get the error. Although this didn't work. I loaded my hack and after the SEGA screen, it just sits there at a black screen. Did I follow this right?


MenuScreen_LevelSelect:

lea (Metablock_Table).l,a1

lea (MapEng_LevSel).l,a0

move.w #0,d0

jsr EniDec ;was bsr.w

lea (Metablock_Table).l,a1

move.l #$40000003,d0

moveq #$27,d1

moveq #$1B,d2

bsr.w JmpTo_ShowVDPGraphics

moveq #0,d3

bsr.w loc_965A

lea ($FFFF08C0).l,a1

lea (MapEng_LevSelIcon).l,a0

move.w #$90,d0

jsr EniDec ;was bsr.w

bsr.w loc_9688

clr.w (Player_mode).w

clr.w (Results_Screen_2P).w

clr.b (Level_started_flag).w

clr.w ($FFFFF7F0).w

lea (word_87C6).l,a2

bsr.w JmpTo2_Dynamic_Normal

moveq #$26,d0

bsr.w PalLoad1

lea (Normal_palette_line3).w,a1

lea (Second_palette_line3).w,a2

moveq #7,d1

;

;===========GenesisFan64's instructions==============

;

	lea ($FFFF0000).l,a1

  lea (Eni_LevSel).l,a0

  move.w #$2140,d0

  jsr EniDec

  lea ($FFFF0000).l,a1

  move.l #$60000003,d0

  moveq #39,d1

  moveq #29,d2

  jsr ShowVDPGraphics

 

  move.l #$68000000,($C00004).l

  lea (Nem_LevSel).l,a0

  jsr NemDec

;

;===========GenesisFan64's instructions==============

;

loc_9366:


And:


PalLoad1:

;

;===========GenesisFan64's instructions==============

;

	lea (Pal_LevSel).l,a0

	lea (Second_palette_Line2).l,a1

  move.w #$F,d0

MenuScreen_PalLoop:

  move.w (a0)+,(a1)+

  dbf d0,MenuScreen_PalLoop

;

;===========GenesisFan64's instructions==============

;

lea (PalPointers).l,a1

lsl.w #3,d0

adda.w d0,a1

movea.l (a1)+,a2

movea.w (a1)+,a3

adda.w #$80,a3

move.w (a1)+,d7

- move.l (a2)+,(a3)+

dbf d7,-

rts

; End of function PalLoad1


You also said to look for

moveq #$26,d0

bsr.w PalLoad1


But you didn't say what to do. Plus there are several of these in my ASM.

Edited by redhotsonic, 01 September 2011 - 10:51 PM.

  • 0

#6 Gardeguey

Gardeguey

    Bye. find me on other places like YT or dA

  • Pro User
  • 69 posts
  • Gender:Male
  • Location:Nvo. Laredo
  • Interests:Programming (68k), ROM hacking, Gardevoir/Lopunny <3 and Maryoku Yummy

Posted 01 September 2011 - 11:01 PM

This:


; loc_92F6:

MenuScreen_LevelSelect:

	lea	($FFFF0000).l,a1

	lea	(Eni_LevSel).l,a0

	move.w	#$2140,d0

	jsr	EniDec

	lea	($FFFF0000).l,a1

	move.l	#$60000003,d0

	moveq	#39,d1

	moveq	#29,d2

	jsr	ShowVDPGraphics

 

	move.l	#$68000000,($C00004).l

	lea	(Nem_LevSel).l,a0

	jsr	NemDec

 

	lea	(Metablock_Table).l,a1

	lea	(MapEng_LevSel).l,a0

	move.w	#0,d0

	bsr.w	EniDec

	lea	(Metablock_Table).l,a1

	move.l	#$40000003,d0

	moveq	#$27,d1

	moveq	#$1B,d2

	bsr.w	JmpTo_ShowVDPGraphics

 

	moveq	#0,d3

	bsr.w	loc_965A

	lea	($FFFF08C0).l,a1

	lea	(MapEng_LevSelIcon).l,a0

	move.w	#$90,d0

	bsr.w	EniDec

	bsr.w	loc_9688

	clr.w	(Player_mode).w

	clr.w	(Results_Screen_2P).w

	clr.b	(Level_started_flag).w

	clr.w	($FFFFF7F0).w

	lea	(word_87C6).l,a2

	bsr.w	JmpTo2_Dynamic_Normal

	moveq	#$26,d0

	bsr.w	PalLoad1

 

	lea	(Pal_LevSel).l,a0

	lea	(Second_palette_Line2).l,a1

	move.w	#$F,d0

MenuScreen_PalLoop:

	move.w	(a0)+,(a1)+

	dbf	d0,MenuScreen_PalLoop

  

	;...

(also, lol for the "code" tag, i was using "ASM")

Edited by GenesisFan64, 01 September 2011 - 11:21 PM.

  • 0

#7 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 01 September 2011 - 11:04 PM

Nope, still getting the exact same thing. After the SEGA screen, it goes blank and stays that way.

I'll have another look tomorrow, I'm off to bed =P

EDIT: Got it done. The problem was when saving the data in imagens, I had it in BASIC, and not Binary. When you said:

Click on "Actions" again, and save the respective files (Tile data, Pallette data and Tile map)


I literally did, I never thought to change the format bit! You might want to add that bit in =P

Anyway, thanks for the guide!
  • 0

#8 Pokepunch

Pokepunch

    Meh...

  • Member
  • 153 posts
  • Gender:Male
  • Location:UK
  • Interests:Nothing

Posted 01 January 2012 - 10:47 PM

Sorry about the bump but would this be possible for the Sonic 2 level select in Sonic 1? I tried but was not to sure about what I was doing.

Edited by cookietheguineapig, 01 January 2012 - 10:48 PM.

  • -1

#9 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 01 January 2012 - 10:50 PM

It's possible because Psy has done it. But this is for more like adding background to the level select, not porting level selects to a different game.
  • 0

#10 Pokepunch

Pokepunch

    Meh...

  • Member
  • 153 posts
  • Gender:Male
  • Location:UK
  • Interests:Nothing

Posted 01 January 2012 - 11:01 PM

It's possible because Psy has done it. But this is for more like adding background to the level select, not porting level selects to a different game.

I mean putting the background in for this. Would it be similar to the above posts?

Edited by cookietheguineapig, 01 January 2012 - 11:02 PM.

  • 0

#11 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 02 January 2012 - 11:56 AM

Well, Psy followed this guide to put a background in his level select. His level select is Sonic 2 in Sonic 1. IIRC, he just followed the Sonic 2 steps.
  • 0

#12 Pokepunch

Pokepunch

    Meh...

  • Member
  • 153 posts
  • Gender:Male
  • Location:UK
  • Interests:Nothing

Posted 02 January 2012 - 01:38 PM

Oh now ImaGenesis is playing up the same way yours did. And I tried all the stuff that you tried with no luck.

Edited by cookietheguineapig, 02 January 2012 - 01:39 PM.

  • 0

#13 Regeneration

Regeneration

    Newbie

  • Trialist
  • 3 posts
  • Gender:Male
  • Location:Under your bed ;)
  • Interests:Girls
    Music
    Friends
    Socialising
    SONIC THE HEDGEHOG

Posted 03 January 2012 - 12:45 AM

I would like to thank you for this tutorial. It worked perfectly

Posted Image
  • 1

#14 Dandaman955

Dandaman955

    6 Chaos Emeralds

  • Member
  • 577 posts
  • Gender:Male
  • Location:North Wales

Posted 03 January 2012 - 04:08 PM

It'd be pretty awesome if the forums had a 'post without bumping' feature.
  • 1

#15 Shadow Fire

Shadow Fire

    That does it. You're *BLEEP*ing dead.

  • Administrator
  • 265 posts
  • Gender:Male
  • Location:Space.
  • Interests:Stuff. =P

Posted 20 January 2012 - 03:46 PM

Well, Psy followed this guide to put a background in his level select. His level select is Sonic 2 in Sonic 1. IIRC, he just followed the Sonic 2 steps.

I'm curious about this too. I'm using the code of Esrael's... and there's nothing in there that seems to match the code in this tutorial.
  • 0

#16 Spanner

Spanner

    Capable when people thought I wasn't...

  • Staff
  • 1477 posts
  • Gender:Male
  • Location:United Kingdom

Posted 20 January 2012 - 04:22 PM

Esrael used a very old disassembly to port this. It may be worthwhile for somebody to port the screen code from at least the 2007 Sonic 2 disassembly to try and keep some sort of consistency. However, that challenge alone is up to someone to do it if they want to.
  • 0

#17 Shadow Fire

Shadow Fire

    That does it. You're *BLEEP*ing dead.

  • Administrator
  • 265 posts
  • Gender:Male
  • Location:Space.
  • Interests:Stuff. =P

Posted 21 January 2012 - 11:38 AM

Damn... That puts me out of luck. I haven't had any experience with the S2 disasms.
  • 0

#18 Animemaster

Animemaster

    Lets get to work!

  • Pro User
  • 984 posts
  • Gender:Male
  • Location:UK

Posted 21 January 2012 - 05:55 PM

Damn... That puts me out of luck. I haven't had any experience with the S2 disasms.

I can port a bg for you if you want.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users