Basic Questions and Answers Thread

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

  1. ChemicalStar

    ChemicalStar Newcomer Trialist

    Joined:
    Dec 20, 2024
    Messages:
    5
    heres
    upload_2025-1-7_19-26-53.png upload_2025-1-7_19-26-53.png upload_2025-1-7_19-28-15.png upload_2025-1-7_19-31-36.png upload_2025-1-7_19-31-52.png

    my disassembly
    im sorry if i write too much
     

    Attached Files:

    Last edited by a moderator: Jan 7, 2025
  2. JoaoV1238

    JoaoV1238 Newcomer Trialist

    Joined:
    Nov 22, 2023
    Messages:
    16
    Location:
    Marble Garden
    I found a weird SMPS pack called Cool-Spot's smps archive with some stolen content, but obviously i wont use the stolen content, There a bunch of songs that i saw people using on other hacks like Angel island Act 2, and others And a bunch of sonic 2 music and sfx in a folder called "From Sonic 2 Clone Driver" Inside of a folder called Sonic 2 to Sonic 1, is there any problem to use it?

    The glitch sound might be because you added too much data
     
    Last edited by a moderator: Jan 8, 2025
    ChemicalStar likes this.
  3. PeanutNoceda

    PeanutNoceda Trying to forget my pain of the past Member

    Joined:
    Sep 26, 2024
    Messages:
    58
    Location:
    Green Hill Zone, South Island
    Wait what?
    Better dont use them, that's what I recommend, but… if you want to use them, its at your own risk.
     
  4. JoaoV1238

    JoaoV1238 Newcomer Trialist

    Joined:
    Nov 22, 2023
    Messages:
    16
    Location:
    Marble Garden
    Ok then, Cool-Spot was a russian person who stealed stuff from Megamix, and OuricoDoido got it some of the codes and putted it on the infamous hack STHOSP, But i gonna use the music from STHOSP since it's no stolen, thanks for the help:D
     
    Last edited: Jan 8, 2025
  5. TheManThatPacs

    TheManThatPacs Newcomer Trialist

    Joined:
    Jan 9, 2025
    Messages:
    4
    Hey there! I'm new here, working on my first hack, and i'm thinking of making custom music for it; but, i can't find any software to do it.

    If it helps, it's a Sonic 1 hack, Github dissasembly.

    Help is highly appreciated! Thank you!
     
    DanielHall likes this.
  6. PeanutNoceda

    PeanutNoceda Trying to forget my pain of the past Member

    Joined:
    Sep 26, 2024
    Messages:
    58
    Location:
    Green Hill Zone, South Island
    hmm... Im not an expert in smps work but if you want to add custom music you can use Mid2smps, smps2asm and vgm2smps.
     
  7. TheManThatPacs

    TheManThatPacs Newcomer Trialist

    Joined:
    Jan 9, 2025
    Messages:
    4
    Thank you! I'll try that!

    Heya, i'm on Mid2smps, and i keep getting this error:
    View attachment 6815

    I'm following this tutorial, if it helps.

    Nevermind-- The issue's fixed! Sorry for the inconvenience!
     
    Last edited by a moderator: Jan 10, 2025
    PeanutNoceda likes this.
  8. ChemicalStar

    ChemicalStar Newcomer Trialist

    Joined:
    Dec 20, 2024
    Messages:
    5
    yes i use other sonic 1 disassembly and sound glich was gone but im stuck in add dma queue now
    i want to know how fix dmaqueue
     
  9. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    861
    Location:
    North Wales
    Mind if I ask, what exactly are you planning? Do you want custom music or do you want to convert another track, or maybe even a game's music port? Not really too many options in regards to tools, in all honesty, but you can still make summat work.
     
  10. TheManThatPacs

    TheManThatPacs Newcomer Trialist

    Joined:
    Jan 9, 2025
    Messages:
    4
    its custom music, specifically, to recreate a track from sonic 4.
     
  11. CutieGundam

    CutieGundam I'm just a cute MS Girl! ;) Member

    Joined:
    Jul 10, 2023
    Messages:
    40
    I've been racking my brains all day because I can't port the Sonic 2/S3K invincibility stars to RetroKoH's S1Fixed. I actually made it in normal Sonic 1, but in S1Fixed... ugh... Well, the sprites get invisible...
    I know it happens because the invincibility stars and the shields were already separated and uncompressed. But the stars are different still uses shield mappings. And I don't know which code makes it don't work

    Just, look at this:


    s1built000.png

    s1built001.png

    S1Fixed000.png


    The first two worked, but the last didn't. :(
     
  12. DeltaW

    DeltaW The noob next door Staff

    Joined:
    Aug 7, 2019
    Messages:
    394
    From looking at the pics, I'm guessing that the priority isn't set properly. S1Fixed uses an optimized variant of S3K priority manager, which requires you to make the priority a word and name the priority by name just like this:

    Code:
            move.w    #priority1,d0
    The stars objects load the priority before it calls DisplaySprite2, kinda like this:

    Code:
        .display_main:
            add.b    d0,InvStars_SpeedIndex(a0)
            move.w    #priority1,d0
            jmp        DisplaySprite2
    There are two instances of it. Just find the calls to DisplaySprite2 then make those changes where necessary.

    However, it would help if you provided the object code so I can see what the issue is.
     
    PeanutNoceda likes this.
  13. CutieGundam

    CutieGundam I'm just a cute MS Girl! ;) Member

    Joined:
    Jul 10, 2023
    Messages:
    40
    In S1Fixed, the invincibility stars object is 21.

    This is the code I used. I don't remember from where I got these. But I did the changes and still didn't worked. :[

    Code:
    ; ---------------------------------------------------------------------------
    ; Object 21 - invincibility stars
    ; ---------------------------------------------------------------------------
    
    StarsItem:
            moveq    #0,d0
            move.b    InvStars_routine(a0),d0
            move.w    InvStars_Index(pc,d0.w),d1
            jmp    InvStars_Index(pc,d1.w)
    ; ===========================================================================
    
    InvStars_Index:    dc.w InitObjects-InvStars_Index
            dc.w MainObject-InvStars_Index
            dc.w SubObject-InvStars_Index
    ; ===========================================================================
    
    SubObjectsData:
        dc.l Ani_InvStars2 ; animation script
        dc.w $B ; speed index,sub3 anim
        dc.l Ani_InvStars3
        dc.w $160D
        dc.l Ani_InvStars4
        dc.w $2C0D
    ; ===========================================================================   
    
    InvStars_routine: equ $A ; the same as obRoutine in other objects
    InvStars_AniScript: equ $30 ; animation script used by sub-objects(in main object it's clear and unused) (4 bytes)
    InvStars_SpeedIndex: equ $34  ; (2 bytes)
    InvStars_PrevPosIndex: equ $36 ; clear and unused in main object
    
    
    InitObjects:
        move.l    #Art_Stars,d1
        move.w    #$A820,d2
        move.w    #$200,d3
        jsr    (QueueDMATransfer).l
        moveq    #0,d2
        lea    SubObjectsData-6(pc),a2
        lea    (a0),a1
        moveq    #3,d1
    initStars:   
        move.b    (a0),(a1) ; load obj35
        move.b    #4,InvStars_routine(a1)        ; => .SubObject
        move.l    #Map_InvStars,$4(a1)
        move.w    #$541,$2(a1)
        move.b  #%001000100,1(a1)
        move.b    #$10,mainspr_width(a1)
        move.b    #2,mainspr_childsprites(a1)
        move.b    d2,InvStars_PrevPosIndex(a1)
        addq.w    #1,d2
        move.l    (a2)+,InvStars_AniScript(a1)
        move.w    (a2)+,InvStars_SpeedIndex(a1)
        lea    $40(a1),a1 ; a1=object
        dbf    d1,initStars
    
        move.b    #2,InvStars_routine(a0)        ; => .MainObject
        move.b    #4,InvStars_SpeedIndex(a0)
    
    MainObject:
        lea ($FFFFD000).w,a1 ; a1=character
        tst.b   ($FFFFFE2D).w
        beq.w    Invinc_JmpTo_DeleteObject
        move.w    8(a1),d0
        move.w    d0,8(a0)
        move.w    $C(a1),d1
        move.w    d1,$C(a0)
        lea    sub2_x_pos(a0),a2
        lea    Ani_InvStars1,a3
        moveq    #0,d5
    
    getFrame_main:
        move.w    $38(a0),d2
        move.b    (a3,d2.w),d5
        bpl.s    setFrameAndPosition_main
        clr.w    $38(a0)
        bra.s    getFrame_main
    ; ===========================================================================
    
    setFrameAndPosition_main:
        addq.w    #1,$38(a0)
        lea    InvStars_Speeds,a6
        move.b    InvStars_SpeedIndex(a0),d6
        bsr.w    InvStars_get_speed
        move.w    d2,(a2)+    ; sub2_x_pos
        move.w    d3,(a2)+    ; sub2_y_pos
        move.w    d5,(a2)+    ; sub2_mapframe
        addi.w    #$20,d6
        bsr.w    InvStars_get_speed
        move.w    d2,(a2)+    ; sub3_x_pos
        move.w    d3,(a2)+    ; sub3_y_pos
        move.w    d5,(a2)+    ; sub3_mapframe
        moveq    #$12,d0
        btst    #0,$22(a1)
        beq.s    display_main
        neg.w    d0
    
    display_main:
            add.b    d0,InvStars_SpeedIndex(a0)
            move.w    #priority1,d0
            jmp        DisplaySprite2
    ; ===========================================================================
    
    SubObject:
        lea ($FFFFD000).w,a1 ; a1=character
        tst.b   ($FFFFFE2D).w
        beq.w    Invinc_JmpTo_DeleteObject
        lea    ($FFFFF7A8).w,a5
        lea    ($FFFFCB00).w,a6
        
    getPosition_sub:
        move.b    InvStars_PrevPosIndex(a0),d1
        lsl.b    #2,d1
        move.w    d1,d2
        add.w    d1,d1
        add.w    d2,d1
        move.w    (a5),d0
        sub.b    d1,d0
        lea    (a6,d0.w),a2
        move.w    (a2)+,d0
        move.w    (a2)+,d1
        move.w    d0,8(a0)
        move.w    d1,$C(a0)
        lea    sub2_x_pos(a0),a2
        movea.l    InvStars_AniScript(a0),a3
    
    getFrame_sub:
        move.w    $38(a0),d2
        move.b    (a3,d2.w),d5
        bpl.s    setFrameAndPosition_sub
        clr.w    $38(a0)
        bra.s    getFrame_sub
    ; ===========================================================================
    
    setFrameAndPosition_sub:
        swap    d5
        add.b    $35(a0),d2
        move.b    (a3,d2.w),d5
        addq.w    #1,$38(a0)
        lea    InvStars_Speeds(pc),a6
        move.b    InvStars_SpeedIndex(a0),d6
        bsr.s    InvStars_get_speed
        move.w    d2,(a2)+    ; sub2_x_pos
        move.w    d3,(a2)+    ; sub2_y_pos
        move.w    d5,(a2)+    ; sub2_mapframe
        addi.w    #$20,d6
        swap    d5
        bsr.s    InvStars_get_speed
        move.w    d2,(a2)+    ; sub3_x_pos
        move.w    d3,(a2)+    ; sub3_y_pos
        move.w    d5,(a2)+    ; sub3_mapframe
        moveq    #2,d0
        btst    #0,$22(a1)
        beq.s    loc_1DB20
        neg.w    d0
    
    loc_1DB20:
            add.b    d0,InvStars_SpeedIndex(a0)
            move.w    #priority1,d0
            jmp        DisplaySprite2
    ; ===========================================================================
    InvStars_get_speed:
        andi.w    #$3E,d6 ; limit to 6 bits and clear first bit
        move.b    (a6,d6.w),d2 ; move x-move speed to d2
        move.b    1(a6,d6.w),d3 ; move y-move speed to d3
        ext.w    d2
        ext.w    d3
        add.w    d0,d2 ; add object x position to x-move speed
        add.w    d1,d3 ; add object y position to y-move speed
        rts
    ; ===========================================================================
    Invinc_JmpTo_DeleteObject:
         jmp    DeleteObject
    ; ===========================================================================
    InvStars_Speeds: ; x-move speed,    y-move speed   
            dc.b   $0F,$00   
            dc.b   $0F,$03 
            dc.b   $0E,$06 
            dc.b   $0D,$08
            dc.b   $0B,$0B 
            dc.b   $08,$0D 
            dc.b   $06,$0E 
            dc.b   $03,$0F
            dc.b   $00,$10 
            dc.b   $FC,$0E
            dc.b   $F9,$0D 
            dc.b   $F7,$0C
            dc.b   $F4,$0A 
            dc.b   $F2,$07
            dc.b   $F1,$05 
            dc.b   $F0,$02
            dc.b   $F0,$00 
            dc.b   $F0,$FB
            dc.b   $F1,$F8 
            dc.b   $F2,$F6
            dc.b   $F4,$F3
            dc.b   $F7,$F1
            dc.b   $F9,$F0
            dc.b   $FC,$EF
            dc.b   $FF,$EF
            dc.b   $03,$F0 
            dc.b   $06,$F1
            dc.b   $08,$F2 
            dc.b   $0B,$F4
            dc.b   $0D,$F7 
            dc.b   $0E,$F9 
            dc.b   $0F,$FC
    
    ; ---------------------------------------------------------------------------
    ; Animation script - invincibility stars
    ; ---------------------------------------------------------------------------
    
    ; The animation script differs from the animate_sprite subroutine
    ; Every positive byte - mapping
    ; Every negative byte - loop flag
    
    Ani_InvStars1:    dc.b   8,  5,  7,  6,  6,  7,  5,  8,  6,  7,  7,  6,$FF
        even
    Ani_InvStars2:    dc.b   8,  7,  6,  5,  4,  3,  4,  5,  6,  7,$FF
            dc.b   3,  4,  5,  6,  7,  8,  7,  6,  5,  4
        even
    Ani_InvStars3:    dc.b   8,  7,  6,  5,  4,  3,  2,  3,  4,  5,  6,  7,$FF
            dc.b   2,  3,  4,  5,  6,  7,  8,  7,  6,  5,  4,  3
        even
    Ani_InvStars4:    dc.b   7,  6,  5,  4,  3,  2,  1,  2,  3,  4,  5,  6,$FF
            dc.b   1,  2,  3,  4,  5,  6,  7,  6,  5,  4,  3,  2
        even        
     
  14. DeltaW

    DeltaW The noob next door Staff

    Joined:
    Aug 7, 2019
    Messages:
    394
    OK, the code looks alright. IMO, I think you're better off downloading what I have and naming your constants and variables to instead of using raw numbers and RAM bytes. Just compare some of the bytes like $22 example, searching it up under Constants.asm and seeing that it's defined as obStatus. Do the same thing with RAM, but with Variables.asm. I only say that in case something you end up changing anything variable-related that may alter the object code if you haven't defined it already.

    The only other thing I can think of is that you will have to convert the invincibility stars mappings to Sonic 2's format (as S1Fixed uses S2 buildsprites and mapping format) or if not, you'll have to show me how the stars are loaded through the monitor contents object.
     

    Attached Files:

  15. CutieGundam

    CutieGundam I'm just a cute MS Girl! ;) Member

    Joined:
    Jul 10, 2023
    Messages:
    40
    I converted the original mappings from Sonic 2 to ASM, and...

    S1Fixed000.png

    Yeah... It glitched the background.

    But if you want to know how the stars are loaded, well, there it is

    Code:
    Pow_Invinc:
        if SuperMod=1
            btst    #sta2ndSuper,(v_player+obStatus2nd).w    ; is Sonic super?
            bne.s    .nomusic                                ; if yes, branch
        endif
    
            bset    #sta2ndInvinc,(v_player+obStatus2nd).w    ; make Sonic invincible
            move.b    #$96,(v_player+obInvinc).w                ; time limit for the power-up -- RetroKoH Sonic SST Compaction
            move.b    #id_StarsItem,(v_starsobj).w            ; load stars object
            move.b    #1,(v_starsobj+obAnim).w
            tst.b    (f_lockscreen).w                        ; is boss mode on?
            bne.s    .nomusic                                ; if yes, branch
            cmpi.b    #$C,(v_air).w
            bls.s    .nomusic
            move.w    #mus_Invincible,d0
            move.b    d0,(v_lastbgmplayed).w                    ; store last played music
            jmp        (PlaySound).w                            ; play invincibility music
    
     
  16. DeltaW

    DeltaW The noob next door Staff

    Joined:
    Aug 7, 2019
    Messages:
    394
    OK so upon looking at the disassembly, it might be the case that you will need to load the invincibility stars mappings separately from the original mappings (i.e. not using Map_Shield but something like Map_InvStars). While the objects were separated, the mappings weren't.
     
  17. CutieGundam

    CutieGundam I'm just a cute MS Girl! ;) Member

    Joined:
    Jul 10, 2023
    Messages:
    40
    After longs days, I finally fixed my problem. And It was actually my fault. Hahahaha! And also, I changed the original value, "$A820", to "$AA20". And now, it's finally working. Thanks for helping me, Delta!
     
    DeltaW likes this.
  18. PeanutNoceda

    PeanutNoceda Trying to forget my pain of the past Member

    Joined:
    Sep 26, 2024
    Messages:
    58
    Location:
    Green Hill Zone, South Island
    i dont know what happened, but in the results the colors are wrong (the hud is using the yellow colors of the second palette)
    blastem_20250118_075816.png
     
  19. RobiWanKenobi

    RobiWanKenobi Python Developer and ASM enthusiast Member

    Joined:
    Sep 10, 2022
    Messages:
    106
    Location:
    United States
    that's a mappings issue
     
  20. PeanutNoceda

    PeanutNoceda Trying to forget my pain of the past Member

    Joined:
    Sep 26, 2024
    Messages:
    58
    Location:
    Green Hill Zone, South Island
    oh... in that case how i can fix that?