Basic Questions and Answers Thread

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

  1. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,870
    The error handler says "MenuScreen_Options+$0062", I believe the instruction is going to be a word move to or from the address $FFFFF7B9, it'll be a direct write/read as none of the address registers have this address. Likewise, this instruction is going to be just a few lines below "clr.w ($FFFFF7F0).w", you just barely didn't show us enough of the routine to see the instruction responsible, it's... just right below the screenshot, just barely missed it.

    Take a screenshot of the instructions further down and we'll point out which one. I think you have roughly 8-C bytes left to reach it.

    Basically... you cannot perform word operations on odd addresses because of the way the CPU handles the 16-bit BUS.

    I haven't used SonED in quite a long time, so I don't remember if it does. But make sure you are in "layout edit" mode to ensure that when you do press the "space" bar, it will affect the chunk you're hovering over, and not an object or something silly.
     
    DeltaWooloo and ProjectFM like this.
  2. Stampy599

    Stampy599 Newcomer Trialist

    Joined:
    Mar 9, 2020
    Messages:
    5
    also i have an issue with the title screen. It looks like this for some reason[​IMG]
     
  3. DeltaWooloo

    DeltaWooloo A hacker, helper, friend and a Wooloo Member

    Joined:
    Aug 7, 2019
    Messages:
    228
    Here is the other bit of code under "clr.w ($FFFFF7F0).w":
    Screenshot 2020-03-14 at 16.18.27.png
     
  4. Lone Devil

    Lone Devil READ BERSERK Member

    Joined:
    Dec 29, 2010
    Messages:
    159
    Location:
    Dallas Texas
    How do I make Sonic's standard #$600 running speed increase over time? (from only running on-foot) like a formula 1 car?
    I've tried [addi.w #$10,(v_sonspeedmax).w] for running speeds but it only buffs the stored max speed making running speeds faster and too fast from the start of acceleration.

    EDIT: Double checked to confirm my mind wasn't playing tricks with me.
     
    Last edited: Mar 15, 2020
  5. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,870
    There you go, the line which has "move.w #$0000,($FFFFF7B9).w", just remove that line. The line "move.w ($FFFFF7B8).w" will handle it for you.
     
    DeltaWooloo likes this.
  6. DeltaWooloo

    DeltaWooloo A hacker, helper, friend and a Wooloo Member

    Joined:
    Aug 7, 2019
    Messages:
    228
    I ported Balloon Park into Sonic 1 and the PSGs is messed up. How can I resolve this?
     
    Last edited: Mar 20, 2020
  7. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    I have a question, i'm making my first Sonic 1 hack, and i successfully added an extended camera, uncapped ground and air speeds, advanced debugger, and the start button fix (without ESE). I was interested in adding the Super Peel Out to the hack, but there aren't any tutorials around. I tried porting it form the ReadySonic disassembly, and it worked out until i needed to figure out how to get the graphics ported from there, now i'm getting an Address error from sonicdynplc |:[. I want to start fresh with my Super Peel Out idea, what do i do?
     
  8. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    113
    Location:
    Buffalo, New York
    If you want an example, look at the Free Assets Thread, which has a disasm for an unfinished ROM Hack called "Sonic CD Art Test". It has a peelout, although it uses an older version of Hivebrain, so you might have to alter it. You also have to port the art for the peelout using a mapping program. But if you do all that, make sure you give credit to LuigiXHero for it. If you cannot figure it out, just PM me and I'll tinker with a copy of what disassembly you started off on.
    Here's the version I that more or less is the same as the one in Sonic CD Art Test, albeit ported to AS from AS68K with some flaws in regards to not all of the features could be successfully ported because I'm a lazy shit, not because it's not possible, because it definitely is (for example, it gradually building up speed and not being able to fire until it built up said speed, I need to add a check using a variable), so it's more like a faster spindash.
    Code:
    Sonic_Peelout:
           btst   #1,$39(a0)
           bne.s   Sonic_DashLaunch
           cmpi.b   #7,$1C(a0) ;check to see if your looking up
           bne.s   .return
           move.b   ($FFFFF603).w,d0
           andi.b   #%01110000,d0
           beq.w   .return
           move.b   #id_Run,obAnim(a0)
           move.w   #0,$3A(a0)
           move.w   #$82,d0
           jsr       (PlaySound_Special).l ; Play peelout charge sound
           addq.l   #4,sp
           bset   #1,$39(a0)
           bsr.w   Sonic_LevelBound
           bsr.w   Sonic_AnglePos
       .return:
           rts
    ; ---------------------------------------------------------------------------
    Sonic_DashLaunch:
           move.b   #id_PeeloutCharge,obAnim(a0)
           move.b   ($FFFFF602).w,d0
           btst   #0,d0
           bne.w   Sonic_DashCharge
           bclr   #1,$39(a0)   ; stop Dashing
           cmpi.b   #$1E,$3A(a0)   ; have we been charging long enough?
           move.b   #id_Dash,obAnim(a0)   ; launches here (peelout sprites)
           move.w   #1,$10(a0)   ; force X speed to nonzero for camera lag's benefit
           move.w   #$0F00,$14(a0)   ;Set sonic's speed
           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,(v_cameralag).w
           btst   #0,$22(a0)
           beq.s   .dontflip
           neg.w   $14(a0)
    .dontflip:
           ;bset   #2,$22(a0) ; apparently with this commented out, it won't cause extreme camera lag. weird that it's even here.
           bclr   #7,$22(a0)
           move.w   #$D3,d0
           ;jsr       (PlaySound_Special).l
           move.w   #$D4,d0
           ;jsr       (PlaySound_Special).l
           bra.w   Sonic_DashResetScr
    ; ---------------------------------------------------------------------------
    Sonic_DashCharge:               ; If still charging the dash...
           cmpi.b   #$1E,$3A(a0)
           beq.s   Sonic_DashResetScr
           addi.b   #1,$3A(a0)
           jmp    Sonic_DashResetScr
      
    Sonic_Dash_Stop_Sound:
           move.w   #$D3,d0
           ;jsr       (PlaySound_Special).l
    
    Sonic_DashResetScr:
           addq.l   #4,sp           ; increase stack ptr ; was 4
           cmpi.w   #$60,($FFFFF73E).w
           beq.s   .finish
           bcc.s   .skip
           addq.w   #4,($FFFFF73E).w
       .skip:
           subq.w   #2,($FFFFF73E).w
       .finish:
           bsr.w   Sonic_LevelBound
           bsr.w   Sonic_AnglePos
           rts
          
    Of course, your peelout is most likely going to be a variation of mine, as I use a different disassembly with a different set of ways of setting Sonic's frames (i.e. mine uses id_Frame, yours might be moving the byte of a RAM address your frame is associated with). Just be aware of that.
     
    Last edited: Mar 28, 2020
    ProjectFM likes this.
  9. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    Thanks, i'll try it out then, (i'm using the latest GitHub version.)
     
  10. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    OK, So I actually got it working, Thanks! I did use the graphics from LuigiXHero so i'll credit his work. Is it OK if I PM you the stuff for your opinion on the port job
     
  11. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    279
    Since everyone seems to be getting the peelout code from that. I updated the disasm to have better Peelout and Sonic CD Spindash code from Ralakimus he made me just yesterday in fact.

    Should mention the peelout in that is based off of Mercury's from ReadySonic, just edited by Me and Ralakimus to be better. So make sure you credit Mercury also.
     
    Tanman Tanner likes this.
  12. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    Ah, that's great actually! I'll try to update my code with the better disasm for more practice with porting. I'll make sure to add that to the credits
     
  13. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    113
    Location:
    Buffalo, New York
    After looking at how Mercury did his peelout, I can see some influences, but it honestly appears different in how he did it, though I will credit all 3 of you.
     
  14. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    OK, so I did some updates, which are pretty satisfactory. The peelout works well with my extended camera (all though, when you charge a peelout to the left, the camera still moves to the right). There is however one problem. The peelout graphics no longer show when i charge a peelout, only the normal run (which is better than Sonic hovering across the air though). I tried to find where the code loads the animatons, changed it and tested but i can't seem to get it to work. |:|

    So, i'm uploading my disam just incase anyone has a fix, because i've been trying for hours, and I want to get onto the spindash then level editing.
    If you found a fix, go ahead and upload that, please
     

    Attached Files:

  15. ralakimus

    ralakimus pretty much a dead account Member

    Joined:
    Aug 26, 2013
    Messages:
    1,069
    Check out Sonic_Animate from where you got the peelout code.
     
  16. TG72

    TG72 Newcomer Trialist

    Joined:
    Mar 27, 2020
    Messages:
    7
    I got it up. :] I'm adding my spindash now. The peelout looks like how it is in Sonic 3 Complete, where the charge is the CD Sprite, then when you release you run with normal sprites.
    It's not how most hacks go with it, or how Sonic CD goes for it, but I like it.
     
  17. Iso Kilo

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

    Joined:
    Oct 9, 2017
    Messages:
    347
    Location:
    A warm and lovely place~
    Despite your contempt, here's how to fix it:
    Head to loc_13A9C:, and above
    Code:
            lea    (SonAni_Run).l,a1 ; use    running    animation
            cmpi.w    #$600,d2    ; is Sonic at running speed?
            bcc.s   loc_13AB4   ; if yes, branch
    
    Place
    Code:
            lea    (SonAni_Dash).l,a1 ; use    full speed    animation (May be different based on your animation file)
            cmpi.w    #$A00,d2    ; is Sonic at dashing speed?
            bcc.s   loc_13AB4   ; if yes, branch
    
    What it's doing should be fairly obvious, the animation is being loaded, and then the player's speed is checked, if the speed reaches a certain point, then it'll branch to play the animation.
    Note that this is for the Hive disasm.
     
  18. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    113
    Location:
    Buffalo, New York
    Yeah, I noticed the fact Run was being used initially instead of 3rdDash (I think that's what the animation is called in the Sonic CD Art disasm), but I shrugged it off as a small mistake or intentional design and fixed it with my version of the Peelout anim. What you did though Iso Kilo could work on the Sonic 1 AS Disasm, as the SonAni_ naming convention still exists, and if not (as I might of ported SonAni_ naming), you could move.w the id for the animation. At least, that's what I did with my S2 spindash.
    I'm dumb, I misread it. The Peelout did use Run instead of 3rdDash for the peelout, but that could of been done to make porting it easier.
     
  19. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    113
    Location:
    Buffalo, New York
    Pretty quick question about A DAC sample I have. I'm using KEH's Sound Driver and my Knuckles death sound is the memey "Oh No" sound effect. However, it sounds far too deep. How could I possibly adjust this? Should the bitrate be higher?
     
  20. DeltaWooloo

    DeltaWooloo A hacker, helper, friend and a Wooloo Member

    Joined:
    Aug 7, 2019
    Messages:
    228
    When I'm porting the Insta-Shield to Sonic 1, it builds without no problem but the shield isn't showing up. I put the shield in the object pointer, ported QueueDMATransfer, optimized shield art and made sure it loaded to Sonic when spawned under the dust code and nothing happened. Do you know any fixes? Here is the code:

    Code:
    Obj_Insta_Shield:            ; DATA XREF: SpawnLevelMainSprites_SpawnPlayers+6Ao
                        ; SpawnLevelMainSprites_SpawnPlayers+BCo ...
            move.l    #Map_InstaShield,$C(a0)
            move.l    #DPLC_InstaShield,$3C(a0)
            move.l    #ArtUnc_InstaShield,$38(a0)
            move.b    #4,4(a0)
            move.w    #$80,8(a0)
            move.b    #$18,7(a0)
            move.b    #$18,6(a0)
            move.w    #$79C,$A(a0)
            move.w    #$F380,$40(a0)
            btst    #7,($FFFFB00A).w
            beq.s    loc_19518
            bset    #7,$A(a0)
    
    loc_19518:                ; CODE XREF: ROM:00019510j
            move.w    #1,$20(a0)
            move.b    #-1,$34(a0)
            move.l    #loc_1952A,(a0)
    
    loc_1952A:                ; DATA XREF: ROM:00019524o
            movea.w    $42(a0),a2
            btst    #1,$2B(a2)
            bne.s    locret_195A4
            move.w    $10(a2),$10(a0)
            move.w    $14(a2),$14(a0)
            move.b    $2A(a2),$2A(a0)
            andi.b    #1,$2A(a0)
            tst.b    ($FFFFF7C6).w
            beq.s    loc_1955B
            ori.b    #2,$2A(a0)
    
    loc_1955B:                ; CODE XREF: ROM:00019552j
            andi.w    #$7FFF,$A(a0)
            tst.w    $A(a2)
            bpl.s    loc_1956C
            ori.w    #$8000,$A(a0)
    
    loc_1956C:                ; CODE XREF: ROM:00019564j
            lea    (Ani_InstaShield).l,a1
            jsr    AnimateSprite
            cmpi.b    #7,$22(a0)
            bne.s    loc_1958C
            tst.b    $2F(a2)
            beq.s    loc_1958C
            move.b    #2,$2F(a2)
    
    loc_1958C:                ; CODE XREF: ROM:0001957Ej
                        ; ROM:00019584j
            tst.b    $22(a0)
            beq.s    loc_1959A
            cmpi.b    #3,$22(a0)
            bne.s    loc_1959E
    
    loc_1959A:                ; CODE XREF: ROM:00019590j
            bsr.w    PLCLoad_Shields
    
    loc_1959E:                ; CODE XREF: ROM:00019598j
            jmp    BuildSprites
    ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    
    locret_195A4:                ; CODE XREF: ROM:00019534j
            rts 
    
    Ani_InstaShield:dc.w byte_199EE-Ani_InstaShield    ; DATA XREF: ROM:0001956Co
                        ; ROM:000199EAo ...
            dc.w byte_199F1-Ani_InstaShield
    byte_199EE:    dc.b  $1F,   6,    $FF    ; DATA XREF: ROM:000199EAo
    byte_199F1:    dc.b    0,   0,      1,   2,   3,     4,   5,   6,    6,   6,      6,   6,   6,     6,   7, $FD,    0
    ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    Map_InstaShield:dc.w word_1A0E0-Map_InstaShield    ; DATA XREF: ROM:000194CEo
                        ; ROM:0001A0D0o ...
            dc.w word_1A0F4-Map_InstaShield
            dc.w word_1A108-Map_InstaShield
            dc.w word_1A116-Map_InstaShield
            dc.w word_1A12A-Map_InstaShield
            dc.w word_1A13E-Map_InstaShield
            dc.w word_1A152-Map_InstaShield
            dc.w word_1A152-Map_InstaShield
    word_1A0E0:    dc.w 3            ; DATA XREF: ROM:0001A0D0o
            dc.b  $E8,   8,      0,   0, $FF, $F0
            dc.b  $F0,   4,      0,   3, $FF, $F8
            dc.b  $F8,   0,      0,   5,   0,     0
    word_1A0F4:    dc.w 3            ; DATA XREF: ROM:0001A0D0o
            dc.b  $F0,   4,      0,   6,   0,     8
            dc.b  $F8,   8,      0,   8,   0,     0
            dc.b    0,   4,      0,  $B,   0,     0
    word_1A108:    dc.w 2            ; DATA XREF: ROM:0001A0D0o
            dc.b    0,   9,      0,  $D,   0,     0
            dc.b  $10,  $C,      0, $13, $FF, $F8
    word_1A116:    dc.w 3            ; DATA XREF: ROM:0001A0D0o
            dc.b  $F0,  $C,      0,   0, $FF, $E8
            dc.b  $F8,   8,      0,   4, $FF, $E8
            dc.b    0,   6,      0,   7, $FF, $E8
    word_1A12A:    dc.w 3            ; DATA XREF: ROM:0001A0D0o
            dc.b  $E8,   4,      0,  $D, $FF, $F0
            dc.b  $E8,  $B,      0,  $F,   0,     0
            dc.b    8,   4,      0, $1B,   0,     8
    word_1A13E:    dc.w 3            ; DATA XREF: ROM:0001A0D0o
            dc.b  $F0,   4,    $18, $1B, $FF, $E8
            dc.b  $F8,  $B,    $18,  $F, $FF, $E8
            dc.b  $10,   4,    $18,  $D,   0,     0
    word_1A152:    dc.w 0            ; DATA XREF: ROM:0001A0D0o
    ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    DPLC_InstaShield:dc.w word_1A164-DPLC_InstaShield ; DATA XREF: ROM:000194D6o
                        ; ROM:0001A154o ...
            dc.w word_1A164-DPLC_InstaShield
            dc.w word_1A164-DPLC_InstaShield
            dc.w word_1A16A-DPLC_InstaShield
            dc.w word_1A16A-DPLC_InstaShield
            dc.w word_1A16A-DPLC_InstaShield
            dc.w word_1A16A-DPLC_InstaShield
            dc.w word_1A16A-DPLC_InstaShield
    word_1A164:    dc.w 2            ; DATA XREF: ROM:0001A154o
            dc.w $F000
            dc.w $6010
    word_1A16A:    dc.w 2            ; DATA XREF: ROM:0001A154o
            dc.w $F017
            dc.w $C027
    
    ArtUnc_InstaShield: incbin artunc/insta.bin
    
    PLCLoad_Shields:            ; CODE XREF: ROM:0001959Ap
                        ; ROM:00019686p ...
            moveq    #0,d0
            move.b    $22(a0),d0
            cmp.b    $34(a0),d0
            beq.s    locret_199E8
            move.b    d0,$34(a0)
            movea.l    $3C(a0),a2
            add.w    d0,d0
            adda.w    (a2,d0.w),a2
            move.w    (a2)+,d5
            subq.w    #1,d5
            bmi.s    locret_199E8
            move.w    $40(a0),d4
    
    loc_199BE:                ; CODE XREF: PLCLoad_Shields+4Aj
            moveq    #0,d1
            move.w    (a2)+,d1
            move.w    d1,d3
            lsr.w    #8,d3
            andi.w    #$F0,d3
            addi.w    #$10,d3
            andi.w    #$FFF,d1
            lsl.l    #5,d1
            add.l    $38(a0),d1
            move.w    d4,d2
            add.w    d3,d4
            add.w    d3,d4
            jsr    (QueueDMATransfer).l
            dbf    d5,loc_199BE
    
    locret_199E8:                ; CODE XREF: PLCLoad_Shields+Aj
                        ; PLCLoad_Shields+1Ej
            rts 
    ; End of function PLCLoad_Shields
    I ported this over from an old SK disassembly, not the GitHub version. Let me know if I have to and help me.
     
    Last edited: Apr 7, 2020