Basic Questions and Answers Thread

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

  1. Speems

    Speems Well-Known Member Member

    Joined:
    Mar 14, 2017
    Messages:
    69
    Location:
    Rochester Hills, MI
    I am ready to owe up to a really dumb mistake I made the other day. If you're gonna use a direct rom editor tool thingy, then Esrael Sonic Editor II has an option to enable the Press Start Button text in the Miscellaneous section. But much like every other change you make in it, repair the checksum within the app's Checksum Check tool. Even then, it is insanely outdated and disassemblies are much more preferred.
    [​IMG]
     
  2. hebereke

    hebereke opa opa! Member

    Joined:
    May 3, 2012
    Messages:
    32
    In theory, would this approach work with a global instrument bank anyways? I haven't really familiarized myself with how SMPS's commands/flags work, so I'm not entirely sure if there's any different way in which I would specify instruments from a different track, or from a global instrument bank in the ROM.
     
  3. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,888
    Location:
    italy
    Again, what I suggested isn't the proper way to do what you're asking for, it's only an easy workaround. Anyway, let me clarify. In the header of each smps song there is a pointer to the instrument data used by that song. That data usually is at the end of the song itself, but nothing prevents it from being somewhere else (S3&K uses a special word to point to the UVB). The instrument selection flag doesn't really care about where the instrument pointer goes to, it merely picks the instrument located 25×n bytes starting from that pointer, without asking questions. In fact, some songs in S3&K actually use this technique instead of the UVB (ICZ1 and 2 iirc and maybe another pair, I'm going from memory here and I cba to double check).

    So, you can set the instrument pointer of all the songs to the same location, as long as it's within the same bank if you're using Z80 smps. At that point you only need to feed the proper IDs to the instrument selection flags. For example, if your first songs uses instruments 0 to 2, and your second songs uses different instruments, you'll have to renumber them to start from 3. Just make sure not to go beyond the 255 limit and you should be good.
     
    hebereke and ProjectFM like this.
  4. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    547
    Location:
    France
    Hi all, once again I come to solve a problem that seems totally basic to me and it enrages me not to find a solution to the problem after 5 days of investigation.

    First of all, I use the GitHub disassembly.

    It's been a long time now since I used THIS GUIDE.

    Without any problems, it works everywhere correctly.

    So I continued the development of my hack without worries until I had to add water in the other levels, then I used THIS GUIDE.

    That's where the problems started, I noticed that when I loaded water in for example Star Light Zone or Marble Zone, the chunk n°0 (the one that is empty) became solid, and my characters ran into an invisible wall, my Ashuro climbed with his WallJump into the void. Anyway, I removed the water guide until I could find a solution later, but now I discovered a new problem that I think has been there for a LONG time.

    It's about Labyrinth Zone. As you can see on the Screen: https://ibb.co/Mnf7Rkx [​IMG] , when I choose to go to LZ, and I follow Sonic, the level loads correctly without a hitch.

    But as soon as I want to use Ashuro (or my other characters), the level gets stuck on a black screen (https://ibb.co/zNY5NqK)[​IMG] with the Title Card. Nothing loads and nothing happens. The music continues to play, so the game does not crash completely.

    Did I miss something?

    EDIT:
    I see the same problem in Scrap Brain and Final Zone.

    So I think it has to do with whether a zone has a link to LZ or to water... I don't know, help me I'm lost! xD
     
    Last edited: Jan 18, 2022
  5. SuperSayian Zrise

    SuperSayian Zrise Well-Known Member Exiled

    Joined:
    May 10, 2021
    Messages:
    78
    First of all for the water, you probably didn't optimize it enough for the git disassembly. Even though if it built then I'm maybe wrong. However did you try using some blank chunk that isn't 0 or the tiles it uses for some reason go soild.

    For the second reason, you should install the crash handler v2 and add it to your hack. Even though it feels a bit long, after that your done. (Also, if you don't want this in final release game, just make a copy for that handler and when you update one build, update the handler build as well.
     
  6. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    547
    Location:
    France

    Thank you for your feedback!

    First, yes the porting of Hivebrain to Github went well as I'm used to it and it's nothing difficult, and I also tried to replace with an empty chunk other than "0" but same problem.

    For the second one, I already have this installed and obviously it's not an illegal instruction or anything, it's just the level left on the titlecard, I can't do anything, it crashed, the only thing that works is the music that keeps playing correctly as if nothing happened...
     
    SuperSayian Zrise likes this.
  7. SuperSayian Zrise

    SuperSayian Zrise Well-Known Member Exiled

    Joined:
    May 10, 2021
    Messages:
    78
    Ok, so thats that likely just a problem with the tile. Is it weridly possible you have to replace it with a newer tile because the tile cant be infected if its attacking star light and marble zone.
    Even though you didn't say it was a problem with the tile, just the chunk. I will have to look into it later.

    Now the second one is a game freeze, could possibly happen because: pattern load cues load number for example:
    If I had 3 things I'm telling it to load, then I put 2. The game will actually freeze due to that. Or the number is like about C or in decimal 12. And the objects loading is only 3.
    Main level load blocks is the next, you probably messed it up in some way. The area in the main asm or the Main Level Load Blocks asm file.
    Palcycle is another point for this. Maybe you were tinkering with it or something.
    Level layout index or object layout index: also, probably possible if your game even builds.

    I know I used basic reasons on why the game may freeze on Level load but thats all I really know of. Or the resizing and stuff like that but yeah.
     
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    547
    Location:
    France
    Thank you for being so involved.

    It is indeed relevant that you try to find "simple" solutions, sometimes I too forget basic things.

    But this is the first time in 8 years of rom-hacking that I'm confronted with this so...

    In fact, it's not a tile problem since the transparent tiles of the other chunks are not solid, it's really only chunk 0 that's buggy.

    And for Labyrinth Zone, the problem with the level not loading happened only with Ashuro or the other characters.

    Only Sonic gets into Labyrinth without any problem, with everything working, but not the others.
     
    SuperSayian Zrise likes this.
  9. Tarekboushi

    Tarekboushi Newcomer Trialist

    Joined:
    Jan 24, 2021
    Messages:
    10
    how should i port the mario deja vu from the sonic prototype to the final disassembly? (github)
     
  10. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    411
    Location:
    Buffalo, NY, USA
    I've never used that guide, but have you tried doing it this way?:

    https://sonicresearch.org/community...-level-adding-water-to-zones.6055/#post-85378

    Another way to test what's going on is to try that guide out on a clean disassembly, as there may be a conflict somewhere with your new code that's causing the issue.
     
  11. SuperSayian Zrise

    SuperSayian Zrise Well-Known Member Exiled

    Joined:
    May 10, 2021
    Messages:
    78
    What is this mario deja vu thing anyway? Or its a typo.
     
  12. yami

    yami la la la! let's all sing a happy song! Member

    Joined:
    Sep 24, 2020
    Messages:
    30
    Are you referring to the prototype victory animation?
     
    SuperSayian Zrise likes this.
  13. SuperSayian Zrise

    SuperSayian Zrise Well-Known Member Exiled

    Joined:
    May 10, 2021
    Messages:
    78
  14. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    226
    Location:
    Eastwatch Island
    So, I'm really wanting to set up Bizhawk, but I'm having issues getting it to work in general. I just wanna do longplays for Genesis, Master System/Game Gear, Game Boy, and SNES. The general shittiness of Kega Fusion's lossless codec and the crappy quality of NEStopia videos is getting old, and I'm holding off to show videos of my projects' progress until I can get it to work.
     
  15. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,888
    Location:
    italy
    There's always Gens ReRecording for Genesis, Dega for Master System and Game Gear, Visual Boy Advance for Game Boy, and Snes9X for Snes. So you don't need that other emulator with the weird name.
     
  16. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    226
    Location:
    Eastwatch Island
    Thank you! Hopefully it doesn't look like shit on Youtube or in general. That's one reason I hate recording with older emus. The quality usually doesn't go above 240p resolution, when at least 720 is what I go for.

    SNES9X luckily DOES go pretty damn high in quality tho, and has been my preferred SNES emulator for quite a while.
     
  17. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,888
    Location:
    italy
    Emulators usually dump videos at the native resolution of the emulated system, so 224p or 240p for Mega Drive / Genesis, and 144p for Game Boy. If for whatever reason you're into that silly "HD" fad and you want to upload "8K" videos of Game Boy footage, you can always upscale your videos in postprocessing, but that's something I can't help you with, because I'm strongly against such a thing.
     
  18. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    226
    Location:
    Eastwatch Island
    Yeah. I don't want full HD. I'm just into 720p so it doesn't look awful on Youtube. Otherwise I wouldn't care about resolution.

    Hell the only reason I have an Analogue SG is because my childhood Genesis stopped working, CRT TV's aren't as easy to find, and admittedly playing SG-1000, Game Gear, and Master System with FM were the big draws.
     
  19. Spicy Bread SSR

    Spicy Bread SSR You can call me Mal if you like Member

    Joined:
    Feb 27, 2021
    Messages:
    25
    Location:
    yes
    Edit 3: I found the issue, nevermind. The issue is arbitrary and annoying, but I found it
    What was it? I forgot to add an even before one of the mapping files. If you still want to read my slow descent into insanity, then be my guest

    Alright, this is kind of complicated to explain, so bare with me

    I've been optimizing Sonic 2 in both CPU speed and space, and I'm currently on OBJ1A and OBJ1F (the collapsing platforms). I changed the initiation codes to this, along with removing the unused slope data and delay data. This is what I currently have
    Most changes are in the initiation and removal of unused slope data, because the bug I'm about to talk about stopped me from doing anything more
    Code:
    ; ===========================================================================
    ; ----------------------------------------------------------------------------
    ; Object 1A - Collapsing platform from HPZ
    ;
    ; Unlike Object 1F, this supports sloped platforms and subtype-dependant
    ; mappings. Both are used by GHZ, the latter to allow different shading
    ; on right-facing ledges.
    
    ; Most of those features will be removed in due time, because I'm optimising
    ; this form HPZ use secifically
    ; ----------------------------------------------------------------------------
    ; Sprite_108BC:
    Obj1A:
        moveq    #0,d0
        move.b    routine(a0),d0
        move.w    Obj1A_Index(pc,d0.w),d1
        jmp    Obj1A_Index(pc,d1.w)
    ; ===========================================================================
    ; off_108CA:
    Obj1A_Index:    offsetTable
            offsetTableEntry.w Obj1A_Init        ; 0
            offsetTableEntry.w Obj1A_Main        ; 2
            offsetTableEntry.w Obj1A_Fragment    ; 4
    ; ===========================================================================
    
    collapsing_platform_delay_pointer = objoff_34
    collapsing_platform_delay_counter = objoff_38
    collapsing_platform_stood_on_flag = objoff_3A
    collapsing_platform_slope_pointer = objoff_3C
    
    ; loc_108D0:
    Obj1A_Init:
        addq.b    #2,routine(a0)
        move.l    #Obj1A_MapUnc_1101C,mappings(a0)
        move.w    #make_art_tile(ArtTile_ArtNem_HPZPlatform,2,0),art_tile(a0)
    ;    bsr.w    Adjust2PArtPointer
        ori.b    #4,render_flags(a0)
        move.b    #4,priority(a0)
        move.b    #$30,width_pixels(a0)
        move.b    #7,collapsing_platform_delay_counter(a0)
        move.b    subtype(a0),mapping_frame(a0)
        move.l    #Obj1A_HPZ_SlopeData,collapsing_platform_slope_pointer(a0)
        move.l    #Obj1A_HPZ_DelayData,collapsing_platform_delay_pointer(a0)
    
    ; loc_1097C:
    Obj1A_Main:
        tst.b    collapsing_platform_stood_on_flag(a0)
        beq.s    +
        tst.b    collapsing_platform_delay_counter(a0)
        beq.w    Obj1A_CreateFragments    ; time up; collapse
        subq.b    #1,collapsing_platform_delay_counter(a0)
    +
        move.b    status(a0),d0
        andi.b    #standing_mask,d0
        beq.s    sub_1099E
        move.b    #1,collapsing_platform_stood_on_flag(a0)
    
    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    
    
    sub_1099E:
        moveq    #0,d1
        move.b    width_pixels(a0),d1
        movea.l    collapsing_platform_slope_pointer(a0),a2 ; a2=object
        move.w    x_pos(a0),d4
        jsrto    (SlopedPlatform).l, JmpTo_SlopedPlatform
    ;    jsr    (SlopedPlatform).l
    ;    bsr.w    SlopedPlatform
        bra.w    MarkObjGone
    ; End of function sub_1099E
    
    ; ===========================================================================
    ; loc_109B4:
    Obj1A_Fragment:
        tst.b    collapsing_platform_delay_counter(a0)
        beq.s    Obj1A_FragmentFall    ; time up; collapse
        tst.b    collapsing_platform_stood_on_flag(a0)
        bne.s    +
        subq.b    #1,collapsing_platform_delay_counter(a0)
        bra.w    DisplaySprite
    ; ===========================================================================
    +
        bsr.w    sub_1099E
        subq.b    #1,collapsing_platform_delay_counter(a0)
        bne.s    +
        lea    (MainCharacter).w,a1 ; a1=character
        bsr.s    sub_109DC
        lea    (Sidekick).w,a1 ; a1=character
    
    sub_109DC:
        btst    #3,status(a1)
        beq.s    +
        bclr    #3,status(a1)
        bclr    #5,status(a1)
        move.b    #AniIDSonAni_Run,prev_anim(a1)    ; Force player's animation to restart
    +
        rts
    ; End of function sub_109DC
    
    ; ===========================================================================
    ; loc_109F8:
    Obj1A_FragmentFall:
        bsr.w    ObjectMoveAndFall
        tst.b    render_flags(a0)
        bpl.w    DeleteObject
        bra.w    DisplaySprite
    ; ===========================================================================
    ; ----------------------------------------------------------------------------
    ; Object 1F - Collapsing platform from ARZ, MCZ and OOZ (and MZ, SLZ and SBZ)
    ; MCZ goes first because ARZ has the same width_pixels, and it's exclusive to 2P
    ; ----------------------------------------------------------------------------
    ; Sprite_10A08:
    Obj1F:
        moveq    #0,d0
        move.b    routine(a0),d0
        move.w    Obj1F_Index(pc,d0.w),d1
        jmp    Obj1F_Index(pc,d1.w)
    ; ===========================================================================
    ; off_10A16:
    Obj1F_Index:    offsetTable
            offsetTableEntry.w Obj1F_Init        ; 0
            offsetTableEntry.w Obj1F_Main        ; 2
            offsetTableEntry.w Obj1F_Fragment    ; 4
    ; ===========================================================================
    ; loc_10A1C:
    Obj1F_Init:    ; MCZ is the top priority here, due to being in 2P Mode
        addq.b    #2,routine(a0)
        move.l    #Obj1F_MapUnc_11106,mappings(a0)
        move.w    #make_art_tile(ArtTile_ArtNem_MCZCollapsePlat,3,0),art_tile(a0)
        bsr.w    Adjust2PArtPointer
        ori.b    #4,render_flags(a0)
        move.b    #4,priority(a0)
        move.b    #7,collapsing_platform_delay_counter(a0)
        move.b    #$20,width_pixels(a0)    ; MCZ and ARZ are both 20
        move.l    #Obj1F_MCZ_DelayData,collapsing_platform_delay_pointer(a0)
    ;    tst.w    (Two_player_mode).w ; is it two player mode?
    ;    bne.s    Obj1F_Main          ; if so, skip all the other level checks. Could save a few init cycles in 2P Mode
        cmpi.b    #aquatic_ruin_zone,(Current_Zone).w
        bne.s    +
        move.l    #Obj1F_MapUnc_1115E,mappings(a0)
        move.w    #make_art_tile(ArtTile_ArtKos_LevelArt,2,0),art_tile(a0)
        move.l    #Obj1F_ARZ_DelayData,collapsing_platform_delay_pointer(a0)
    +
        cmpi.b    #oil_ocean_zone,(Current_Zone).w
        bne.s    +
        move.l    #Obj1F_MapUnc_110C6,mappings(a0)
        move.w    #make_art_tile(ArtTile_ArtNem_OOZPlatform,3,0),art_tile(a0)
        move.b    #$40,width_pixels(a0)    ; use the bigger collision
        move.l    #Obj1F_OOZ_DelayData,collapsing_platform_delay_pointer(a0)
    +
        cmpi.b    #hidden_palace_zone,(Current_Zone).w
        bne.s    +
        move.l    #Obj1A_MapUnc_1101C,mappings(a0)
        move.w    #make_art_tile(ArtTile_ArtNem_HPZPlatform,2,0),art_tile(a0)
    ;    bsr.w    Adjust2PArtPointer
        move.b    #$30,width_pixels(a0)
        move.l    #Obj1A_HPZ_DelayData,collapsing_platform_delay_pointer(a0)
    +
    ; loc_10AD6:
    Obj1F_Main:
        tst.b    collapsing_platform_stood_on_flag(a0)
        beq.s    +
        tst.b    collapsing_platform_delay_counter(a0)
        beq.w    Obj1F_CreateFragments    ; time up; collapse
        subq.b    #1,collapsing_platform_delay_counter(a0)
    +
        move.b    status(a0),d0
        andi.b    #standing_mask,d0
        beq.s    sub_10AF8
        move.b    #1,collapsing_platform_stood_on_flag(a0)
    
    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    
    
    sub_10AF8:
        moveq    #0,d1
        move.b    width_pixels(a0),d1
        move.w    #$10,d3
        move.w    x_pos(a0),d4
        jsrto    (PlatformObject).l, JmpTo2_PlatformObject
    ;    jsr    (PlatformObject).l
    ;    bsr.w    PlatformObject
        bra.w    MarkObjGone
    ; End of function sub_10AF8
    
    ; ===========================================================================
    ; loc_10B0E:
    Obj1F_Fragment:
        tst.b    collapsing_platform_delay_counter(a0)
        beq.s    Obj1F_FragmentFall    ; time up; collapse
        tst.b    collapsing_platform_stood_on_flag(a0)
        bne.s    +
        subq.b    #1,collapsing_platform_delay_counter(a0)
        bra.w    DisplaySprite
    ; ===========================================================================
    +
        bsr.w    sub_10AF8
        subq.b    #1,collapsing_platform_delay_counter(a0)
        bne.s    +    ; rts
        lea    (MainCharacter).w,a1 ; a1=character
        bsr.s    sub_10B36
        lea    (Sidekick).w,a1 ; a1=character
    
    sub_10B36:
        btst    #3,status(a1)
        beq.s    +    ; rts
        bclr    #3,status(a1)
        bclr    #5,status(a1)
        move.b    #AniIDSonAni_Run,prev_anim(a1)    ; Force player's animation to restart
    +
        rts
    ; End of function sub_10B36
    
    ; ===========================================================================
    ; loc_10B52:
    Obj1F_FragmentFall:
        bsr.w    ObjectMoveAndFall
        tst.b    render_flags(a0)
        bpl.w    DeleteObject
        bra.w    DisplaySprite
    ; ===========================================================================
    ; loc_10B62:
    Obj1F_CreateFragments:
    ; loc_10B68:
    Obj1A_CreateFragments:
        move.b    #1,mapping_frame(a0)
    +
        movea.l    collapsing_platform_delay_pointer(a0),a4
        moveq    #0,d0
        move.b    mapping_frame(a0),d0
        add.w    d0,d0
        movea.l    mappings(a0),a3
        adda.w    (a3,d0.w),a3
        move.w    (a3)+,d1
        subq.w    #1,d1
        bset    #5,render_flags(a0)
        _move.b    id(a0),d4
        move.b    render_flags(a0),d5
        movea.l    a0,a1
        bra.s    +
    ; ===========================================================================
    -    bsr.w    SingleObjLoad
        bne.s    +++
        addq.w    #8,a3
    +
        move.b    #4,routine(a1)
        _move.b    d4,id(a1) ; load obj1F
        move.l    a3,mappings(a1)
        move.b    d5,render_flags(a1)
        move.w    x_pos(a0),x_pos(a1)
        move.w    y_pos(a0),y_pos(a1)
        move.w    art_tile(a0),art_tile(a1)
        move.b    priority(a0),priority(a1)
        move.b    width_pixels(a0),width_pixels(a1)
        move.b    y_radius(a0),y_radius(a1)
        move.b    (a4)+,collapsing_platform_delay_counter(a1)
        cmpa.l    a0,a1
        bhs.s    +
        bsr.w    DisplaySprite2
    +    dbf    d1,-
    +
        bsr.w    DisplaySprite
        move.w    #SndID_Smash,d0
        jmp    (PlaySound).l
    ; ===========================================================================
    ; Delay data for obj1A in HPZ:
    ;byte_10C0B:
    Obj1A_HPZ_DelayData:
        dc.b $18,$1C,$20,$1E,$1A,$16,  6, $E,$14,$12, $A,  2
    
    ;byte_10FEC:
    Obj1A_HPZ_SlopeData:
        dc.b $10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10
        dc.b $10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10
        dc.b $10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10
    
    ; Delay data for obj1F in ARZ:
    ;byte_10C34:
    Obj1F_ARZ_DelayData:
        dc.b $16,$1A,$18,$12,  6, $E, $A,  2
    
    ; Delay data for obj1F in MCZ:
    ;byte_10C2E:
    Obj1F_MCZ_DelayData:
        dc.b $1A,$16,$12, $E, $A,  2
    
    ; Delay data for obj1F in OOZ:
    ;byte_10C27:
    Obj1F_OOZ_DelayData:
        dc.b $1A,$12, $A,  2,$16, $E,  6
    
    ; ----------------------------------------------------------------------------
    ; sprite mappings (HPZ)
    ; ----------------------------------------------------------------------------
    Obj1A_MapUnc_1101C:    BINCLUDE "mappings/sprite/obj1A_b.bin"
    ; ----------------------------------------------------------------------------
    
    ; ----------------------------------------------------------------------------
    ; sprite mappings (OOZ)
    ; ----------------------------------------------------------------------------
    Obj1F_MapUnc_110C6:    BINCLUDE "mappings/sprite/obj1F_b.bin"
    ; -------------------------------------------------------------------------------
    ; sprite mappings (MCZ)
    ; -------------------------------------------------------------------------------
    Obj1F_MapUnc_11106:    BINCLUDE "mappings/sprite/obj1F_c.bin"
    ; -------------------------------------------------------------------------------
    ; sprite mappings (ARZ)
    ; -------------------------------------------------------------------------------
    Obj1F_MapUnc_1115E:    BINCLUDE "mappings/sprite/obj1F_d.bin"
    ; ===========================================================================
    
        if ~~removeJmpTos
    JmpTo_SlopedPlatform ; JmpTo
        jmp    (SlopedPlatform).l
    JmpTo2_PlatformObject ; JmpTo
        jmp    (PlatformObject).l
    
        align 4
        endif
    

    When doing this, JmpTo2_PlatformObject and JmpTo_SlopedObject, Jmpto's that only these objects use, got "misaligned". Changing SlopedObject to always be a simple jsr to that code fixed that (or at least, it removed the error), but changing PlatformObject like that made errors like this (long story short, most of the game got misaligned. Note that this also happens when I turn on RemoveJmptos)

    Code:
    > > > s2.asm(21271): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21272): warning: address is not properly aligned
    > > >  move.b routine(a0),d0
    > > > s2.asm(21273): warning: address is not properly aligned
    > > >  move.w Obj1C_Index(pc,d0.w),d1
    > > > s2.asm(21274): warning: address is not properly aligned
    > > >  jmp Obj1C_Index(pc,d1.w)
    > > > s2.asm(21338): warning: address is not properly aligned
    > > >  addq.b #2,routine(a0)
    > > > s2.asm(21339): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21340): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21341): warning: address is not properly aligned
    > > >  move.w d0,d1
    > > > s2.asm(21342): warning: address is not properly aligned
    > > >  lsl.w #3,d0
    > > > s2.asm(21343): warning: address is not properly aligned
    > > >  lea Obj1C_InitData(pc),a1
    > > > s2.asm(21344): warning: address is not properly aligned
    > > >  lea (a1,d0.w),a1
    > > > s2.asm(21345): warning: address is not properly aligned
    > > >  move.b (a1),mapping_frame(a0)
    > > > s2.asm(21346): warning: address is not properly aligned
    > > >  move.l (a1)+,mappings(a0)
    > > > s2.asm(21347): warning: address is not properly aligned
    > > >  move.w (a1)+,art_tile(a0)
    > > > s2.asm(21348): warning: address is not properly aligned
    > > >  bsr.w Adjust2PArtPointer
    > > > s2.asm(21349): warning: address is not properly aligned
    > > >  ori.b #4,render_flags(a0)
    > > > s2.asm(21350): warning: address is not properly aligned
    > > >  move.b (a1)+,width_pixels(a0)
    > > > s2.asm(21351): warning: address is not properly aligned
    > > >  move.b (a1)+,priority(a0)
    > > > s2.asm(21352): warning: address is not properly aligned
    > > >  lea Obj1C_Radii(pc),a1
    > > > s2.asm(21353): warning: address is not properly aligned
    > > >  move.b (a1,d1.w),d1
    > > > s2.asm(21354): warning: address is not properly aligned
    > > >  beq.s BranchTo_MarkObjGone ; if the radius is zero, branch
    > > > s2.asm(21355): warning: address is not properly aligned
    > > >  move.b d1,y_radius(a0)
    > > > s2.asm(21356): warning: address is not properly aligned
    > > >  bset #4,render_flags(a0)
    > > > s2.asm(21359): warning: address is not properly aligned
    > > >  bra.w MarkObjGone
    > > > s2.asm(21366): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21367): warning: address is not properly aligned
    > > >  move.b routine(a0),d0
    > > > s2.asm(21368): warning: address is not properly aligned
    > > >  move.w Obj71_Index(pc,d0.w),d1
    > > > s2.asm(21369): warning: address is not properly aligned
    > > >  jmp Obj71_Index(pc,d1.w)
    > > > s2.asm(21384): warning: address is not properly aligned
    > > >  addq.b #2,routine(a0)
    > > > s2.asm(21385): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21386): warning: address is not properly aligned
    > > >  andi.w #$F,d0
    > > > s2.asm(21387): warning: address is not properly aligned
    > > >  lsl.w #3,d0
    > > > s2.asm(21388): warning: address is not properly aligned
    > > >  lea Obj71_InitData(pc),a1
    > > > s2.asm(21389): warning: address is not properly aligned
    > > >  lea (a1,d0.w),a1
    > > > s2.asm(21390): warning: address is not properly aligned
    > > >  move.b (a1),mapping_frame(a0)
    > > > s2.asm(21391): warning: address is not properly aligned
    > > >  move.l (a1)+,mappings(a0)
    > > > s2.asm(21392): warning: address is not properly aligned
    > > >  move.w (a1)+,art_tile(a0)
    > > > s2.asm(21393): warning: address is not properly aligned
    > > >  bsr.w Adjust2PArtPointer
    > > > s2.asm(21394): warning: address is not properly aligned
    > > >  ori.b #4,render_flags(a0)
    > > > s2.asm(21395): warning: address is not properly aligned
    > > >  move.b (a1)+,width_pixels(a0)
    > > > s2.asm(21396): warning: address is not properly aligned
    > > >  move.b (a1)+,priority(a0)
    > > > s2.asm(21397): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21398): warning: address is not properly aligned
    > > >  andi.w #$F0,d0
    > > > s2.asm(21399): warning: address is not properly aligned
    > > >  lsr.b #4,d0
    > > > s2.asm(21400): warning: address is not properly aligned
    > > >  move.b d0,anim(a0)
    > > > s2.asm(21403): warning: address is not properly aligned
    > > >  lea (Ani_obj71).l,a1
    > > > s2.asm(21404): warning: address is not properly aligned
    > > >  bsr.w AnimateSprite
    > > > s2.asm(21405): warning: address is not properly aligned
    > > >  bra.w MarkObjGone
    > > > s2.asm(21271): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21272): warning: address is not properly aligned
    > > >  move.b routine(a0),d0
    > > > s2.asm(21273): warning: address is not properly aligned
    > > >  move.w Obj1C_Index(pc,d0.w),d1
    > > > s2.asm(21274): warning: address is not properly aligned
    > > >  jmp Obj1C_Index(pc,d1.w)
    > > > s2.asm(21338): warning: address is not properly aligned
    > > >  addq.b #2,routine(a0)
    > > > s2.asm(21339): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21340): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21341): warning: address is not properly aligned
    > > >  move.w d0,d1
    > > > s2.asm(21342): warning: address is not properly aligned
    > > >  lsl.w #3,d0
    > > > s2.asm(21343): warning: address is not properly aligned
    > > >  lea Obj1C_InitData(pc),a1
    > > > s2.asm(21344): warning: address is not properly aligned
    > > >  lea (a1,d0.w),a1
    > > > s2.asm(21345): warning: address is not properly aligned
    > > >  move.b (a1),mapping_frame(a0)
    > > > s2.asm(21346): warning: address is not properly aligned
    > > >  move.l (a1)+,mappings(a0)
    > > > s2.asm(21347): warning: address is not properly aligned
    > > >  move.w (a1)+,art_tile(a0)
    > > > s2.asm(21348): warning: address is not properly aligned
    > > >  bsr.w Adjust2PArtPointer
    > > > s2.asm(21349): warning: address is not properly aligned
    > > >  ori.b #4,render_flags(a0)
    > > > s2.asm(21350): warning: address is not properly aligned
    > > >  move.b (a1)+,width_pixels(a0)
    > > > s2.asm(21351): warning: address is not properly aligned
    > > >  move.b (a1)+,priority(a0)
    > > > s2.asm(21352): warning: address is not properly aligned
    > > >  lea Obj1C_Radii(pc),a1
    > > > s2.asm(21353): warning: address is not properly aligned
    > > >  move.b (a1,d1.w),d1
    > > > s2.asm(21354): warning: address is not properly aligned
    > > >  beq.s BranchTo_MarkObjGone ; if the radius is zero, branch
    > > > s2.asm(21355): warning: address is not properly aligned
    > > >  move.b d1,y_radius(a0)
    > > > s2.asm(21356): warning: address is not properly aligned
    > > >  bset #4,render_flags(a0)
    > > > s2.asm(21359): warning: address is not properly aligned
    > > >  bra.w MarkObjGone
    > > > s2.asm(21366): warning: address is not properly aligned
    > > >  moveq #0,d0
    > > > s2.asm(21367): warning: address is not properly aligned
    > > >  move.b routine(a0),d0
    > > > s2.asm(21368): warning: address is not properly aligned
    > > >  move.w Obj71_Index(pc,d0.w),d1
    > > > s2.asm(21369): warning: address is not properly aligned
    > > >  jmp Obj71_Index(pc,d1.w)
    > > > s2.asm(21384): warning: address is not properly aligned
    > > >  addq.b #2,routine(a0)
    > > > s2.asm(21385): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21386): warning: address is not properly aligned
    > > >  andi.w #$F,d0
    > > > s2.asm(21387): warning: address is not properly aligned
    > > >  lsl.w #3,d0
    > > > s2.asm(21388): warning: address is not properly aligned
    > > >  lea Obj71_InitData(pc),a1
    > > > s2.asm(21389): warning: address is not properly aligned
    > > >  lea (a1,d0.w),a1
    > > > s2.asm(21390): warning: address is not properly aligned
    > > >  move.b (a1),mapping_frame(a0)
    > > > s2.asm(21391): warning: address is not properly aligned
    > > >  move.l (a1)+,mappings(a0)
    > > > s2.asm(21392): warning: address is not properly aligned
    > > >  move.w (a1)+,art_tile(a0)
    > > > s2.asm(21393): warning: address is not properly aligned
    > > >  bsr.w Adjust2PArtPointer
    > > > s2.asm(21394): warning: address is not properly aligned
    > > >  ori.b #4,render_flags(a0)
    > > > s2.asm(21395): warning: address is not properly aligned
    > > >  move.b (a1)+,width_pixels(a0)
    > > > s2.asm(21396): warning: address is not properly aligned
    > > >  move.b (a1)+,priority(a0)
    > > > s2.asm(21397): warning: address is not properly aligned
    > > >  move.b subtype(a0),d0
    > > > s2.asm(21398): warning: address is not properly aligned
    > > >  andi.w #$F0,d0
    > > > s2.asm(21399): warning: address is not properly aligned
    > > >  lsr.b #4,d0
    > > > s2.asm(21400): warning: address is not properly aligned
    > > >  move.b d0,anim(a0)
    > > > s2.asm(21403): warning: address is not properly aligned
    > > >  lea (Ani_obj71).l,a1
    > > > s2.asm(21404): warning: address is not properly aligned
    > > >  bsr.w AnimateSprite
    > > > s2.asm(21405): warning: address is not properly aligned
    > > >  bra.w MarkObjGone
    
    That's quite long... If you continue, then the most random of things can crash the game, like getting anywhere near monitors

    I just ignored JmpTo2_PlatformObject at this point, and make what uses it always jsr to PlatformObject regardless of setting, just like SlopedObject. It only gives the error that JmpTo2_PlatformObject is misaligned, which is still annoying, but it doesn't randomly crash the game wherever the hell it wanted to so that's cool... so why does the object itself now crash the game? I'm not even using the misaligned JmpTo2_PlatformObject! Did I do something that crashes the game during it's initiation or something? Nothing seems out of place, and the code is literally skipping the misaligned jmpto that would crash it in the first place. Also, note that it crashes in EVERY zone.

    Obj1A crashes the game too for similar reasons. (I think it didn't give error when I removed it because it's only Jmpto_SlopedObject in the game. Other branches to that code are bsr.w)
    But that begs the question: what is crashing the game?

    After I realized that, I moved the jmptos to the end of an object close to it, OBJ1C, because it specifically says that it's misaligned. It also gave that giant list of misalignment errors I've shown above

    I removed the JmpTo2_PlatformObject again and changed all the jmpto's to PlatformObject by hand to have the right numbers (jmpto3 to jmpto2, 4 to 3, 8 to 7, etc), and it gave the same errors as above, again

    By the way, did I mention that the definition of insanity is repeating the same thing over ad over again, expecting different results?. I'm genuinely at a loss on this

    So, I have two questions:
    1. Why and how has it gotten misaligned in the first place? This has only happened to me with this object, and I see no logical reason as to why this would even happen to begin with.
    2. How can I fix this? Preferably without the jmpto's because jsring to a jmp is very wasteful on an object that already wastes a ton of cycles
    edit: grammar

    Edit 2: I installed a debugger to figure out exactly what's crashing the game, along with adding align 12 before the jmptos. Whever you're using indirect bsr.w's to a jmp or a dircet jsr, someone else crashes the game now. I'll type the errors down below

    Address: Obj1A_MapUnc_1101C+2 (it'll always be the objects mappings +2)
    Location: 00016226
    Module: BuildSprites_DrawSprite+0016
    Caller: Level_MainLoop+0066

    The location points to a seemingly inconsequential line in BuildSprites_DrawSprite
    Code:
       27402/   16210 :                     BuildSprites_DrawSprite:
       27403/   16210 : 2268 0004               movea.l    mappings(a0),a1
       27404/   16214 : 7200                    moveq    #0,d1
       27405/   16216 : 0804 0005               btst    #5,d4    ; is the static mappings flag set?
       27406/   1621A : 6610                    bne.s    +    ; if it is, branch
       27407/   1621C : 1228 001A               move.b    mapping_frame(a0),d1
       27408/   16220 : D241                    add.w    d1,d1
       27409/   16222 : D2F1 1000               adda.w    (a1,d1.w),a1
       27410/   16226 : 3219                    move.w    (a1)+,d1    ; I don't know why this of all things crashes both Obj1A and Obj1F, but it does now
       27411/   16228 : 5341                    subq.w    #1,d1    ; get number of pieces
       27412/   1622A : 6B04                    bmi.s    ++    ; if there are 0 pieces, branch
       27413/   1622C :                     +
       27414/   1622C : 6100 0128               bsr.w    DrawSprite    ; draw the sprite
       27415/   16230 :                     +
       27416/   16230 : 0028 0080 0001          ori.b    #$80,render_flags(a0)    ; set on-screen flag
    
     
    Last edited: Feb 21, 2022
  20. Dark Shamil Khan

    Dark Shamil Khan TASer lol Member

    Joined:
    Nov 7, 2021
    Messages:
    51
    Location:
    Pakistan
    What emulator is better for recording SMS games? Bizhawk or Kega Fusion. (I am guessing it was asked here beforehand but I wanted to try and make a walkthrough of hack. =P)
    Edit: nvm, I just needed to scroll upwards lol.