don't click here

Basic Questions & Answers thread

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

  1. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    I just had an idea that perhaps running 64-bit windows might be the issue. SNASM68k won't run at all, and ASM68K seems to not like me very much.

    For example, I attempted to run ASM68K on a vanilla text disassembly of Sonic 2 and the "align"s were rejected with the error of "unrecognized Opcode"

    I even tried making a basic program to load the registers with some values (put into drx's template from the hacking cult) but the 68k debug in gens only shows 7 empty data registers, with one (either d2 or d3) having 0x53 in it.

    This is upsetting.
     


  2. Since when do we care about copyright? The other zones come with them joint anyway...and we already know sega can't care less about us hacking the shit out of their roms =P
     
  3. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Lemme guess, it's something like
    Code (ASM):
    1. move.b #$9F, ($C00011)
    2. move.b #$BF, ($C00011)
    3. move.b #$DF, ($C00011)
    4. move.b #$FF, ($C00011)
    That mutes all PSG channels, just in case. Don't worry =P

    Do you know how to write to VRAM and CRAM? I guess this will lead to a separate thread anyways =P
     
  4. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    Similar, like this:
    Code (Text):
    1.                ; initialize PSG
    2.                MOVEQ    #4-1,D5    ; loop for 4 PSG registers
    3.      .6     MOVE.B  (A5)+,$0011(A3)   ; C00011 copy PSG initialization commands
    4.                DBRA D5,.6
    Nope. That's why I want this code working, so I can experiment with it and figure out how to do these things.

    Should I make a new thread?
     
  5. Hivebrain

    Hivebrain

    Administrator
    3,049
    162
    43
    53.4N, 1.5W
    Github
    Everyone should be using the superior SVN disassembly. It's updated regularly, and comes with all the data files and SonED2 projects you need.
     
  6. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    Yes, for hacking, but I was just looking to assemble it to make sure ASK68K was functioning properly on my 64-bit windows system. To do that I need a single file.
     
  7. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Wow, that's overkill o_o; Do you know if the values that get written match the ones I've posted? ($9F, $BF, $DF and $FF)

    Maybe this page can help for now, I'm not exactly good at explaining these things =& But basically you write something into $C00004 to tell where to write then send the data into $C00000. Check the page for details of what to send into $C00004.

    But honestly, that "hello, world" program isn't exactly easy to understand :psyduck:

    The Windows version of asm68k should work in Win64 because it's a 32-bit program. I don't guarantee anything about long filenames, though. Didn't that version have an bug parsing spaces in filenames in the command line, completely disregarding the quotes? (shame Windows for forcing programs to parse the command line manually instead of doing it itself like the rest of OSes)

    By the way, quick usage for ASM68K:
    Code (Text):
    1. asm68k /p «filename.asm», «filename.bin»
    That does an exact build of the code and outputs a raw binary. /p is needed to prevent the assembler from adding its signature at the end of the file =|
     
  8. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    My God, it's starting to work. My header's broken again, but I can fix that, I now have a garbled font with a correct palette loaded. GENIUS!

    Long story short: That /p (the lack of it) was the source of my problems. I love you Sik, and you now have a 1-time use free coupon to have me hump your leg upon request.
     
  9. RamiroR

    RamiroR

    Member
    355
    0
    16
    The "RINGS" text was in black, but now it displays correctly.

    [​IMG]

    Like normal levels, how can I get the ring counter to flash red when at 0?
     
  10. filmzombie

    filmzombie

    The real spindash... Member
    155
    0
    0
    England- The Land of Tea
    Sonic Synthesis
    okay, I still havent been able to get Sonic 1 working in SonEd2. However, I have managed to upload Sonic 2, so instead I'm just editing that instead.

    Currently, I have editied the Silver Sonic and Final Fight in Death Egg, Act 1 of Emerald Hill is now pretty much complete (got loop to work by copying settings from EHAct2 ;)

    However, even though I vaguely recall somebody mentioning how to do this, when I come to start editing Chemical Plant Zone, what's the best way I go about positioning certain oobjects such as moving platforms or rotating ground effectively, considering there are no pictures for reference?

    My concern is they may end up a bit wonky next to each other since I will probably try guessing positions.
     
  11. muteKi

    muteKi

    Fuck it Member
    7,852
    131
    43
    Is it really an issue? You can't actually get hurt in the special stages...
     
  12. RamiroR

    RamiroR

    Member
    355
    0
    16
    I think it's quite normal to have it flash even if I cannot get hurt. It can warn you of not getting a ring bonus—no bonus points in the special stage. It's pretty rare to exit the special stage with no rings.
     
  13. nineko

    nineko

    I am the Holy Cat Tech Member
    6,312
    488
    63
    italy
    You should look into the Obj21_Flash subroutine (if you're using the old disassembly, I don't know if they renamed it).

    Also keep in mind that Sonic 1 has a bug with that, but I doubt that it would affect you.
     
  14. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    Can anyone explain to me how Sonic 3 seems to have to background layers?

    For example, in HCZ Act 2, there are large columns in the background with more tiles deforming behind them. Same thing with the 'towers' in CNZ Act 1.

    How is this possible? I'm under the impression the the VDP only has 3 layers?
     
  15. muteKi

    muteKi

    Fuck it Member
    7,852
    131
    43
    Animated patterns, basically. Dynamite Headdy did something similar.

    You'll notice that these background layers are rather simple and repeat often -- that's to cut down on the number of tiles used for the effect to save space.

    What happens is that the game checks for the players motion/position and draws the background based on that. Sonic 2 used this in Hill Top as well.
     
  16. Spanner

    Spanner

    The Tool Member
    Okay guys, I'm working on a port of something (not naming) from Sonic 2 to Sonic 1. Unfortunately, something's stopping me. This supposed opcode:
    Code (ASM):
    1. mvabs.w
    The mvabs opcode appears in loc_366D6 in the S2 disassembly and is used like this (I can't describe it due to my lack of 68K knowledge):
    Code (ASM):
    1. mvabs.w d3,d5
    Now, I've looked at the macros and I can't find it and it's also an unknown opcode with the AS version of the Sonic 1 disassembly, which is strange.
    So any of you asmfags know how to solve this?
     
  17. nineko

    nineko

    I am the Holy Cat Tech Member
    6,312
    488
    63
    italy
    Code (Text):
    1. ; macro to move the absolute value of the source in the destination
    2. mvabs macro source,destination
    3.         move.ATTRIBUTE  source,destination
    4.         bpl.s   +
    5.         neg.ATTRIBUTE   destination
    6. +
    7.     endm
    Retrieved from http://svn.sonicretro.org/wsvn/CommunityDi...y/s2.asm?rev=63
     
  18. Spanner

    Spanner

    The Tool Member
    And I didn't see that. :O
    Thanks though, I added the macro, fixing the problem.
     
  19. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    Much Appreciated, thanks for the quick responce.
     
  20. Azu

    Azu

    I must be stupid. Member
    Should I know C++/C to learn ASM for hacking and such?