Actions

SCHG How-to

Difference between revisions of "Relocate Player Object Logic in Sonic 2 SMS"

From Sonic Retro

m (+cat)
m (Text replacement - "SCHG How-tos (Sonic the Hedgehog 2 (Master System)]]" to "SCHG How-tos (Sonic the Hedgehog 2 (Master System))]]")
 
(4 intermediate revisions by 3 users not shown)
Line 8: Line 8:
 
We're going to start by increasing the ROM size. Open src/s2.asm and find the section that starts ".ROMBANKMAP". It should look like this:
 
We're going to start by increasing the ROM size. Open src/s2.asm and find the section that starts ".ROMBANKMAP". It should look like this:
  
<asm>
+
<syntaxhighlight lang="asm">
 
.ROMBANKMAP
 
.ROMBANKMAP
 
BANKSTOTAL 32
 
BANKSTOTAL 32
 +
BANKSIZE $7FF0
 +
BANKS 1
 +
BANKSIZE $0010
 +
BANKS 1
 
BANKSIZE $4000
 
BANKSIZE $4000
BANKS 32
+
BANKS 30
 
.ENDRO
 
.ENDRO
</asm>
+
</syntaxhighlight>
  
 
Change it to look like this:
 
Change it to look like this:
  
<asm>
+
<syntaxhighlight lang="asm">
 
.ROMBANKMAP
 
.ROMBANKMAP
 
BANKSTOTAL 64
 
BANKSTOTAL 64
 +
BANKSIZE $7FF0
 +
BANKS 1
 +
BANKSIZE $0010
 +
BANKS 1
 
BANKSIZE $4000
 
BANKSIZE $4000
BANKS 64
+
BANKS 62
 
.ENDRO
 
.ENDRO
</asm>
+
</syntaxhighlight>
  
 
That was easy enough...
 
That was easy enough...
Line 32: Line 40:
 
Now we're going to add a source file for the 32nd bank. Create a new file called "bank32.asm" in the src/includes dir. Open the src/includes/banks.asm file. Add the following lines at the end and save:
 
Now we're going to add a source file for the 32nd bank. Create a new file called "bank32.asm" in the src/includes dir. Open the src/includes/banks.asm file. Add the following lines at the end and save:
  
<asm>
+
<syntaxhighlight lang="asm">
 
.BANK 32
 
.BANK 32
 
.ORG $0000
 
.ORG $0000
Line 38: Line 46:
  
 
.include "src\includes\bank32.asm"
 
.include "src\includes\bank32.asm"
</asm>
+
</syntaxhighlight>
  
 
== Move the Logic ==
 
== Move the Logic ==
 
Open src/object_logic/bank31_logic.asm. It should start with the following lines:
 
Open src/object_logic/bank31_logic.asm. It should start with the following lines:
  
<asm>
+
<syntaxhighlight lang="asm">
 
.include "src\object_logic\logic_sonic.asm"
 
.include "src\object_logic\logic_sonic.asm"
  
Line 49: Line 57:
  
 
.include "src\object_logic\logic_block_fragment.asm"
 
.include "src\object_logic\logic_block_fragment.asm"
</asm>
+
</syntaxhighlight>
  
 
Cut the line that includes the logic for the Sonic object and paste it into the "bank32.asm" file. Save everything and build the ROM.
 
Cut the line that includes the logic for the Sonic object and paste it into the "bank32.asm" file. Save everything and build the ROM.
  
[[Category:SCHG How-tos|{{PAGENAME}}]]
+
[[Category:SCHG How-tos (Sonic the Hedgehog 2 (Master System))]]|{{PAGENAME}}]]

Latest revision as of 11:18, 25 August 2018

(Original guide by Glitch)

Introduction

This guide will show you how to increase the the Sonic 2 ROM from 32 to 64 banks and move the logic for the Sonic object into bank 32. This gives you much more room to breathe when editing the player object not to mention extra space for art!

Increasing the ROM Size

We're going to start by increasing the ROM size. Open src/s2.asm and find the section that starts ".ROMBANKMAP". It should look like this:

.ROMBANKMAP
BANKSTOTAL 32
BANKSIZE $7FF0
BANKS 1
BANKSIZE $0010
BANKS 1
BANKSIZE $4000
BANKS 30
.ENDRO

Change it to look like this:

.ROMBANKMAP
BANKSTOTAL 64
BANKSIZE $7FF0
BANKS 1
BANKSIZE $0010
BANKS 1
BANKSIZE $4000
BANKS 62
.ENDRO

That was easy enough...

Prepare the Source Files

Now we're going to add a source file for the 32nd bank. Create a new file called "bank32.asm" in the src/includes dir. Open the src/includes/banks.asm file. Add the following lines at the end and save:

.BANK 32
.ORG $0000
Bank32:

.include "src\includes\bank32.asm"

Move the Logic

Open src/object_logic/bank31_logic.asm. It should start with the following lines:

.include "src\object_logic\logic_sonic.asm"

.include "src\object_logic\logic_ring_sparkle.asm"

.include "src\object_logic\logic_block_fragment.asm"

Cut the line that includes the logic for the Sonic object and paste it into the "bank32.asm" file. Save everything and build the ROM.|Relocate Player Object Logic in Sonic 2 SMS]]