Skip to content

Commit

Permalink
Changed object respawn table and stack equates.
Browse files Browse the repository at this point in the history
  • Loading branch information
flamewing committed Nov 12, 2015
1 parent 83cc1db commit de5ffff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion s2.asm
Expand Up @@ -30064,7 +30064,8 @@ ObjectsManager_Init:
move.w #$101,(a2)+ ; the first two bytes are not used as respawn values
; instead, they are used to keep track of the current respawn indexes

move.w #bytesToLcnt(Object_Respawn_Table_End-Object_Respawn_Table-2),d0 ; set loop counter
; The '+7E' shouldn't be here; this loop accidentally clears an additional $7E bytes
move.w #bytesToLcnt(Obj_respawn_data_End-Obj_respawn_data+$7E),d0 ; set loop counter
- clr.l (a2)+ ; loop clears all other respawn values
dbf d0,-

Expand Down
8 changes: 4 additions & 4 deletions s2.constants.asm
Expand Up @@ -1405,10 +1405,10 @@ Target_palette_line3: ds.b palette_line_size ; Target_palette will contain the
Target_palette_line4: ds.b palette_line_size

Object_Respawn_Table:
Obj_respawn_index: ds.w $C0
Object_Respawn_Table_End:

ds.b $80 ; Stack
Obj_respawn_index: ds.b 2 ; respawn table indices of the next objects when moving left or right for the first player
Obj_respawn_data: ds.b $100 ; Maximum possible number of respawn entries that S2 can handle; for stock S2, $80 is enough
Obj_respawn_data_End:
ds.b $FE ; Stack; the first $7E bytes are cleared by ObjectsManager_Init, with possibly disastrous consequences. At least $A0 bytes are needed.
System_Stack:

SS_2p_Flag: ds.w 1 ; $FFFFFE00-$FFFFFE01 ; seems unused
Expand Down

0 comments on commit de5ffff

Please sign in to comment.