Basic Questions and Answers Thread

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

  1. Alegamer700

    Alegamer700 Newcomer Member

    Joined:
    Jun 14, 2021
    Messages:
    18
    Location:
    Somewhere in South America
    Yeah, i know that I deleted the last post I did in this thread, but now i'm going to make a question about something else.

    I'm trying to port the respawn feature from the sonic 1 prototype ( ). I know that 2 lines makes the code not work, but idk which. This is the code I have:
    Code:
    ReAppear:
            move.b    (v_jpadpress2).w,d0
            andi.b    #btnABC,d0
            beq.s    ReAppr_End
            andi.b    #btnA,d0
            bne.s    ReAppr_End
            move.b    #id_Walk,obAnim(a0)        ; Respawns you after a death
            subq.b    #4,obRoutine(a0)    ; The lines above seem to make the code do nothing
            move.w    $38(a0),obY(a0)
            move.w    #120,flashtime(a0)    ; set sonic to be invulnerable for 2 seconds
    
    ReAppr_End:
            rts
    If someone founds something else just tell me
    (Also, the Sonic 1 Beta disassembly is cortesy of Filter)
     
  2. JGamer2151

    JGamer2151 Well-Known Member/Lurker Member

    Joined:
    Dec 1, 2020
    Messages:
    96
    88 in pure decimal equates to 58 in hex, which unless you have extended music slots it won’t work this way.

    I know this is already old at this point, but still.
     
  3. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    Yes, that is more or less what I said.
     
    Last edited: Sep 26, 2023
    JGamer2151, nineko and DeltaWooloo like this.
  4. Arandomguy

    Arandomguy Newcomer Trialist

    Joined:
    Apr 7, 2023
    Messages:
    9
    Where are the Z80 Banks locations from Knuckles Chaotix'? I may be stupid, but where are they exactly?
     
  5. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
  6. Arandomguy

    Arandomguy Newcomer Trialist

    Joined:
    Apr 7, 2023
    Messages:
    9
    But the location i am looking for is Midnight Greenhouse.
     
  7. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    Look harder, it's the 5th entry in the list there.
     
  8. Arandomguy

    Arandomguy Newcomer Trialist

    Joined:
    Apr 7, 2023
    Messages:
    9
    How do i can loop a MIDI with "Sekaiju"?
     
  9. Delta

    Delta Newcomer Member

    Joined:
    Nov 27, 2022
    Messages:
    11
    How do i fix a black screen after adding the Sonic 2 Clone Driver into a clean dissasembly? i already tried to find some answers, but sadly none.
     
  10. Miles Sebas Prower

    Miles Sebas Prower Newcomer Member

    Joined:
    Aug 22, 2023
    Messages:
    21
    Location:
    Alvarenga, Charallave
    Yeah, when I took a look at it, I have noticed.. yeah, I forgot about that, since I think GitHub's version didn't have the $, thanks for pointing it out
     
  11. Miles Sebas Prower

    Miles Sebas Prower Newcomer Member

    Joined:
    Aug 22, 2023
    Messages:
    21
    Location:
    Alvarenga, Charallave
    So ever since I made the speed issues fixes in a Sonic 2 hack I'm doing, I got a black screen when I got to check it, then, after applying the Super Sonic bugs fixes, I've got an graphics bug issue that I've never noticed until I made the 14 continues bug fix (AKA the bug where the Oil Ocean Zone theme plays forever), the continue screen is fine when a continue is gotten, but getting two or more continues breaks the continue screen, leading to this: 20230915_155238.jpg

    Does anyone know how I can fix the continue screen and make it not look like this? I tried to look for some information about this, but unfortunately, none. Here's my current asm file, since I'm not sure what's causing the graphics bug issue
    https://mega.nz/file/WHhgQBTY#25WoMA8df9YADriefwDMOpcDBjtHzmvMJJ9lWbaPevY
     

    Attached Files:

  12. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    That's a bug in the Xenowhirl disassembly. Multiple parts of Sonic 2 were disassembled incorrectly, causing the game to break when you edit it. I know that there's also an object somewhere whose data was accidentally turned into code, but I can't remember which. That disassembly's 16 years old, so I recommend using something newer, like the Git disassembly.
     
  13. JGamer2151

    JGamer2151 Well-Known Member/Lurker Member

    Joined:
    Dec 1, 2020
    Messages:
    96
    Interestingly enough to me, I’ve used the 2007 Xenowhirl disassembly for Sonic 2 hacking for a while when I started hacking Sonic 2 up until I switched over to the GitHub disassembly as early as 2018 from what I remember because it’s more up to date. The main reason for that change was because of the music and sound pointers, which were hardcoded in the Xenowhirl disassembly but have changed to constants in the GitHub disassembly. Other than that, the GitHub disassembly is my main disassembly for Sonic 2 hacking.
     
  14. Miles Sebas Prower

    Miles Sebas Prower Newcomer Member

    Joined:
    Aug 22, 2023
    Messages:
    21
    Location:
    Alvarenga, Charallave
    Specific parts like the speed codes and the Super Sonic code in my case? Now that you say it, it now gets me thinking that the Xenowhirl disassembly is obsolete, I think that must be the main reason why the game itself breaks if specific code is edited, even if it's just for a bug fix. Well, time to move to the GitHub disassembly, I have no choice but to use it, since I don't want the graphics bug to happen
     
  15. Miles Sebas Prower

    Miles Sebas Prower Newcomer Member

    Joined:
    Aug 22, 2023
    Messages:
    21
    Location:
    Alvarenga, Charallave
    I need help to optimize the code for the invincibility music after breaking a Super monitor without the powerup in Sonic 3 & Knuckles to fix a bug where the invincibility music doesn't play at all if a Super monitor is broken and the player doesn't have invincibility.
    Code:
    Sonic 3
    Monitor_Give_SuperSonic:
            addq.w    #1,(a2)
            addi.w    #50,(Ring_count).w
            move.b    #1,(Super_palette_status).w
            move.b    #$F,(Palette_timer).w
            move.b    #1,(Super_Sonic_Knux_flag).w
            move.w    #60,(Super_frame_count).w
            move.l    #Map_SuperSonic,(Player_1+mappings).w
            move.b    #$81,(Player_1+object_control).w
            move.b    #$1F,(Player_1+anim).w
            move.l    #Obj_SuperSonic_Stars,(Super_stars).w
            move.w    #$A00,(Max_speed).w
            move.w    #$30,(Acceleration).w
            move.w    #$100,(Deceleration).w
            move.b    #0,(Player_1+invincibility_timer).w
            bset    #1,$2B(a1)
            moveq    #signextendB(sfx_Whistle),d0
            jsr    (Play_SFX).l
            btst    #1,$2B(a1)    ;  <-
            bne.s    locret_1B8DF    ;  <-
            moveq    #signextendB(mus_Invincibility),d0
            jmp    (Play_Music).l
    ; ---------------------------------------------------------------------------
    locret_1B8DF:
            rts
    Code:
    Sonic & Knuckles/Sonic 3 & Knuckles
        .continued:
            move.b    #$81,(Player_1+object_control).w
            move.b    #0,(Player_1+invincibility_timer).w
            bset    #Status_Invincible,status_secondary(a1)
            moveq    #signextendB(sfx_SuperTransform),d0
            jsr    (Play_SFX).l
            btst    #1,$2B(a1)    ; Is invincility music already playing? <-
            bne.s    locret_1DB25    ; Resume music instead of restarting it if it's already playing <-
            moveq    #signextendB(mus_Invincibility),d0        ; play invincibility theme
            jmp    (Play_Music).l
    ; ---------------------------------------------------------------------------
    locret_1DB25:
            rts
    I know that this is by the pointed lines that I added, but I am not sure how I'm supposed to program it to play if the monitor is broken without the invincibility, or skip the play commands if the music is playing already
    (Using the bne just makes the BGM there resume instead of playing the invincibility music)
    EDIT: Nevermind, forget it, I already saw the issue, since I already noticed what was going on here
     
    Last edited: Oct 27, 2023
  16. Catswell

    Catswell Plushy lazy cat Member

    Joined:
    Aug 2, 2017
    Messages:
    37
    Location:
    Star Light Zone
    I wonder if it's possible to make hack go right to the level, skipping SEGA/title screens. Specifically on S1 Hivebrain (2005) disassembly.

    EDIT: Friend helped me to find a solution
     
    Last edited: Nov 13, 2023
  17. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    It's as easy as setting game mode to level from the very start.

    Locate this line before the "MainGameLoop:"
    Code:
            move.b  #0,($FFFFF600).w ; set Game Mode to Sega Screen
    
    MainGameLoop:
    and replace with:
    Code:
            move.b  #$C,($FFFFF600).w ; set Game Mode to Level
    
    MainGameLoop:
    
    Now boot up your game... and realize the screen is completely empty, even though the game is playable. This is because "Level" game mode doesn't enable display (rendering) bit on the VDP, it just relies on previous game modes to do so.

    You can find the missing piece to enable display under "SegaScreen:"
    Code:
            move.w  ($FFFFF60C).w,d0
            ori.b   #$40,d0
            move.w  d0,($C00004).l
    You can copy-paste this code above "Level_TtlCard:" and level should now display normally.
     
    Catswell likes this.
  18. That-One-Mega-Man

    That-One-Mega-Man Doofus Maximus Member

    Joined:
    Jun 18, 2023
    Messages:
    32
    Location:
    Right behind you
    upload_2023-11-19_12-22-23.png

    so i'm trying to make a flash happen before the boss appears
    but its
    uh
    not going well as you can see
    the palette gets stuck here
    Code:
    loc_6ED0:
            move.w    #$C3,d0
            bsr.w    PlaySound_Special
            bsr.w    Pal_MakeFlash
            bsr.w    Pal_WhiteToBlack
            move.w    #$8C,d0
            bsr.w    PlaySound    ; play boss music
            move.b    #1,($FFFFF7AA).w ; lock    screen
            addq.b    #2,($FFFFF742).w
            moveq    #$11,d0
            bra.w    LoadPLC        ; load boss patterns
    here's what ive got in terms of code
    can yall tell me what im doin wrong?
     
  19. Thiago REzEnDe

    Thiago REzEnDe Newcomer Trialist

    Joined:
    Sep 17, 2022
    Messages:
    9
    Location:
    Hill Valey, California
    This Line is causing the problem. Remove it and it should work.
     
  20. That-One-Mega-Man

    That-One-Mega-Man Doofus Maximus Member

    Joined:
    Jun 18, 2023
    Messages:
    32
    Location:
    Right behind you
    i added it because it gets stuck on a brighter white if i dont have it
    help me two.png
     
    Last edited: Nov 20, 2023