Basic Questions and Answers Thread

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

  1. RobiWanKenobi

    RobiWanKenobi Python Developer and ASM enthusiast Member

    Joined:
    Sep 10, 2022
    Messages:
    119
    Location:
    United States
    (I had a misconception that Sonic 1 was like S2, where the mappings for the title cards included the palette stuff)

    one way you could do it is by making everything on Line 1 instead of Line 0
    Code:
    loc_C5CA:
            move.b    d0,obFrame(a1)
            move.l    #Map_Got,obMap(a1)
            move.w    #make_art_tile(ArtTile_Title_Card,1,1),obGfx(a1) ; changed from 0,1 to 1,1
    
    However, that will mean that all of the art needs to work on Line 1, looking at what you have though, it may be fine, especially if you are clever about the art for the title cards and end of act results (Currently, I only see 2 things that need to really be on Line 0, but those could be made grey instead of blue)

    (I hoped to find a way to just do the text bit, but I'm not sure how I would)
     
    PeanutNoceda likes this.
  2. PeanutNoceda

    PeanutNoceda Well-Known member Member

    Joined:
    Sep 26, 2024
    Messages:
    95
    Location:
    My house
    It worked! Thank You!
    blastem_20250118_104822.png
     
  3. Devon

    Devon La mer va embrassé moi et délivré moi lakay. Member

    Joined:
    Aug 26, 2013
    Messages:
    1,461
    Location:
    your mom
    ...yeah it does, though? It's the 2nd to last value in "spritePiece".
    Code:
    spritePiece macro xpos,ypos,width,height,tile,xflip,yflip,pal,pri
     
  4. RobiWanKenobi

    RobiWanKenobi Python Developer and ASM enthusiast Member

    Joined:
    Sep 10, 2022
    Messages:
    119
    Location:
    United States
    The mappings for those don't use spritePiece
     
  5. Devon

    Devon La mer va embrassé moi et délivré moi lakay. Member

    Joined:
    Aug 26, 2013
    Messages:
    1,461
    Location:
    your mom
    Well, in that case, the palette line is in the tile ID, which is formatted as such in binary:

    PCCV HTTT TTTT TTTT
    • P = Priority flag
    • C = Palette line
    • V = Vertical flip
    • H = Horizontal flip
    • T = Tile ID
    If you are using the 2022 Hivebrain disassembly, then you are meant to add "pal2", "pal3", or "pal4" to the end of the "piece" macro (you can see it in the HUD mappings, for instance).
     
  6. RobiWanKenobi

    RobiWanKenobi Python Developer and ASM enthusiast Member

    Joined:
    Sep 10, 2022
    Messages:
    119
    Location:
    United States
    (Side Note, I hack Sonic 2 so much more than Sonic 1)
    Code:
    ; ---------------------------------------------------------------------------
    ; Sprite mappings - "SONIC HAS PASSED" title card
    ; ---------------------------------------------------------------------------
    Map_Got:    dc.w M_Got_SonicHas-Map_Got
            dc.w M_Got_Passed-Map_Got
            dc.w M_Got_Score-Map_Got
            dc.w M_Got_TBonus-Map_Got
            dc.w M_Got_RBonus-Map_Got
            dc.w M_Card_Oval-Map_Got
            dc.w M_Card_Act1-Map_Got
            dc.w M_Card_Act2-Map_Got
            dc.w M_Card_Act3-Map_Got
    M_Got_SonicHas:    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
    M_Got_Passed:    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
    M_Got_Score:    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
    M_Got_TBonus:    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
    M_Got_RBonus:    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
    
     
  7. Devon

    Devon La mer va embrassé moi et délivré moi lakay. Member

    Joined:
    Aug 26, 2013
    Messages:
    1,461
    Location:
    your mom
    The third and fourth values for each sprite piece are the tile offset and flags split into separate bytes. If you want a piece to be offset by 1 palette line, add $20 to the third value.

    For example, this line
    Code:
            dc.b $F8, 5, 0, $3E, $B8
    becomes
    Code:
            dc.b $F8, 5, $20, $3E, $B8
    And this line, whose tile offset is -8 (yes, this is intended, it goes back 8 tiles instead of forwards)
    Code:
            dc.b $F8, $D, $FF, $F8, $28
    becomes (overflows past 0)
    Code:
            dc.b $F8, $D, $1F, $F8, $28
    To offset by 2 palette lines, add $40, to offset by 3 palette lines, add $60.
     
    Last edited: Jan 19, 2025
  8. RobiWanKenobi

    RobiWanKenobi Python Developer and ASM enthusiast Member

    Joined:
    Sep 10, 2022
    Messages:
    119
    Location:
    United States
    Thanks for the clarification.
     
  9. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Thank you.
     
  10. Carlos Iagnecz

    Carlos Iagnecz Newcomer Member

    Joined:
    Jun 16, 2023
    Messages:
    21
    Location:
    Brazil
    Change the Got_Map's palette to the second one. If you are using MapMacros it's as simple as setting the penultimate value in the entries related to the SCORE, RING BONUS and TIME BONUS to one
    Eggman can't be saved so much. Grab the Sonic 2 or 3 sprite.
     
  11. BL3H

    BL3H idiot sandwich Member

    Joined:
    Jul 19, 2022
    Messages:
    43
    Location:
    Tails' Workshop, Angel Island
    Quick question and I know this sounds dumb, but, how would you check to see if Sonic is colliding with another specific object? I'm assuming it would be to check for a specific touch response from the object and then have that branch to its own routine.
     
  12. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Hello, I am trying to port a few songs from S3K to Sonic 1, They all use UVB so i cant port them, Here is the list of songs i want to port:
    Angel Island Act 1
    Angel Island Act 2
    Hydrocity Act 1
    Hydrocity Act 2
    Act Clear
    Continue (maybe)
    Menu
    By the way, I am using SMPSConv
     
  13. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    I have ported Angel Island Act 2, s3 Act clear, and the s3 continue theme to my romhack and I made a tutorial for it in the mini tutorial thread
     
  14. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Ok im going to try that
     
  15. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    did it work?
     
  16. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    it sound weird i used it in s1fixed with flamedriver, i am using angel island act 2
     
  17. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    send me the editied disasm so i can see
     
    Last edited: Jan 24, 2025
  18. LaneLovesLain

    LaneLovesLain Newcomer Trialist

    Joined:
    Jan 25, 2025
    Messages:
    2
    I'm new to this, so this may be very simple, but I'm using SonED2 and whenever I assemble the ROM, only changes I make to the level layout are saved while any objects I remove or add are not. How can I fix this?
     
  19. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    Are you using the currect revision files? When i first started romhacking I acidentlly kept clicking on the wrong revision file for soned2 all the time although now I use SonLVL.
     
  20. LaneLovesLain

    LaneLovesLain Newcomer Trialist

    Joined:
    Jan 25, 2025
    Messages:
    2
    I tried using a newer revision just now, and I could add objects but now everything except objects gets erased from the level after assembling
     

    Attached Files: