Basic Questions and Answers Thread

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

  1. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Why are you looking at the continue screen? The TitleScreen Routine provides you with everything you'll ever need.

    So yes, it's possible, in fact, it's even easier than what you're making it out to be, you could easily just use the Sonic 1 Title Screen. All you'd have to do is change the art.

    1. Change the Sonic art in the title screen to Richter.

    2. In whatever you're using to edit the art, I'm assuming PlanED or SonMapED, have the Richter Sprite instead of popping from underneath, have him come from the top.

    3. Go to The Title Screen routine. Look for the part that has the bit about what art loads at the beginning. Go place in a RAM check that goes with your character selection. Make it to where RAM Address A loads this art, and RAM Address B load the other. (On a completely different note, hopefully by now you've done away with that idiotic old tutorial where Sonic and Richter are the same object, but load different art. This will also make adding in an options menu that much easier down the road as opposed to using button combos on the title screen.)

    4. Go to Obj0E (The TItle Screen Emblem) and add in a RAM check similar to the top that tells which Mappings and Animation data will be loaded.

    5. Assuming you didn't fuck up anything between steps 1 through 4, you should be all good.
     
    Last edited by a moderator: Jul 19, 2014
  2. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    406
    Location:
    Town Creek, AL
    1. Looked at the continue screen to see how it would all load (though i think i didn't take enough code to load from #Map_Richter & load correct animation before loading Big Richter. My idea  would prpbably work if one object instead of 2 like i thought at first)

    2. I'm using SonMapEd and have everything needed ready.

    3. All at $FFFFFFFE


    Map_Character: moveq #0,d0
    move.b (Character).w,d0 ; Character in Macros is $FFFFFFFE
    lsl.w #2,d0 ; Multiply by 4, to get correct address
    move.l Map_Characters(pc,d0.w),($FFFFD004).w ; Get the map address, and put it to $D004
    rts
    Map_Characters:
    dc.l Map_Sonic ; Sonic (dummied out)
    dc.l Map_Richter ; Richter
    dc.l Map_Sonic2 ; Sonic2

    This is the code i'm using which loads maps.

    I should also bring up that with this code, i've ran into an error which loads stage art over sonic's or garbled art. I readded Sonic  1's art, map, & DPLC only to fix this.
     
  3. Viva La Luna

    Viva La Luna A.K.A. crypt0nymous Member

    Joined:
    Jun 7, 2012
    Messages:
    82
    Location:
    Istanbul
    Since I'm newbie for Rom hacking, I want to ask a question.


    What does "ROM Padding" stand for? Is it useful or important? If it doesn't effect for ROM, emulator or hardware, I won't use it because the emulator takes so much time to load when I use it.


    EDIT: grammar fix
     
    Last edited by a moderator: Jul 21, 2014
  4. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,170
    Location:
    Limbo
    I'm not quite certain, but I think it has something to do with how build.bat compresses the rom. It doesn't seem like something that could be altered for the betterment of a hack, though.
     
  5. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,883
    Location:
    italy
    While (most) emulators can load ROMs of any given size, real hardware usually expects a ROM to be sized as a power of 2 (128kB, 256kB, 512kB, ..., 4096kB). Hence, if your built ROM is (say) 703kB, it will be padded up to 1024kB in the chance you'll burn it on a flashcart and play it on a real Mega Drive / Genesis.


    Doing so results in a slower boot process because most games have a checksum routine which does weird math things with all the bytes in the ROM itself to check for its integrity (and displays a red screen in the process if the checksum is wrong).


    The best approach you can take here is to get rid of the checksum routine to begin with, and then you'll decide about whether removing the padding option or not. If you're hacking Sonic 1 with the Hivebrain disassembly I can give you detailed directions; if you aren't, it's intuitive enough. The code is very close to the top of the ROM.
     
    Last edited by a moderator: Jul 21, 2014
  6. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    What means that data ends on an odd adress?
     
    Last edited by a moderator: Jul 21, 2014
  7. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,883
    Location:
    italy
    It means that you need to put an "even" directive somewhere. I don't want to annoy you with details, just remember that the Mega Drive / Genesis is a 16-bit console and it doesn't like to play along with byte-sized stuff (e.g. 8 bits per time), most things are word-sized (16 bits per time). Thus, most things should be word-aligned.


    As a rule of thumb, make sure that there is an "even" directive right after all the INCBINs. It's possible that a few ones aren't actually needed but you'll be safer in this way.
     
  8. SteelTitanium

    SteelTitanium Newcomer Member

    Joined:
    Dec 26, 2011
    Messages:
    22
    Do anyone know how to add working loops to a level using SonLVL? I'm trying to add a loop and it don't work like it should.
     
  9. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,883
    Location:
    italy
    Saying which game you're trying to hack will help you receive a relevant answer, since loops are done in completely different ways in Sonic 1 and Sonic 2. Since I don't want to waste a post on a futile advice, let me assume it's Sonic 2, since "path swappers" are a gigantic pain in the ass. You'll need to put two "path swapper" objects in the proper places, look at how existing loops do it. Then start wishing they kept the 256×256 system :U
     
  10. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    406
    Location:
    Town Creek, AL
    Nineko is right in the Sonic 2 manor, but sonic 1, when you add a loop you need to double click for the loop to work right. Sonic 3K i'm unsure of (more path swappers i think) I use sonlvl on one computer, Soned on another cause sonlvl don't work on my Xp
     
  11. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    408
    Location:
    Buffalo, NY, USA
    For Sonic 1, just double-click the relevant chunk. A yellow border should appear around it upon doing so. If it still doesn't work, try again using one of the other loop chunks.

    edit: ninja'd
     
    Last edited by a moderator: Jul 22, 2014
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    For Sonic 2/S3K (they use the same system), you could make sure the "Include objects with foreground selection" option is enabled in the Edit menu, go to the Foreground tab, switch to Select mode, highlight the area covering the entire loop and the pathswapper on the right side of it, press Ctrl+C or right click->Copy, go to the area you want to put the new loop, and right click->Paste Once. You should end up with a working copy of the loop with the pathswappers and rings already there.
     
  13. Stardust Gear

    Stardust Gear A Programmer Member

    Joined:
    Apr 27, 2014
    Messages:
    134
    Yes i know in SonLVL i need to double-click the chunk to make it loop.

    I make my S1 hack in SonLVL.

    And a question for MainMemory:

    What is the chunk limit for Sonic 1?
     
  14. Stardust Gear

    Stardust Gear A Programmer Member

    Joined:
    Apr 27, 2014
    Messages:
    134
    How to create a special chunk system in Sonic 1 that use 256x256 chunks but use the path swapper system of S2 and s3k?

    Also I want to import the pinball mode from S2 to disable the "special tube chunks" features.

    Another feature I want to add is to move the "Remember State" bit and then to enable placing objects with ID higher than 0x7F.
     
  15. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Well, I'm trying to add 4th ring counter's digit (for hubs). I edited mappings, so there is one more tile, I changed also Hud_Rings to

    Hud_Rings: ; XREF: HudUpdate
    lea (Hud_100).l,a2
    moveq #2,d6

    cmpi.b #$3,($FFFFFE11).w
    beq.s Hud_Rings2
    cmpi.b #$7,($FFFFFE10).w
    bne.s Hud_Rings3

    Hud_Rings2:
    lea (Hud_1000).l,a2
    moveq #3,d6

    Hud_Rings3:
    bra.s Hud_LoadArt
    ; End of function Hud_Rings

    And almost everything is working fine - in normal level the counter is where it should be and counts how it should. But in hubs...

    [​IMG]

    the "0" is one tile to the left. Althrough, after collecting a ring, that garbage changes to 1, 2, etc. but after hurt, the digit in place of garbage don't changes to 0. Also, sometimes the garbage appears again after passing few pixels without collecting rings.

    To make it weirder, after collecting rings in hubs generates garbage in the BG

    [​IMG]

    So my question is: how to move the "0" 1 tile to the right? I think that this generates all the other problems mentioned in this post.
     
    Last edited by a moderator: Jul 22, 2014
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    With the standard system you can have $52 chunks in a level. If you alter the code to read uncompressed chunks from ROM, you can have $100 chunks.
     
  17. ralakimus

    ralakimus IMPOLITE AND EVIL! Member

    Joined:
    Aug 26, 2013
    Messages:
    1,113
    I have a quesiton for MainMemory also.

    Is it possible for SonLVL to support custom sized chunks?
     
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Not currently. It may be possible in the future, but you'd have to provide a class definition for your chunk format.
     
  19. ralakimus

    ralakimus IMPOLITE AND EVIL! Member

    Joined:
    Aug 26, 2013
    Messages:
    1,113
    Oh well, I needed to make the Pokemon portion of my hack, and I thought it would be easier if I just used 16x16 chunks, or just blocks.
     
  20. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Ralakimus your post reminded me to finish Retro Graphics Toolkit's Chunk funcationality. I will get to that some time tommorow. The way Retro Graphics Toolkit is written it will only take a few lines of code to support custome chunk sizes. Already you can use custome block sizes or have chunks that use tiles instead of blocks. Also I have been working on Retro Graphics Toolkit recently and added sprite support. If you load a large image Retro Graphics Toolkit will divide it up into the least sprites possible.[​IMG]

    If you are a windows user and want to try out Retro Graphics Toolkit and don't want to compile it from source I keep update to date binaries here https://github.com/ComputerNerd/Retro-Graphics-Toolkit/blob/master/RetroGraphicsToolkit.exe.7z

    All you need to do is press View raw to download the file and extract it using 7zip. Unsurpisingly I think each relase of Retro Graphics Toolkit keeps getting better and better so with that said what do people think about this relase and the concepts and features that Retro Graphics Toolkit has to offer? Are there any feature requests or bugs that you want me to be addressed? Even better do you have a patch that you want to submit? I am always open to patches.