Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    87
    Does anyone know what controls the full velocity bounce whenever you hit something while holding jump?

    I wanna make so a particular object always gives you that boost, even when not holding it.
     
  2. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    I am working on a Sonic 1 Hack and was editing Sonic's Title Screen Sprites and Palette. When I tested it, the background palette ended up like this. I don't understand why it looks like this. I didn't touch the background palette. How do I fix this? [​IMG]
     
    Last edited: Dec 23, 2020
  3. Spanner

    Spanner The Tool Administrator

    Joined:
    Aug 9, 2007
    Messages:
    2,470
    Whatever you used to upload the picture clearly doesn't work with the forums. Try imgur instead.
     
    DeltaWooloo likes this.
  4. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    There. I used imgur.
     
  5. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    I figured it out. Turns out I didn't load all 4 title screen palletes.
     
    Misinko likes this.
  6. Giovanni

    Giovanni Well-Known Member Member

    Joined:
    Apr 16, 2015
    Messages:
    161
    Location:
    Italy
    I am trying to have Sonic and Tails both be invincible upon destroying an Invincibility monitor in Sonic 2. The thing is, I am having trouble editing the Invincibility stars code so that both Sonic and Tails properly display the stars.
    There's this condition I'm trying to follow though. Whenever a monitor is destroyed, Sonic is always the parent object (regardless of whether Sonic or Tails destroyed the monitor).
     
  7. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    877
    Location:
    Orono, Maine
    Breaking the monitor should spawn two invincibility objects. One in which Sonic is the parent and one in which Tails is the parent. Each set of objects should have a unique spot in the reserved SST.
     
    Giovanni likes this.
  8. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    An error occurred when I was building my Sonic 1 hack. The error was, "\SONIC1.ASM(6007) : Error : Branch (32770 bytes) is out of range". I am using Hivebrain's 2005 ASM68K disassembly. How do I fix this?
     
  9. Iso Kilo

    Iso Kilo Is it a fox? Is it a wolf? It's Kilo! Member

    Joined:
    Oct 9, 2017
    Messages:
    379
    Location:
    A warm and lovely place~
    This is a fairly simple error you'll run into a lot while ROM hacking. This answer will hopefully help you later on.
    Go to line 6007 in sonic1.asm. If it's any of these branches, change it to the one following it here
    Code:
    bra.s -> bra.w
    bra.w -> jmp
    bsr.s -> bsr.w
    bsr.w -> jsr
    If it's not any of these branches, we'll need to look at the code to understand what's going on.
     
  10. Giovanni

    Giovanni Well-Known Member Member

    Joined:
    Apr 16, 2015
    Messages:
    161
    Location:
    Italy
    Worked like a charm! Thank you.
     
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    899
    I think it's the JumpHeight routine. You could maybe make it so the object in question clears the "jumping" flag when you bounce off of it, that way it would skip the code that caps your vertical momentum when you're not holding the button.
     
  12. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    So your saying I need to change "bra.w DisplaySprite" to "jmp DisplaySprite" ?
     
  13. RandomName

    RandomName Newcomer Member

    Joined:
    Jun 3, 2020
    Messages:
    16
    Location:
    Russia
    Yes, you need to do this.
     
  14. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    OK. Got it.
     
  15. Ronald Rose

    Ronald Rose Newcomer In Limbo

    Joined:
    Feb 7, 2016
    Messages:
    10
    Will there be parts 2 & 3 for the github Disassembly? Everyone including I get confused when trying the Github Disassembly for the Spindash to work like the Monitor Bug, The Spindash Sound, The Spindash Dust, Converting art buffer, Making the Spin Dash Rev Sound and the Screen Scroll Delay.
     
  16. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    115
    Location:
    Buffalo, New York
    It's not very difficult to interpret ASM68K code as AS code, or vice versa. There's a few differences between each other, but otherwise if you know AS68K, you do somewhat know like 90% of AS, or again vice versa.
     
  17. Psi

    Psi Well-Known Member Member

    Joined:
    Dec 20, 2014
    Messages:
    87
    I'm trying to port the SBZ sawblades to Sonic 2, but so far my edits don't seem to load the damn thing. The art loads into the VRAM and sometimes the sounds will briefly play, but no object, does anyone know what I'm doing wrong here?

    Code:
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Object E7 - ground saws and pizza cutters (SBZ)
    ; ---------------------------------------------------------------------------
    Obj_E7:                    ; XREF: Obj_Index
            moveq    #0,d0
            move.b    routine(a0),d0
            move.w    ObjE7_Index(pc,d0.w),d1
            jmp    ObjE7_Index(pc,d1.w)
    ; ===========================================================================
    ObjE7_Index:
            dc.w ObjE7_Main-ObjE7_Index
            dc.w ObjE7_Action-ObjE7_Index
    ; ===========================================================================
    
    ObjE7_Main:                ; XREF: ObjE7_Index
            addq.b    #2,routine(a0)
            move.l    #Map_ObjE7,mappings(a0)
            move.b    #4,1(a0)
            move.w    #$4398,art_tile(a0)
            move.b    #4,$18(a0)
            move.b    #$20,$19(a0)
            move.w    8(a0),$3A(a0)
            move.w    $C(a0),$38(a0)
            cmpi.b    #3,$28(a0)
            bcc.s    ObjE7_Action
            move.b    #$A2,$20(a0)
    
    ObjE7_Action:                ; XREF: ObjE7_Index
            moveq    #0,d0
            move.b    $28(a0),d0
            andi.w    #7,d0
            add.w    d0,d0
            move.w    ObjE7_TypeIndex(pc,d0.w),d1
            jsr    ObjE7_TypeIndex(pc,d1.w)
            move.w    $3A(a0),d0
            andi.w    #$FF80,d0
            sub.w    (Camera_X_pos_coarse).w,d1
            cmpi.w    #$280,d0
            bhi.s    ObjE7_Delete
            jmp    DisplaySprite
    ; ===========================================================================
    
    ObjE7_Delete:
            jmp    DeleteObject
    ; ===========================================================================
    ObjE7_TypeIndex:
            dc.w ObjE7_Type00-ObjE7_TypeIndex
            dc.w ObjE7_Type01-ObjE7_TypeIndex
            dc.w ObjE7_Type02-ObjE7_TypeIndex
            dc.w ObjE7_Type03-ObjE7_TypeIndex
            dc.w ObjE7_Type04-ObjE7_TypeIndex
    ; ===========================================================================
    
    ObjE7_Type00:                ; XREF: ObjE7_TypeIndex
            rts   
    ; ===========================================================================
    
    ObjE7_Type01:                ; XREF: ObjE7_TypeIndex
            move.w    #$60,d1
            moveq    #0,d0
            move.b    ($FFFFFE6C).w,d0
            btst    #0,$22(a0)
            beq.s    ObjE7_Animate01
            neg.w    d0
            add.w    d1,d0
    
    ObjE7_Animate01:
            move.w    $3A(a0),d1
            sub.w    d0,d1
            move.w    d1,8(a0)    ; move saw sideways
            subq.b    #1,$1E(a0)
            bpl.s    loc_15A46
            move.b    #2,$1E(a0)    ; time between frame changes
            bchg    #0,$1A(a0)    ; change frame
    
    loc_15A46:
            tst.b    1(a0)
            bpl.s    locret_15A60
            move.w    ($FFFFFE04).w,d0
            ;andi.w    #$F,d0
            ;bne.s    locret_15A60
            ;move.w    #$B0,d0
            ;jsr    (PlaySound_Special).l ;    play saw sound
    
    locret_15A60:
            rts   
    ; ===========================================================================
    
    ObjE7_Type02:                ; XREF: ObjE7_TypeIndex
            move.w    #$30,d1
            moveq    #0,d0
            move.b    ($FFFFFE64).w,d0
            btst    #0,$22(a0)
            beq.s    ObjE7_Animate02
            neg.w    d0
            addi.w    #$80,d0
    
    ObjE7_Animate02:
            move.w    $38(a0),d1
            sub.w    d0,d1
            move.w    d1,$C(a0)    ; move saw vertically
            subq.b    #1,$1E(a0)
            bpl.s    loc_15A96
            move.b    #2,$1E(a0)
            bchg    #0,$1A(a0)
    
    loc_15A96:
            tst.b    1(a0)
            bpl.s    locret_15AB0
            move.b    ($FFFFFE64).w,d0
            cmpi.b    #$18,d0
            bne.s    locret_15AB0
            move.w    #$AC,d0
            jsr    (PlaySound).l
    
    locret_15AB0:
            rts   
    ; ===========================================================================
    
    ObjE7_Type03:                ; XREF: ObjE7_TypeIndex
            tst.b    $3D(a0)
            bne.s    ObjE7_Animate03
            lea    (MainCharacter).w,a1
            bsr.s    +
            lea    (Sidekick).w,a1
    +
            move.w    8(a1),d0
            subi.w    #$C0,d0
            bcs.s    loc_15B02
            sub.w    8(a0),d0
            bcs.s    loc_15B02
            move.w    $C(a1),d0
            subi.w    #$80,d0
            cmp.w    $C(a0),d0
            bcc.s    locret_15B04
            addi.w    #$100,d0
            cmp.w    $C(a0),d0
            bcs.s    locret_15B04
            move.b    #1,$3D(a0)
            move.w    #$600,$10(a0)    ; move object to the right
            move.b    #$A2,$20(a0)
            move.b    #2,$1A(a0)
            ;move.w    #$B0,d0
            ;jsr    (PlaySound_Special).l ;    play saw sound
    
    loc_15B02:
            addq.l    #4,sp
    
    locret_15B04:
            rts   
    ; ===========================================================================
    
    ObjE7_Animate03:            ; XREF: ROM:00015AB6j
            jsr    ObjectMove
            move.w    8(a0),$3A(a0)
            subq.b    #1,$1E(a0)
            bpl.s    locret_15B24
            move.b    #2,$1E(a0)
            bchg    #0,$1A(a0)
    
    locret_15B24:
            rts   
    ; ===========================================================================
    
    ObjE7_Type04:                ; XREF: ObjE7_TypeIndex
            tst.b    $3D(a0)
            bne.s    ObjE7_Animate04
            lea    (MainCharacter).w,a1
            bsr.s    +
            lea    (Sidekick).w,a1
    +
            move.w    8(a1),d0
            addi.w    #$E0,d0
            sub.w    8(a0),d0
            bcc.s    loc_15B74
            move.w    $C(a1),d0
            subi.w    #$80,d0
            cmp.w    $C(a0),d0
            bcc.s    locret_15B76
            addi.w    #$100,d0
            cmp.w    $C(a0),d0
            bcs.s    locret_15B76
            move.b    #1,$3D(a0)
            move.w    #-$600,$10(a0)    ; move object to the left
            move.b    #$A2,$20(a0)
            move.b    #2,$1A(a0)
            move.w    #$AC,d0
            jsr    (PlaySound).l
    
    loc_15B74:
            addq.l    #4,sp
    
    locret_15B76:
            rts   
    ; ===========================================================================
    
    ObjE7_Animate04:
            jsr    ObjectMove
            move.w    8(a0),$3A(a0)
            subq.b    #1,$1E(a0)
            bpl.s    locret_15B96
            move.b    #2,$1E(a0)
            bchg    #0,$1A(a0)
    
    locret_15B96:
            rts   
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Sprite mappings - ground saws    and pizza cutters (SBZ)
    ; ---------------------------------------------------------------------------
    Map_ObjE7:
        include "mappings/sprite/objE7.asm"
     
  18. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    7
    I am working on a sonic 1 ROM hack, but when I build the ROM I get these two errors:
    \_MAPS\OBJ8A.ASM(4) : Error : Symbol 'byte_1733f' not defined
    \_MAPS\OBJ8A.ASM(6) : Error : Symbol 'byte_1743c' not defined
    I am using Hivebrain's 2005 ASM68K disassembly. How do I fix this?
     
    Last edited: Jan 1, 2021
  19. Scrap Brain

    Scrap Brain Active Member Member

    Joined:
    Sep 18, 2020
    Messages:
    40
    Location:
    Sonic the Hedgehog for the Sega Genesis
    Trying to get SBZ act 3 to load different art than the LZ art and I have no idea how to do make SBZ3 load alternate art. I was able to get SBZ3 to load alternate background mappings but I have no clue how to get it to load the alternate tiles. If someone could direct me on to how I could achieve this result without having to make the game load the separate SBZ3 art instead of the LZ art then please tell me.
    [​IMG]
    upload_2021-1-1_20-26-22.png
    upload_2021-1-1_20-27-15.png


    Edit: I tried to get the game to load them myself so I did this by GM_level:

    Code:
    bsr.w    AddPLC        ; load level patterns
            cmpi.b    #id_LZ,(v_zone).w ; is level LZ?
            bne.s    loc_37FC    ; if not, branch
    
            cmpi.b    #3,(v_act).w    ; is act number 3?
            bne.s    loc_37FC    ; if not, branch
            moveq    #plcid_SBZ3,d0
    
    loc_37FC:
            moveq    #plcid_Main2,d0
            bsr.w    AddPLC        ; load standard    patterns
    
    Level_ClrRam:
            lea    (v_objspace).w,a1
    I made sure to define my variables and added entries for SBZ3 in Pattern Load Cues.asm but when I load up the game it doesn't work. Can someone help me with this?
     
    Last edited: Jan 2, 2021
  20. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    340
    Location:
    Buffalo, NY, USA