don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. I've had another idea for my hack. I'd like to add a third act to CPZ (or possibly HPZ). How would I go about this in the ASM file? I'm using Xenowhirl's S2 disassembly if it helps (2007).

    I've had a look round the Wiki and from what I can understand, it shows how to add levels, but nothing specific on acts.
     
  2. qiuu

    qiuu

    Tech Member
    144
    9
    18
    Blue Ball & Blocks
    If you're to do something like this only once, the easiest way is to do it like it was done for the third act of MTZ. Essentially MTZ 3 is a separate zone just using the same graphics as MTZ 1&2.

    Essentially it is like adding a new zone, just that you share the graphics with CPZ, I.e. the palettes, tiles, blocks, chunks, PLCs, background deformation, palette cycles, music, and debug object list (hope I didn't forget anything).

    I have not tested it myself, but what you should do is this:
    Take an unused zone slot, like the one for LEV9. To make the game load the CPZ graphics for that level, go to LevelArtPointers and change the entries for LEV9 to the CPZ ones.
    To have the level load correct Layout, Rings and Objects, go to Off_Level, Off_Rings and Off_Objects respectively and replace the entry for your new level at the correct spot as well as binclude your new level/rings/object file.
    Additionally change the corresponding entries in the ArtLoadCues, MusicList, JmpTbl_DbgObjLists, JmpTbl_SwScrlMgr, PalCycle, PLC_DYNANM, DynamicLevelEventIndex and for the level size and the start position, change the corresponding data at WrdArr_LvlSize and WrdArr_StartLoc.
    For Zone IDs > 7 there's also an entry in the WaterHeight table and the Dynamic_water_routine_table that you might want to change if you're using water.
    To have CPZ 3 actually come after CPZ 2, go to word_142F8 (Main game level order) and adapt the entries for these two acts.
    To fix the title card number and the end of act number, go to loc_13DEE and loc_14168 and add an exception like it is done for MTZ (cmpi.b #5,d0 checks for MTZ).

    If you intend to use a custom number of acts for many zones, there's a cleaner way to do that, having jump tables depending on zone and sub-jump tables depending on act for reading data like the layout etc.
    It's a lot of copying and pasting though, I've made some incomplete scrap notes with most of the relevant code snippets and what's roughly to be done for that., sometime I might make a guide out of this perhaps. For just one act I guess it's not worth the effort, though you don't have to change entries for palettes, tiles, blocks, etc. then.
     
  3. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Nitpicking time! =D

    Code (ASM):
    1. Dynamic_water_routine_table @DynamicWater
    2.     - add a jump table depending on Zone, not act
    Code (ASM):
    1. Dynamic_water_routine_table @DynamicWater
    2.     - add a jump table depending on Zone and act.*
    You can set it up so only act 1, 2 or 3 of a level loads water. Like it was done for CPZ.

    Otherwise, nice notes. :(
     
  4. qiuu

    qiuu

    Tech Member
    144
    9
    18
    Blue Ball & Blocks
    My idea was actually to set it up like the Dynamic Level Events jumptable, I.e. subroutine depending on zone, and within that subroutine a check for the act. I mean considering that Dynamic water was only used in one single level, a jumptable is almost over the top, but sub-jumptables would just be overkill.

    I updated the notes to reflect that now. Now also includes code for these tables, and allows changing water height and dynamic water also for zones with IDs lower than 8.

    One thing I forgot to say is that to avoid complications with Signpost loading, loc_19208 and SetLevelEndType have to be checked.
     
  5. MKAmeX

    MKAmeX

    Member
    279
    0
    16
    California
    Needlemouse, Sonic Boom, Graphic Design
    Everything seems to be working fine with adding chunks until I get to chunk 53. Anything after chunk 52 is garbled up and creates its own collisions and block formation. It looks normal in SonED2, but when playing, it looks like this:

    [​IMG]

    It only seems to happen in Labyrinth zone. Is there a reason that I can't go passed 52 chunks, or did I screw something up?
     
  6. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    You can't have more than $52 chunks because there isn't enough space in RAM for more in S1.
     
  7. MKAmeX

    MKAmeX

    Member
    279
    0
    16
    California
    Needlemouse, Sonic Boom, Graphic Design
    Ahh... Ok, thanks. :v:

    Is it possible to add more RAM so I could have more chunks?
     
  8. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    No, but you can have them uncompressed in ROM, which allows you to use up to $7F (but it'll take a lot of ROM space in return)
     
  9. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I am tring to edit the dynamic water heights in Torrent Tower Zone, but I can't get anymore locations to load except the first one.


    Code (ASM):
    1. DynamicWaterCPZ2:
    2.     cmpi.w  #$1DE0,(Camera_X_pos).w
    3.     bcs.s   WaterHeight_Change2
    4.         cmpi.w  #$516,(Camera_Y_pos).w
    5.         bcs.s   WaterHeight_Change2
    6.     move.w  #$510,(Water_Level_3).w
    7.  
    8. WaterHeight_Change2:
    9.     cmpi.w  #$282B,(Camera_X_pos).w
    10.     bcs.s   +
    11.         cmpi.w  #$690,(Camera_Y_pos).w
    12.         bcs.s   +
    13.         move.w  #$400,(Water_Level_1).w
    14.  
    15. +
    16.     rts
    Basically, what I am tring to do here is make the water rise to 510 when you get to 1DE0/0516
    and lower to 400 when you get to 282B/0690.

    What am I doing wrong?
     
  10. SteelBrush

    SteelBrush

    603e Member
    1,194
    0
    0
    the home of spotted dick, Devon
    Tramadol, Tamazepam and finding a reason to exist.
    Could anyone tell me an effect way of ripping the level art from Sonic CD, I have tried everything that has been suggested so far as well as, searching the forums and trying a few things out myself. Damizean's Level Ripper, refuses to work on Win2K, SonED1 won't open Sonic CD PC. The method I'm using now is to decompress the offset in The Sega Data Compressor to a Sonic 1 savestate, is this the correct method to use?
     
  11. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I normally use photoshop and SonED2, I can take screenshots of SCD, stick it in photoshop, cut up the art into 8x8 tiles and go at it in soned2.
     
  12. muteKi

    muteKi

    Fuck it Member
    7,941
    170
    43
    I think you can also dump the VRam in the Gens KMod.
     
  13. SteelBrush

    SteelBrush

    603e Member
    1,194
    0
    0
    the home of spotted dick, Devon
    Tramadol, Tamazepam and finding a reason to exist.
    Genskmod is a great tool, I didn't even know it existed, does it have a wiki entry?
    Thanks to you both, that's my problem solved.
     
  14. Try changing Water_Level_1 to Water_Level_3 and see if that works. Also there's a chance that your Y position checks might cause water height fluctuations, in which case you'll need to set up a routine table and set up the routines.

    Gens KMod
     
  15. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    You're correct about the Y position checks, It also seems that the lower the number used on the water_level_1, the higher the water rises, interesting.
     
  16. SMTP

    SMTP

    Tech Member
    Yes, lower number because water is set by play area coordinates, higher up is a lower number.
     
  17. Spanner

    Spanner

    Zzz... Member
    3,384
    192
    43
    United Kingdom
    Falling asleep for once
    I'm currently sorting out the correct frames for Sonic as he now uses the S3K sprites but the spring frames are not working. I use the 2007 disassembly so a fix that I read doesn't work for it.

    Also, I think I said this but got no response, how can I remove the old Sonic 2 sound driver?
     
  18. I'm pretty sure that's fixed by changing two addi.b #$5F,d0 to addi.b #$31,d0 inside Sonic's animation routine.

    Also if you mean you're manually re-arranging Sonic's S3K frames to match the arrangement they have in Sonic 2, that's a pretty tedious way to go, it's far easier to just copy over Sonic's S3K animation script from Stealth's disasm.
     
  19. Spanner

    Spanner

    Zzz... Member
    3,384
    192
    43
    United Kingdom
    Falling asleep for once
    OK, trying it out with one & it's a failure already. I split up most of the dc.b shit but it comes up with an empty argument error.
     
  20. If you got the art from SCAA, horizontal and diagonal are labeled wrong, they're flipped.