don't click here

Basic Questions & Answers thread

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

  1. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Ok then. That's kind of lame... but oh well. Only option is the two you gave me, work my ass off to revert some of the code to the old format or switch to hivebrain altogether...

    Who's idea was it to split everything up in such a confusing way that leaves almost all tutorials extremely hard to follow, or mess up the simplicity of being able to locate routines without looking through a bunch of files until you find the right one? It's a headache.

    Thus why I've stuck to the Xenowhirl 2007 version of Sonic 2 for Sonic Super Deformed this entire time, the mercurial version for S2 is just as much of a pain if I recall. =/
     
  2. RetroKoH

    RetroKoH

    Member
    1,728
    107
    43
    S1Fixed: A successor to ReadySonic
    Well, I can tell you this much, as much of a pain as it is to jump from file to file sometimes, I LOVE the files ALL being split up like that... for me it beats looking through one long-ass file... now yes, there is a Find function. But you know what? Nocs on the iOS doesn't have that, and cannot read files that are too long... so I love the split in the HG disassemblies. :D

    It's a matter of preference, really... there is no truly right or wrong answer to that one. The only time the split EVER bothered me was when I applied the S3K Priority Manager to Sonic 1. That was a real bitch to do on the HG disasm. Worth it though.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    I believe that would be Hivebrain.
    As far as I'm aware, the only real differences are some changed labels, more macros, and a new system for assigning RAM addresses.
     
  4. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    68
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    If memory serves, there were also some parts that were incorrectly and/or incompletely disassembled in the 2007 disassembly but were fixed in the Hg disassembly.
     
  5. TehKaker

    TehKaker

    Member
    12
    0
    1
    Anybody who has worked with s3k before... anybody knows a way about how in SonED to define where to mark the limit between primary and secondary tiles/blocks/chunks?

    EDIT: Just switched to SonLVL, and it works fine there.
     
  6. RetroKoH

    RetroKoH

    Member
    1,728
    107
    43
    S1Fixed: A successor to ReadySonic
    Not a real hacking related question, but it is related to emulators so I hope it gets a pass...

    What's the best suggestion for capturing gameplay video? I was suggested KEGA Fusion's AVI log feature, which I have just barely tried, with no success... all I got was an AVI file with sound only... funny enough. IDK if the codec is the problem, or what... I'm a noob when it comes to these things.

    Does anyone have any suggestions? I'm doing some searching to remedy the situation ATM... perhaps some help could go my way?
     
  7. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Gens Rerecording has always worked for me.
     
  8. RetroKoH

    RetroKoH

    Member
    1,728
    107
    43
    S1Fixed: A successor to ReadySonic
    Thanks for the tip, as always Mercury! I just tried it, recording on Uncompressed, as all other codec options won't work...

    Uncompressed works, I just have to convert it using VLC Player, but it does the trick. I'm currently uploading my first ever video to YouTube, so I can now show video progress on my hacks!

    Thanks again! :D
     
  9. I've been trying to find models for either characters or the stages themselves from "Sonic R". I haven't been able to find anything, is it because I'm just stupid and looking in all the wrong places, or are we actually still unable to get that stuff from any version of the game? (We can extract and replace stuff from Adventure and Generations, but not R?)
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    Sonic Adventure has the advantage of using a standard Dreamcast model format which is described in the SDK. Sonic Generations has the advantage of everyone loving it. Sonic R does not use a standard model format, and it is a spinoff that nobody cares much about.

    A while back some people did figure out much of the character models/animations in the PC version, but the object models and stage files are complete unknowns. And unlike Adventure, the character models in R have no bone structure of any kind, the animations position each model piece individually.
     
  11. RetroKoH

    RetroKoH

    Member
    1,728
    107
    43
    S1Fixed: A successor to ReadySonic
    I have a quick question about an issue I'm having with setting a value from a table to RAM. Here is my attempt. Please refrain from laughter.


    Code (Text):
    1.  
    2.  
    3.                 lea (SS_TimeLimits).l,a1    ; load Special Stage times
    4.                 move.b  (v_lastspecial).w,d0    ; load current special stage number
    5.                 lsl.b   #2,d0
    6.                 movea.l (a1,d0.w),a1        ; load desired time
    7.                 ; LOAD VALUE TO COUNT DOWN FROM, BASED ON SPECIAL STAGE NUMBER. READ FROM TABLE
    8.                 move.l  (a1),(v_time).w ; start with time on the clock
    9.  
    For reference, here is the table. They are longword values that I want loaded into the timer:

    Code (Text):
    1.  
    2. ; ---------------------------------------------------------------------------
    3. ; Special Stage Time Limits to set
    4. ; ---------------------------------------------------------------------------
    5.  
    6. SS_TimeLimits:
    7.         dc.l    $20000 ; #0 - 2'00"00
    8.         dc.l    $20000 ; #1 - 2'00"00
    9.         dc.l    $10000 ; #2 - 1'00"00
    10.         dc.l    $30000 ; #3 - 3'00"00
    11.         dc.l    $10000 ; #4 - 1'00"00
    12.         dc.l    $30000 ; #5 - 3'00"00
    13.         dc.l    $20000 ; #6 - 2'00"00
    14.  
    I assume I'm completely missing the boat on this... as the timer is not starting where I want it to... I've tried different combinations of instructions... and tried looking through the code to figure out how the engine does this... It's going over my head.
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    (a1,d0.w) means you're taking the value in a1, adding the low word of d0 to it, and retrieving the value at the resulting address. You have to either change it to an lea to take the address of a1+d0.w or change it to a plain move.l (a1,d0.w),(v_time).w.
     
  13. vladikcomper

    vladikcomper

    Tech Member
    211
    170
    43
    Sonic Warped
    Besides what MainMemory said, there's another problem with your code. You're loading a byte in D0, but then using it as a word with (a1,d0.w) addressing form. The high byte of D0 will remain "dirty", which results into wrong value when reading D0 as a word.

    Here's a small example. Let's pretend D0 was $3F5E before executing the code (any random value may occur, since registers are used all the way) and v_lastspecial was $01. In this case, results of running your code will be:

    Code (Text):
    1.  
    2.                                 ; d0 = 3F 5E
    3.                 move.b  (v_lastspecial).w,d0    ; d0 = 3F 01
    4.                 lsl.b   #2,d0           ; d0 = 3F 04
    5.                                 ; ...
    In order to fix this, just clear D0 before loading anything into it. With this and applying other fixes the code will look something like this:

    Code (Text):
    1.                 moveq   #0,d0           ; pre-clear d0
    2.                 move.b  (v_lastspecial).w,d0    ; load current special stage number
    3.                 add.w   d0,d0           ; multiply by 4
    4.                 add.w   d0,d0           ;
    5.                 lea (SS_TimeLimits).l,a1    ; load Special Stage times
    6.                 move.l  (a1,d0.w),(v_time).w    ; start with time on the clock
    In case the SS_TimeLimits is within 128 bytes from the last instruction, you could replace the last two lines with just move.l SS_TimeLimits(pc,d0.w),(v_time).w.
     
  14. RetroKoH

    RetroKoH

    Member
    1,728
    107
    43
    S1Fixed: A successor to ReadySonic
    Ah... I didn't even realize that last point about clearing d0. And the clarification on how to use this type of instruction really helps. Thanks for the help, from both of you guys!
     
  15. GT Koopa

    GT Koopa

    Member
    2,023
    20
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    So this HG Sonic 2 Disassembly. I am rather frustrated with it. Doing something as simple as the swapping chunk code in game doesn't work when I put it elsewhere.


    Testing this right away in Chemical Plant Zone does nothing. It runs through the code which I know via the ring collection sound but the chunk won't update to what I expect it to do.

    In the 2007 disassembly, this would be:

    What is going wrong?

    Edit: I think I figured it out. The problem was just my supposing that the chunk location to call up in the RAM would be that chunk location by the cursor in SonEd2. In reality, the whole bg chunk locations as well threw me off.
     
  16. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Okay, I've got a few questions pertaining to Sonic 2.

    First one: Why can Tails not fly under the water? It's weird that hee fails to respawn in CPZ, ARZ, and HPZ just because of whatever causes that.

    I had more, but I don't remember them now, so I'll just move on to one related to a hack.
    I'm having a problem withe Sonic 1 title cards, which I ported in from the Nick Arcade prototype (and made them display of course).

    The problem is dealing with something to to do with the configuration data, everything else seems to work fine. On the later Zone's, I'll see stuff like this:

    [​IMG]

    Notice how the act number is stuck over there on the right.

    Here is where the configuration data is read:

    Code (Text):
    1. Obj34_CheckConfig:
    2.         lea (Obj34_Config).l,a3
    3.         lsl.w   #4,d0
    4.         adda.w  d0,a3
    5.         lea (Obj34_ItemData).l,a2
    6.         moveq   #3,d1
    7.  
    8. Obj34_Loop:
    9.         move.b  #$34,id(a1)
    10.         move.w  (a3),x_pos(a1) ; load start x-position
    11.         move.w  (a3)+,$32(a1)  ; load finish x-position (same as start)
    12.         move.w  (a3)+,$30(a1)  ; load main x-position
    13.         move.w  (a2)+,$A(a1)
    14.         move.b  (a2)+,routine(a1)
    15.         move.b  (a2)+,d0
    16.         bne.s     Obj34_ActNumber
    17.         move.b  d2,d0
    and here is the actual data:

    Code (Text):
    1. Obj34_Config:
    2.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; EHZ
    3.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; 001
    4.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; WZ
    5.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; 003
    6.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; MTZ
    7.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; MTZ
    8.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; 006
    9.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; HTZ
    10.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; HPZ
    11.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; 009
    12.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; OOZ
    13.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; MCZ
    14.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; CNZ
    15.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; CPZ
    16.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; GCZ
    17.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; ARZ
    18.     dc.w     $0000, $0120,  $FEFC,$013C,  $0414, $0154,  $0214, $0154; DEZ
    Any idea what's wrong?
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    Under TailsCPU_Flying_Part2, delete the section where it checks the water flag. Or have it switch him to a swimming animation when he moves below the water line instead of setting his Y coordinate.
     
  18. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    That seemed to be minimal help.
    In a rogue case, I can get him to appear at all when underwater, but normally he still won't respawn when I'm underwater.

    Additionally, I remember my other question now; I'm working with the bubble object (object 0A), and I'm confused about something; All I'm trying to do is reduce the rate that the characters release air bubbles, but I'm not sure how to to that. In a Sonic and Tails game, with rippling water, the additional bubbles can make it very laggy.
     
  19. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    11
    18
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    Anyone know how to transpose VGMs? Alpha SPC player can do this for SPCs, but in_vgm cannot.
    + - Betting Nineko or ValleyBell will show up with the answer.  
     
  20. ValleyBell

    ValleyBell

    Tech Member
    246
    25
    28
    researching PC-98/X68000 sound drivers
    in_vgm doesn't come with a transposing feature, but you can easily hex-edit the (uncompressed) VGMs to play at lower or higher frequencies.
    (If you need to uncompress them, rename them to .vgm.gz and use one of the many tools that support the .gz format.)

    At first, you need to look at the VGM spec. Find the offset of the clock value of the chip you want to transpose.
    Then open the VGM in a hex editor and write the clock value down. (Note: They are in Intel byte order, so the bytes 78 56 34 12 are read as $12345678.)
    Now you need to scale the value. The usual frequency formula applies here, so doubling the value means to transpose one octave up, halving it transposes one down. For semitones, the factor is 2 ^ (transpose / 12).
    Write the new clock value to the file and save.

    Example: Transpose the SN76489 PSG up by 2 tones
    Clock value is at $0C, value is $00369E99 = 3 579 545.
    Scaling factor: 2 ^ (2/12) = 1.1225
    3 579 545 * 1.1225 = 4 017 903 = $003D4EEF

    + - P.S.: If you look at nineko's last log in date, you'll know that he won't show up. :P