don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. Beebles

    Beebles

    Now with OFFICIAL terrible Knuckles artwork. Member
    87
    0
    0
    Check my blog for details.
    Ok, so I'm working on an ASM hack of Sonic 1, and starting to try to understand ASM through use of the How-Tos on the wiki. This one in particular. I've managed to add the spindash coding and fix the sound effects, and am trying to add the tiles for a proper spindash look. I found the two art files, searched Zophar.net to get Tile Molester, and proceeded to attempt opening sonic.bin.

    Failure.

    Anybody know why this is happening? The way the How-to is worded suggests that Tile Molester (or any tile editor for that matter) can open .bin art files, but all I'm loading is glitchy pixels. Assistance would be appreciated.
     
  2. I'm no expert, but isn't that supposed to happen? It opens tiles in stupid places for no good reason?
     
  3. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    SonMapEd is a good tool for tasks of this sort.
     
  4. Destructiox

    Destructiox

    Masochistic Maniac, Raving Lunatic Member
    237
    0
    0
    East Midlands, England
    Sonic 1 Lunacy.
    Make sure you're using the right Codec.

    Go to View -> Codec and select 4bpp Linear. You'll get the tiles, but not in the right colour. Don't worry about that.

    Also, if you're adding the spindash sprites, make sure to pad out sonic.bin with rompad so you have extra space to put the tiles in.
     
  5. Beebles

    Beebles

    Now with OFFICIAL terrible Knuckles artwork. Member
    87
    0
    0
    Check my blog for details.
    Yeah, I tried that before Tile Molester, but couldn't figure out whether or not I could copy/paste tiles.

    Hmm, that may be the issue. I also didn't pad the .bin file, so that could have been bad. Alright, I'll try these. Thanks.
     
  6. Destructiox

    Destructiox

    Masochistic Maniac, Raving Lunatic Member
    237
    0
    0
    East Midlands, England
    Sonic 1 Lunacy.
    Yeah, I wish I'd remembered that the first seven times I tried to copy the tiles over, only to re-open sonic.bin to discover that they'd vanished :v:
     
  7. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.
    Wasn't there a guide on how to split EHZ and HTZ from using the same art? I thought there was, but can't find it.
     
  8. qiuu

    qiuu

    Tech Member
    144
    9
    18
    Blue Ball & Blocks
  9. Spanner

    Spanner

    The Tool Member
    Okay, I was planning to add another level with the 01 slot (Sonic 2) however the title card won't load, the music plays though. How could I fix this, I'm stumbled, it was working a few days ago.
     
  10. I have a couple of questions pertaining to hacking Sonic Advance.

    1. Can you add new characters?
    2. Would it be possible to make it so that if you have all the Chaos Emeralds, get 50 rings, and double jump as sonic he will become Super Sonic like in the old games? My thought would be upon double jumping with 50 rings, his sprite changes and invincibility kicks in.
    3. And my last question.... Are there any tools that will work for Macintosh? I have a Windows computer, but I prefer Mac, and I haven't seen any tools for Macintosh. Its ok If there isn't any.... I could just use my other computer.

    Thanks
     
  11. HighFrictionZone

    HighFrictionZone

    Hi. Member
    855
    0
    16
    Katy, Texas
    Nothing
    May seem like some easy questions to some, but here are some, in order of increasing difficulty:

    What is the best way to edit the icons for the monitors?
    Can I add additional monitor icons? How?
    How many additional monitor icons could I add before I ran out of space in memory to add more?

    COMPLETELY UNRELATED ISSUE
    I'm trying to add the spindash to Metal and Sonic in Sonic for 32X. Assuming I don't crash the game [by simply calling Playsound instead of $880000+(Playsound)], the spindash sound fails to play and instead screws the music up and some tiles get lost. I assume this is probably something to do with either the format of the spindash sound or the size of it, but I don't really know how to fix either. This isn't so much a question as it is a something-to-think-about. If you happen to know how I can fix it, by all means tell me. If not, just keep it in mind if you intend to go about adding sound effects, something I have no idea how to do!

    Bonus: I attempt to respond to something!
    From what I can gather, Sonic Advance hacking is a relatively new subfield of the Sonic hacking scene. If I recall correctly, we don't know too much about the inner workings, but we are learning more. A couple forum searches should turn up the relevant information. That being said, with the tools we currently have, no I don't think we can add new characters, nor could we add super sonic (though I suppose with action replay codes we might be able to approximate it, it really wouldn't be the same at all). And no, I don't believe there are mac-based tools. Macs tend to get the shaft when it comes to software.
     
  12. The best way is to edit the monitor mappings using SonMapEd. To add additional icons, I believe you'd only need to add new frames to the mappings, and then extend the offset table for monitor behaviour. Theoretically, you can have up to 256 icons, since the monitor subtype is stored in an unsigned byte, but the main issue is finding space in VRAM to put your new art in.
     
  13. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    1) With any tile editor of your choice. Each monitor icon uses four 8x8 tiles. They're Nemesis compressed, so you'll have to use a program natively capable to edit tiles in Nemesis format, or uncompress them with TSDC (or another decompressor) and then edit said tiles with the editor of your choice. For example, since SonMapEd confuses the hell out of me, I wrote my own tile editor, and I used it with success to edit the monitor icons (and other things) in my hack.
    2+3) Yes, you can add monitor icons. The existing subtypes range from 0 to 8, and 9 is the broken monitor. You can use subtypes from $A and above for your new monitors, as long as you add mappings for them in _maps\obj26.asm, and animations for them in _anim\obj26.asm. The problem is that there is little to no VRAM free in that region, so you need to use some tricks in order to add even a single monitor. For one, you can set the 1-up monitor to use the tiles from the lives counter (yes, they're duplicated in VRAM, yet they are the same), and for two, you can get rid of one or two of the three "static" monitor frames. The animation for the monitors is usually like 0, X, X, 1, X, X, 2, X, X, where X is the frame used by your monitor, and 0, 1, and 2, are the three "static" frames. You can get rid of two of them, and edit the animations accordingly.
    Therefore, if you apply both of the suggestions above, you can end up with three free additional subtypes, $A, $B, and $C. For the record, this is what I did in my hack, where $A is the note monitor, $B is the emerald monitor, and $C is the feather monitor; editing the unused monitors to suit your needs is another viable option: monitor subtype $8 (goggles) is the time monitor in soniNeko.

    Once you have the new subtypes set up, you have to go to the code and edit the bunch of Obj2E_xxx checks.
     
  14. I just need some second opinions on what tools and programs I should use to make a hack. You guys making them interest me.
     
  15. SonED, SonED2, SonMapEd, and maybe ESE/ESEII. Oh, and xm3smps!
     
  16. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    Don't get ESE, get the ESE Layout Editor. It's somewhere around here... and it supports disassemblies!

    Anyway, a question. Are there ANY sound effects not used in Sonic 2?
     
  17. Mikel

    Mikel

    Member
    Although this is old, I made a fix for the EHZ deformation for backgrounds like the one you have.

    Use this code to change the deformation on 1 Player:

    Code (ASM):
    1. SwScrl_EHZ:
    2.     tst.w   (Two_player_mode).w
    3.     bne.w   loc_C6C4
    4.     move.w  ($FFFFEE0C).w,($FFFFF618).w
    5.     lea (Horiz_Scroll_Buf).w,a1
    6.     move.w  (Camera_X_pos).w,d0
    7.     neg.w   d0
    8.     move.w  d0,d2
    9.     swap    d0
    10.                 move.w  d2,d0
    11.     asr.w   #6,d0
    12.     move.w  #bytesToLcnt($58),d1
    13. -   move.l  d0,(a1)+
    14.     dbf d1,-
    15.  
    16.     move.w  d2,d0
    17.     asr.w   #6,d0
    18.     move.w  #bytesToLcnt($E8),d1
    19. -   move.l  d0,(a1)+
    20.     dbf d1,-
    21.  
    22.     move.w  d0,d3
    23.     move.b  ($FFFFFE0F).w,d1
    24.     andi.w  #7,d1
    25.     bne.s   +
    26.     subq.w  #1,($FFFFA800).w
    27. +
    28.     move.w  ($FFFFA800).w,d1
    29.     andi.w  #0,d1
    30.     lea (SwScrl_RippleData).l,a2
    31.     lea (a2,d1.w),a2
    32.     move.w  #bytesToLcnt($54),d1
    33. -   move.b  (a2)+,d0
    34.     ext.w   d0
    35.     add.w   d3,d0
    36.     move.l  d0,(a1)+
    37.     dbf d1,-
    38.  
    39.     move.w  #0,d0
    40.     move.w  #bytesToLcnt($2C),d1
    41. -   move.l  d0,(a1)+
    42.     dbf d1,-
    43.  
    44.     move.w  d2,d0
    45.     asr.w   #6,d0
    46.     move.w  #bytesToLcnt($40),d1
    47. -   move.l  d0,(a1)+
    48.     dbf d1,-
    49.  
    50.     move.w  d2,d0
    51.     asr.w   #6,d0
    52.     move.w  d0,d1
    53.     move.w  #6,d1
    54.     add.w   d1,d0
    55.     move.w  #bytesToLcnt($40),d1
    56. -   move.l  d0,(a1)+
    57.     dbf d1,-
    58.  
    59.     move.l  d0,d4
    60.     swap    d4
    61.     move.w  d2,d0
    62.     asr.w   #6,d0
    63.     move.w  d2,d1
    64.     asr.w   #6,d1
    65.     sub.w   d1,d0
    66.     ext.l   d0
    67.     asl.l   #6,d0
    68.     divs.w  #$30,d0
    69.     ext.l   d0
    70.     asl.l   #6,d0
    71.     moveq   #0,d3
    72.     move.w  d2,d3
    73.     asr.w   #6,d3
    74.     move.w  #bytesToLcnt($3C),d1 ; $3C bytes
    75. -   move.w  d4,(a1)+
    76.     move.w  d3,(a1)+
    77.     swap    d3
    78.     add.l   d0,d3
    79.     swap    d3
    80.     dbf d1,-
    81.  
    82.     move.w  #($48)/8-1,d1 ; $48 bytes
    83. -   move.w  d4,(a1)+
    84.     move.w  d3,(a1)+
    85.     move.w  d4,(a1)+
    86.     move.w  d3,(a1)+
    87.     swap    d3
    88.     add.l   d0,d3
    89.     add.l   d0,d3
    90.     swap    d3
    91.     dbf d1,-
    92.  
    93.     move.w  #($100)/12-1,d1 ; $100 bytes
    94. -   move.w  d4,(a1)+
    95.     move.w  d3,(a1)+
    96.     move.w  d4,(a1)+
    97.     move.w  d3,(a1)+
    98.     move.w  d4,(a1)+
    99.     move.w  d3,(a1)+
    100.     swap    d3
    101.     add.l   d0,d3
    102.     add.l   d0,d3
    103.     add.l   d0,d3
    104.     swap    d3
    105.     dbf d1,-
    106.  
    107.     rts
    If you want to do the same for Two Player mode, use this code:

    Code (ASM):
    1. sub_C71A:
    2.     neg.w   d0
    3.     move.w  d0,d2
    4.     swap    d0
    5.     move.w  d2,d0
    6.     move.w  #6,d0
    7. -   move.l  d0,(a1)+
    8.     dbf d1,-
    9.  
    10.     move.w  d2,d0
    11.     asr.w   #6,d0
    12.     move.w  #bytesToLcnt($74),d1
    13. -   move.l  d0,(a1)+
    14.     dbf d1,-
    15.  
    16.     move.w  d0,d3
    17.     move.w  ($FFFFA800).w,d1
    18.     andi.w  #0,d1
    19.     lea SwScrl_RippleData(pc),a2
    20.     lea (a2,d1.w),a2
    21.  
    22.     move.w  #bytesToLcnt($2C),d1
    23. -   move.b  (a2)+,d0
    24.     ext.w   d0
    25.     add.w   d3,d0
    26.     move.l  d0,(a1)+
    27.     dbf d1,-
    28.  
    29.     move.w  #0,d0
    30.     move.w  #bytesToLcnt($14),d1
    31. -   move.l  d0,(a1)+
    32.     dbf d1,-
    33.  
    34.     move.w  d2,d0
    35.     asr.w   #6,d0
    36.     move.w  #bytesToLcnt($20),d1
    37. -   move.l  d0,(a1)+
    38.     dbf d1,-
    39.  
    40.     move.w  d2,d0
    41.     asr.w   #6,d0
    42.     move.w  d0,d1
    43.     move.w  #6,d1
    44.     add.w   d1,d0
    45.     move.w  #bytesToLcnt($20),d1
    46. -   move.l  d0,(a1)+
    47.     dbf d1,-
    48.  
    49.     move.w  d2,d0
    50.     asr.w   #6,d0
    51.     move.w  d2,d1
    52.     asr.w   #6,d1
    53.     sub.w   d1,d0
    54.     ext.l   d0
    55.     asl.l   #6,d0
    56.     divs.w  #$30,d0
    57.     ext.l   d0
    58.     asl.l   #6,d0
    59.     moveq   #0,d3
    60.     move.w  d2,d3
    61.     asr.w   #6,d3
    62.  
    63.     move.w  #bytesToLcnt($A0),d1
    64. -   move.w  d2,(a1)+
    65.     move.w  d3,(a1)+
    66.     swap    d3
    67.     add.l   d0,d3
    68.     swap    d3
    69.     dbf d1,-
    70.  
    71.     rts
    And that is how you fix the deformation for backgrounds like this one on EHZ.
     
  18. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Yes there are a few, when I get home later I'll let you know which ones specifically. :v:
    EDIT:
    Sound43 and Sound49. If you are planning to not use the 2 player mode then you could use Sound6C (teleport) and Sound53 (signpost spinning 2 Player). Hope that helps.
     
  19. Aquaslash

    Aquaslash

    <The Has-been Legend> Moderator
    1. There has yet to be a disassembly of Sonic Advance, so unless you find a way to do it in hex, it looks unlikely.

    2. Same as #1 with a twist. Super Sonic has VERY few sprites in the game. In fact, there's only transformation, running, and boosting. You'd have to add sprites and mappings for the rest of the frames.

    3. Very few.
     
  20. muteKi

    muteKi

    Fuck it Member
    7,851
    131
    43
    In note of point #2 though, I feel that I should add that a lot of Super Sonic's frames from Sonic 2 and Sonic 3 were just recolors of the normal Sonic sprite.