Basic Questions and Answers Thread

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

  1. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
    At some point in my hack, Sonic stopped being able to perform a left roll. I've looked at my rolling code and couldn't find anything wrong with it. I'm also fairly sure the spindash isn't the problem either, help?
     
  2. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Compare the original rolling code with the code you have currently.
     
  3. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
    I've done that already, and couldn't spot any differences.
     
  4. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Hi!

    I have ported an extra character to Sonic 1, when i select "Sonic", i am playing with Sonic, so when i select "ExtraCharacter" on the title menu, i am playing with my new character.

    I want to know how to change the life icon, the "Sonic Has passed" and the signpost depending on the character i have chosen.

    I don't want the method, just the ASM box or location.

    I know that the Sonic Has Passed is in Obj3A, put i want the routine that load the mappings. (i want to load a different mapping, created with the Selbi's SonicTextCodeGenerator for map_obj3A).

    I want some help also for life icon, and the signpost to do the same: Load a different art depending on the character i have chosen.
     
  5. LucasMadword

    LucasMadword That one nerd. You know the one. Member

    Joined:
    Jul 18, 2015
    Messages:
    29
    Ashuro, when it starts to load in the mappings (eg for the Sonic has Passed, Obj3A_ChkPLC on the Hivebrain 2005), you first start with a check of whether mapping has been loaded.

    Code:
    Obj3A_ChkPLC:                ; XREF: Obj3A_Index
            tst.l    ($FFFFF680).w    ; are the pattern load cues empty?
            beq.s    Obj3A_Main    ; if yes, branch
            rts    
    Rather than checking whether the cues are empty, you can check whether the correct cues have loaded, and then branch away from that.

    It's similar for the rest. When the object has it's mapping loaded, do a check for the characters and load the correct mapping.
     
  6. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I don't understand nothing about it.
    Justly, i want to know exactly where in the code, the Sonic Has Passed mappings are loaded.
    I know about the method to load an alternative mapping but i don't know where is the exact part of code..

    I'm not sure about Obj3A_ChkPLC.

    In fact, i want to do this:

    cmpi.b #$01,($FFFFFFFE).w ; is the multiple character flag set to $01 (extra)?
    bne.s CancelLoadMap ; if not, load Sonic's title card "has passed" mappings
    beq.s Map2_obj3A ; branch to rest of code

    CancelLoadMap:
    bra.s Map_Obj3A

    Map2_obj3A: dc.w byte2_CBEA-Map_obj3A ; 0

    byte2_CBEA: dc.b $A ; EXTRA CHARACTER HAS
    dc.b $F8, 5, 0, 0, $B0 *
    dc.b $F8, 5, 0, $3E, $C0 *
    dc.b $F8, 5, 0, $1C, $D0 *
    dc.b $F8, 5, 0, $46, $E0 *
    dc.b $F8, 5, 0, $3A, $F0 *
    dc.b $F8, 5, 0, $32, $0 *
    dc.b $F8, 0, 0, $56, $10 ; Space
    dc.b $F8, 5, 0, $1C, $20 ; H
    dc.b $F8, 5, 0, 0, $30 ; A
    dc.b $F8, 5, 0, $3E, $40 ; S
    bra.w ContMap3A

    Map_obj3A: dc.w byte_CBEA-Map_obj3A ; 0

    ContMap3A:
    dc.w byte_CC13-Map_obj3A ; 1
    dc.w byte_CC32-Map_obj3A ; 2
    dc.w byte_CC51-Map_obj3A ; 3
    dc.w byte_CC75-Map_obj3A ; 4
    dc.w byte_CB47-Map_obj3A ; 5
    dc.w byte_CB26-Map_obj3A ; 6
    dc.w byte_CB31-Map_obj3A ; 7
    dc.w byte_CB3C-Map_obj3A ; 8
    byte_CBEA: dc.b 8 ; SONIC HAS
    dc.b $F8, 5, 0, $3E, $B8
    dc.b $F8, 5, 0, $32, $C8
    dc.b $F8, 5, 0, $2E, $D8
    dc.b $F8, 1, 0, $20, $E8
    dc.b $F8, 5, 0, 8, $F0
    dc.b $F8, 5, 0, $1C, $10
    dc.b $F8, 5, 0, 0, $20
    dc.b $F8, 5, 0, $3E, $30
    byte_CC13: dc.b 6 ; PASSED
    dc.b $F8, 5, 0, $36, $D0
    dc.b $F8, 5, 0, 0, $E0
    dc.b $F8, 5, 0, $3E, $F0
    dc.b $F8, 5, 0, $3E, 0
    dc.b $F8, 5, 0, $10, $10
    dc.b $F8, 5, 0, $C, $20
    byte_CC32: dc.b 6 ; SCORE
    dc.b $F8, $D, 1, $4A, $B0
    dc.b $F8, 1, 1, $62, $D0
    dc.b $F8, 9, 1, $64, $18
    dc.b $F8, $D, 1, $6A, $30
    dc.b $F7, 4, 0, $6E, $CD
    dc.b $FF, 4, $18, $6E, $CD
    byte_CC51: dc.b 7 ; TIME BONUS
    dc.b $F8, $D, 1, $5A, $B0
    dc.b $F8, $D, 0, $66, $D9
    dc.b $F8, 1, 1, $4A, $F9
    dc.b $F7, 4, 0, $6E, $F6
    dc.b $FF, 4, $18, $6E, $F6
    dc.b $F8, $D, $FF, $F0, $28
    dc.b $F8, 1, 1, $70, $48
    byte_CC75: dc.b 7 ; RING BONUS
    dc.b $F8, $D, 1, $52, $B0
    dc.b $F8, $D, 0, $66, $D9
    dc.b $F8, 1, 1, $4A, $F9
    dc.b $F7, 4, 0, $6E, $F6
    dc.b $FF, 4, $18, $6E, $F6
    dc.b $F8, $D, $FF, $F8, $28
    dc.b $F8, 1, 1, $70, $48
    even

    But i know it will not work like that.
     
  7. LucasMadword

    LucasMadword That one nerd. You know the one. Member

    Joined:
    Jul 18, 2015
    Messages:
    29
    Ah, I know why you cannot find Obj3A_ChkPLC... It's probably because you are using the GitHub disassembly, rather than the 2005 Hivebrain one that I use. Not sure which function in the GitHub disassembly it is. If someone else tells you the function which loads the mappings (the equivalent to Obj3A_ChkPLC), then you can follow my post.
     
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I have the Hivebrain 2005, and i have Obj3A_chkPLC, but i have don't understand your method.
     
  9. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Code:
    Obj3A_Main:
         movea.l   a0,a1
         lea   (Obj3A_Config).l,a2
         moveq   #6,d1
    
    Obj3A_Loop:
         move.b   #$3A,0(a1)
         move.w   (a2),8(a1)   ; load start x-position
         move.w   (a2)+,$32(a1)   ; load finish x-position (same as start)
         move.w   (a2)+,$30(a1)   ; load main x-position
         move.w   (a2)+,$A(a1)   ; load y-position
         move.b   (a2)+,$24(a1)
         move.b   (a2)+,d0
         cmpi.b   #6,d0
         bne.s   loc_C5CA
         add.b   ($FFFFFE11).w,d0 ; add act number to frame number
    
    loc_C5CA:
         move.b   d0,$1A(a1)
         move.l   #Map_obj3A,4(a1)
         move.w   #$8580,2(a1)
         move.b   #0,1(a1)
         lea   $40(a1),a1
         dbf   d1,Obj3A_Loop   ; repeat 6 times
    
    Tip: SONIC HAS mapping is the first one (#0).

    As for the arts - icon and signpost: find where their PLCs are loaded then add checks for your character.
     
  10. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Oh yes thanks!!

    EDIT:

    Another question, i have another problem:
    --------------------------------------------------------------------------------------------
    move.b ($FFFFFF86).w,d0 ; move light jump flag to d0
    move.b ($FFFFFFE8).w,d0 ; move drop attack flag to d0
    cmpi.b #$01,d0 ; if light/drop attack flag set?
    blt.s Obj01_Display ; if not, don't show the sprite
    --------------------------------------------------------------------------------------------
    Here it is, the code is ok, but in game, that only work when i'm doing the drop attack, and not the light jump. Where is the problem?
     
    Last edited: Jul 30, 2016
  11. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Your code is a mess. I guess you want to check both variables, but you load one over the other and then you check if the variables are set or not by comparing them to #1 and using blt. It would be in your best interest to go read up on some more 68k ASM.

    To answer your actual question:
    As said before, you are loading one variable over the other. In my opinion, if you are trying to check that either is set, do something like...
    Code:
       move.b ($FFFFFF86).w,d0
       add.b ($FFFFFFE8).w,d0
       beq.s @whereever ; if the result is a 0 value, we know that neither is set and we can branch
       bra.w Obj01_Display ; otherwise, display
    
     
  12. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    It should be obvious: you're overwriting the light jump flag in d0. It looks like you're trying to perform an OR, where if either the light jump or drop attack flag is set, d0 will contain $01. Move doesn't do that: it will set d0 to $00 if the drop attack flag is $00. OR, on the other hand, will set d0 to $01 so long as at least one of the flags is set to $01.

    Also, if your flags are simple on/off booleans, you can get away with performing a 'tst.b d0', then 'beq.s Obj01_Display', instead. I'm pretty sure that creates faster and smaller code.

    Ooh, a ninja!
     
  13. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you Banana, thank you clown, it's more easy now!

    EDIT: Ok, ANOTHER f*ck*ng problem.

    I want Sonic and my extra character load their own life icon.

    But still don't work.

    After searching as hard, how the rom load the life icon plc, i need some help...
     

    Attached Files:

    Last edited: Jul 30, 2016
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    I "sort of" explained this the other day to Pacguy. Here is my post.

    I know this is for Sonic 2, but as Sonic 1 is so similar, and I've labeled my code ever so well, this shouldn't be hard to get your head around to getting your character to add their own life icon :)
     
  15. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you very much RHS.
     
    Last edited: Jul 31, 2016
  16. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    well, i'm back. since the last time I was able to relocate sonic's starting point. apparently the first time I tried to do it I accidentally picked up his demo starting point XD. but yeah, right now the only problem I have left are the chunk that is built to make you spin (which I considering to possibly jusy make it a part of the level. and to make chunks that sonic can get behind from.
    EDIT
    ok, I was able to figure out that you can set certain blocks to "prioraty" mode which makes them apear after sonic
    EDIT 2
    I was able to successfully build my wall (no Trump joke intendant) and no blocks that should'nt be in front were harmed in the process.
    all that's left is that chunk. Also I want to ask about the special stage ring I put in the area. It doesn't seem to do anything when I enter it. Is there a way to make it go to the special stage without ending the level or something?
     
    Last edited: Jul 31, 2016
  17. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    EDIT: I'm still in trouble. I have trying everything.

    I have also trying to make 2 pattern load cues files, load them depending on the character loaded.
    Make a lifeicon2.bin...
    Then, all is loaded perfectly, instead of the signpost and the lifeicon, still be Sonic and not Ashuro.

    I have replaced all the "LoadPLC" and "LoadPLC2" of the sonic1.asm, to "PlayerPLC" and "PlayerPLC2", and i have doing it:

    PlayerPLC:
    cmpi.w #$01,($FFFFFFFE).w ; if Ashuro player flag set?
    beq.w LoadPLC_A
    bne.w LoadPLC

    PlayerPLC2:
    cmpi.w #$01,($FFFFFFFE).w ; if Ashuro player flag set?
    beq.w LoadPLC2_A
    bne.w LoadPLC2
    ; ---------------------------------------------------------------------------
    ; Subroutine to load pattern load cues - Ashuro
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    LoadPLC_A:
    movem.l a1-a2,-(sp)
    lea (ArtLoadCues2).l,a1
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    lea ($FFFFF680).w,a2

    loc2_1598:
    tst.l (a2)
    beq.s loc2_15A0
    addq.w #6,a2
    bra.s loc2_1598
    ; ===========================================================================

    loc2_15A0: ; XREF: LoadPLC
    move.w (a1)+,d0
    bmi.s loc2_15AC

    loc2_15A4:
    move.l (a1)+,(a2)+
    move.w (a1)+,(a2)+
    dbf d0,loc2_15A4

    loc2_15AC:
    movem.l (sp)+,a1-a2
    rts
    ; End of function LoadPLC


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    LoadPLC2:
    movem.l a1-a2,-(sp)
    lea (ArtLoadCues2).l,a1
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    bsr.s ClearPLC_A
    lea ($FFFFF680).w,a2
    move.w (a1)+,d0
    bmi.s loc_15D8

    loc2_15D0:
    move.l (a1)+,(a2)+
    move.w (a1)+,(a2)+
    dbf d0,loc2_15D0

    loc2_15D8:
    movem.l (sp)+,a1-a2
    rts
    ; End of function LoadPLC2

    ; ---------------------------------------------------------------------------
    ; Subroutine to clear the pattern load cues
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    ClearPLC_A: ; XREF: LoadPLC2
    lea ($FFFFF680).w,a2
    moveq #$1F,d0

    ClearPLC_Loop_A:
    clr.l (a2)+
    dbf d0,ClearPLC_Loop_A
    rts
    ; End of function ClearPLC

    ; ---------------------------------------------------------------------------
    ; Subroutine to use graphics listed in a pattern load cue
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    RunPLC_RAM_A: ; XREF: Pal_FadeTo
    tst.l ($FFFFF680).w
    beq.s locret2_1640
    tst.w ($FFFFF6F8).w
    bne.s locret2_1640
    movea.l ($FFFFF680).w,a0
    lea (loc_1502).l,a3
    lea ($FFFFAA00).w,a1
    move.w (a0)+,d2
    bpl.s loc2_160E
    adda.w #$A,a3

    loc2_160E:
    andi.w #$7FFF,d2
    move.w d2,($FFFFF6F8).w
    bsr.w NemDec4
    move.b (a0)+,d5
    asl.w #8,d5
    move.b (a0)+,d5
    moveq #$10,d6
    moveq #0,d0
    move.l a0,($FFFFF680).w
    move.l a3,($FFFFF6E0).w
    move.l d0,($FFFFF6E4).w
    move.l d0,($FFFFF6E8).w
    move.l d0,($FFFFF6EC).w
    move.l d5,($FFFFF6F0).w
    move.l d6,($FFFFF6F4).w

    locret2_1640:
    rts
    ; End of function RunPLC_RAM


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    sub_1642: ; XREF: loc_C44; loc_F54; loc_F9A
    tst.w ($FFFFF6F8).w
    beq.w locret_16DA
    move.w #9,($FFFFF6FA).w
    moveq #0,d0
    move.w ($FFFFF684).w,d0
    addi.w #$120,($FFFFF684).w
    bra.s loc_1676
    ; End of function sub_1642


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    sub_165E: ; XREF: Demo_Time
    tst.w ($FFFFF6F8).w
    beq.s locret2_16DA
    move.w #3,($FFFFF6FA).w
    moveq #0,d0
    move.w ($FFFFF684).w,d0
    addi.w #$60,($FFFFF684).w

    loc_1676: ; XREF: sub_1642
    lea ($C00004).l,a4
    lsl.l #2,d0
    lsr.w #2,d0
    ori.w #$4000,d0
    swap d0
    move.l d0,(a4)
    subq.w #4,a4
    movea.l ($FFFFF680).w,a0
    movea.l ($FFFFF6E0).w,a3
    move.l ($FFFFF6E4).w,d0
    move.l ($FFFFF6E8).w,d1
    move.l ($FFFFF6EC).w,d2
    move.l ($FFFFF6F0).w,d5
    move.l ($FFFFF6F4).w,d6
    lea ($FFFFAA00).w,a1

    loc2_16AA: ; XREF: sub_165E
    movea.w #8,a5
    bsr.w NemDec3
    subq.w #1,($FFFFF6F8).w
    beq.s loc2_16DC
    subq.w #1,($FFFFF6FA).w
    bne.s loc2_16AA
    move.l a0,($FFFFF680).w
    move.l a3,($FFFFF6E0).w
    move.l d0,($FFFFF6E4).w
    move.l d1,($FFFFF6E8).w
    move.l d2,($FFFFF6EC).w
    move.l d5,($FFFFF6F0).w
    move.l d6,($FFFFF6F4).w

    locret2_16DA: ; XREF: sub_1642
    rts
    ; ===========================================================================

    loc2_16DC: ; XREF: sub_165E
    lea ($FFFFF680).w,a0
    moveq #$15,d0

    loc2_16E2: ; XREF: sub_165E
    move.l 6(a0),(a0)+
    dbf d0,loc2_16E2
    rts
    ; End of function sub_165E

    ; ---------------------------------------------------------------------------
    ; Subroutine to execute the pattern load cue
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    RunPLC_ROM_A:
    lea (ArtLoadCues2).l,a1 ; load the PLC index
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    move.w (a1)+,d1 ; load number of entries in the PLC

    RunPLC_Loop_A:
    movea.l (a1)+,a0 ; get art pointer
    moveq #0,d0
    move.w (a1)+,d0 ; get VRAM address
    lsl.l #2,d0 ; divide address by $20
    lsr.w #2,d0
    ori.w #$4000,d0
    swap d0
    move.l d0,($C00004).l ; put the VRAM address into VDP
    bsr.w NemDec ; decompress
    dbf d1,RunPLC_Loop_A ; loop for number of entries
    rts
    ; End of function RunPLC_ROM
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Subroutine to load pattern load cues
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    LoadPLC:
    movem.l a1-a2,-(sp)
    lea (ArtLoadCues).l,a1
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    lea ($FFFFF680).w,a2

    loc_1598:
    tst.l (a2)
    beq.s loc_15A0
    addq.w #6,a2
    bra.s loc_1598
    ; ===========================================================================

    loc_15A0: ; XREF: LoadPLC
    move.w (a1)+,d0
    bmi.s loc_15AC

    loc_15A4:
    move.l (a1)+,(a2)+
    move.w (a1)+,(a2)+
    dbf d0,loc_15A4

    loc_15AC:
    movem.l (sp)+,a1-a2
    rts
    ; End of function LoadPLC


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    LoadPLC2:
    movem.l a1-a2,-(sp)
    lea (ArtLoadCues).l,a1
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    bsr.s ClearPLC
    lea ($FFFFF680).w,a2
    move.w (a1)+,d0
    bmi.s loc_15D8

    loc_15D0:
    move.l (a1)+,(a2)+
    move.w (a1)+,(a2)+
    dbf d0,loc_15D0

    loc_15D8:
    movem.l (sp)+,a1-a2
    rts
    ; End of function LoadPLC2

    ; ---------------------------------------------------------------------------
    ; Subroutine to clear the pattern load cues
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    ClearPLC: ; XREF: LoadPLC2
    lea ($FFFFF680).w,a2
    moveq #$1F,d0

    ClearPLC_Loop:
    clr.l (a2)+
    dbf d0,ClearPLC_Loop
    rts
    ; End of function ClearPLC

    ; ---------------------------------------------------------------------------
    ; Subroutine to use graphics listed in a pattern load cue
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    RunPLC_RAM: ; XREF: Pal_FadeTo
    tst.l ($FFFFF680).w
    beq.s locret_1640
    tst.w ($FFFFF6F8).w
    bne.s locret_1640
    movea.l ($FFFFF680).w,a0
    lea (loc_1502).l,a3
    lea ($FFFFAA00).w,a1
    move.w (a0)+,d2
    bpl.s loc_160E
    adda.w #$A,a3

    loc_160E:
    andi.w #$7FFF,d2
    move.w d2,($FFFFF6F8).w
    bsr.w NemDec4
    move.b (a0)+,d5
    asl.w #8,d5
    move.b (a0)+,d5
    moveq #$10,d6
    moveq #0,d0
    move.l a0,($FFFFF680).w
    move.l a3,($FFFFF6E0).w
    move.l d0,($FFFFF6E4).w
    move.l d0,($FFFFF6E8).w
    move.l d0,($FFFFF6EC).w
    move.l d5,($FFFFF6F0).w
    move.l d6,($FFFFF6F4).w

    locret_1640:
    rts
    ; End of function RunPLC_RAM


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    sub_1642: ; XREF: loc_C44; loc_F54; loc_F9A
    tst.w ($FFFFF6F8).w
    beq.w locret_16DA
    move.w #9,($FFFFF6FA).w
    moveq #0,d0
    move.w ($FFFFF684).w,d0
    addi.w #$120,($FFFFF684).w
    bra.s loc_1676
    ; End of function sub_1642


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    sub_165E: ; XREF: Demo_Time
    tst.w ($FFFFF6F8).w
    beq.s locret_16DA
    move.w #3,($FFFFF6FA).w
    moveq #0,d0
    move.w ($FFFFF684).w,d0
    addi.w #$60,($FFFFF684).w

    loc_1676: ; XREF: sub_1642
    lea ($C00004).l,a4
    lsl.l #2,d0
    lsr.w #2,d0
    ori.w #$4000,d0
    swap d0
    move.l d0,(a4)
    subq.w #4,a4
    movea.l ($FFFFF680).w,a0
    movea.l ($FFFFF6E0).w,a3
    move.l ($FFFFF6E4).w,d0
    move.l ($FFFFF6E8).w,d1
    move.l ($FFFFF6EC).w,d2
    move.l ($FFFFF6F0).w,d5
    move.l ($FFFFF6F4).w,d6
    lea ($FFFFAA00).w,a1

    loc_16AA: ; XREF: sub_165E
    movea.w #8,a5
    bsr.w NemDec3
    subq.w #1,($FFFFF6F8).w
    beq.s loc_16DC
    subq.w #1,($FFFFF6FA).w
    bne.s loc_16AA
    move.l a0,($FFFFF680).w
    move.l a3,($FFFFF6E0).w
    move.l d0,($FFFFF6E4).w
    move.l d1,($FFFFF6E8).w
    move.l d2,($FFFFF6EC).w
    move.l d5,($FFFFF6F0).w
    move.l d6,($FFFFF6F4).w

    locret_16DA: ; XREF: sub_1642
    rts
    ; ===========================================================================

    loc_16DC: ; XREF: sub_165E
    lea ($FFFFF680).w,a0
    moveq #$15,d0

    loc_16E2: ; XREF: sub_165E
    move.l 6(a0),(a0)+
    dbf d0,loc_16E2
    rts
    ; End of function sub_165E

    ; ---------------------------------------------------------------------------
    ; Subroutine to execute the pattern load cue
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    RunPLC_ROM:
    lea (ArtLoadCues).l,a1 ; load the PLC index
    add.w d0,d0
    move.w (a1,d0.w),d0
    lea (a1,d0.w),a1
    move.w (a1)+,d1 ; load number of entries in the PLC

    RunPLC_Loop:
    movea.l (a1)+,a0 ; get art pointer
    moveq #0,d0
    move.w (a1)+,d0 ; get VRAM address
    lsl.l #2,d0 ; divide address by $20
    lsr.w #2,d0
    ori.w #$4000,d0
    swap d0
    move.l d0,($C00004).l ; put the VRAM address into VDP
    bsr.w NemDec ; decompress
    dbf d1,RunPLC_Loop ; loop for number of entries
    rts
    ; End of function RunPLC_ROM

    But nothing changes.

    I think i will give up.
     
    Last edited: Jul 31, 2016
  18. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Ignoring that this code being a real nonsense, your problem is at the beginning, these bne.w "should" be bra.w/jmp. Much simpler way would be doing a check in the routines themselves rather than copying them all over again for basically one change. It confuses + takes really more ROM space than it's worthy.
     
  19. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I have also doing a check in the routines and still doesn't work.
    I will try to make the "bra.w" instead of "bne.w"...
    I'm stuck :(
     
  20. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    Placing the code for the checks in your routine would help. You also imply that you've only done half of what Painto said yet you say your stuck. At least attempt to solve the problem with the solution you've been given before claiming to be stuck.