Basic Questions and Answers Thread

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

  1. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    Maybe it's just my browser, but I don't see any entries for your new zone in LevelOrder. That could explain why dynscrresizeload is loading invalid data, because you've entered an invalid zone.

    I don't have a disassembly on hand to look at, but you should be able to tell by the contents of d0 or one of the other registers, which is used as an index into the offset table.

    EDIT: It was my browser, it was hiding the last few lines.

    EDIT2: Darn, if I'm looking at the right routine, d0 gets overwritten with the offset.
     
    Last edited: Aug 21, 2016
    Xeal likes this.
  2. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    For reading the guides, the markey jester's guide, the guide on Sonic Retro, other guides on internet. French guides sucks and don't speak about the Sonic's engine :)

    The Frozen Island pointers are $700 (act1), $701 (act2), $702 (act3)

    EDIT: Ok, i will look at this!
     
  3. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    Hang on, there are Frozen Island entries in LevelOrder, but not any for the ending zone. That means your zone isn't reading the right data, it's reading the stuff after it.
     
  4. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    The ending sequence is 06, right? So FIZ is 07 normally.
    The ending sequence have just $600 or $600,$601,$602?
     
  5. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    I don't think it matters. The ending zone never normally uses that data.
     
  6. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    If Ending zone never uses that data, so how can i tell to the game to use the good entry for Frozen Island?

    I don't understand why, but when i put $700 or $701 or $702 after Green Hill zone act 1 (or any other area), the game branch to FIZ after them. But when i want to make another act of another zone (or the same zone) branch after my FIZ act, it doesn't work.
     
  7. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    Just fill the ending zone's data with padding? There's no pointer table to point each zone to its data: it's hardcoded so each zone has X bytes of data.
     
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    ......Well, i'll try many things, if i can figure out the problem, i will come back to say how...
     
  9. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    What? I'm saying to add some filler 'dc.w's between SBZ and FIZ's data. Do I need to do that for you, as well?
     
  10. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    No no no Clown, sorry! This is what i am doing! I'm actually test it! :)

    Solved! :eek:
    The solution is:
    I put 4 dc.w lvlord_sega after the scrap brain pointers, and then, after the 4 dc.w, put my FIZ pointers!
     
    Last edited: Aug 21, 2016
  11. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    Hey, I want to put a move in my hack similar to the Drop Dash in Sonic Mania . I though it would be easy. but it's harder then I though, I basically took the dash part out of the spindash subroutine and now trying to set it so that it will be activated only after you double press the jump button. but I am not sure how to do that. for now, the best thing I did was make sure it will branch to the dash from sonic's JumpHeight on locret_134c2. and I did that sonic doesn't drop dash when jump is being held because that's the least annoying thing I was able to do so far.

    here is what I got so far:

    Code:
    locret_134C2:
            move.b($FFFFF602).w,d0
            andi.b    #$70,d0        ; is A, B or C pressed?
            beq.w    dont_dropdash
            move.b    #1,($FFFFFFEB).w
            rts
    
    
    
    Code:
    
    ; Start of Subroutine Sonic_DropDash
    
    Sonic_DropDash:
    loc_1AC8E4:
            tst.b    ($FFFFFFEB).w    ; was dropdash flag set?
            beq.w    dont_dropdash    ; if yes, branch
            move.b    #0,($FFFFFFEB).w    ; if not, set jumpdash flag
            move.b    #$1F,$1C(a0)
            move.b    ($FFFFF602).w,d0
            btst    #1,d0
            move.b    #$E,$16(a0)
            move.b    #7,$17(a0)
            move.b    #2,$1C(a0)
            addq.w    #5,$C(a0)
            move.b    #0,$39(a0)
            moveq    #0,d0
            move.b    $3A(a0),d0
            add.w    d0,d0
            move.w    Dash_Speed(pc,d0.w),$14(a0)
       
        loc_1ACD04:
            move.w    $14(a0),d0
            subi.w    #$800,d0
            add.w    d0,d0
            andi.w    #$1F00,d0
            neg.w    d0
            addi.w    #$2000,d0
            move.w    d0,($FFFFC904).w
            btst    #0,$22(a0)
            beq.s    loc_1ACF44
            neg.w    $14(a0)
        loc_1ACF44:
            bset    #2,$22(a0)
            move.b    #0,($FFFFD1DC).w
            move.w    #$BC,d0
            jsr    (PlaySound_Special).l
    ; ФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФ
    Dash_Speed:    dc.w  $800        ; 0
            dc.w  $880        ; 1
            dc.w  $900        ; 2
            dc.w  $980        ; 3
            dc.w  $A00        ; 4
            dc.w  $A80        ; 5
            dc.w  $B00        ; 6
            dc.w  $B80        ; 7
            dc.w  $C00        ; 8
    
    ; ФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФ
    
    
    dont_dropdash:
            rts
    
    ;End of subroutine DropDash
    
    EDIT: never mind, figured it on my own
     
    Last edited: Aug 24, 2016
  12. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    Hello!
    I want to find a old thread (or message) that talk about "how to add new loops".
    I know how to add new loops (with loopnums.bin), but in fact , i want to add some new S-Tubes, and then: it doesnt work.
    So how can i do this? There is a routine in Sonic1.asm? I'm using the Hivebrain.
     
  13. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    loopnums.bin contains data for both loops (2 first bytes) and S-tubes (2 last bytes). If you want have more, you may do either rewrite the thing or make an object like S2 to force rolling state when touched.
     
    Last edited: Aug 25, 2016
  14. FireRat

    FireRat Well-Known Member Exiled

    Joined:
    Oct 31, 2009
    Messages:
    544
    Loops chunks need to have an ID + $80 (bit 7 set). This is the "loop identifier". Also, next to your loop chunk, you need a copy of it with the collision set to the other side.
     
  15. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    Hmmm I think that the 2 first bytes are for the Loops and 2 last are S-TUBE (exemple: GHZ = B5 7F = Loops. 1F 20 = S-Tube.)
    I know how to add loops :p
    But for add S-tube, after changing the "20" of "1F 20" at the first line, nothing changes.
    Create an object to force it?
    I don't know how to create an object, every time i try to, it doesn't work :D

    I know bro', i want to know about S-Tube u_u
     
  16. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    810
    Location:
    Portland, Maine
    I've been getting two game-breaking bugs in my Sonic 1 hack that I've been able to track down the source of but have been unable to fix.

    The first one occurs when exiting a special stage. When loading the next level, the game crashes. The source seems to be in LoadZoneTiles which was added using Clownacy's Sonic 2 Art Loader in Sonic 1 guide. Removing the branch to LoadZoneTiles in loc_3946 prevents the crash from happening. This bug only occurs in Regen.
    Edit: Regen show this error screen.

    The second one occurs when entering zone $07, which was added to the game using this guide. In Regen, the game crashes twice in a row. Fusion shows this error screen. Gens just keeps the screen black. The problem has been traced back to the branch to DelayProgram under Level_TtlCard although removing the branch still causes the crash to happen.

    Because many edits have been made to my hack's code, here is the code from Level to right before Level_MainLoop:
    Code:
    Level:                    ; XREF: GameModeArray
            bset    #7,($FFFFF600).w ; add $80 to screen mode (for pre level sequence)
            tst.w    ($FFFFFFF0).w
            bmi.s    loc_37B6
            move.b    #$E1,d0
            bsr.w    PlaySound_Special ; fade out music
    
    loc_37B6:
            bsr.w    ClearPLC
            bsr.w    Pal_FadeFrom
            moveq    #0,d0
            bsr.w    LoadPLC
            tst.w    ($FFFFFFF0).w
            bmi.s    Level_ClrRam
            move    #$2700,sr
            move.l    #$70000002,($C00004).l
            moveq    #2,d0
            bsr.w    LoadPLC
            bsr.w    LoadAnimalPLC
            move    #$2300,sr
            moveq    #0,d0
            move.b    ($FFFFFE10).w,d0
            lsl.w    #4,d0
            lea    (MainLoadBlocks).l,a2
            lea    (a2,d0.w),a2
            moveq    #0,d0
            move.b    (a2),d0
            beq.s    loc_37FC
            bsr.w    LoadPLC        ; load level patterns
    
    loc_37FC:
            moveq    #1,d0
            bsr.w    LoadPLC        ; load standard    patterns
    
    Level_ClrRam:
            lea    ($FFFFB000).w,a1
            moveq    #0,d0
            move.w    #$7FF,d1
    
    Level_ClrObjRam:
            move.l    d0,(a1)+
            dbf    d1,Level_ClrObjRam ; clear object RAM
    
            lea    ($FFFFF628).w,a1
            moveq    #0,d0
            move.w    #$15,d1
    
    Level_ClrVars:
            move.l    d0,(a1)+
            dbf    d1,Level_ClrVars ; clear misc variables
    
            lea    ($FFFFF700).w,a1
            moveq    #0,d0
            move.w    #$3F,d1
    
    Level_ClrVars2:
            move.l    d0,(a1)+
            dbf    d1,Level_ClrVars2 ; clear misc variables
    
            lea    ($FFFFFE60).w,a1
            moveq    #0,d0
            move.w    #$47,d1
    
    Level_ClrVars3:
            move.l    d0,(a1)+
            dbf    d1,Level_ClrVars3 ; clear object variables
    
            move    #$2700,sr
            bsr.w    ClearScreen
            cmpi.b    #1,($FFFFFE10).w  
            beq.s    Level_InitWater
            cmpi.b    #3,($FFFFFE10).w  
            beq.s    Level_InitWater
            cmpi.b    #5,($FFFFFE10).w  
            bne.s    Level_ClearWater
            cmpi.b    #2,($FFFFFE11).w  
            beq.s    Level_ClearWater
    
    Level_InitWater:
            move.b    #1,(Water_flag).w
            bra.s    Level_ClrVars3_Continue
    
    Level_ClearWater:
            move.b    #0,(Water_flag).w
    
    Level_ClrVars3_Continue:
            lea    ($C00004).l,a6
            move.w    #$8B03,(a6)
            move.w    #$8230,(a6)
            move.w    #$8407,(a6)
            move.w    #$857C,(a6)
            move.w    #$9001,(a6)
            move.w    #$8004,(a6)
            move.w    #$8720,(a6)
    
    loc_4262:
            move.w    #$8ADF,($FFFFF624).w
            move.w    ($FFFFF624).w,(a6)
            clr.w    ($FFFFDC00).w
            move.l    #-$2400,($FFFFDCFC).w
            tst.b    (Water_flag).w    ; does level have water
            beq.s    Level_LoadPal    ;if not, branch
            move.w    #$8014,(a6)
            moveq    #0,d0
            move.w    ($FFFFFE10).w,d0
            ror.b    #2,d0
            lsr.w    #6,d0
            add.w    d0,d0
            lea    (WaterHeight).l,a1 ; load water    height array
            move.w    (a1,d0.w),d0
            move.w    d0,($FFFFF646).w ; set water heights
            move.w    d0,($FFFFF648).w
            move.w    d0,($FFFFF64A).w
            clr.b    ($FFFFF64D).w    ; clear    water routine counter
            clr.b    ($FFFFF64E).w    ; clear    water movement
            move.b    #1,($FFFFF64C).w ; enable water
    
    Level_LoadPal:
            move.w    #$1E,($FFFFFE14).w
            move    #$2300,sr
            moveq    #3,d0
            bsr.w    PalLoad2    ; load Sonic's pallet line
            tst.b    (Water_flag).w    ; does level have water?
            beq.s    Level_LoadCol
            moveq    #$B,d0        ; pallet number    $B (LZ)
            cmpi.b    #1,($FFFFFE10).w ; is LZ?
            beq.s    Level_WaterPal    ; if so, branch
            moveq    #$F,d0        ; pallet number    $F (SLZ)
            cmpi.b    #3,($FFFFFE10).w ; is SLZ?
            beq.s    Level_WaterPal    ; if so, branch
            moveq    #$E,d0        ; pallet number    $10 (SBZ)
    
    Level_WaterPal:
            bsr.w    PalLoad3_Water    ; load underwater pallet (see d0)
            tst.b    ($FFFFFE30).w
            beq.s    Level_LoadCol
            move.b    ($FFFFFE53).w,($FFFFF64E).w
    
    Level_LoadCol:
            moveq     #0,d0
            move.b     ($FFFFFE10).w,d0
            add.w    d0,d0                ; multiply d3 by x2
            add.w    d0,d0                ; multiply d3 by x2 again (x4)
            move.l    CollArray1Table(pc,d0.w),($FFFFF784).w
            move.l    CollArray2Table(pc,d0.w),($FFFFF788).w
            move.l    AngleMapTable(pc,d0.w),($FFFFF78C).w    
            bra.s     Level_TtlCard
    
    CollArray1Table:
            dc.l    CollArray21    ; GHZ
            dc.l    CollArray21    ; LZ
            dc.l    CollArray1    ; MZ
            dc.l    CollArray3K1    ; SLZ
            dc.l    CollArray1    ; SYZ
            dc.l    CollArray3K1    ; SBZ
            dc.l    CollArray21    ; End
            dc.l    CollArray21    ; SSZ
          
    CollArray2Table:
            dc.l    CollArray22    ; GHZ
            dc.l    CollArray22    ; LZ
            dc.l    CollArray2    ; MZ
            dc.l    CollArray3K2    ; SLZ
            dc.l    CollArray2    ; SYZ
            dc.l    CollArray3K2    ; SBZ
            dc.l    CollArray22    ; End
            dc.l    CollArray22    ; SSZ
    
    AngleMapTable:
            dc.l    AngleMap2    ; GHZ
            dc.l    AngleMap2    ; LZ
            dc.l    AngleMap    ; MZ
            dc.l    AngleMap3K    ; SLZ
            dc.l    AngleMap    ; SYZ
            dc.l    AngleMap3K    ; SBZ
            dc.l    AngleMap2    ; End
            dc.l    AngleMap2    ; SSZ
    
    LoadSolids:
            moveq     #0,d0
            move.b     ($FFFFFE10).w,d0
            add.w    d0,d0                ; multiply d3 by x2
            add.w    d0,d0                ; multiply d3 by x2 again (x4)
            move.l    CollArray1Table(pc,d0.w),($FFFFF784).w
            move.l    CollArray2Table(pc,d0.w),($FFFFF788).w
            move.l    AngleMapTable(pc,d0.w),($FFFFF78C).w
            rts
    
    Level_TtlCard:
            move.b    #$C,($FFFFF62A).w
            bsr.w    DelayProgram
            jsr    ObjectsLoad
            jsr    BuildSprites
            bsr.w    RunPLC_RAM
            tst.l    ($FFFFF680).w    ; are there any    items in the pattern load cue?
            bne.s    Level_TtlCard    ; if yes, branch
            jsr    Hud_Base
    
    loc_3946:
            moveq    #3,d0
            bsr.w    PalLoad1    ; load Sonic's pallet line
            bsr.w    LevelSizeLoad
            bsr.w    DeformBgLayer
            bset    #2,($FFFFF754).w
            bsr.w    LoadZoneTiles    ; load level art
            bsr.w    MainLoadBlockLoad ; load block mappings    and pallets
            bsr.w    LoadTilesFromStart
            bsr.w    ColIndexLoad
            bsr.w    LZWaterEffects
            tst.w    ($FFFFFFF0).w
            bmi.w    Level_LoadCharacter
            cmpi.b    #$18,($FFFFF600).w
            beq.s    Level_LoadCharacter
            move.b    #$21,($FFFFB040).w ; load HUD object
    
    Level_LoadCharacter:
            moveq    #0,d0
            cmpi.w    #1,(Current_Character).w
            beq.s    Level_Shadow
            cmpi.w    #2,(Current_Character).w
            beq.s    Level_Silver
            moveq    #3,d0
            cmpi.w    #2,(Current_Partner).w
            bne.s    Level_Sonic
            moveq    #$1A,d0
    
    Level_Sonic:
            bsr.w    PalLoad2    ; load Sonic's pallet line
            move.b    #1,($FFFFB000).w ; load    Sonic object
            bra.s    Level_ChkPartner
    
    Level_Silver:
            moveq    #$16,d0
            bsr.w    PalLoad2    ; load Sonic's pallet line
            move.b    #2,($FFFFB000).w ; load    Silver object
            bra.s    Level_ChkPartner
    
    Level_Shadow:
            moveq    #$17,d0
            bsr.w    PalLoad2    ; load Sonic's pallet line
            move.b    #$8E,($FFFFB000).w ; load    Shadow object
    
    Level_ChkPartner:
            cmpi.w    #1,(Current_Partner).w
            beq.s    Level_SonicP
            cmpi.w    #2,(Current_Partner).w
            beq.s    Level_ShadowP
            cmpi.w    #3,(Current_Partner).w
            beq.s    Level_SilverP
            bra.s    Level_ChkDebug
    
    Level_SonicP
            move.b    #1,($FFFFB380).w ; load    Sonic object
            bra.s    Level_ChkDebug
    
    Level_SilverP:
            move.b    #2,($FFFFB380).w ; load    Silver object
            bra.s    Level_ChkDebug
    
    Level_ShadowP:
            move.b    #$8E,($FFFFB380).w ; load    Shadow object
    
    Level_ChkDebug:
            tst.b    ($FFFFFFE2).w    ; has debug cheat been entered?
            beq.s    Level_ChkWater    ; if not, branch
            btst    #6,($FFFFF604).w ; is A    button pressed?
            beq.s    Level_ChkWater    ; if not, branch
            move.b    #1,($FFFFFFFA).w ; enable debug    mode
    
    Level_ChkWater:
            move.w    #0,($FFFFF602).w
            move.w    #0,($FFFFF604).w
            move.b    #0,($FFFFF74F).w
            tst.b    (Water_flag).w    ; does level have water?
            beq.s    Level_LoadObj    ; if not, branch
            move.b    #$1B,($FFFFB780).w ; load water    surface    object
            move.w    #$60,($FFFFB788).w
            move.b    #$1B,($FFFFB7C0).w
            move.w    #$120,($FFFFB7C8).w
    
    Level_LoadObj:
            jsr    ObjPosLoad
            move.b    #0,($FFFFFE17).w
            jsr    RingsManager
            jsr    ObjectsLoad
            jsr    BuildSprites
            moveq    #0,d0
            tst.b    ($FFFFFE30).w    ; are you starting from    a lamppost?
            bne.s    loc_39E8    ; if yes, branch
            tst.l     ($FFFFF608).w
            bne.s     loc_39E8
            move.l    d0,($FFFFFE22).w ; clear time
            move.b    d0,($FFFFFE1B).w ; clear lives counter
            move.b    d0,($FFFFFE2D).w
    
    loc_39E8:
            tst.l     ($FFFFF608).w
            bne.s     Level_Update
            move.b    d0,($FFFFFE1A).w
            bclr    #1,($FFFFB02B).w ; clear invincibility
            move.b    d0,($FFFFFE2E).w ; clear speed shoes
            move.b    d0,($FFFFFE2F).w
    
    Level_Update:
            move.w    d0,($FFFFFE08).w
            move.w    d0,($FFFFFE02).w
            move.w    d0,($FFFFFE04).w
            move.b    d0,($FFFFFE07).w
            bsr.w    OscillateNumInit
            move.b    #1,($FFFFFE1F).w ; update score    counter
            move.b    #1,($FFFFFE1D).w ; update rings    counter
            move.b    #1,($FFFFFE1E).w ; update time counter
            move.w    #0,($FFFFF790).w
            lea    (Demo_Index).l,a1 ; load demo data
            moveq    #0,d0
            move.b    ($FFFFFE10).w,d0
            lsl.w    #2,d0
            movea.l    (a1,d0.w),a1
            tst.w    ($FFFFFFF0).w    ; is demo mode on?
            bpl.s    Level_Demo    ; if yes, branch
            lea    (Demo_EndIndex).l,a1 ; load ending demo    data
            move.w    ($FFFFFFF4).w,d0
            subq.w    #1,d0
            lsl.w    #2,d0
            movea.l    (a1,d0.w),a1
    
    Level_Demo:
            move.b    1(a1),($FFFFF792).w ; load key press duration
            subq.b    #1,($FFFFF792).w ; subtract 1 from duration
            move.w    #1800,($FFFFF614).w
            tst.w    ($FFFFFFF0).w
            bpl.s    Level_ChkWaterPal
            move.w    #540,($FFFFF614).w
            cmpi.w    #4,($FFFFFFF4).w
            bne.s    Level_ChkWaterPal
            move.w    #510,($FFFFF614).w
    
    Level_ChkWaterPal:
            moveq    #$B,d0        ; pallet $1E (LZ underwater)
            cmpi.b    #1,($FFFFFE10).w
            beq.s    ChkWaterPal
            moveq    #$15,d0        ; pallet $15 (SLZ underwater)
            cmpi.b    #3,($FFFFFE10).w
            beq.s    ChkWaterPal
            moveq    #$16,d0        ; pallet $16 (SBZ underwater)
            cmpi.b    #5,($FFFFFE10).w  
            bne.s    Level_Delay
            cmpi.b    #2,($FFFFFE11).w  
            beq.s    Level_Delay
    ; ===========================================================================
    
    ChkWaterPal:
            bsr.w    PalLoad4_Water
    
    Level_Delay:
            move.w    #3,d1
    
    Level_DelayLoop:
            move.b    #8,($FFFFF62A).w
            bsr.w    DelayProgram
            dbf    d1,Level_DelayLoop
    
            move.w    #$202F,($FFFFF626).w
            bsr.w    Pal_FadeTo2
            tst.w    ($FFFFFFF0).w
            bpl.s    Level_GetBgm
    ; ===========================================================================
    
    Level_ClrCardArt:
            moveq    #2,d0
            jsr    (LoadPLC).l    ; load explosion patterns
            moveq    #0,d0
            move.b    ($FFFFFE10).w,d0
            addi.w    #$15,d0
            jsr    (LoadPLC).l    ; load animal patterns (level no. + $15)
    
    Level_GetBgm:
            tst.w    ($FFFFFFF0).w
            bmi.w    Level_StartGame    ; change from bmi.s to bmi.w or you'll get an error
            moveq    #0,d0
            move.b    ($FFFFFE10).w,d0
            cmpi.b    #$0,($FFFFFE11).w    ; is this act 1?
            bne.s    Level_GetBgm2    ; if not, branch
            lea    (MusicList1).l,a1    ; load Music Playlist for Acts 1
            bra.s    Level_PlayBgm    ; go to PlayBgm
    Level_GetBgm2:
            cmpi.b    #$1,($FFFFFE11).w    ; is this act 2?
            bne.s    Level_GetBgm3    ; if not, branch
            lea    (MusicList2).l,a1    ; load Music Playlist for Acts 2
            bra.s    Level_PlayBgm    ; go to PlayBgm
    Level_GetBgm3:
            cmpi.b    #$2,($FFFFFE11).w    ; is this act 3?
            bne.s    Level_GetBgm4    ; if not, branch
            lea    (MusicList3).l,a1    ; load Music Playlist for Acts 3
            bra.s    Level_PlayBgm    ; go to PlayBgm
    Level_GetBgm4:
            cmpi.b    #$3,($FFFFFE11).w    ; is this act 4?
            bne.s    Level_PlayBgm    ; if not, branch
            lea    (MusicList4).l,a1    ; load Music Playlist for Acts 4
    Level_PlayBgm:
            move.b    (a1,d0.w),d0    ; add d0 to a1
            move.b    d0,($FFFFF75D).w    ; store level music
            bsr.w    PlaySound    ; play music
    
    Level_StartGame:
            move.b    #1,($FFFFF74F).w
            move.b    #1,($FFFFFE1E).w ; update time counter
            jsr    SingleObjLoad
            cmpi.w    #2,($FFFFFE10).w
            bne.s    Level_StartGame2
            jsr    SingleObjLoad
    
    Level_StartGame2:
            jsr    BuildSprites
            bclr    #7,($FFFFF600).w ; subtract 80 from screen mode
     
  17. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    Ok, i've got a bug again, but this, is kindly STRANGE.
    Here: is the video of my bug.

    As you can see, it's happen only when Sonic taking a Extra Life, when i collect 100 rings or destroy a 1-up monitor.
    And as you can see, in the Debugger, there is an STRANGE error, and i can't go to this in the Sonic.lst because it doesn't exist.
     
  18. Ralakimus

    Ralakimus "I want to die alone tonight~" Member

    Joined:
    Aug 26, 2013
    Messages:
    1,000
    Location:
    Assville, Shittucky
    Do you have it so your assembler outputs a listing file? From what I see, you are using Vladikcomper's debugger, so do you have ",sonic.lst" after "sonic.sym" or whatever your symbol file is called?

    EDIT: I've misread your post.
     
    Last edited: Aug 26, 2016
  19. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    528
    Location:
    France
    Yes i have but inside, normally there is the number of "location" ect... But it isn't here.
     
    Last edited: Aug 27, 2016
  20. A-S-H

    A-S-H Moderator and Host of the SMPS Competition Member

    Joined:
    Jun 5, 2015
    Messages:
    427
    Location:
    Music Plant Zone
    Hey, I've got myself two problems:
    1. All loops do not work anymore. I have replaced "loopnums.bin" and checked the code for Sonic_Loops and all places that it is called from and it seems identical to a clean Sonic 1 asm file.

    2. I can't seem to make the credits start after finishing LZ3. How would I go about doing that?