Basic Questions & Answers thread

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

  1. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,411
    67
    28
    SonLVL
    LevelConverter can handle some of the format conversion, but you still have to port animated palettes, animated tiles, start positions, screen size, dynamic events, and change objects around so they fit with S3K's set (or port from S2).
     
  2. Aerosol

    Aerosol

    FML and FU2 Moderator
    10,602
    76
    28
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    When you say dynamic events, you're talking about things like Hill Top Zone's rising lava right? And changing objects around would include gimmicks and bosses? That's out my scope of asm abilities right now. Maybe if I have time later on I'll mull around with that. Thanks for the answer MM (both of them!)
     
  3. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,586
    7
    18
    United Kingdom
    YouTuber
    As you may of known, in my hack for Great Gate, the background changes when you go underwater. Here is a short video demonstrating: http://www.youtube.com/watch?v=YMPIBURXgyg

    And here is a picture in SonED2 of my background:
    [​IMG]




    SwScrl_ARZ is the one with the mountains, SwScrl_ARZ2 is the one with the blue "underwater" background.

    In SwScrl_ARZ, I have:
    Code (Text):
    1. move.w #$0000,($FFFFEE0C).w ; lock the background vertically in place (starting at the top)

    In SwScrl_ARZ2, I have:
    Code (Text):
    1. move.w #$0200,($FFFFEE0C).w ; lock the background vertically in place (starting 200 down)



    Anyway, the background does not always load properly. The way I got it set, is that when you enter the area, it changes it layer deformation routine.

    Code (Text):
    1. SwScrl_ARZ:
    2. tst.b  (arzbg).w
    3. bne.w SwScrl_Arz2
    4. ; blah blah blah
    in the routine events:

    Code (Text):
    1. cmpi.w #$960,(Camera_X_pos).w ; Has Sonic reached this far?
    2. ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    3. cmpi.w #$2E0,(Camera_Y_pos).w ; Has Sonic reached this low?
    4. ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    5. move.b #1,(arzbg).w ; Move 1 to arzbg so SwScrl_Arz2 can load



    This wasn't enough. It did load SwScrl_Arz2, but it seems to not create the blue background until Sonic kept moving for a certain distance. So, I made it move a certain distance itself for a short time so it will load:

    Code (Text):
    1. cmpi.w #$960,(Camera_X_pos).w ; Has Sonic reached this far?
    2. ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    3. cmpi.w #$2E0,(Camera_Y_pos).w ; Has Sonic reached this low?
    4. ble.s + ; If not, branch and see if Sonic went top way of GGZ1
    5. move.b #1,(arzbg).w ; Move 1 to arzbg so SwScrl_Arz2 can load
    6. move.b #$7E,(ARZBGtimer).w ; Move 7E to timer, so the underwater background has time to load
    And in the layerdeformation:

    Code (Text):
    1. SwScrl_Arz2:
    2. move.w ($FFFFEEB0).w,d4
    3. tst.b (ARZBGtimer).w ; is it 0?
    4. beq.s + ; if so, branch, and skip next 2 instructions
    5. subi.b #1,(ARZBGtimer).w
    6. addi.l #$00098000,(RamSpace4).w
    7. move.w (RamSpace4).w,d4
    8. +
    9. ext.l d4
    10. asl.l #6,d4
    11. moveq #2,d6
    12. bsr.w sub_D904
    13.  
    14. ;blah blah blah


    That works, sometimes. Here is an example of it working: http://www.youtube.com/watch?v=Gukg4hmcA9s



    But sometimes, it doesn't load up the background completely and only loads up "columns" of it. It then loads the rest of the columns when Sonic starts moving again. Here is another video showing the example: http://www.youtube.com/watch?v=XRlnPGEREso

    No matter how long I make it scroll automatically, it won't always load.



    So, I wondered, does anyone know a way to make it load immediately? I tried moving #1 to Dirty_flag, but alas, no difference.


    If you need any more details or information, I will supply. I greatly appreciate any help.


    EDIT: It seems that when it doesn't work, the auto-scroll scrolls faster than normal, maybe that's why it causes to do a few columns. Also, sorry for posting the question in the wrong sub-forum, I saw this post got moved =P
     
  4. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    I have a fairly simple question.

    I am working more on that giant motobug boss that I posted a little while back, but I want to do something more with it. I won't go much into details, but here is what I want to do for right now.

    I want the boss to check for if it has reached a certain point on the screen, and branch if it has not.

    I tried something like this

    Code (Text):
    1.         cmpi.w  #$29C0,x_pos(a1)         ; Is the boss at this location on the map?
    2.         bgt +                        ; if not, branch
    However, this does nothing at all. The enemy is loaded at a1, and set at a greater x position than the check at first. Any help would be appreciated.
     
  5. RetroKoH

    RetroKoH

    Member
    1,657
    11
    18
    Project Sonic 8x16
    Anyone remember Sonic 3 & Knuckles: Master Edition? Of course you do. That one hack with frustrating as all hell layouts that did nothing but abuse the shit out of spikes and death drops and made you want to rip out your hair?

    Well, they made a sequel... Search it on Youtube.
    apparantly it was made by someone by the name of Mok45... or something like that...

    Anyway, does anyone know where to get a copy of the ROM?
    And is this person who made this hack a member of Retro?
     
  6. Aerosol

    Aerosol

    FML and FU2 Moderator
    10,602
    76
    28
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I converted Green Hill Zone to "S3&K" with level converter...now what? :v:

    I also only have the S&K disassembly, cause that's what the Mercurial had. I just want to try building that disasm with that converted level in the place of Mushroom Hill Act 1, just to see what would happen. But I haven't a clue what I'm doing here.
     
  7. Ravenfreak

    Ravenfreak

    Sucks at sprite art Tech Member
    2,869
    43
    28
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    Actually the Mercurial disassembly is indeed the S3K disassembly, though you can build S&K. IIRC, you have to first spilt the two games by clicking "split s3k.bat",and then you'll have s3 and sk. Then place GHZ's data in the appropriate folder (Levels/GHZ if you have created a folder for GHZ which I assume you did. :v:) Then build the ROM. (And this way if you wanted GHZ to be in S3K, you can build S3K complete so it's not just S&K.) However, I've never tried out MainMemory's level converter, so I'm not sure if you'd run into some issues with the data. :\
     
  8. FraGag

    FraGag

    Tech Member
    Where is this code located? You don't show where you set a1, so I can't tell if it's initialized properly. If this is in the boss object's code, the object should be in a0.

    What do you mean by "this does nothing at all"? What is it supposed to do? If you don't have any better debugging tools, try putting an ILLEGAL instruction at the point you want to reach and when the game crashes with an illegal instruction exception, it means the branch was taken.
     
  9. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    Basically, I replaced the routine that loads the original EHZ boss, which does load the boss at a1. And to be a little more specific, the problem isn't that it doesn't do anything. But rather I cannot figure which branch condition to use, I want to check if the object has reached that position on the screen, if not branch. If so, stop all horizontal movement.

    Code (Text):
    1. ; ===========================================================================
    2. ; loc_E6B0:
    3. LevEvents_EHZ2_Routine2:
    4.     cmpi.w  #$28F0,(Camera_X_pos).w       ; is Sonic at this position on the cameras x_pos?
    5.     bcs.s   return_E6EC                   ; if not, don't do this yet
    6.     move.w  #$28F0,(Camera_Min_X_pos).w   ; lock the minimum x_pos for the camera here
    7.     move.w  #$2940,(Camera_Max_X_pos).w   ; lock the maximum x_pos for the camera here
    8.     move.w  #$28F0,(Tails_Min_X_pos).w
    9.     move.w  #$2940,(Tails_Max_X_pos).w
    10.     addq.b  #2,(Dynamic_Resize_Routine).w ; => LevEvents_EHZ2_Routine3
    11.     move.w  #$F9,d0                       ; Set to fade the level music out
    12.     bsr.w   JmpTo3_PlayMusic              ; play the fading "music"
    13.     clr.b   ($FFFFF73A).w                 ; clear this
    14.     move.b  #2,(Current_Boss_ID).w        ; Turns on boss flag
    15.     moveq   #$29,d0                       ; set PLC 29 (EHZ boss)
    16.     bsr.w   JmpTo2_LoadPLC                ; load said plc
    17.  
    18. return_E6EC:
    19.     rts
    20. ; ===========================================================================
    21. ; loc_E6EE:
    22. LevEvents_EHZ2_Routine3:
    23.     cmpi.w  #$388,(Camera_Y_pos).w
    24.     bcs.s   +
    25.     move.w  #$388,(Camera_Min_Y_pos).w
    26.     move.w  #$388,($FFFFEEFC).w
    27. +
    28.     addq.b  #1,($FFFFF73A).w               ; add 1 to this
    29.     cmpi.b  #$5A,($FFFFF73A).w             ; is it 5A
    30.     bcs.s   return_E736                    ; if the result is greater than...
    31.     bsr.w   JmpTo_SingleObjLoad            ; set to load an object (this prepares for the boss loading)
    32.     bne.s   +                              ; if not, play music and jump to the 4th routine
    33.  
    34.  
    35.         moveq #$5F+$80,d0                  ;
    36.     jsr (PlaySound).l                  ; play it!
    37.     move.b  #$4E,(a1)                      ; load obj56 (EHZ boss)
    38.     move.b  #$81,subtype(a1)
    39.     move.w  #$2AFE,x_pos(a1)               ; x position to load object   ; 29C0 For original spot/ center screen
    40.     move.w  #$426,y_pos(a1)                ; y position to load object
    41.    
    42.         cmpi.w  #$29C0,x_pos(a1)         ;
    43.         bgt +                        ;
    44.         clr.w   x_vel(a1)
    45.         move.b  #$15,($FFFFF622).w             ; Flash the Screen
    46.         move.b  #$56,(a1)                      ; load obj56 (EHZ boss)
    47.  
    48. +
    49.     addq.b  #2,(Dynamic_Resize_Routine).w  ; => LevEvents_EHZ2_Routine4
    50.     move.w  #$93,d0
    51.     bsr.w   JmpTo3_PlayMusic
    52.  
    53. return_E736:
    54.     rts
    55. ; ===========================================================================
    That is how this is set up currently.
     
  10. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,138
    0
    16
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    So you load the boss at position $2AFE; why bother checking if its position is higher than $29C0? You already know the result beforehand.
     
  11. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,411
    67
    28
    SonLVL
    You would start by replacing MHZ's files in the Levels folder with the files you got from LevelConverter, then... I'm not sure. I've never ported a level to S3K.
     
  12. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    The thought behind that was if the position is higher, branch and ignore the lines following.

    I changed loc_E6EE to look like this, which I thought would work better, but nothing happens when the boss reaches $29C0.

    Code (Text):
    1. ; loc_E6EE:
    2. LevEvents_EHZ2_Routine3:
    3.     cmpi.w  #$388,(Camera_Y_pos).w
    4.     bcs.s   +
    5.     move.w  #$388,(Camera_Min_Y_pos).w
    6.     move.w  #$388,($FFFFEEFC).w
    7. +
    8.     addq.b  #1,($FFFFF73A).w               ; add 1 to this
    9.     cmpi.b  #$5A,($FFFFF73A).w             ; is it 5A
    10.     bcs.s   return_E736                    ; if the result is greater than...
    11.     bsr.w   JmpTo_SingleObjLoad            ; set to load an object (this prepares for the boss loading)
    12.     bne.s   +                              ; if not, play music and jump to the 4th routine
    13.  
    14.  
    15.         moveq #$5F+$80,d0                  ;
    16.     jsr (PlaySound).l                  ; play it!
    17.     move.b  #$4E,(a1)                      ; load obj56 (EHZ boss)
    18.     move.b  #$81,subtype(a1)
    19.     move.w  #$2AFE,x_pos(a1)               ; x position to load object   ; 29C0 For original spot/ center screen
    20.     move.w  #$426,y_pos(a1)                ; y position to load object
    21.  
    22.         cmpi.w  #$29C0,x_pos(a1)         ;
    23.         beq +                        ;
    24.  
    25.     addq.b  #2,(Dynamic_Resize_Routine).w  ; => LevEvents_EHZ2_Routine4
    26.     move.w  #$93,d0
    27.     bsr.w   JmpTo3_PlayMusic
    28.     rts
    29. +
    30.         clr.w   $14(a1)
    31.         move.b  #$15,($FFFFF622).w             ; Flash the Screen
    32.         move.b  #$56,(a1)                      ; load obj56 (EHZ boss)
    33.  
    34. return_E736:
    35.     rts
    36. ; ===========================================================================
     
  13. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,138
    0
    16
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    You are basically persisting on the same error; you missed my subtlety, which is partly my fault for being too terse and cryptic, so let me elaborate: the code you gave creates a new boss at position $2AFE whenever it runs; immediately after creating this new boss, the code compares the position of this newly created boss to $29C0 and branch if the boss' position is higher than this (that is, always). You are always creating a brand new boss and using its position; you are never checking the position of the true boss. Thus, the code will never work as you intend it to.
    For it to have a chance of working, you have a couple options: you can either scan SST to find the boss object; or you can save a pointer to it in RAM after you create the boss, loading it back to check its position; or you can move the check into the boss' code.
     
  14. FraGag

    FraGag

    Tech Member
    After Routine3 creates the boss, it also increases the routine counter by 2, so the eventual Routine4 will run on subsequent frames. Unless your boss should react to something that is handled in the dynamic level events, you should really put code of this nature in the boss object's code instead; that way, you won't have to find the boss in object RAM. If you really want or need this code to be in the DLE, put it in Routine4.
     
  15. SmashFGM

    SmashFGM

    Member
    49
    0
    0
    Sorry if this has already been answered. But how would you add more levels to Sonic 2, 2 player mode. Say I wanted to add Oil Ocean Zone how would I add it.

    Thanks.
     
  16. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    I searched for the answer to this but I couldn't find it anywhere; it seems like a pretty basic thing though, strangely. How does one "Add a Palette to the Palette Index", and "Call the number out in d0"? Couldn't find the answer to this, sorry if I just made a simple oversight.
     
  17. Machenstein

    Machenstein

    Member
    830
    0
    0
    Is there a way to edit Sonic Advance's title screen?
     
  18. Ravenfreak

    Ravenfreak

    Sucks at sprite art Tech Member
    2,869
    43
    28
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    From the hacking guide, it looks like most art is uncompressed, so you could probably open it in TLP or similar art editing program. Though you'd have to find where the art is located, as it's not listed on the guide on the wiki. :\
     
  19. Trujin

    Trujin

    The Bad Seed. Member
    So I've recently took up hacking again. As a beginner I've depended entirely by the "SCHG: How to" guides. All seemed well, until... OH SHIT!

    [​IMG]

    Now, this seems like an easy fix, but I'm stupid so HALP PLZ? I've undone everything that I had recently applied. But still, same problem. I even went for the copy that I made and even that shares the same problem. So basically, I've fucked up! If there's a lesson to be learnt there, it's that you cannot make enough back-ups in case issues like this ever surfice.

    EDIT: I managed to fix a problem with the ring sprite. But now Sonic is totally invisible. I'm just going to leave the it alone until I get some help.
     
  20. Sorry for the n00by question, but how do you get SADXMDL to work, I tried opening my .exe file, but for whatever reason it always brings up an error that says "Arithmetic operation resulted in an overflow". Anyone know how to get it to work?