Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I port Knuckles to base Sonic 2 #64

Open
GamingUnleashed opened this issue Dec 4, 2024 · 2 comments
Open

How can I port Knuckles to base Sonic 2 #64

GamingUnleashed opened this issue Dec 4, 2024 · 2 comments
Labels
help Help with using the disassembly.

Comments

@GamingUnleashed
Copy link

I wanna port knuckles into regular sonic 2 because I went to make a rom hack that fixes bugs & restores stuff & I tried the tutorial on Sonic Retro & It didn’t work since it’s outdated so I just wanna know how can I port it

@Clownacy
Copy link
Member

Clownacy commented Feb 1, 2025

The Knuckles in Sonic 2 disassembly currently marks every difference between KiS2 and the original Sonic 2, like this:

    if gameRevision=3
	; KiS2 (Knuckles): More Super Knuckles palette stuff.
	moveq	#0,d0
	move.w	d0,(Palette_frame).w
	move.b	d0,(Super_Sonic_palette).w	; stop palette cycle
	lea	(CyclingPal_SKRevert).l,a0
	bra.w	.loadPalette
    else
	; run frame timer
	subq.b	#1,(Palette_timer).w
	bpl.s	.return
	move.b	#3,(Palette_timer).w

	; decrement palette frame and update Sonic's palette
	lea	(CyclingPal_SSTransformation).l,a0
	move.w	(Palette_frame).w,d0
	subq.w	#8,(Palette_frame).w	; previous frame
	bcc.s	+			; branch, if it isn't the first frame
    if fixBugs
	move.w	#0,(Palette_frame).w
    else
	; This does not clear the full variable, causing this palette cycle
	; to behave incorrectly the next time it is activated.
	move.b	#0,(Palette_frame).w
    endif

To port Knuckles, find that relevant code modifications and copy them over to your disassembly. Alternatively, you can do what I did for my 'Sonic the Hedgehog and Miles Tails Prower the Fox in Knuckles the Echidna in Sonic the Hedgehog 2' ROM-hack and modify a copy of the KiS2 disassembly to restore Sonic and Tails instead. I'm not sure which is easier. In either case, you'd need to add some custom code to each section of modified code to make it run either the Sonic 2 or KiS2 version of the code based on whether the player is playing as Knuckles or not.

@Clownacy Clownacy added the help Help with using the disassembly. label Feb 1, 2025
@GamingUnleashed
Copy link
Author

I got knuckles to work in base sonic 2 now i need help with the special stage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Help with using the disassembly.
Projects
None yet
Development

No branches or pull requests

2 participants