Actions

SCHG

Difference between revisions of "Esrael s2k"

From Sonic Retro

(Needs copyediting; see SCHG Talk:Esrael s2k)
 
m (Text replacement - " Objects==" to " objects==")
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{cleanup-copyedit}}
+
{{HistoricalArticle}}
Using a hexadecimal editor is possible to modify the game, publishing it byte to byte. Knowing where it is each instruction and altering it correctly you can personalize the game. You can draw other character in the place of Sonic, but this is not easy since it has that if fact point to point. To alter the name of the levels in the level select menu and in  title it of the levels. But to program the game it is necessary that he is in the binary format, it is not very difficult to convert the game for binary, you can use a conversion program or emulative Genecyst that he/she has the option DUMP ROM, that makes the conversion.
 
  
In spite of Sonic 2 & Knuckles to be just Sonic 2 coupled Sonic & Knuckles, this game can be considered a new version of Sonic 2, because the game Sonic & Knuckles after identifying the cartridge coupled Sonic 2 activates a memory that is at the end of the two games, and this memory tells all the instructions of the game of Sonic 2 basically & Knuckles, just using the cartridge of Sonic 2 for the graphs and maps of the levels, see that in this manual you will see that the information that are altered in most of the case meet above the address 0x300000 and little thing they were among the addresses 0x200000 to 0x2FFFFF that is where the game of Sonic 2 is in the memory when being coupled Sonic & Knuckles, tends above in hands the information and more in elapsing perhaps of the document you uniform that can say that the game Sonic 2 & Knuckles a new game of Sonic 2 can be considered with Knuckles.  
+
Using a hex editor it is possible to modify ''[[Sonic 2 & Knuckles]]'', editing it byte by byte. By knowing where each function is and modifying it correctly, it is possible to customize the game. You can draw another character in [[Knuckles|Knuckles']] place, but it's not very easy, because it needs to be drawn pixel by pixel. You can change the level names in the level select menu and in the level title cards. But to program the game, it needs to be in the binary format. It isn't hard to convert the game to binary form. You can use a conversion program or the [[Genecyst]] emulator's DUMP ROM option, which does the conversion.
  
Observe the table below with the levels and with its respective ids, these ids is important because the game uses these ids for if referene the certain level.
+
In spite of ''Sonic 2 & Knuckles'' being just ''[[Sonic 2]]'' coupled with ''[[Sonic & Knuckles]]'', this game can be considered a new version of ''Sonic 2'', because ''Sonic & Knuckles'', after identifying that the cartridge attached is ''Sonic 2'', activates a memory that is at the end of the two games, and this memory contains all the game code, only using the ''Sonic 2'' cartridge for the graphs and maps of the levels. In this guide, you will see that the information that's altered in most of the cases is above the address $300000, where the extra memory is stored, and a few things are in the addresses $200000 to $2FFFFF, where ''Sonic 2'' is stored in memory. Because of this, ''Sonic 2 & Knuckles'' can be considered to be a completely new game, using ''Sonic 2''<nowiki>'</nowiki>s engine and data, and starring Knuckles.
  
{|align="center" border="1"
+
==Level IDs==
!LEVEL||ID
+
Observe the table below with the levels and their respective IDs. These IDs are important because the game uses them for referencing the levels.
 +
 
 +
{| class="prettytable" style="width:auto;"
 +
! Level !! ID
 
|-
 
|-
|EMERALD HILL
+
| Emerald Hill
|00
+
| 00
 
|-
 
|-
|METROPOLIS
+
| Metropolis
|04
+
| 04
 
|-
 
|-
|METROPOLIS
+
| Metropolis
|05
+
| 05
 
|-
 
|-
|WING FORTRESS
+
| Wing Fortress
|06
+
| 06
 
|-
 
|-
|HILL TOP
+
| Hill Top
|07
+
| 07
 
|-
 
|-
|OIL OCEAN
+
| Oil Ocean
|0A
+
| 0A
 
|-
 
|-
|MYSTIC CAVE
+
| Mystic Cave
|0B
+
| 0B
 
|-
 
|-
|CASINO NIGHT
+
| Casino Night
|0C
+
| 0C
 
|-
 
|-
|CHEMICAL PLANT
+
| Chemical Plant
|0D
+
| 0D
 
|-
 
|-
|DEATH EGG
+
| Death Egg
|0E
+
| 0E
 
|-
 
|-
|AQUATIC RUIN
+
| Aquatic Ruin
|0F
+
| 0F
 
|-
 
|-
|SKY CHASE
+
| Sky Chase
|10
+
| 10
 
|}
 
|}
  
Notice that some numbers are jumped as of the 01, 03, 06 and 09.  In spite of not existing a level name for these ID's in the relationship and nor in the level select menu. If you place these ID's that they are lacking it can access lost levels (Makes the experience and see the results). it Observes the table with the standard location of the phases and soon soon after an explanation.
+
Note that some numbers are skipped, like 01, 03, 06 and 09.  Although these do not have level names and are not in the level select, if you place these IDs, you can access lost levels (try it and see the results). The table below gives the location of the level IDs for each level in the level select menu. The first address in the table is for the zone byte, and the second for the act byte. For example, at the address $307916 you will see the byte 07 (Hill Top Zone) and at the address $307917 you will see the byte 00 (Act 1).
  
{|align="center" border="1"
+
{| class="prettytable" style="width:auto;"
!Level||Act||Address
+
! Level !! Act !! Address
 
|-
 
|-
|EMERALD HILL
+
| Emerald Hill
|ACT 1
+
| Act 1
|307906 e 307907
+
| $307906-$307907
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307908 e 307909
+
| $307908-$307909
 
|-
 
|-
|CHEMICAL PLANT
+
| Chemical Plant
|ACT 1
+
| Act 1
|30790A e 3079B
+
| $30790A-$30790B
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|30790C e 30790D  
+
| $30790C-$30790D
 
|-
 
|-
|AQUATIC RUIN
+
| Aquatic Ruin
|ACT 1
+
| Act 1
|30790E e 30790F
+
| $30790E-$30790F
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307910 e 307911
+
| $307910-$307911
 
|-
 
|-
|CASINO NIGHT   
+
| Casino Night
|ACT 1
+
| Act 1
|307912 e 307913
+
| $307912-$307913
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307914 e 307915
+
| $307914-$307915
 
|-
 
|-
|HILL TOP
+
| Hill Top
|ACT 1
+
| Act 1
|307916 e 307917
+
| $307916-$307917
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307918 e 307919
+
| $307918-$307919
 
|-
 
|-
|MYSTIC CAVE
+
| Mystic Cave
|ACT 1
+
| Act 1
|30791A e 30791B
+
| $30791A-$30791B
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|30791C e 30791D
+
| $30791C-$30791D
 
|-
 
|-
|OIL OCEAN
+
| Oil Ocean
|ACT 1
+
| Act 1
|30791E e 30791F
+
| $30791E-$30791F
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307920 e 307921
+
| $307920-$307921
 
|-
 
|-
|METROPOLIS
+
| Metropolis
|ACT 1
+
| Act 1
|307922 e 307923
+
| $307922-$307923
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|307924 e 307925
+
| $307924-$307925
 
|-
 
|-
 
|
 
|
|ACT 3
+
| Act 3
|307926 e 307927
+
| $307926-$307927
 
|-
 
|-
|SKY CHASE                                   
+
| Sky Chase
 
|
 
|
|307928 e 307927
+
| $307928-$307927
 
|-
 
|-
|WING FORTRESS                         
+
| Wing Fortress
|
+
|
|30792A e 30792B
+
| $30792A-$30792B
 
|-
 
|-
|DEATH EGG                                   
+
| Death Egg
|
+
|
|30792C e 30792D
+
| $30792C-$30792D
 
|}
 
|}
  
The table above indicates where they are located the configuration bytes in the screen of level select. The 1st. address of the table it indicates the byte of the zone and the 2nd. address indicates the act byte. Example in the address 307916 you will see the byte 07 (Hill Top zone) and in the address 307917 you will see the byte 00 (Act 1). 
+
==Level Music==
 
+
You can change the music which plays in each level. The format is very simple: one byte per level, that byte being the ID of the music to play. To change what music plays, play the desired music in the sound test, write down the number of the music and place it in the byte that represents the chosen level. Note that the music ID is actually equal to the music number in the sound test + $80, so remember to add $80 before placing it in the playlist. The table below gives the address of the music ID for each level:
==Levels Music== 
 
  
You can also choose the music to be played in the levels. The format is of just a byte for level and it is very simple. To place another music of its preference, play the sounds in the sound test, write down the number of the music and place in the byte that represents the chosen level.  See below in the table the location of the selection of music. Observation: When modifying the music of the levels it adds 80 to the number of Sound Test and place in the wanted place, the table below has some examples of as the midis they are in Rom and as they appear in Sound Test.
+
{| class="prettytable" style="width:auto;"
 
+
!Level !! Music ID !! Music number !! Address
{|align="center" border="1"
 
!Level||Music in<br/> the Rom||Music in<br/> the Sound Test||Address
 
 
|-
 
|-
|EMERALD HILL
+
| Emerald Hill
|82
+
| 82
|02
+
| 02
|30397C
+
| $30397C
 
|-
 
|-
|ID 01
+
| ID 01
|82
+
| 82
|02
+
| 02
|30397D
+
| $30397D
 
|-
 
|-
|WOOD ZONE
+
| Wood Zone
|85
+
| 85
|05
+
| 05
|30397E
+
| $30397E
 
|-
 
|-
|ID 03
+
| ID 03
|84
+
| 84
|04
+
| 04
|30397F
+
| $30397F
 
|-
 
|-
|METROPOLIS
+
| Metropolis
|85
+
| 85
|05
+
| 05
|303980
+
| $303980
 
|-
 
|-
|METROPOLIS 3
+
| Metropolis 3
|85
+
| 85
|05
+
| 05
|303981
+
| $303981
 
|-
 
|-
|WING FORTRESS
+
| Wing Fortress
|8F
+
| 8F
|0F
+
| 0F
|303982
+
| $303982
 
|-
 
|-
|HILL TOP
+
| Hill Top
|86
+
| 86
|06
+
| 06
|303983
+
| $303983
 
|-
 
|-
|HIDDEN PALACE
+
| Hidden Palace
|90
+
| 90
|10
+
| 10
|303984
+
| $303984
 
|-
 
|-
|ID 09
+
| ID 09
|8D
+
| 8D
|0D
+
| 0D
|303985
+
| $303985
 
|-
 
|-
|OIL OCEAN
+
| Oil Ocean
|84
+
| 84
|04
+
| 04
|303986
+
| $303986
 
|-
 
|-
|MYSTIC CAVE
+
| Mystic Cave
|8B
+
| 8B
|0B
+
| 0B
|303987
+
| $303987
 
|-
 
|-
|CASINO NIGHT
+
| Casino Night
|89
+
| 89
|09
+
| 09
|303988
+
| $303988
 
|-
 
|-
|CHEMICAL PLANT
+
| Chemical Plant
|8E
+
| 8E
|0E
+
| 0E
|303989
+
| $303989
 
|-
 
|-
|DEATH EGG
+
| Death Egg
|8A
+
| 8A
|0A
+
| 0A
|30398A
+
| $30398A
 
|-
 
|-
|AQUATIC RUIN
+
| Aquatic Ruin
|87
+
| 87
|07
+
| 07
|30398B
+
| $30398B
 
|-
 
|-
|SKY CHASE
+
| Sky Chase
|8D
+
| 8D
|0D
+
| 0D
|30398C
+
| $30398C
 
|}
 
|}
  
==Altering Objects==  
+
==Altering objects==
 +
You can also alter the objects in the levels such as [[Badnik|badniks]], monitors, obstacles, etc. The configuration of the objects in the levels uses 6 bytes in the format XX XX YY YY OO VV. XX XX is the horizontal position, YY YY is the vertical position, OO is the object to be placed, and VV is the object subtype. To obtain the exact location where you want to place your objects, enable debug mode and note the first line of coordinates on the HUD in the place of the score counter. These will be the coordinates that you should use for the object. The table below lists the locations of the object placement data for each level. Each level's data ends with FF FF 00 00 00 00, after which the next level's data begins.
  
You can also alter objects in the levels as badnicks, lives, obstacles, etc... The configuration of the objects in the levels uses 6 long bytes, being in the format XX-XX-YY-YY-OO-VV. Explaining to X's better indicates the horizontal position in the screen, Y's indicates the vertical position in the screen, O's indicates the objects they be she placed and V's indicates the possible variations of each object. To obtain the exact location of the place where you want for the objects, make the code of the debug mode and write down the first line of coordinates in the place of SCORE, These will be the coordinates that you should type to place the object in the wanted place. See the location where game it search the objects of the levels. The levels finish the mappings before the bytes FF-FF-00-00-00-00. Starting from these bytes next level begins.
+
{| class="prettytable" style="width:auto;"
 
+
| Emerald Hill
{|align="center" border="1"
+
| Act 1
|EMERALD HILL
+
| $DF3FE
|ACT 1
 
|DF3FE
 
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|DF7B2
+
| $DF7B2
 
|-
 
|-
|METROPOLIS ZONE
+
| Metropolis
|ACT 1
+
| Act 1
|DFBD2
+
| $DFBD2
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E005E
+
| $E005E
 
|-
 
|-
 
|
 
|
|ACT 3
+
| Act 3
|E05A4
+
| $E05A4
 
|-
 
|-
|WING FORTRESS                               
+
| Wing Fortress
 
|
 
|
|E0C10
+
| $E0C10
 
|-
 
|-
|HILL TOP
+
| Hill Top
|ACT 1
+
| Act 1
|E1018
+
| $E1018
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E1396
+
| $E1396
 
|-
 
|-
|HIDDEN PALACE                             
+
| Hidden Palace
 
|
 
|
|2E8C80
+
| $2E8C80
 
|-
 
|-
|OIL OCEAN
+
| Oil Ocean
|ACT 1
+
| Act 1
|E1A4A
+
| $E1A4A
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E1F18
+
| $E1F18
 
|-
 
|-
|MYSTIC CAVE
+
| Mystic Cave
|ACT 1
+
| Act 1
|E23DA
+
| $E23DA
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E26F2
+
| $E26F2
 
|-
 
|-
|CASINO NIGHT
+
| Casino Night
|ACT 1
+
| Act 1
|33F06E
+
| $33F06E
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|33F74C
+
| $33F74C
 
|-
 
|-
|CHEMICAL PLANT
+
| Chemical Plant
|ACT 1
+
| Act 1
|E2A88
+
| $E2A88
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E2EFC
+
| $E2EFC
 
|-
 
|-
|DEATH EGG                                     
+
| Death Egg
 
|
 
|
|2EB230
+
| $2EB230
 
|-
 
|-
|AQUATIC RUIN
+
| Aquatic Ruin
|ACT 1
+
| Act 1
|E34D8
+
| $E34D8
 
|-
 
|-
 
|
 
|
|ACT 2
+
| Act 2
|E398E
+
| $E398E
 
|-
 
|-
|SKY CHASE                                     
+
| Sky Chase
 
|
 
|
|2EBBDE
+
| $2EBBDE
 
|}
 
|}
  
==I Begin of Knuckles in the Phases==
+
==Level Starting locations==
 +
You can change Knuckles' starting location for each level. To find out what coordinates to use, enable Debug Mode, go to your new starting location, and write down the coordinates (the top line in the HUD in place of the score counter). Refer to the table below to get the address you have to place your new coordinates at:
  
In this part you can define in that point of the screen Knuckles begins. To select a place different from the original. Use the debug mode. Go to the place from where you want to begin and write down the coordinates (first line in the place of Score), Tends in hands the coordinates it places them in the place of the level chosen accordingly below in the address of the table.
+
{| class="prettytable" style="width:auto;"
 
+
! Level !! Address !! Default Coordinates
 
{|align="center" border="1"
 
!Level||Location||Coordinates
 
 
|-
 
|-
|Emerald Hill  1
+
| Emerald Hill  1
|30A488
+
| $30A488
|0060028F
+
| 0060028F
 
|-
 
|-
|Emerald Hill 2
+
| Emerald Hill 2
|30A48C
+
| $30A48C
|006002AF
+
| 006002AF
 
|-
 
|-
|01-00
+
| 01-00
|30A490
+
| $30A490
|0060028F
+
| 0060028F
 
|-
 
|-
|01-01
+
| 01-01
|30A494
+
| $30A494
|006002AF
+
| 006002AF
 
|-
 
|-
|Wood 1
+
| Wood 1
|30A498
+
| $30A498
|006001AC
+
| 006001AC
 
|-
 
|-
|Wood 2
+
| Wood 2
|30A49C
+
| $30A49C
|006001AC
+
| 006001AC
 
|-
 
|-
|03-00
+
| 03-00
|30A4A0
+
| $30A4A0
|0060028F
+
| 0060028F
 
|-
 
|-
|03-01
+
| 03-01
|30A4A4
+
| $30A4A4
|006002AF
+
| 006002AF
 
|-
 
|-
|Metropolis 1
+
| Metropolis 1
|30A4A8
+
| $30A4A8
|0060028C
+
| 0060028C
 
|-
 
|-
|Metropolis 2
+
| Metropolis 2
|30A4AC
+
| $30A4AC
|006005EC
+
| 006005EC
 
|-
 
|-
|Metropolis 3
+
| Metropolis 3
|30A4B0
+
| $30A4B0
|0060020C
+
| 0060020C
 
|-
 
|-
|05-01
+
| 05-01
|30A4B4
+
| $30A4B4
|006002AF
+
| 006002AF
 
|-
 
|-
|Wing Fortress 1
+
| Wing Fortress 1
|30A4B8
+
| $30A4B8
|006004CC
+
| 006004CC
 
|-
 
|-
|Wing Fortress 2
+
| Wing Fortress 2
|30A4BC
+
| $30A4BC
|01E004CC
+
| 01E004CC
 
|-
 
|-
|Hill Top 1
+
| Hill Top 1
|30A4C0
+
| $30A4C0
|006003EF
+
| 006003EF
 
|-
 
|-
|Hill Top 2
+
| Hill Top 2
|30A4C4
+
| $30A4C4
|006006AF
+
| 006006AF
 
|-
 
|-
|Hidden Palace 1
+
| Hidden Palace 1
|30A4C8
+
| $30A4C8
|023001AC
+
| 023001AC
 
|-
 
|-
|Hidden Palace 2
+
| Hidden Palace 2
|30A4CC
+
| $30A4CC
|023001AC
+
| 023001AC
 
|-
 
|-
|09-00
+
| 09-00
|30A4D0
+
| $30A4D0
|0060028F
+
| 0060028F
 
|-
 
|-
|09-01
+
| 09-01
|30A4D4
+
| $30A4D4
|006002AF
+
| 006002AF
 
|-
 
|-
|Oil Ocean 1
+
| Oil Ocean 1
|30A4D8
+
| $30A4D8
|006006AC
+
| 006006AC
 
|-
 
|-
|Oil Ocean 2
+
| Oil Ocean 2
|30A4DC
+
| $30A4DC
|0060056C
+
| 0060056C
 
|-
 
|-
|Mystic Cave 1
+
| Mystic Cave 1
|30A4E0
+
| $30A4E0
|006006AC
+
| 006006AC
 
|-
 
|-
|Mystic Cave 2
+
| Mystic Cave 2
|30A4E4
+
| $30A4E4
|006005AC
+
| 006005AC
 
|-
 
|-
|Casino Night 1
+
| Casino Night 1
|30A4E8
+
| $30A4E8
|006002AC
+
| 006002AC
 
|-
 
|-
|Casino Night 2
+
| Casino Night 2
|30A4EC
+
| $30A4EC
|0060058C
+
| 0060058C
 
|-
 
|-
|Chemical Plant 1
+
| Chemical Plant 1
|30A4F0
+
| $30A4F0
|006001EC
+
| 006001EC
 
|-
 
|-
|Chemical Plant 2
+
| Chemical Plant 2
|30A4F4
+
| $30A4F4
|0060012C
+
| 0060012C
 
|-
 
|-
|Death Egg 1
+
| Death Egg 1
|30A4F8
+
| $30A4F8
|0060012D
+
| 0060012D
 
|-
 
|-
|Death Egg 2
+
| Death Egg 2
|30A4FC
+
| $30A4FC
|0060012D
+
| 0060012D
 
|-
 
|-
|Aquatic Ruin  1
+
| Aquatic Ruin  1
|30A500
+
| $30A500
|0060037E
+
| 0060037E
 
|-
 
|-
|Aquatic Ruin  2
+
| Aquatic Ruin  2
|30A504
+
| $30A504
|0060037E
+
| 0060037E
 
|-
 
|-
|Sky Chase 1
+
| Sky Chase 1
|30A508
+
| $30A508
|01200070
+
| 01200070
 
|-
 
|-
|Sky Chase 2
+
| Sky Chase 2
|30A50C
+
| $30A50C
|01400070
+
| 01400070
 
|}
 
|}
  
 
==Events==
 
==Events==
 +
In this game, the Sega logo, title screen, levels, special stages, etc. are different events and have IDs assigned to them. The table below lists the ID and starting code location of each event. The IDs go in units of 4, and by knowing the exact initialization place of the events you can reprogram them without affecting the operation of the game.
  
In the games of Sonic, the Sega Logo, The screen of I title, the levels, the Special Stages, etc.. they are different events and they are called with different codes and you it can you work them placing its values in the appropriate place, the numbers that you will see below in the table they simply belong the code of the game and theses numbers don't polish by chance of 4 in 4, If you go until the address 0x3000A0 you will see several numbers 6000xxxxx it  notices that the neighbor 6000xxxx has one it distances of 4 bytes of the address 0x3000A0, the neighbor 6000xxxx has 8 bytes of the address 0x3000A0 and so on. Before you wonder: what does this have of important? - I answer: being known the exact initialization place of the events you can reprogram them without affecting the operation of the game. See below in the table the events and its respective initialization addresses.
+
{| class="prettytable" style="width:auto;"
 
+
! Event !! ID !! Code
{|align="center" border="1"
 
!Event||ID||Start
 
 
|-
 
|-
|Sega Logo
+
| Sega Logo
|00
+
| 00
|0x303310
+
| $303310
 
|-
 
|-
|Screen Titles
+
| Screen Titles
|04
+
| 04
|0x3034E8
+
| $3034E8
 
|-
 
|-
|Demo Mode
+
| Demo Mode
|08
+
| 08
|0x3039A0
+
| $3039A0
 
|-
 
|-
|Normal Gameplay
+
| Normal Gameplay
|0C
+
| 0C
|0x3039A0
+
| $3039A0
 
|-
 
|-
|Special Stage
+
| Special Stage
|10
+
| 10
|0x304A0A
+
| $304A0A
 
|-
 
|-
|Continue
+
| Continue
|14
+
| 14
|0x3072A6
+
| $3072A6
 
|-
 
|-
|Level Select Menu
+
| Level Select Menu
|18-1C
+
| 18-1C
|0x3076C2
+
| $3076C2
 
|-
 
|-
|End Sequence
+
| End Sequence
|20
+
| 20
|0x308008
+
| $308008
 
|-
 
|-
|Level Select Menu
+
| Level Select Menu
|24
+
| 24
|0x3076C2
+
| $3076C2
 
|}
 
|}
  
==Codes of the Game==
+
==Cheat Codes==
  
===Level Select Menu===  
+
===Level Select Code===
  
In this part you will know the codes of the game and as to alter them, the access code to the Level Select Menu is: up, up, up, down, down, down, left, right, left, right. In the Rom this code this stored in the format of the keys of the game and you it can it simply alters placing the value of the corresponding key. The code this stored in the address 0x3038E2 and you will see the following bytes: -01-01-01-02-02-02-04-08-04-08-00-FF - where: 01-is up, 02 is down, 04 is left, 08 is right and 00-FF indicate end of the code, you can modify the access code to level select menu even so the game only accepts code for the directional keys, you should place the bytes 00-FF in the end to indicate that the code finished
+
You can alter the codes used in the game. The code for the Level Select Menu is {{up}}, {{up}}, {{up}}, {{down}}, {{down}}, {{down}}, {{left}}, {{right}}, {{left}}, {{right}}. In the ROM this code is stored in the Motorola key format, and you can simply alter it by placing new key values. The code is stored at the address $3038E2, and consists of the following bytes: 01 01 01 02 02 02 04 08 04 08 00 FF, where 01 is {{up}}, 02 is {{down}}, 04 is {{left}}, 08 is {{right}}, and 00 FF indicates the end of the code. You can modify this code as you wish, but remember to keep the bytes 00 FF at the end so the game knows the code has ended. Summary:
  
TABLE SUMMARY   
+
{| class="prettytable" style="width:auto;"
 
+
! Code !! Location
{|align="center" border="1"
 
!Code||Location
 
 
|-
 
|-
|Level Select Menu
+
| Level Select Menu
|0x3038E2 á 0x3038ED
+
| $3038E2-$3038ED
 
|-
 
|-
|Keys
+
! Key
|Value
+
! Value
 
|-
 
|-
|UP
+
| {{Up}}
|01
+
| 01
 
|-
 
|-
|DOWN
+
| {{Down}}
|02
+
| 02
 
|-
 
|-
|LEFT
+
| {{Left}}
|04
+
| 04
 
|-
 
|-
|RIGHT
+
| {{Right}}
|08
+
| 08
 
|}
 
|}
  
 
===Debug Mode and Super Knuckles===
 
===Debug Mode and Super Knuckles===
 +
These codes are used from the level select menu and are inserted in the sound test by playing the respective music. They are easier to alter because they are stored in ROM in the same way they are typed in Sound Test. The only difference from the level select code is that FF is used to indicate the end of the code rather than 00 FF. The table below lists the locations of the codes:
  
Them code to proceed is made after having been acessed the level select menu and they are inserted in Sound Test playing the respective music. These are easier to alter because are stored in Rom in the same way that are typed in Sound Test. The only difference in relation to the access code to the level select menu is that you have to type FF instead of 00-FF to indicate it I finish of the code. See below in the table the codes and its respective locations.
+
{| class="prettytable" style="width:auto;"
 
+
!Event !! Code !! Location
{|align="center" border="1"
 
!Event||Code||Location
 
 
|-
 
|-
|Debug Mode
+
| Debug Mode
|01-09-09-04-01-00-01-08
+
| 01,09,09,04,01,00,01,08
|0x307C7A to  0x307C81
+
| $307C7A-$307C81
 
|-
 
|-
|All Emeralds (Super Knuckles)
+
| All Emeralds (Super Knuckles)
|01-06-07-07-07-02-01-06
+
| 01,06,07,07,07,02,01,06
|0x307C83 to 0x307C8A
+
| $307C83-$307C8A
 
|}
 
|}
  
==Curiousities==
+
==Curiosities==
 +
You will see the codes of ''Sonic 2'' alone in this game. Even though they do not work, the Oil Ocean music bug (after entering the 14 continues cheat) has been fixed, because if you observe the address $307C4C you will see the bytes 10 3C 00 BF and not 10 3C 00 3F, which is what is present in the ''Sonic 2'' ROM and causes the music lock. This bug is not even fixed in ''[[Sonic Jam]]''. Many other bugs that happen in ''Sonic 2'' don't happen in this version. For example, the bug where the game freezes if you enter object placement mode after dying and place an object does not occur in this game.
 +
 
  
You will see the codes of Sonic 2 alone, but without none usefulness in this game, now the onlooker is that if these codes were used the game it would not join in the music Oil Ocean when being made the code (01-01-02-04), because if you observe in the address 0x307C4C you will see the bytes 10-3C-00-BF and not 10-3C-00-3F as it happens in the game of Sonic 2 and that it causes the lock in the music Oil Ocean, I am commenting this because it Sega it didn't correct this bug nor in Sonic Jam in spite of not joining in the music OIL OCEAN SONIC JAM doesn't play the Sound of the it continues that should be played when doing the code 01-01-02-04. Many other bugs that happen in the cartridge of Sonic 2 doesn't happen in this version, a simple example is the bug of the debug that when you die and it tries to place an object in the screen the game it doesn't place the object in the screen while you doesn't leave in the edition way and to come back, being avoided the game as soon as freezes.
+
==References==
 +
<references />
  
 
{{SCHGuides}}
 
{{SCHGuides}}
[[Category:Sonic Community Hacking Guide]]
 

Latest revision as of 16:41, 24 March 2020

Historical document icon.svg This historical hacking document is preserved here for archival purposes.
It has not been revised since its original writing and may be outdated.

Using a hex editor it is possible to modify Sonic 2 & Knuckles, editing it byte by byte. By knowing where each function is and modifying it correctly, it is possible to customize the game. You can draw another character in Knuckles' place, but it's not very easy, because it needs to be drawn pixel by pixel. You can change the level names in the level select menu and in the level title cards. But to program the game, it needs to be in the binary format. It isn't hard to convert the game to binary form. You can use a conversion program or the Genecyst emulator's DUMP ROM option, which does the conversion.

In spite of Sonic 2 & Knuckles being just Sonic 2 coupled with Sonic & Knuckles, this game can be considered a new version of Sonic 2, because Sonic & Knuckles, after identifying that the cartridge attached is Sonic 2, activates a memory that is at the end of the two games, and this memory contains all the game code, only using the Sonic 2 cartridge for the graphs and maps of the levels. In this guide, you will see that the information that's altered in most of the cases is above the address $300000, where the extra memory is stored, and a few things are in the addresses $200000 to $2FFFFF, where Sonic 2 is stored in memory. Because of this, Sonic 2 & Knuckles can be considered to be a completely new game, using Sonic 2's engine and data, and starring Knuckles.

Level IDs

Observe the table below with the levels and their respective IDs. These IDs are important because the game uses them for referencing the levels.

Level ID
Emerald Hill 00
Metropolis 04
Metropolis 05
Wing Fortress 06
Hill Top 07
Oil Ocean 0A
Mystic Cave 0B
Casino Night 0C
Chemical Plant 0D
Death Egg 0E
Aquatic Ruin 0F
Sky Chase 10

Note that some numbers are skipped, like 01, 03, 06 and 09. Although these do not have level names and are not in the level select, if you place these IDs, you can access lost levels (try it and see the results). The table below gives the location of the level IDs for each level in the level select menu. The first address in the table is for the zone byte, and the second for the act byte. For example, at the address $307916 you will see the byte 07 (Hill Top Zone) and at the address $307917 you will see the byte 00 (Act 1).

Level Act Address
Emerald Hill Act 1 $307906-$307907
Act 2 $307908-$307909
Chemical Plant Act 1 $30790A-$30790B
Act 2 $30790C-$30790D
Aquatic Ruin Act 1 $30790E-$30790F
Act 2 $307910-$307911
Casino Night Act 1 $307912-$307913
Act 2 $307914-$307915
Hill Top Act 1 $307916-$307917
Act 2 $307918-$307919
Mystic Cave Act 1 $30791A-$30791B
Act 2 $30791C-$30791D
Oil Ocean Act 1 $30791E-$30791F
Act 2 $307920-$307921
Metropolis Act 1 $307922-$307923
Act 2 $307924-$307925
Act 3 $307926-$307927
Sky Chase $307928-$307927
Wing Fortress $30792A-$30792B
Death Egg $30792C-$30792D

Level Music

You can change the music which plays in each level. The format is very simple: one byte per level, that byte being the ID of the music to play. To change what music plays, play the desired music in the sound test, write down the number of the music and place it in the byte that represents the chosen level. Note that the music ID is actually equal to the music number in the sound test + $80, so remember to add $80 before placing it in the playlist. The table below gives the address of the music ID for each level:

Level Music ID Music number Address
Emerald Hill 82 02 $30397C
ID 01 82 02 $30397D
Wood Zone 85 05 $30397E
ID 03 84 04 $30397F
Metropolis 85 05 $303980
Metropolis 3 85 05 $303981
Wing Fortress 8F 0F $303982
Hill Top 86 06 $303983
Hidden Palace 90 10 $303984
ID 09 8D 0D $303985
Oil Ocean 84 04 $303986
Mystic Cave 8B 0B $303987
Casino Night 89 09 $303988
Chemical Plant 8E 0E $303989
Death Egg 8A 0A $30398A
Aquatic Ruin 87 07 $30398B
Sky Chase 8D 0D $30398C

Altering objects

You can also alter the objects in the levels such as badniks, monitors, obstacles, etc. The configuration of the objects in the levels uses 6 bytes in the format XX XX YY YY OO VV. XX XX is the horizontal position, YY YY is the vertical position, OO is the object to be placed, and VV is the object subtype. To obtain the exact location where you want to place your objects, enable debug mode and note the first line of coordinates on the HUD in the place of the score counter. These will be the coordinates that you should use for the object. The table below lists the locations of the object placement data for each level. Each level's data ends with FF FF 00 00 00 00, after which the next level's data begins.

Emerald Hill Act 1 $DF3FE
Act 2 $DF7B2
Metropolis Act 1 $DFBD2
Act 2 $E005E
Act 3 $E05A4
Wing Fortress $E0C10
Hill Top Act 1 $E1018
Act 2 $E1396
Hidden Palace $2E8C80
Oil Ocean Act 1 $E1A4A
Act 2 $E1F18
Mystic Cave Act 1 $E23DA
Act 2 $E26F2
Casino Night Act 1 $33F06E
Act 2 $33F74C
Chemical Plant Act 1 $E2A88
Act 2 $E2EFC
Death Egg $2EB230
Aquatic Ruin Act 1 $E34D8
Act 2 $E398E
Sky Chase $2EBBDE

Level Starting locations

You can change Knuckles' starting location for each level. To find out what coordinates to use, enable Debug Mode, go to your new starting location, and write down the coordinates (the top line in the HUD in place of the score counter). Refer to the table below to get the address you have to place your new coordinates at:

Level Address Default Coordinates
Emerald Hill 1 $30A488 0060028F
Emerald Hill 2 $30A48C 006002AF
01-00 $30A490 0060028F
01-01 $30A494 006002AF
Wood 1 $30A498 006001AC
Wood 2 $30A49C 006001AC
03-00 $30A4A0 0060028F
03-01 $30A4A4 006002AF
Metropolis 1 $30A4A8 0060028C
Metropolis 2 $30A4AC 006005EC
Metropolis 3 $30A4B0 0060020C
05-01 $30A4B4 006002AF
Wing Fortress 1 $30A4B8 006004CC
Wing Fortress 2 $30A4BC 01E004CC
Hill Top 1 $30A4C0 006003EF
Hill Top 2 $30A4C4 006006AF
Hidden Palace 1 $30A4C8 023001AC
Hidden Palace 2 $30A4CC 023001AC
09-00 $30A4D0 0060028F
09-01 $30A4D4 006002AF
Oil Ocean 1 $30A4D8 006006AC
Oil Ocean 2 $30A4DC 0060056C
Mystic Cave 1 $30A4E0 006006AC
Mystic Cave 2 $30A4E4 006005AC
Casino Night 1 $30A4E8 006002AC
Casino Night 2 $30A4EC 0060058C
Chemical Plant 1 $30A4F0 006001EC
Chemical Plant 2 $30A4F4 0060012C
Death Egg 1 $30A4F8 0060012D
Death Egg 2 $30A4FC 0060012D
Aquatic Ruin 1 $30A500 0060037E
Aquatic Ruin 2 $30A504 0060037E
Sky Chase 1 $30A508 01200070
Sky Chase 2 $30A50C 01400070

Events

In this game, the Sega logo, title screen, levels, special stages, etc. are different events and have IDs assigned to them. The table below lists the ID and starting code location of each event. The IDs go in units of 4, and by knowing the exact initialization place of the events you can reprogram them without affecting the operation of the game.

Event ID Code
Sega Logo 00 $303310
Screen Titles 04 $3034E8
Demo Mode 08 $3039A0
Normal Gameplay 0C $3039A0
Special Stage 10 $304A0A
Continue 14 $3072A6
Level Select Menu 18-1C $3076C2
End Sequence 20 $308008
Level Select Menu 24 $3076C2

Cheat Codes

Level Select Code

You can alter the codes used in the game. The code for the Level Select Menu is Up, Up, Up, Down, Down, Down, Left, Right, Left, Right. In the ROM this code is stored in the Motorola key format, and you can simply alter it by placing new key values. The code is stored at the address $3038E2, and consists of the following bytes: 01 01 01 02 02 02 04 08 04 08 00 FF, where 01 is Up, 02 is Down, 04 is Left, 08 is Right, and 00 FF indicates the end of the code. You can modify this code as you wish, but remember to keep the bytes 00 FF at the end so the game knows the code has ended. Summary:

Code Location
Level Select Menu $3038E2-$3038ED
Key Value
Up 01
Down 02
Left 04
Right 08

Debug Mode and Super Knuckles

These codes are used from the level select menu and are inserted in the sound test by playing the respective music. They are easier to alter because they are stored in ROM in the same way they are typed in Sound Test. The only difference from the level select code is that FF is used to indicate the end of the code rather than 00 FF. The table below lists the locations of the codes:

Event Code Location
Debug Mode 01,09,09,04,01,00,01,08 $307C7A-$307C81
All Emeralds (Super Knuckles) 01,06,07,07,07,02,01,06 $307C83-$307C8A

Curiosities

You will see the codes of Sonic 2 alone in this game. Even though they do not work, the Oil Ocean music bug (after entering the 14 continues cheat) has been fixed, because if you observe the address $307C4C you will see the bytes 10 3C 00 BF and not 10 3C 00 3F, which is what is present in the Sonic 2 ROM and causes the music lock. This bug is not even fixed in Sonic Jam. Many other bugs that happen in Sonic 2 don't happen in this version. For example, the bug where the game freezes if you enter object placement mode after dying and place an object does not occur in this game.


References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information