don't click here

Basic Questions & Answers thread

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

  1. The Joebro64

    The Joebro64

    SAY HELLO TO MY CHOCOLATE BLEND Member
    3,193
    2,856
    93
    Ah... I'm playing it with just the ISO. Now I see. Thanks.

    (also I do own the game legally, I just wanted to try out ++ to see what it's like. And I have to say I'm impressed)
     
  2. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    I could be totally off-base, so I recommend testing it yourself, just noticed that the image I have is set up very differently to the Sonic CD++ instructions.

    (I also have a legal copy of SCD, it's just that SCRATCHES happened)
     
  3. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    Thanx. It seems Genesis Plus works, if kinda buggy.

    Also another more obscure thing to ask. Does anyone know where I can find some high quality movie files of the Sonic Mania character endings?
     
  4. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    Sorry, me again, but does anyone know Sonic 3 coding? I've been trying to fine tune Amy in Sonic 3K, but since adding a new move, the high jump is working differently. It only jumps according to the pressure of holding the A button instead of being a consistent height. I'm not sure what I'm doing wrong here since this is supposedly the right coding for a mere button press activation:

    Also is there any known quick way to find and fix checksum errors in ASMs?
     
  5. BlueSpeedsterYT

    BlueSpeedsterYT

    Now rendered in full 3D Member
    28
    2
    3
    Hey it's me again, so I finally figured out how to add Knuckles into Sonic 2 but there is a problem, the game won't build due to errors that I don't know how to fix, if I did anything wrong, please let me know. Thanks.
     
  6. Inferno

    Inferno

    Member
    36
    71
    18
    Sonic 1 Definitive
    First of all, try checking out what the thing is with the first error. If it's meant to be branching to that with the guide applied, then change the bne.s to bne.w in order to allow it to branch over a greater distance. If it's not meant to be like that, then figure out what it's supposed to be like. I suspect that it's the first error causing all the other errors, but I wouldn't know, so give it a try.
     
  7. BlueSpeedsterYT

    BlueSpeedsterYT

    Now rendered in full 3D Member
    28
    2
    3
    Well that was a quick reply, thanks for that, now there is a new problem:
    Do I still replace the s with the w? Or should I do something else?
    UPDATE: Managed to change it to a W but it would take me a long while for me to change some code over a couple of errors
    UPDATE NO.2: It was only one error and now it's done, thanks Inferno Gear!
     
  8. Inferno

    Inferno

    Member
    36
    71
    18
    Sonic 1 Definitive
    I'd like to explain why exactly changing that allowed the game to compile. The "jump distance too big" error means that the game is unable to make the jump with the current branch size (these are short, byte, word, and longword respectively, IIRC). Each of these have a different amount of bytes that they can branch forwards or backwards. By changing those commands from bne.s and bhs.s to bne.w and bhs.w, you were increasing the number of bytes forwards and backwards that the game could branch, to $FFFF forwards and backwards for the word size, IIRC. Hence, the distance is no longer too big for the command. Hopefully this helps you in the future. This should be the order you go in for fixing these things:
    • Is it a .s branch and giving me the "Jump distance too big" error?
    • Turn it into a .b.
    • Is it a .b branch and giving me the "Jump distance too big" error?
    • Turn it into a .w.
    • Is it a .w branch and giving me the "Jump distance too big" error?
    • Turn it into a .l.
    • By some horrible nightmare, is it a .l branch and giving me the "Jump distance too big" error?
    • For conditional branches, make it branch to a command which jumps to the destination, and if it's just bra or bsr, make it jmp or jsr respectively.
    Good luck.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,785
    365
    63
    SonLVL
    No. There is no .l for branches. If it's too far for .w, you have to change it to jmp/jsr.
     
  10. nineko

    nineko

    I am the Holy Cat Tech Member
    6,351
    509
    93
    italy
    Also, weren't .b and .s the same thing?
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,785
    365
    63
    SonLVL
    .b and .s both represent byte-sized data, although I'm not sure if they're interchangeable, I think you have to use .s for branches and .b everywhere else.
     
  12. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    I believe this is the case too. Fairly certain that last time I did some optimization that asm68k threw a wobbly when I used .b for a branch.
     
  13. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    Okay, so I've implemented the upward spin dash/peel out into S3K, but am having a couple issues:

    * Linking the dash to the up button/looking up animation ends up screwing up the Mushroom Hill end transition. Does anyone know how to deactivate looking up just before the player jumps onto the Flying Battery (or alternative is there a branch approach I can put into the spin dash code to deactivate it when the Flying Battery object appears)?
    * For whatever reason, Competition Mode doesn't recognise the up button, so upward dash can not be utilised in it. Any known way to fix this?
     
    Last edited: Feb 2, 2020
  14. Chainspike

    Chainspike

    Stealing rings since 1994 Member
    173
    90
    28
    Death Egg Zone
    S3C Delta
    I'm not certain about the first one, but the branch approach seems like the most logical way to go. For the second question, this is because the Sonic object used in competition mode is actually a separate player object from the one used in the main game. You'll want to find Obj_Sonic2P and make the relevant changes to it.
     
  15. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    Ah, yes, that fixed the 2P issue. Thanx for that. (Can tell I haven't hacked S3K in ages since I already edited this part before).

    I'm not sure what exactly to put to recognise the Mushroom Hill cutscene though. Is there a particular flag related to it or automated cutscenes, or alternatively does anyone know if there's a spin dash flag to turn off so I can try placing it inside the cutscene?
     
  16. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    I don't have the disasm to hand, but you could try doing a break on writing to the controller state location whilst the cutscene is active, and following that back to where the data gets pulled from ROM. The cleanest solution is probably to edit the control sequence going in so that the Fake Player stops pressing d-pad up just before Sonic is due to jump.

    Edit: Just having a quick nosey at the memory map. Are you using $F604 or $F605 to get the controller state? If so, you could try $F602 or $F603 instead, those shouldn't update when the cut scene is active.
     
    Last edited: Feb 6, 2020
  17. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    That's the thing though, I can't make a break when I don't know what input to make for one. Any sort of data connected to the cutscene I try to make work as a branch is not considered valid input (eg. a cmpi.b for the MHZ2 ship's palette or backgroundinit code). Is there any sort of compatible data I could put that would work that way?

    To give you an example I tried putting at the start of the spindash code but it said the addressing mode wasn't allowed:
    Basically what form of code connected to it could I make a valid cmpi or tst out of and how would I structure it is what I wanna figure out.

    I can't find the 4 digit controller input coded anywhere either. Not sure if I know how that works.
     
    Last edited: Feb 7, 2020
  18. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    @E-122-Psi Right, ignore my initial suggestion, it's probably the wrong way to go about it. I'll elaborate on my second suggestion instead. So, for reference: the memory map.

    From the memory map, we can see that $FFF604 and $FFF605 are used to store the controller state. You must be using at least one of these in your code to read the action buttons as part of the peelout combo.

    $FFF602 and $FFF603 act exactly the same as the previous locations, except that they only update when the player has control. So, if you use these in your code instead, Sonic will only be able to use the peelout specifically when the player is in control. No branch needed!


    Ignore it all! In short, I got all the above wrong. I've already rewritten this post twice and accidentally hit "back", so I'll be brief: $FFF7CA is zero only when the player has control. Use that to disable your peelout move. Something like
    Code (Text):
    1. tst.b (Ctrl_1_locked).w
    should do the trick.

    Offs_BackgroundEvent isn't what you think it is. It's not a RAM location that you can compare against, it's the start of a table of addresses.
     
    Last edited: Feb 8, 2020
  19. E-122-Psi

    E-122-Psi

    Member
    2,477
    625
    93
    Ah I think that did it. Thanx very much.
     
  20. So hey guys,Glitchex here. So anyways,Im making a Sonic 1 ROM hack and so I have one question,
    In case if you didnt read the title,I need some tips for making professional level tiles and im planning on making a complete overhaul to Sonic 1, and also one really good app for making level tiles besides SonLVL. Would appreciate your advice for this.