Basic Questions and Answers Thread

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

  1. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Check the guides section which can be accessed on this site's home page.
     
  2. tilk

    tilk Active Member Member

    Joined:
    Feb 2, 2012
    Messages:
    30
    Hi again!


    So, I was wondering if there exists a ASM version of the Sonic 2 Beta sounds for the Clone Driver... As far as I saw, there is S1, S2, SC, S3K, S3D... but S2B?


    Also, the objects from the Nick arcade prototipe, uses the same format as in Sonic 1? (This question also applies to Sonic 2 Beta. I don't think so for the 2nd, but just making sure... maybe the S1 object manager still exists in Sonic 2 Beta).


    Also, I'm have a problem... after applying this guide (http://info.sonicretro.org/SCHG_How-to:port_Sonic_2%27s_Level_Art_Loader_to_Sonic_1) to my disassembly the graphics load completely glitched! The only exception are special stages...(If I'm correct, happens with both: the normal, and the kraminator one.)
     
    Last edited by a moderator: Apr 3, 2015
  3. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    For some reason, something in my Sonic 1 Hivebrain disassembly hack got changed and now the detection for Sonic and other objects on objects is weird, leading to Sonic acting like he's in the air when standing on a platform which leads to him having problems with animations, monitors falling through platforms, and other weird stuff. Does anyone have a fix for this or an idea about what went wrong?

    Also, I checked and this has nothing to do ObjectFall.

    [​IMG]
     
  4. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    No idea what the issue is but like a lot of people have said before: Backup your disassembly before making big changes, or use a service like GitHub. The amount of times I have been able to undo an edit that breaks something is massive since using GitHub.  
     
  5. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    I don't have an copies of my hack that don't have that problem because the last one I had was overwritten by a more recent version (I use Dropbox).
     
  6. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    A quick question regarding objects' pallete swapping in Sonic 2, if I may: I have been looking for how to do that, but only found info for Sonic 1. I searched the mappings .bin file for the object but it seems to be a different format. Is it some code in the s2.asm file? Here is what I want to do: When you open the "monitor and contents" .bin file (in art/nemesis) you'll see that the 10-ring icon is red, but that's because it will use the 2nd pallete. Well, how can I do this for, say, the Robotnik monitor? I want to "make the game tell the robotnik monitor icon" to use the 2nd palette line instead of the first. (realizing that palettes 2 to 4 are loaded in each zone and that the rings use the 2nd line did not help much... ^^´)

    I am not having trouble editing other art though. SonMapEd did not like me, but Flex (offline version) works like a cinch to me, and I am using SonLVL for tile/block/chunk editing. The tutorials available are clear too, no problems so far, but I still have this little nitpick with palette swap. Anyway, I will likely be offline until tomorrow, but thanks in advance!

    EDIT: Yay! A Chaos Emerald! =D
     
    Last edited by a moderator: Apr 6, 2015
  7. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The object's art_tile field (the word at 2(a0)) and the data in the mappings are used together to determine the palette of each sprite. The sprite mappings format is indeed different than Sonic 1's, but SonMapEd and Flex can both change the palette line for a sprite easily. In Flex, it's the button labeled "Change Palette".
     
    Last edited by a moderator: Apr 6, 2015
  8. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    Sorry for the delay in replying:

    I think something's up with either my OS or Flex (offline version) because I did use the "Change palette" button and, regardless of loading mappings or not, it shows, in the program, that the palette's been changed but it is not actually modifying the .bin file... maybe it is windows defender blocking some functionality? (but that would be weird, since it stores tile/art data just fine...) BUT, in the meantime, I figured where the palette values were, so I am posting here, with the bytes aligned:

    [​IMG]

    This is inside obj26.bin and, as you can see, as a test, I changed Tails' Monitor palette from 1st line to 2nd, by editing the first 00 below the 01 to "20" (inside the rectangle). The other "20" belongs to the ring monitor icon. I don't know why the other one is 01 instead of 00, but I assume the "palette swapper" is just the first nibble "0x", "2x", "4x", "6x". Maybe the other is the priority flag? I don't know, I'm just a baka. =P

    Also, speaking of hex: do all hex editors, when you copy and paste on notepad/etc. give you this: <bh:20><bh:22><bh:00>... instead of "20 22 00" (for example)? I'm just asking this because, if I end up making an application that would allow copy/paste from text back to hex editors.

    I actually am making one just to guide myself mainly in ASM stuff, like a code assistant kind of thing, since I am offline most of the time and having to search through dozens of "word" files with copy/pasted tutorials from the web can be a hassle... x'D

    EDIT: added info.
     
    Last edited by a moderator: Apr 8, 2015
  9. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    As indicated in the wiki article I linked, the first nybble consists of the priority bit, two bits for palette selection, and a bit for vertical flipping; the second nybble consists of a bit for horizontal flipping and the three top bits of the tile number.

    And no, all hex editors do not do that. Perhaps you need to change a setting somewhere?
     
  10. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    I actually have that page saved as a word in my computer, but, to be honest, it confused me. (i.e. I did not understand) Particularly because of that PCCY XAAA AAAA AAAA part of it, since it mentioned the "first word", second and third (and I think I read that a word is 4 bytes, right? (I'm not replying/hitting back, it is just to confirm because I am still learning x'D)) but then in the .bin file, I had to align the window of the Hex Editor to display 9 "words" per line so I could see/understand the palette pattern... am I making any sense? ^^

    But that one is already checked on the list. What I definitely need now is to change Hex Editor. (I am/was using one called "Translhextion", but it seems people use that for pokemon hacks... >_____>). Any recommendations are useful, although I will search for one that will retrieve "00 00 00..." when copy/pasting back and forth.

    Cheers! :D
     
  11. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    I use and would suggest HxD, though I know many people that use Hex Workshop and like that better.

    It's just a matter of preference, I suppose.
     
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    In MD terms, a word is two bytes (16 bits), a longword is four bytes (32 bits).

    If you plan on doing a lot of mapping editing by hand, it might help to look at the macro format MappingsConverter produces, which breaks everything down into individual numbers, and can handle Sonic 2's 2P data automatically.
     
    Last edited by a moderator: Apr 9, 2015
  13. tilk

    tilk Active Member Member

    Joined:
    Feb 2, 2012
    Messages:
    30
    Hello! I was looking to this:


    if WallJumpActive=1 ;Mercury Wall Jump
    bra.s loc_8AB6pushclear

    loc_8AB6:
    move.l a0,-(sp)
    movea.l a1,a0
    jsr WallJump
    movea.l (sp)+,a0

    loc_8AB6pushclear:
    else
    loc_8AB6:
    endc ;end Wall Jump

    and then an question came to my mind: how is the loc_8AB6 working if the bra.s is skipping the routine? As far as I know, the "bra.x" (X being s or w) ALWAYS skip the rest of the code...
     
    Last edited by a moderator: Apr 9, 2015
  14. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    Simple: it doesn't. loc_8AB6 is skipped in that instance, and will only be processed following a certain conditional branch in loc_8A92.
     
    Last edited by a moderator: Apr 9, 2015
  15. tilk

    tilk Active Member Member

    Joined:
    Feb 2, 2012
    Messages:
    30
    After further inspection in the ReadySonic Disassembly, I found out that the mappings and DPLC'S are filled with conditions like "    if SpinDashActive=1    ;Mercury Spin Dash". How I'm supposed to modify them using SonMapEd? e.e
     
  16. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
  17. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    I just started using HxD now, seems really neat and lightweight. (also, I closed the HexWorkshop site as soon as I saw a "buy now" button... ^^) 

    Oh, and it copy/pastes Hex values just right! Thanks for the tip! :D

    Wow, I did not even know this existed! Thanks, I will. (I just noticed this is one of your creations. :p) This thing just crossed my mind: does it allow to convert from 2 to S3K, edit it while in S3K format and convert it back to S2? Because I have done some Hex editing to mappings in S3K in the past, like changing MGZ's statue to a bird:

    [​IMG]

    :D

    EDIT: Additional HxD input.
     
    Last edited by a moderator: Apr 10, 2015
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Well yeah, why wouldn't it? Also, the only difference between S2 sprite mappings and S3K sprite mappings is S2 has the extra word for 2P mode.
     
    Last edited by a moderator: Apr 10, 2015
  19. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    Oh, I wonder where I messed up... or maybe I'm just rusty? I would like to think so... x'D. That's cool though. I really have to check that macro when I arrive. (I already have all I need in the pen.) Well, going to my cave now, to learn/practice more (and stop flooding the thread ^^), but thanks to everyone who has been helping me out so far, you guys are being "way past cool"! :D

    ... one might add: "flattery gets you nowhere, sir", but I just couldn't help myself. :p (pun intended, as in why I posted in the Basic Q&A Thread in the first place.)
     
    Last edited by a moderator: Apr 10, 2015
  20. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I have knuckles implemented in my S2 hack, and have breakable walls setup to break whenever he runs into them. however, when he jumps into them they don't break which can be rather annoying indeed. Experimentation pointed me to the following command, which checks whether player one is "pushing" on the object before running the actual breaking code:


    btst #5,status(a0)
    bne.s loc_15DAE

    How would I make a workaround for this with knuckles in mind?