Basic Questions & Answers thread

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

  1. MarkeyJester

    MarkeyJester

    A D V A N C E Resident Jester
    2,078
    211
    43
    Japan
    I tried delving deep into the assembler, and the only option I could think of would be to remove all of the checks for ' symbol, unfortunately it's tied quite heavily to " symbol (obviously as a string has to end with the same symbol it started with), so I substituted ' for " so there are no string references. But then I would hit an issue where it wasn't accepting ' and so I'm assuming there's gonna be a table of acceptable characters or an array of comparison and conditional jumps for it somewhere (haven't found it yet). It's such an annoying quirk about Z80 assembly, the ' serves really no purpose being with af,af other than to indicate visually to the programmer it's swapping with an alternate af, but I'd ask "what else would it swap with?", so it seems mute.

    With regards to your macro issue, I'm not sure what you mean, I suspect I'm misunderstanding, because I tried your macro myself and it worked fine:

    Code (Text):
    1.  
    2.     getzreg   a
    3.  
    4.        dc.b   zreg
    5.  
    6.    getzreg   c
    7.  
    8.        dc.b   zreg
    ...this produced...

    Code (Text):
    1. 07 01
    I'm assuming your using this macro in a particular way that mitigates the above?
     
  2. Hivebrain

    Hivebrain

    Administrator
    2,908
    49
    28
    53.4N, 1.5W
    HiveView
    Turns out it was just a typo. I was sending the wrong value to getzreg.

    ex af,af' will have to be the one instruction that isn't perfectly matched then. Everything else seems to be working, including instructions shared with 68000. I just have a few details to iron out and it'll be ready for release.
     
  3. Rrose80149

    Rrose80149

    Member
    56
    3
    8
    I saw that in Sonic 1 Kawarino hack the goggles object was loaded on Sonic in Labyrinth Zone and Scrap Brain Zone, Act 3. But, I tried everything to get them to load. How do I implement them? I know I need VRAM, pattern load cues, and mappings, but does anyone know?
     
  4. Ravenfreak

    Ravenfreak

    Is actually a guy. Tech Member
    2,961
    95
    28
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
  5. Rrose80149

    Rrose80149

    Member
    56
    3
    8
  6. DeltaWooloo

    DeltaWooloo

    The sheep goes quack! Member
    I've had this issue for a few months but didn't get a chance to say it here. Everyone but Sonic stays blank when they switch to path 2. I know it's a bit 6 issue, but I can't say where the issue lies. Here's a screenshot for reference:
    S1WOOLOOFIED_31.000.png
    For all I know, it's in Sonic_Loops, and it ties to bit 6. I'll send the code below:

    Code (Text):
    1. ; ---------------------------------------------------------------------------
    2. ; Subroutine to    make Sonic run around loops (GHZ/SLZ)
    3. ; ---------------------------------------------------------------------------
    4.  
    5. ; ||||||||||||||| S U B    R O U T    I N E |||||||||||||||||||||||||||||||||||||||
    6.  
    7.  
    8. Sonic_Loops:                ; XREF: Obj01_Control
    9.         cmpi.b    #id_SLZ,(v_zone).w ; is level SLZ ?
    10.         beq.s    @isstarlight    ; if yes, branch
    11.         tst.b    (v_zone).w    ; is level GHZ ?
    12.         bne.w    @noloops    ; if not, branch
    13.  
    14.     @isstarlight:
    15.         move.w    obY(a0),d0
    16.         lsr.w    #1,d0
    17.         andi.w    #$380,d0
    18.         move.b    obX(a0),d1
    19.         andi.w    #$7F,d1
    20.         add.w    d1,d0
    21.         lea    (v_lvllayout).w,a1
    22.         move.b    (a1,d0.w),d1    ; d1 is    the 256x256 tile Sonic is currently on
    23.  
    24.         cmp.b    (v_256roll1).w,d1 ; is Sonic on a "roll tunnel" tile?
    25.         beq.w    Obj01_ChkRoll    ; if yes, branch
    26.         cmp.b    (v_256roll2).w,d1
    27.         beq.w    Obj01_ChkRoll
    28.  
    29.         cmp.b    (v_256loop1).w,d1 ; is Sonic on a loop tile?
    30.         beq.s    @chkifleft    ; if yes, branch
    31.         cmp.b    (v_256loop2).w,d1
    32.         beq.s    @chkifinair
    33.         bclr    #6,obRender(a0) ; return Sonic to high plane
    34.         rts
    35. ; ===========================================================================
    36.  
    37. @chkifinair:
    38.         btst    #1,obStatus(a0)    ; is Sonic in the air?
    39.         beq.s    @chkifleft    ; if not, branch
    40.  
    41.         bclr    #6,obRender(a0)    ; return Sonic to high plane
    42.         rts
    43. ; ===========================================================================
    44.  
    45. @chkifleft:
    46.         move.w    obX(a0),d2
    47.         cmpi.b    #$2C,d2
    48.         bcc.s    @chkifright
    49.  
    50.         bclr    #6,obRender(a0)    ; return Sonic to high plane
    51.         rts
    52. ; ===========================================================================
    53.  
    54. @chkifright:
    55.         cmpi.b    #$E0,d2
    56.         bcs.s    @chkangle1
    57.  
    58.         bset    #6,obRender(a0)    ; send Sonic to    low plane
    59.         rts
    60. ; ===========================================================================
    61.  
    62. @chkangle1:
    63.         btst    #6,obRender(a0) ; is Sonic on low plane?
    64.         bne.s    @chkangle2    ; if yes, branch
    65.  
    66.         move.b    obAngle(a0),d1
    67.         beq.s    @done
    68.         cmpi.b    #$80,d1        ; is Sonic upside-down?
    69.         bhi.s    @done        ; if yes, branch
    70.         bset    #6,obRender(a0)    ; send Sonic to    low plane
    71.         rts
    72. ; ===========================================================================
    73.  
    74. @chkangle2:
    75.         move.b    obAngle(a0),d1
    76.         cmpi.b    #$80,d1        ; is Sonic upright?
    77.         bls.s    @done        ; if yes, branch
    78.         bclr    #6,obRender(a0)    ; send Sonic to    high plane
    79.  
    80. @noloops:
    81. @done:
    82.         rts
    83. ; End of function Sonic_Loops

    All the code is pretty much the same as ReadySonic and has not changed. Unfortunately, I initially used the Hivebrain code which also didn't work either. Does anyone know how I'm able to fix this?
     
  7. JayRay

    JayRay

    Member
    2
    0
    1
    Hello! I'm brand spanking new to creating mods for Sonic Gens, and I would like to completely remove a set of models/enemies. Specifically I would like to alter the 06 mod to not have any Iblis or Mephiles, and replace them with the G.U.N. robots and shadow respectively. Can anyone point me in the right direction of what I need to look into doing? I read all the guides on this site but don't see anything specific on how to do what I'm trying to do with character models. I can research how to use the tools, I just need a bit help knowing what tools I need/a birdseye view of what's involved.

    Hello! I asked on the Basic Q&A but not sure if that's the right place for this question.

    I'm brand spanking new to creating mods for Sonic Gens, and I would like to completely remove a set of models/enemies. Specifically I would like to alter the 06 mod to not have any Iblis or Mephiles, and replace them with the G.U.N. robots and shadow respectively. Can anyone point me in the right direction of what I need to look into doing? I read all the guides on this site but don't see anything specific on how to do what I'm trying to do with character models. I can research how to use the tools, I just need a bit help knowing what tools I need/a birdseye view of what's involved.

    Thank you so much for your patience!
     
    Last edited by a moderator: Sep 21, 2021 at 9:07 PM