don't click here

Basic Questions & Answers thread

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

  1. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    RAM and VRAM are different things. Those $200 bytes you freed were in RAM, not VRAM.

    $F2E0 is an actual VRAM address. $2797 is two things: 2 and $797. The latter is a tile index, which is the VRAM address / $20, the size of a tile. 2 selects the palette line for the sprite to use.
     
  2. Campbellsonic

    Campbellsonic

    Member
    19
    0
    1
    Ah, okay. Makes sense now. So then the number I modified in the lamppost was using Sonic's pallet at line 0, and that's why it was only three digits. Alright, I shouldn't have much trouble rearranging everything then, may just be horribly tedious. Also it seems my question was mostly answered already a couple posts ago... Oops.

    Just out of curiosity, does every person who ports S3 sprites have to go through all of this? It seems like a very common design choice for hacks, yet it's so troublesome to actually do. I just have this feeling I'm missing a far easier way to do it.
     
  3. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    I'm seen a fair few hacks where the maker just ignored the glitched points. Others remove the points object entirely, so you never see it. Doing it 'properly' is the hard way.
     
  4. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    I asked these a while back, but I'm gonna try to ask them one more time since I didn't get an answer. I think they got kinda sandwiched between other questions.

    1: Which Sound Driver is easier on the Z80? Sonic 2's or Sonic 3K's? I'd guess Sonic 3K's, since was made FOR the Z80 rather than just being a hackish port, but I'm not exactly sure about this.

    2: Another edit: Also, which is faster on the 68K? Move.b #1,address , or bset #0, address? tst.b, or btst?

    And, a totally new one...

    3: Is it inappropriate to update an existing guide written by someone else, even if the updated information is more accurate/relevant to current to disassembles? I haven't touched a few old SCHG guides that are in need of pretty major updates because it seemed like kind of a gray area.
     
  5. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    Define 'easier on the Z80'. They both update on V-Int, and process DAC in their spare time, they're both written with space-efficiency in mind (though S&K does better, on occasion: the coord. flag jump table comes to mind), and what S&K's gains from not having music FM6, it loses with SFX FM6.

    Off the top of my head, one of the biggest differences is RAM usage: both drivers have little free Z80 RAM left, and while in S&K's case it's because of how much code and data the driver uses, S2's is largely down to the Saxman-compressed music buffer, which can easily be freed, unlocking plenty of RAM.

    If you ask me, S2's is the easiest on the Z80, pretty much solely down to the fact that it's so stripped-down: you already have the modifications done to S1's driver, like the removal of panning 'animations', special FM3, and LFO, and on top of that you have S2's modifications, like the removal of the Special SFX. In the end, you have a fairly lightweight driver, that has also stood the test of being portable. I certainly wouldn't call it hackish: the port itself appears pretty well-done... barring the horrible 'multiply-by-25' code, anyway.
     
  6. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Is the "Multiply by 25" thing something that's fixable? I don't remember if your old guide on improving the Sound Driver covered it, but I'm intrigued by what you mean.
     
  7. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    it's just written in a messy way. The OptimiseDriver option in the Git disasm already 'fixes' it.
     
  8. Steelrush

    Steelrush

    Every good deed has its reward. Member
    19
    0
    1
    A humid place
    Blaze the Cat in Sonic 2
    I have an additional issue in regards to porting Sonic 1 bosses to Sonic 2.

    I've taken just about all the required steps to porting it, and while the ROM is able to compile, the game crashes once I move to the location where I placed the boss. I have not been able to determine the cause of why this happens at all. :\

    EDIT: The boss I used there was the Labyrinth Zone boss.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I would recommend installing either Flamewing's or vladikcomper's error debuggers, and running the rom in Regen, Genesis Plus GX, or Exodus. Use the listing file (s2.lst) to see where in the code the crash happens, and if you still can't figure it out, then you can come back and ask for more help.
     
  10. NyaNyaLily

    NyaNyaLily

    Previously CHRnyan Member
    88
    29
    18
    Well this is a weird problem.

    So I've placed this red sidewards spring in SonED2 and tested it in game to see if it would work.

    [​IMG]

    But the spring caused Sonic to go so fast that the game sort of glitched.

    [​IMG]

    After this I just placed an even faster one just for the sake of it, and it caused Sonic to fly out of the screen and die.
    So, is there any way to fix this or is it a hardware issue?

    Sidenote: if you walk away from the glitched chunk and come back, the chunk is loaded normally without any problems.
     
  11. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    I think I know what's going on: The Sonic engine can only draw so much level geometry at once, so, in order to prevent bugs, the game limits how fast the camera can move, which is why Sonic can outrun the camera if he runs fast enough. However, Sonic 1 in particular forgot to cap the camera scrolling when running left. The fix for this can be found in the Spin Dash guide (it really should be split into its own guide, though). Look for the code relating to loc_65F6.
     
  12. NyaNyaLily

    NyaNyaLily

    Previously CHRnyan Member
    88
    29
    18
    Alright, I'm sorry for saying this but I can't find the "loc_65F6" line. I don't really know if I'm searching in the wrong .asm file or if the guide is meant for a different disassembly (I'm using the "Sonic 1 Git Disassembly Standard ASM68K version").
    So, in which .asm file do I need to search?

    (Again, sorry for asking this but I barely know what I'm doing)
     
  13. Clownacy

    Clownacy

    Tech Member
    1,053
    581
    93
    Oh, right. In the Git disasm, it's called SH_BehindMid, and it's in DeformLayers.asm/DeformLayers (JP1).asm.
     
  14. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,192
    405
    63
    Japan
    I'm assuming this is the bug-fix in question? It seems we have had it twice on the wiki for some time now... =$
     
  15. NyaNyaLily

    NyaNyaLily

    Previously CHRnyan Member
    88
    29
    18
    Well, the spring is now a speedrunners dream, Sonic speeds out of the screen and activates a level wrap which places him next to the sign post.
    I guess I'll just place a slower one for now.

    Thanks for the help though.
     
  16. Colton

    Colton

    Member
    9
    0
    0
    If you wanted to make the fastest zone ever then that's the way to do it lol
     
  17. Steelrush

    Steelrush

    Every good deed has its reward. Member
    19
    0
    1
    A humid place
    Blaze the Cat in Sonic 2
    An update on my attempt to port the Labyrinth Zone boss (from Sonic 1) to Sonic2;

    Using the debugger, I managed to obtain what could have been a trace to what was making the game crash. The problem is...

    [​IMG]

    None of this is inside any of the ASM files I used, and I did a thorough check to make sure of that. When I used other emulators, I got a slightly different error that also displayed code that didn't appear anywhere in the ASM files being used.

    I have no idea what the problem is now, other than a possible fault in the boss ASM's code that I can't find for some reason. :\

    In case you guys might want it, I provided a link to a save state I made.

    https://www.dropbox.com/s/8e1rmfk17g33vqo/The%20save%20state.zip?dl=0
     
  18. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    PC=$0330B1 should be a clue that something in your code is jumping to the wrong address.

    An actual MC68000 cannot run code on odd addresses; what should have happened is an Address Error, but Kega doesn't implement this. (The disassembled instruction doesn't actually exist, since instructions must be aligned to even addresses.)
     
  19. NyaNyaLily

    NyaNyaLily

    Previously CHRnyan Member
    88
    29
    18
    (Not him again)

    Well, I've ran into a new issue. The screen locks at the original place of the signpost, even though it's not there anymore. This is a pretty annoying problem since it doesn't let you proceed further into the level.
    [​IMG]

    [​IMG]

    I've tried searching in some .asm files like "LevelSizeLoad & BgScrollSpeed (JP1).asm", "DeformLayers (JP1).asm" and "DynamicLevelEvents.asm".

    To no avail. :(
     
  20. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    Quick question. Does any program exist that allows you to edit Sonic 3D Blast (Genesis) Sprites? Want to try and tackle a quick idea I had (replace the Sonic sprites with those from SegaSonic arcade), but if it's too much trouble I'll probably forget about it.