don't click here

Extending Level IDs...

Discussion in 'Engineering & Reverse Engineering' started by stormislandgal, Oct 6, 2006.

  1. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    This post is me postulating stuff. For the actual list of what needs to be extended for more level IDs to work correctly, please see this post. Since the content of this original post is very irrelevant, I will shrink it to bring attention away from it.




    Ok, I've tried many a time to add more levels. I've tried extending offset indexes, I've recycled level slots... But I still can't get it the way I want it. I want to add more levels by extending the indexes, as recycling the levels didn't allow me to put the level order I want it in. So, I'll run down the list of what I believe should be extended. I know I'll miss something, as it's not working, at all:

    Level Layout Index
    Object Layout Index
    Palette Index (this will take a bit of messing around, but I can do it)
    PLC Index (again, messing around is needed)
    Dynamic Level Event / DSR Index
    Palette Cycling Index
    Music Playlist
    Collision Index
    Debug List Index
    MLB Index
    Player Start Location Table
    Level Order

    That's all I can remember of what I did change off the top of my head, as it's been a while since I've worked with Sonic 1
     
  2. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    You forgot about the Level Size Array, Start Location Array, Loop/Auto-Spin Tile Number Array, Background Scroll Array, Background Deformation Array and the Animated Zone Art Array.

    .. that is, if you're talking about Sonic 1. :x

    EDIT: Oh, and rotating palettes
     
  3. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    Yeah, Sonic 1. I forgot the Loop Spin array. =X
     
  4. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    [​IMG]

    I got this error on the title screen(after the "Sonic Team Presents" logo started to fade), and during normal gameplay, in any level, after I extended everything to clone GHZ. I have no idea what could be going wrong here.
     
  5. Heh, I was trying to accomplish what you're doing, ThunderSpeed, and I began with object layout. I replaced the whole offset index loading, as they have the fucking FFFF limit for all data, with 32-bit pointers. Below is the code I used (code from S1 june'05):
    Code (Text):
    1. OPL_Main:           ; XREF: OPL_Index
    2.         addq.b  #2,($FFFFF76C).w
    3. ;       move.w  ($FFFFFE10).w,d0
    4. ;       lsl.b   #6,d0
    5. ;       lsr.w   #4,d0
    6. ;       lea (ObjPos_Index).l,a0
    7. ;       movea.l a0,a1
    8. ;       adda.w  (a0,d0.w),a0
    9. ;--- object layout work begin / reference: http://www.ticalc.org/pub/text/68k/68kguide.txt
    10.         clr.w   d0
    11.         move.b  ($FFFFFE10).w,d0
    12.         mulu.w #32,d0
    13.         move.w  d0,($FFFFFF00).w
    14.         clr.w   d0
    15.         move.b  ($FFFFFE11).w,d0
    16.         mulu.w  #8,d0
    17.         add.w   ($FFFFFF00).w,d0
    18.         move.l  (ObjLayoutPointersMAIN).l,a0
    19.         movea.l 0(a0,d0.w),a0
    20. ;--- object layout work end
    Then, at EOF, I put this:
    Code (Text):
    1. ObjLayoutPointersMAIN:
    2.         dc.l    ObjLayoutPointers
    3. ObjLayoutPointers:  dc.l ObjPos_GHZ1, ObjPos_Null
    4.         dc.l ObjPos_GHZ2, ObjPos_Null
    5.         dc.l ObjPos_GHZ3, ObjPos_Null
    6.         dc.l ObjPos_GHZ1, ObjPos_Null
    7.         dc.l ObjPos_LZ1, ObjPos_Null
    8.         dc.l ObjPos_LZ2, ObjPos_Null
    9.         dc.l ObjPos_LZ3, ObjPos_Null
    10.         dc.l ObjPos_SBZ3, ObjPos_Null
    11.         dc.l ObjPos_MZ1, ObjPos_Null
    12.         dc.l ObjPos_MZ2, ObjPos_Null
    13.         dc.l ObjPos_MZ3, ObjPos_Null
    14.         dc.l ObjPos_MZ1, ObjPos_Null
    15.         dc.l ObjPos_SLZ1, ObjPos_Null
    16.         dc.l ObjPos_SLZ2, ObjPos_Null
    17.         dc.l ObjPos_SLZ3, ObjPos_Null
    18.         dc.l ObjPos_SLZ1, ObjPos_Null
    19.         dc.l ObjPos_SYZ1, ObjPos_Null
    20.         dc.l ObjPos_SYZ2, ObjPos_Null
    21.         dc.l ObjPos_SYZ3, ObjPos_Null
    22.         dc.l ObjPos_SYZ1, ObjPos_Null
    23.         dc.l ObjPos_SBZ1, ObjPos_Null
    24.         dc.l ObjPos_SBZ2, ObjPos_Null
    25.         dc.l ObjPos_FZ, ObjPos_Null
    26.         dc.l ObjPos_SBZ1, ObjPos_Null
    27.         dc.l ObjPos_End, ObjPos_Null
    28.         dc.l ObjPos_End, ObjPos_Null
    29.         dc.l ObjPos_End, ObjPos_Null
    30.         dc.l ObjPos_End, ObjPos_Null
    31.         dc.l ObjPos_LZ1pf1, ObjPos_LZ1pf2
    32.         dc.l ObjPos_LZ2pf1, ObjPos_LZ2pf2
    33.         dc.l ObjPos_LZ3pf1, ObjPos_LZ3pf2
    34.         dc.l ObjPos_LZ1pf1, ObjPos_LZ1pf2
    35.         dc.l ObjPos_SBZ1pf1, ObjPos_SBZ1pf2
    36.         dc.l ObjPos_SBZ1pf3, ObjPos_SBZ1pf4
    37.         dc.l ObjPos_SBZ1pf5, ObjPos_SBZ1pf6
    38.         dc.l ObjPos_SBZ1pf1, ObjPos_SBZ1pf2
    39.         dc.b $FF, $FF, 0, 0, 0, 0
    Aside from OPL_Main, ObjPos_Index is referenced at two more places, but I hadn't messed with them yet. I'll check out other sections later.

    Note: just for the record, I checked out Sonic 3's code first. This is how it looks like:
    Code (Text):
    1. ROM:00019D24 loc_0_19D24:                          ; CODE XREF: ROM:00019D12j
    2. ROM:00019D24                 move.w  ($FFFFFE10).w,d0
    3. ROM:00019D28                 ror.b   #1,d0
    4. ROM:00019D2A                 lsr.w   #5,d0
    5. ROM:00019D2C                 lea     (unk_0_5E0D8).l,a0
    6. ROM:00019D32                 movea.l (a0,d0.w),a0
     
  6. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    Cool, Erik JS, that should help me figure out a bit more on optimizing what Sonic Team created. You're name is definately going in the credits of my hack.

    I got it working. Finally! I ran through the list, documenting what I changed. Here is the list.
    Code (Text):
    1. ; Check list of extended offsets:
    2. ;   Objects/Rings               +
    3. ;   BGScroll_Speed          +
    4. ;   Level_Size              +
    5. ;   DLE                     +
    6. ;   Background Deformation      +
    7. ;   Palette cycling             +
    8. ;   Animated Art                +
    9. ;   Title   Card Configuration Data +
    10. ;   Music Playlist              +   ;   Split off into hex file
    11. ;   Start Location array            +   ;   Split off into hex file
    12. ;   Loop/Roll tile numbers      +   ;   Split off into hex file
    13. ;   Collision pointers          +
    14. ;   Debug list pointers         +
    15. ;   Main Level Load Blocks      +
    16. ;   Level Layout Index          +
    That should be the full list there, as the level slot 09 is working flawlessly. I only used 09 as 07 and 08 are used for something else in the Level Select. The title card configuration data was what I was missing last time, plus I figured out why I was getting that error: I had the code run right through data. Not good. =P

    [​IMG]
    works flawlessly, except for the title card.
     
  7. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    Lol, best level name EVAR.