don't click here

Basic Questions & Answers thread

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

  1. EnderWaffle

    EnderWaffle

    Ghostly Friend Member
    Thanks man!

    Also, Natsumi, I see what you mean. I'll try to use less WAV files and start trying to look for the format changer that Clownacy was talking about.
     
  2. Figured I'd repost this since it's a new page and this is preventing me from moving forward with my hack.
     
  3. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,637
    197
    43
    Buffalo, NY, USA
    The Water
    It's saying that you're trying to branch too far with the bne.s you're using there. Try changing that to a bne.w, perhaps?
     
  4. Hm, it changed that error into this one:

     
  5. nineko

    nineko

    I am the Holy Cat Tech Member
    6,376
    529
    93
    italy
    The error didn't "change", that's another line altogether, not related to the first one (see how the line numbers are 5637 and 58241 respectively). Same deal, change the .s (short (meaning byte)) to .w (word). Should more similar errors pop up, repeat. You might also consider to sort your code in a different way, but for now this will suffice.
     
  6. That worked! I was able to continue the guide to a point, (the last bit about the sliding sound is out of date) and the game builds fine, but whenever I hit any monitors now they don't do anything. No idea what's causing that. My previous download link has been updated with the current codebase.
     
  7. Cooljerk

    Cooljerk

    Professional Electromancer Oldbie
    4,920
    588
    93
    Does any surface in any Sonic game have an angle of $40 or $C0?
     
  8. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    FIRST OFF, I see one huge problem.

    On line 5637, under "CheckLoadSignpostArt", you have this line:
    Code (Text):
    1.     tst.w   (Two_player_mode).w
    2.     bne.w   ++  ; rts
    As you'll remember, you changed the bne.s to bne.w. However, that was'nt the "true" cause of your problem, and will probably only cause more problems.

    Changes that "bne.w ++" to just "bne.s +" (On plus sign).

    I'm going to stop here, because I feel like you don't yet understand the distinction between s and w, and that's extremely important.
    1: "bne" means, "Branch if not equal." In other words, the code I showed is literally "Test for two-player mode. If two-player mode is NOT ZERO, go to the code at +"
    2: "s" stands for "short", and "w" stands for "word". Those are different lengths of branch. Basically, an "s" branch is much faster on the CPU, but has a significantly shorter reach. a "w" branch is slower, but can go farther.
    3: "+" indicates a nearby branch location, marked in the ASM with a + at the start of the line. In this case, you had "++". That means "Branch two + lines ahead."

    In this instance, the desired effect is to stop running code, but using "++" landed you into the middle of the level art loading code, so your game would probably crash when getting near the signpost in 2P mode.

    Your other problem comes from the "Monitors don't break when gliding" part of the guide, where you made some mistake.

    Part of the problem could be some weird duplicated code:
    Code (Text):
    1. Break_Monitor:
    2.     neg.w   y_vel(a0)   ; reverse Sonic's y-motion
    3.     move.b  #4,routine(a1)
    4.     move.w  a0,parent(a1)
    5.     bne.s   return_3F78A
    6.     neg.w   y_vel(a0)   ; reverse Sonic's y-motion
    7.     move.b  #4,routine(a1)
    8.     move.w  a0,parent(a1)
    Should be:
    Code (Text):
    1. Break_Monitor:
    2.     neg.w   y_vel(a0)   ; reverse Sonic's y-motion
    3.     move.b  #4,routine(a1)
    4.     move.w  a0,parent(a1)
     
  9. With your help and a bit more troubleshooting I was able to fix it. Thanks to everyone who helped!
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,797
    383
    63
    SonLVL
    True Dude: I'm sorry my guide caused you problems, I just don't follow every change anyone makes to the S2 disasm, and I guess nobody who works on the S2 disasm bothers updating the guides either. I'll try to fix that in the future.

    Meanwhile, if anyone following a guide finds an inaccuracy, you should probably fix it, it is a wiki after all.
     
  11. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Thank you. I asked about this same exact thing before, but I didn't get a response... Unless I forgot anyway.
     
  12. RelativityStoopid

    RelativityStoopid

    Member
    4
    0
    0
    Hi, I was wondering if any one knew where the RAM offset to keep track of the location for the Blue Sphere special stages for sonic 3 and knuckles? I checked EE78 in the RAM Editing guide but didnt register any values in the special stage. Also if there is any offset that keeps track of your orientation.

    Thanks!

    EDIT: After hour 12 I finally had a good idea to find the orientation which lead me to the position in the grid



    E426 and E002 give orientation
    E422 and E434 give X
    E424 and E436 give Y

    Oddly if you go around the map which is 32x32 it keeps counting i.e. 33,34,35 or going the other direction 1,0,-1,-2. and couldnt find a counter but i guess its just 33 mod 32=1 and -1 mod 32=31 ect.
     
  13. EnderWaffle

    EnderWaffle

    Ghostly Friend Member
    Sorry to interrupt (I think), but I'm back with another problem...

    So I put Esrael's S2 Menu into Sonic 1, but when it loads, it uses the title screen palette instead of the level select palette. I tried loading the level select palette before jumping to the code, and that didn't work. I even tried it on a clean disasm, but it still happened. Can anyone tell me what I'm doing wrong?

    Here is the section of code:
    Code (Text):
    1.  
    2. ...
    3. Title_ChkLevSel:
    4.         tst.b   ($FFFFFFE0).w   ; check if level select code is on
    5.         beq.w   PlayLevel   ; if not, play level
    6.         btst    #6,($FFFFF604).w ; check if A is pressed
    7.         beq.w   PlayLevel   ; if not, play level
    8.         jmp     Level_Select_Menu ; <- Menu from Sonic 2
    9. ;       moveq   #2,d0
    10. ;       bsr.w   PalLoad2    ; load level select pallet
    11. ;       lea ($FFFFCC00).w,a1
    12. ;       moveq   #0,d0
    13. ;       move.w  #$DF,d1
    14.  
    15. Title_ClrScroll:
    16.         move.l  d0,(a1)+
    17.         dbf d1,Title_ClrScroll ; fill scroll data with 0
    18.  
    19.         move.l  d0,($FFFFF616).w
    20.         move    #$2700,sr
    21.         lea ($C00000).l,a6
    22.         move.l  #$60000003,($C00004).l
    23.         move.w  #$3FF,d1
    24.  
    25. Title_ClrVram:
    26.         move.l  d0,(a6)
    27.         dbf d1,Title_ClrVram ; fill VRAM with 0
    28.  
    29.         bsr.w   LevSelTextLoad
    30.  
    31. ; ---------------------------------------------------------------------------
    32. ; Level Select (the old one)
    33. ; ---------------------------------------------------------------------------
    34. ...
    35.  
     
  14. MissingNoGuy

    MissingNoGuy

    Sounds totally automated. Member
    Try uncommenting the section at the end of Title_ChkLevSel, if you haven't tried that already.
     
  15. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    68
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    It will not do anything because of the unconditional jump right above that segment of code.
     
  16. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Keyword, you tried loading the loading the level select BEFORE the code jump.

    You want it to load AFTER. The Level Select is a new scrren, so there should be a palette load request in the Level Select code itself. It will look something like:

    Code (Text):
    1.  moveq  #2,d0
    2.  bsr.w  PalLoad2
    Or PalLoad1. What you need to do is change the number in the moveq line to match your menu screen palette.
     
  17. MissingNoGuy

    MissingNoGuy

    Sounds totally automated. Member
    Is there any GUI utility to edit plane mappings for the S3K disassembly? Was planning on editing the game title, but have no idea where to start.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,797
    383
    63
    SonLVL
    Plane mappings are plane mappings, any editor should work.
     
  19. MissingNoGuy

    MissingNoGuy

    Sounds totally automated. Member
    Alright, I got a tool that works for it. What's the compression used for S3K's title cards? It's not defined in the disassembly but it is compressed, I know that much.
     
  20. kazblox

    kazblox

    Member
    178
    27
    28
    Diassemblies and decompilations.
    Kosinski Moduled... You can find the list of title card pointers at TitleCard_LevelGfx.