Basic Questions and Answers Thread

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

  1. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Hello, This question may be dumb but i want to know how to add custom background to sonic 1 i want to modify Green Hill And Labyrinth Zone, i am using Hivebrain 2005 disassembly
     
  2. PeanutNoceda

    PeanutNoceda Well-Known member Member

    Joined:
    Sep 26, 2024
    Messages:
    95
    Location:
    My house
    You need SonLVL to add new backgrounds for zones, with GHZ is a bit complicated because it uses 2 art files, you need to convert them to 1 art file, and with labyrinth… its not a hard work, because it uses 1 art file, im not in my PC in these moments but to add new background in zones you need to delete Unused chunks, blocks and tilesets to avoid glitches in the background art, oh, and as an extra, to port a new background you need an 265X265 image if i remember right.
    [If i explained some things bad, please, let me know to edit this post]
     
    Blue Gamer likes this.
  3. CutieGundam

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

    Joined:
    Jul 10, 2023
    Messages:
    41
    While doing a 32X port of Sonic 1 using a REV01 2005 Hivebrain Sonic 1 source code I made myself (using the files and codes taken from Clownacy's port that used that ridicu... I mean... amazing Pokémon image... :p), a few errors (several, in fact) happened.

    Code:
    SONIC1.ASM(39667) : Error : Illegal value (8918994)
     jsr (joypad_read).w
    _INC\SBZ PALLET SCRIPT 1.ASM(6) : Error : Illegal value (8921824)
    _INC\SBZ PALLET SCRIPT 1.ASM(9) : Error : Illegal value (8921840)
    _INC\SBZ PALLET SCRIPT 1.ASM(12) : Error : Illegal value (8921856)
    _INC\SBZ PALLET SCRIPT 1.ASM(15) : Error : Illegal value (8921884)
    _INC\SBZ PALLET SCRIPT 1.ASM(18) : Error : Illegal value (8921900)
    _INC\SBZ PALLET SCRIPT 1.ASM(21) : Error : Illegal value (8921916)
    _INC\SBZ PALLET SCRIPT 1.ASM(24) : Error : Illegal value (8921948)
    _INC\SBZ PALLET SCRIPT 1.ASM(27) : Error : Illegal value (8921950)
    _INC\SBZ PALLET SCRIPT 1.ASM(30) : Error : Illegal value (8921952)
    _INC\SBZ PALLET SCRIPT 2.ASM(6) : Error : Illegal value (8921824)
    _INC\SBZ PALLET SCRIPT 2.ASM(9) : Error : Illegal value (8921840)
    _INC\SBZ PALLET SCRIPT 2.ASM(12) : Error : Illegal value (8921958)
    _INC\SBZ PALLET SCRIPT 2.ASM(15) : Error : Illegal value (8921900)
    _INC\SBZ PALLET SCRIPT 2.ASM(18) : Error : Illegal value (8921948)
    _INC\SBZ PALLET SCRIPT 2.ASM(21) : Error : Illegal value (8921950)
    _INC\SBZ PALLET SCRIPT 2.ASM(24) : Error : Illegal value (8921952)
    
    And yes, I fixed the SEGA sound, that's why there's a "joypad_read". So, what's happening in there?
     
  4. Devon

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

    Joined:
    Aug 26, 2013
    Messages:
    1,461
    Location:
    your mom
    Okay, when the 32X is enabled, cartridge memory is moved into the 32X's address space. The first 512 KiB is accessed in addresses 0x880000 through 0x8FFFFF, and to access the rest, you must pick a 1 MiB bank, which is mapped to 0x900000 through 0x9FFFFF. This means that you cannot do word address accesses, since none of those addresses can fit in 16 bits.

    To fix the first one, just remove the parenthesis and the ".w". To fix the rest, you must make the pointers to the palettes defined via a "dc.l" instead of a "dc.w", and then fix up the SBZ palette cycling code to take account for that.

    I will warn you though, the 32X is a finicky piece of fucking shit hardware that was rushed out to market, and unless you are prepared for the absolutely frustrating challenges up ahead, you are probably gonna regret using it. Honestly? I really feel you should just straight up not bother, especially if you aren't even gonna make much use of the 32X hardware. I say that as someone who has made a ROM hack on the 32X, in which I never want to do ever again. You will have to rethink a lot on how the Genesis hardware works with the 32X forcing itself on it. Lemme explain some bits.

    You cannot safely do VDP DMAs from ROM while the 32X has access to the ROM. You must set a flag (RV), which does more memory mapping fuckery to prevent the 32X from accessing ROM and messing up DMAs. The 2 SH-2 CPUs on the 32X are also placed on the same bus, and if both of them try to access the space address in memory, for example, then the whole system can straight up crash. The Z80 is also affected, because with the way the Z80 accesses PSG, it can also screw up how the 32X accesses ROM, and the fix for that is to temporarily move the 68000 ROM bank window away from ROM while you access PSG. As for 32X features, it actually doesn't really have much going for it. 2 CPUs (again on the same bus), a frame buffer to do software rendering on (which doesn't even have enough memory to hold a full screen image in direct color mode, only packed pixel and RLE mode), and a basic stereo PWM audio sampler to stream sample data into. ROM access from the SH-2s is also the slowest out of the memory it can access (ROM, SDRAM, and internal cache), so for optimal performance, you'd wanna fit data in SDRAM and/or cache, and that can be annoying to deal with. On top of that, if the RV flag is set, if the SH-2s try to access ROM, it'll just read trash data, so you have to account for that (the PWM driver in the Clone Driver is taken from Chaotix, which streams PWM data directly from ROM, so that's one thing that will be affected).

    Really, the 32X is plagued with all kinds of weird quirks and poor design choices (see this for more info), and is absolutely not a good system to learn if you are still trying to figure things out on the base Genesis. It is a system that is best left for those who have an understanding of parallel computing (because the 32X runs in parallel with the Genesis), memory management, and processor communication to get the 32X to even work okay to begin with, and even with all that, you still need to be able to write an optimal software renderer for graphics (which has its own issues, like byte accesses on the frame buffer being slow, the fill rate being slow and unreliable), and understand what goes into streaming into the PWM chip. As it stands, there's not exactly a good enough 32X base for Sonic hacking out there. What we do have just do the bare minimum to get the 32X to even boot and run skeleton code. Sonic 1 is easier to get the 32X running from, since the entire ROM can fit in that fixed 512 KiB bank, and it doesn't do any VDP DMAs from ROM (Sonic's graphics are copied into work RAM first). But, once you start expanding from there, the 32X's shittiness will rear its ugly head and cause problems, which is made worse by the fact that there's not really a single 32X emulator out there that's accurate to hardware (Kega Fusion is straight up missing features).

    If none of this deters you, then I wish you luck, but I really suggest you first focus on the Genesis by itself, especially considering you even have to ask why you are getting those errors in the first place. If you *really* want those extra colors and the ability to use 3D graphics, then maybe RSDK or Sonic 3 AIR modding is more suitable for you.
     
    Last edited: Jan 27, 2025
    Blue Gamer and PeanutNoceda like this.
  5. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    How do I make level id 7 not go to GHZ act 2 or go to the sega screen after beating it but instead go to SYZ?
     
  6. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    I fixed it
     
    Last edited: Feb 1, 2025
  7. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    Seems like the mappings and/or dplc's are corrupted
     
  8. TheManThatPacs

    TheManThatPacs Newcomer Trialist

    Joined:
    Jan 9, 2025
    Messages:
    6
    hey, back here again, so im tryna make a sprite load in a specific part of the game, specifically in final zone replacing egman, but it's just crashing.

    i already have the art (uncompresed), mappings and dplc done, ready to show up, but it refuses to.

    what am i doing wrong? im on the github dissasembly. here's the code:
    upload_2025-1-29_19-24-58.png


    upload_2025-1-29_19-26-24.png
     

    Attached Files:

  9. AleDrawer2008

    AleDrawer2008 Active Member Member

    Joined:
    Jun 14, 2021
    Messages:
    31
    Location:
    Somewhere in South America
    the only thing I can say is:

    Not only the names does not match but also the PLCs (not to be confused with DPLCs) are only used with Nemesis-compressed art
     
  10. TheManThatPacs

    TheManThatPacs Newcomer Trialist

    Joined:
    Jan 9, 2025
    Messages:
    6
    i realized that after, thank you
     
  11. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    How do I port the 128 chunks(with the 2 seperate paths) from sonic 2 to sonic 1?
     
  12. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Can someone help me to fix that? i am using Hivebrain 2005 ASM68k disassembly
     
  13. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    you must've removed this code for scrap brain in the Sonic_LevelBound routine:
    Code:
    .bottom:
            move.w    (v_limitbtm1).w,d0
            move.w    (v_limitbtm2).w,d1
            cmp.w    d0,d1        ; screen still scrolling down?
            blt.s    .dontkill    ; if so, don't kill Sonic
            cmpi.w    #(id_SBZ<<8)+1,(v_zone).w ; is level SBZ2 ?
            bne.s    .skipKill1   ; if not SBZ2, skip to KillSonic
            cmpi.w    #$2000,(v_player+obX).w
            blo.s    .skipKill2   ; if below $2000, skip to KillSonic
            clr.b    (v_lastlamp).w    ; clear    lamppost counter
            move.w    #1,(f_restart).w ; restart the level
            move.w    #(id_LZ<<8)+3,(v_zone).w ; set level to SBZ3 (LZ4)
    (you should be able to find the HiveBrain Disasm equivilant)
     
    Last edited: Feb 1, 2025
  14. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    The Hivebrain 2005 equivalent is Boundary_Bottom, The code is still there though
     
  15. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    is the SBZ check removed?
     
  16. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Where is the SBZ2 check code? sorry for being dumb
     
  17. Blue Gamer

    Blue Gamer Autistic Member Member

    Joined:
    Aug 16, 2024
    Messages:
    58
    Location:
    Mysterious Marble Zone, Bird Hill Island
    Code:
            cmpi.w    #(id_SBZ<<8)+1,(v_zone).w ; is level SBZ2 ?
            bne.s    .skipKill1   ; if not SBZ2, skip to KillSonic
            cmpi.w    #$2000,(v_player+obX).w
            blo.s    .skipKill2   ; if below $2000, skip to KillSonic
            clr.b    (v_lastlamp).w    ; clear    lamppost counter
            move.w    #1,(f_restart).w ; restart the level
            move.w    #(id_LZ<<8)+3,(v_zone).w ; set level to SBZ3 (LZ4)
     
  18. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    No, it is not removed.
    It might be Because of Jmp KillSonic

    EDIT: Fixed it
     
    Last edited: Feb 3, 2025
  19. BL3H

    BL3H idiot sandwich Member

    Joined:
    Jul 19, 2022
    Messages:
    43
    Location:
    Tails' Workshop, Angel Island
    Are there any emulators that have support for the Mega Anser's keypad? I want to see if I can do something with it...
    The Mega Anser, in case you didn't know, was a printer for the Mega Drive used for calculating and printing bills and what not, and it came with this key pad. This is from PlutieDev's website and is what it looks like:
    [​IMG]
     
  20. Joao Gamer

    Joao Gamer Well-Known Member Member

    Joined:
    Nov 22, 2023
    Messages:
    90
    Location:
    Brazil
    Hello, I am using Hivebrain 2005 disassembly, Green Hill Zone's collision is glitched on my hack, but i can fix it changing the files into the normal one, but SonLVL keep glitching the collisiong and i hate that, i dont know how to fix this bug!!
     
    IAmAShad0 likes this.