don't click here

Basic Questions & Answers thread

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

  1. MoDule

    MoDule

    Tech Member
    327
    24
    18
    Procrastinating from writing bug-fix guides
    MTZ Boss's init routine only has one line that writes 8 to somewhere. Sure enough, that's the one you're looking for.
     
  2. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    Thanks. I got what I needed. Though the laser code doesn't like the extra hits. I'll have to fix that somehow. Edit: Never mind. Somehow it corrected itself.

    Edit 2: I know the problem. It is only when the boss gets hit during the intermediate "lets move to the other side of the room." I'll have to fix that by making the boss higher.

    Edit 3: Aaannnd done.
     
  3. PencilTips

    PencilTips

    Member
    13
    0
    0
    Cali
    Hi, I'm pretty new here to this site and I've decided to do a little hacking. For starters, I looked around the site and found a thread containing a guide on how to Sonic 1 Split Disassembly by Qjimbo on Youtube. http://www.youtube.com/watch?v=FDAJpXf9xyI

    I've done pretty much evrything he told me to do, or what he explained in that video. After that I was confused, I know my Green Hill Zone is messed up so it needs to be fixed.
    But I'm just gonna leave it as it is and edit on another level. The problem is, how do I not mess up?
     
  4. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    IT COMES MESSED UP. Yeah. I know. There is a guide to fix it, though I can't find it at the minute.



    Now, here's my current problem.
     
  5. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    While I'm offline and unable to pester people with ASM questions, I'm working on what I now how to do best. That is, the artstic side of things. I've already started editing the Sonic 3 sprites using nothing but what's in the Sonic 3 palette, and I'm gonna move onto making art for my levels. Before I go TOO far with it though....

    What should I keep in mind to make sure that my level art will be able to import nicely into the level I plan to replace? I'm okay with (infact, it's probably rather necessary) replacing palettes and the like. And does anyone know of a pixel editor that let's me restrict the amount of colors to 9-bit RGB. I know Photoshop lets me do that, but I never liked using Photoshop for pixel work. Also, is it okay to only create 128x128 metatiles and let SonMapEd break it up for me?

    Another question, this one is nice and concise. I just want some Sonic 3 FM voices to put together some songs for my hack. Where can I find those, and can anyone recommend an XM tracker?

    And one other, unrelated question. I tried using the Sonic 2 Text Generator and I've got two issues. Firstly, for the lulz, I wanted to change "© 1992 Sega" to "© 2011 Aerosol". Copyright law warnings aside, can anyone tell me how to move that text around so that anything longer than the original text doesn't end up on the next line? Also, I had trouble setting up the asm files according to the instructions in the program. I got build errors when I followed the instructions, and the program itself says "unable to insert setup code", or something along those lines (not at home at the moment). I'm using the SVN disasm...is it only able to work with the 2007 disasm?

    edit: XM tracker, not FM. Duh.
     
  6. nineko

    nineko

    I am the Holy Cat Tech Member
    6,314
    489
    63
    italy
    A quick dirty way to do this is to only use colors whose RGB values are in the X0Y0Z0 form where X, Y and Z are even values between 0 and 14 (E). Which means for example E06020 or 4080A0. It will be an approximation (it has been proven that "white" on the Genesis isn't E0E0E0) but if it's just for editing purposes it should be accurate enough. To get more accurate values you should use XXYYZZ (still with even values only).
    Also remember that you can use only one palette line per 8x8 tile, so you're limited to 15 colors + 1 transparency in every 8x8 tile. Unless you pull off some magic trickery of course.
     
  7. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    In my search for the Sonic 3 Universal Voice Bank, I found this: http://oerg866.tototek.com/x3vrec.html

    The download links, sadly, do not work any longer, and Google is proving ineffective. I really want the Sonic 3 Voicebank though. Anyone got any other leads?
     
  8. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,205
    432
    63
    Japan
    http://mrjester.hapisan.com/01_PBLC/BMP29BIT.exe

    Put a bitmap file named "FULL.bmp" in the same directory as that, run it, and it'll output MD.bmp with all the colours changed to 9-bit. (This is not an editor by the way)
     
  9. Azu

    Azu

    I must be stupid. Member
    There's was this tool called "arctool" on X-Cult, but it's not their anymore. It let's you extract data from the .arc files in Sonic 2006. The Wii u8 Extractor tools won't work on it.
     
  10. Shoemanbundy

    Shoemanbundy

    Researcher
    1,094
    30
    28
    Chicago, Illinois
    selling shoes
    I'm too stressed out to do more searching. I exported a .obj file with the SADX level editor, now I'm trying to find a program to use that will let me load the OBJ file, WITH textures, and also has a triangulate option. I was using Google Sketch but apparently they haven't conceived the convenience of loading OBJ files, and any plugins I find don't load the textures with the file. :/ Anyone got a good recommendation for a program that will help?
     
  11. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Blender.
     
  12. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    EDIT: Holiday's are over! Time for me to get back to work!

    I'm still trying to import the Sonic 3 sprites into Sonic 2. I saved Sonic's DPLC, mappings, palette, and art from Sonic 3 after opening it in SonMapEd and made the following changes in s2.asm

    Code (ASM):
    1. ;---------------------------------------------------------------------------------------
    2.     align $20
    3. ArtUnc_Sonic:   BINCLUDE    "sonic3stuff/Sonic3art.bin"
    4. ;---------------------------------------------------------------------------------------
    5. ; Uncompressed art
    6. ; Patterns for Tails  ; ArtUnc_64320:
    7. ;---------------------------------------------------------------------------------------
    8.     align $20
    9. ArtUnc_Tails:   BINCLUDE    "art/uncompressed/Tails's art.bin"
    10. ;--------------------------------------------------------------------------------------
    11. ; Sprite Mappings
    12. ; Sonic         ; MapUnc_6FBE0: SprTbl_Sonic:
    13. ;--------------------------------------------------------------------------------------
    14. Mapunc_Sonic:   BINCLUDE    "sonic3stuff/Sonic3map.asm"
    15. ;--------------------------------------------------------------------------------------
    16. ; Sprite Dynamic Pattern Reloading
    17. ; Sonic DPLCs           ; MapRUnc_714E0:
    18. ;--------------------------------------------------------------------------------------
    19. ; WARNING: the build script needs editing if you rename this label
    20. ;          or if you move Sonic's running frame to somewhere else than frame $2D
    21. MapRUnc_Sonic:  BINCLUDE    "sonic3stuff/Sonic3PLC.asm"
    I didn't change anything to do with the palette just yet.

    I didn't run into any build errors, so I thought I was all good till I ran into this:
    [​IMG]

    I have a feeling it has something to do with the fact that the Sonic 3 mappings file is only three words long, and Sonic 2's is four words long. What changes can I make to fix this? Where should I be looking for clues? I tried loading up all the Sonic 3 information, then switching SonMapEd's format to Sonic 2 before saving. All that produced was a completely white screen, and genskmod eventually crashed.

    One more thing. If I change Sonic3PLC.asm to Sonic3PLC2.asm (the same thing, just saved under "Sonic 2" format), I get this instead of the above:
    [​IMG]

    If I change Sonic3map.asm to Sonic3map2.asm, I just get a blank white screen.
     
  13. vladikcomper

    vladikcomper

    Tech Member
    205
    134
    43
    Sonic Warped
    I'm not sure how Sega screen in Sonic 2 works, but if the art and sprites mappings are the only things you changed, the issue may be in these lines:
    Code (ASM):
    1. Mapunc_Sonic:   BINCLUDE    "sonic3stuff/Sonic3map.asm"
    2. MapRUnc_Sonic:  BINCLUDE    "sonic3stuff/Sonic3PLC.asm"
    3.  
    You include ASM files as binary data, so the compilator just insert the contents of the files instead of assembling their code. Also, if file sizes are odd, then some data can be wrongly aligned, probably that caused pallete glitches.
    Try to use "include" command.
     
  14. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Part 1 is this, indeed: load S3&K mappings and dplcs with S3&K format ticked, switch to S2 format and save.

    Part 2: In build.bat, edit the line containing "fixpointer" to point to the correct running frames. Since you are copying the sprite and mappings unchanged, you will have to find this:
    Code (Text):
    1. off_3A294 MapRUnc_Sonic $2D 0 4
    and replace with this:
    Code (Text):
    1. off_3A294 MapRUnc_Sonic $21 0 4
    Part 3: open the sprite (running frames) in SonMapEd and note the sizes and order of the sprite pieces. For S3&K Sonic, all four running frames have the same number and sizes for all pieces. You will then need to find "SonicRunningSpriteScaleData" in s2.asm and edit accordingly.

    Part 4: even if everything has been done correctly so far, things will appear garbled in the Sega screen. This is because of integer overflows due to the art tiles in use in the running sprites. If you have updated recently from SVN, it is easier to do: find "CopySpriteTilesToRAMForSegaScreen" in s2.asm, find the following nearby line:
    Code (ASM):
    1.     if 1==0
    2.  
    and replace it by
    Code (ASM):
    1.     if 1==1
    You can look in the SVN file to see what needs to be changed otherwise.

    Edit: Oh, I nearly forgot:
    Part 5: grab a slice of VRAM and edit mappings/sprite/objB1.bin in SonMapEd accordingly.
     
  15. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    What do you mean by "grab a slice of VRAM"? (Oh I get it now. This is for the Sonic running across the SEGA screen. I'll come back to this).


    I replaced Sonicandtails.bin with my Sonic3pal.bin and I got this:
    [​IMG]

    I'm guessing by importing Tail's Sonic 3 sprites, that problem will be fixed but what about everything else?

    After changing most of the animations, I ran into another problem:

    Code (ASM):
    1. SonAni_Hurt:    dc.b $9A,$D0,$FF
    2. SonAni_Slide:   dc.b   9,$D0,$D1,$FF
    This is what I have in s2.asm. But the game continues to use the sprites in $B6 and $B7 for the hurt animation.
     
  16. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    [​IMG]
    Thanks to a little help from MarkeyJester, this little guy is moving right. Now I want to put hit points on him. Say...3.

    Code (ASM):
    1.  
    2. Obj45_Main:             ; XREF: Obj45_Index
    3.     addq.b  #2,$24(a0) 
    4.     move.w  #$50,$30(a0)
    5.     move.w  #$10,$32(a0)
    6.     move.w  #$0000,2(a0)        ; moves #$0000 to the art tile's SST (it's 2 in S1 and S2)     
    7.     move.l  #Map_obj45,4(a0)    ; moves the mappings into the mapping's SST    
    8.     move.b  #$20,$19(a0)       
    9. ;-----------------------------------
    10.     move.b  #$7,$20(a0) ; make object bust like badnik (for now)
    11.     move.b  #3,$21(a0) ;set hits to 3?
    12. ;-----------------------------------
    13.     move.b  #4,1(a0)    ; use screen coordinates (such as the ones you see in debug mode)      
    14.     move.b  #4,$18(a0)  ; set priority
    15.     rts
    16.  
    What happens is Sonic bounces off of the "boss" and the collision disappears. It stays gone until Sonic leaves the area and reloads the boss again. So, how do the regular bosses do it?
     
  17. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    Is there a non-optimizing assembler? I have code that is 0(a5) but it assembles to what (a5) would assemble to and I have my reasons for wanting 0(a5) to remain 0(a5).
     
  18. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,205
    432
    63
    Japan
    That would be the assembler's optimisation settings, these are written in "build.bat" and are given to the assembler, now it will depend on what assembler you're using.

    As an example, I have a Sonic 1 source here with me currently using asm68k, and inside "build.bat" (opened with a text editor) I see:

    Code (Text):
    1. asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- sonic1.asm, s1built.bin
    With each of the /o ? being an optimisation setting, Asm69k provided a list:

    [​IMG]

    Simply remove the /o settings you don't want, for example, if I don't want the assembler to change add commands to addq (if it can at any point), then I'd either remove "/o oaq+" from that line, or change the + to a -. The other assemblers should have a similar method of optimisation settings. Though I'm not familiar with this process so you may want to have a play around.

    EDIT: Infact, I have a question of my own...

    Recently, I've been getting used to using branch commands without specifying the size/type (I.e. I mean without setting .s for short or .w for word), now I've found this useful having the assembler automatically shorten branch commands to short if it can and word if it can't, as this saves me time not having the assembler complain or having to change the size back and forth because I edit/change huge heaps of code. HOWEVER, I have noticed that the assembler (Asm68k in this case) sets short/word correctly for branches that branch backwards, but NOT branches that branch forward, infact, it sets all of them word even though most of them can be set short quite easily. Now I'll assume this is a bug, if not, then what's causing this, and is there a fix/correction for this issue? (Really, I could do with using best optimisation possible right now without the irritation).
     
  19. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Dunno if this is the most effective place for this question but...

    Anyone use Ultimate Genesis Soundfont v2.1 much? I can't find the "Go!" sample in the drumset, and I wonder if it's just me.
     
  20. Bgvanbur

    Bgvanbur

    Tech Member
    128
    1
    0
    USA
    a disassembly, some small Sega CD projects
    asmx will always optimize this operand. Both SNASM68k and asm68k allow controlling the various optimizations.

    I have a private version of asmx I made that allows control of optimizations (I used it to make a bit perfect assembly from the Sonic 1 disassembly). However from what I can tell the asmx software license does not allow redistribution of asmx with modifications (since no specific license was specified) and the asmx author does not respond to his email.