don't click here

Basic Questions & Answers thread

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

  1. Sonic 65

    Sonic 65

    Tech Member
    I don't know the exact details, but I know that it uses the Genesis's double-resolution mode (this is enabled by setting bits 1 and 2 of VDP register $C). I think Nemesis made a post about this a while back.
     
  2. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Jman explain it a bit here.
     
  3. So I loaded a clean Sonic 1 ROM (it was a .gen file if that matters) into the editor and edited the first act of GHZ a bit. When I opened the edited rom in GENS all I got was a red screen. What did I do wrong and how do I fix this?
     
  4. Afti

    Afti

    ORIGINAL MACHINE Member
    3,521
    0
    0
    Your checksum is bad.

    You click the 'Fix Checksum' option.

    It's very simple.
     
  5. nineko

    nineko

    I am the Holy Cat Tech Member
    6,310
    486
    63
    italy
    I seriously think we should bring this topic back to a place where it can be seen even by people who don't bother to search the forum. Unless keeping it hidden is part of a plan to find out lazy people. But I doubt so.
     
  6. Ah, thanks. I'm kind of new at this. I know I should be starting with SonED but I hate the way it saves with project files. Plus I'm skipping the "oh shits I needs moar power" bit.
     
  7. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    Dear christ, get your head out of your ass already.

    That said, the forum description says to read this forum and the archive below, which clearly had the answer to your question. There's a difference between confusion and laziness. Put a little effort into finding out the answer to a question before asking it—use the search function.
     
  8. muteKi

    muteKi

    Fuck it Member
    7,852
    131
    43
    Also the Genesis DOES have "scaling" capabilities through the use of raster (I.e., line by line refreshing) effects. This is only possible for the non-sprite layers (I.e., the foreground and background), and isn't directly hardware related; it requires programming "tricks" in order to work. (Should be noted that similar effects can be done by writing to CRAM (color pallette) during line refreshes as well, theoretically allowing the entire color range of the MD on screen at once, though it's generally best used in modes where the screen is divided into horizontal sections as the normal palette restrictions still apply.)
     
  9. Twilight

    Twilight

    Member
    51
    0
    6
    Michigan
    A Sonic the Hedgehog hack
    What does

    align macro
    cnop 0,/1
    endm

    mean? And what makes

    move a6,usp

    improper?
     
  10. Uhh...what game? Sonic 1 or 2?
     
  11. Twilight

    Twilight

    Member
    51
    0
    6
    Michigan
    A Sonic the Hedgehog hack
    Sonic 1.
     
  12. nineko

    nineko

    I am the Holy Cat Tech Member
    6,310
    486
    63
    italy
    ASM68K doesn't support the "align" directive natively, which is used to align some stuff (code, but more usually data) at a certain offset in the rom. This is useful for example to put sound banks in specific locations or something.
    So with this macro, which is defined at the beginning of the ASM file, you're making your ASM68K able to use the "align" directive, even if in a bastardized way.
    Some other assemblers, like AS (iirc) does not need this macro, as they natively support align.
     
  13. FraGag

    FraGag

    Tech Member
    To complement nineko's post...
    I suppose that ASM68k incorrectly assumes that MOVE, without an explicit size attribute, is a word-sized operation. However, the documentation clearly states that MOVE to USP (usp is the user stack pointer) is a long-sized operation. This is, I think, a small bug in the assembler, as other assemblers accept it just fine, but can be worked around by replacing move with move.l, as has been stated in the guide on the wiki (SCHG How-to:Convert the Hivebrain 2005 disassembly to ASM68K).
     
  14. Anthall

    Anthall

    Spambot Member
    235
    0
    0
    Leicester, UK
    Sonic the Hedgehog - The Final Showdown
    OK, Its another question from me about ASM, but I doubt this is possible, but I'd thought I'd ask.

    Is it possible to create random subroutine jumping in Assembly for Sonic 1?

    For example, is it possible to make some code so that there is a 50% chance of jumping to one Subroutine and a 50% chance of jumping to another subroutine?

    Thanks.

    EDIT: Fixed Crappy Grammar
     
  15. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Code (ASM):
    1.     jsr RandomNumber
    2.     andi.b  #1,d0
    3.     tst.b   d0
    4.     beq.s   Routine
    5.     bra.s   OtherRoutine
    I believe that should work.
     
  16. FraGag

    FraGag

    Tech Member
    You don't need to put the TST here, as the ANDI instruction will set the flags the same way TST would, making the TST redundant. Also, you won't need the last BRA if the code is directly after.
     
  17. Anthall

    Anthall

    Spambot Member
    235
    0
    0
    Leicester, UK
    Sonic the Hedgehog - The Final Showdown
    Thanks Malevolence and FraGag for your help. I have 2 questions though.

    1. Is it possible to have more than two outcomes?

    2. What does the #1 mean?

    Thanks
     
  18. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    It is possible to have more than one but you're going to have to make a whole table. The 1 makes sure that the result is either 1 or 0 (if you do an and 1 to the value of 0111 you'll get a 0001, if you do it to the value of 0110 you'll get a 0, and takes a value in binary and keeps all bits that are the same in both values).
     
  19. nineko

    nineko

    I am the Holy Cat Tech Member
    6,310
    486
    63
    italy
    Is the andi really needed, since tst will check one bit anyway?
     
  20. FraGag

    FraGag

    Tech Member
    You're confusing BTST and TST. TST will test the whole operand (according to its size attribute), while BTST will test a single bit, which is specified in the left operand.

    Anthall, if your number of outcomes is a power of 2 (2, 4, 8, 16, etc.), it's quite easy to set up:
    Code (ASM):
    1.         jsr RandomNumber    ; call the pseudo-random number generator
    2.         andi.b  #xx,d0      ; restrict the number to a valid range
    3.         move.w  RandomJumps(pc,d0.w),d0
    4.         jsr RandomJumps(pc,d0.w) ; call a random jump routine
    5.         ; code continues here
    6.  
    7. RandomJumps:
    8.         dc.w    RandomJump1-RandomJumps
    9.         dc.w    RandomJump2-RandomJumps
    10.         dc.w    RandomJump3-RandomJumps
    11.         dc.w    RandomJump4-RandomJumps
    12.  
    13. RandomJump1:
    14.         ; code here
    15.         rts ; don't forget the rts!
    16. ; do the same for all other RandomJump routines
    In the code above, replace xx with (the number of outcomes - 1) * 2 (still assuming it's a power of 2), e.g. for 16 outcomes, use (16-1)*2 = 30 (or $1E in hex). If the number of outcomes isn't a power of 2, you'll have to use a modulo instead of ANDI; use the DIVU instruction for that (which is much slower).