don't click here

Basic Questions & Answers thread

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

  1. Destructiox

    Destructiox

    Masochistic Maniac, Raving Lunatic Member
    237
    0
    0
    East Midlands, England
    Sonic 1 Lunacy.
    That's where it all went wrong, I do believe.
     
  2. Hivebrain

    Hivebrain

    Administrator
    3,049
    161
    43
    53.4N, 1.5W
    Github
    HivePal can edit any file, not just complete ROMs. You just need to specify the length of the palette yourself, then load it.
     
  3. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    When you start to edit you take a clean rom and a clean disassembly folder and split it. I figured I could erase everything and split my rom with a clean disassembly. That's why I renamed it.


    What do you mean 'specify the length of the palette yourself'? Don't you just load it, change it, then save it?
     
  4. Hivebrain

    Hivebrain

    Administrator
    3,049
    161
    43
    53.4N, 1.5W
    Github
    The default length in HivePal is set to 10 (hex) colours, iirc. If you're editing a level palette, you'd need to change it to 30. Apart from that, all you need to do is load it, change it and save it.
     
  5. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    Every time I build my rom and then put it into Hivepal, change the colors (which all I'm doing is opening it and changing the colors manually by sliding the bars, that is what I have always done and it has worked fine), and then try to play it, the screen is red and nothing happens. Also when I change the colors of s2.bin in Hivepal and then open my edit in SonED2, there is no change to the palette.
     
  6. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    That's a checksum error. You need to remove the checksum routine first to get rid of this error.

    Also I thought you were editing Sonic 2? Because only Sonic 1 has it o_O
     
  7. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    I am and that's what I got. How do I remove the checksum routine?
     
  8. SMTP

    SMTP

    Tech Member
    Umm you really shouldnt be using Hivepal on your complied rom.... either use it to edit the individual palette files or use the built in palette editor in SonED2.
     
  9. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    I just want to change all the greens to blues. I can't figure out how to do that except changing it all manually bit by bit.

    EDIT: OKay, NM. I figured out how to use it.
     
  10. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    I'm really not trying to be in this thread everyday...

    Sonic 2 - SonED2

    I finished EHZ1 and started EHZ2. I got half way through changing it when I saved and tried to test it. I started the game, got through act 1. When I got to act 2 the music came on and I could see the background but nothing else. If I move the D-pad around I can hear Sonic rolling and I can hear him jump. When I put the debug code in I got in the level, I turned into a ring and tried to move around. There was no visual change but the debug counter was moving, when I turn back into Sonic the counter reset to where it was.

    Everything shows up fine in SonED2, so what did I do this time?

    :(
     
  11. SMTP

    SMTP

    Tech Member
    Thats rather odd to say the least. Did you happen to put an object thats NOT supposed to be placed in ehz or use an invalid object ID?
     
  12. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    I did some basics first and put the tubes from Hill Top in there, tested it, and it worked. So that's when I did about half the level and tested it again, that's when the problem started. Other then that I don't think I put any other 'wrong' objects in there. The ID is the third set of numbers on the object right? The first is what it is and the second is what kind, I think.
     
  13. SMTP

    SMTP

    Tech Member
    First is ID, Second is subID, third is rotation and object saving.
     
  14. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    Yeah dur that's right. I've spent all day getting my grandfather out of the hospital.

    I didn't put anything in that's not supposed to be there except the Hill Top tubes which worked the first time I tested it. I will take out the tubes and see what that does.
     
  15. SR212787

    SR212787

    Member
    80
    0
    0
    Gallifrey, TN
    Sonic 2
    I took out the tubes and a few objects, anything I could think of that could be it and still nothing. What did I do now, or am I just lucky for glitches? :specialed:
     
  16. While looking around in Sonic1.asm, I found this
    Code (Text):
    1. Obj2E_ChkS:
    2.         cmpi.b    #7,d0    ; does monitor contain 'S'
    3.         bne.s    Obj2E_ChkEnd
    4.         nop
    5.  
    6. Obj2E_ChkEnd:
    7.         rts        ; 'S' and goggles monitors do nothing
    This got me wondering, if I could change what the Eggman Monitor does, maybe I could add on and change what the 'S' and goggle monitors do. So, heres my question(s):

    1) How do I get it so that the 'S' Monitor is seperate from the goggle monitor (if not already seperate)?
    2) What code must I use to have the 'S' monitor act as both an invincibility monitor and 5 '10 ring' monitors at once? (Along with the Ring check to add on an extra life)
    3) How do I have the goggle monitor remove any caps added on while sonic is underwater (You know, him slowing down), along with changing sonic's sprites so that the unused "goggle sonic" is used for his idle and running sprites? Also, the googles are removed at any time Sonic would take damage without a barrier (ie: Langding on spikes once ( :objection: I'm still trying to figure out how to disable the spike bug, but thats irrelevent for the moment))

    Please put the answers to each of these within a single code box, if possible.
     
  17. HighFrictionZone

    HighFrictionZone

    Hi. Member
    855
    0
    16
    Katy, Texas
    Nothing
    After
    Code (Text):
    1. bne.s    Obj2E_ChkEnd
    Replace the nop with whatever code you want the S monitor to run, then add a section like this:

    Code (Text):
    1. Obj2E_ChkS:
    2.         cmpi.b    #8,d0; is it a goggles monitor?
    3.         bne.s    Obj2E_ChkEnd
    4.         nop
    Again, replacing the nop with whatever code you want the goggles monitor to run.

    Finally, edit the comment on the last part so it's like this:
    Code (Text):
    1. Obj2E_ChkEnd:
    2.         rts       ; Everything else does nothing.
    This last part is optional, and mostly so you don't forget that you did change the code so "S" and "Goggles" do stuff now.



    In theory, if you kept increasing the number after #8 you could have more monitors. In practice, all that new monitor art isn't going to make itself or find space in memory to be drawn.

    That'd generally be how you get goggles and "S" to work.

    As for how to get the "S" monitor to work the way you want, I'd suggest looking at how the invincibility monitor works, using that as a base, then throwing in the code from the 10-ring monitor for good measure. It's all already there and laid out to be used. While you're at it, throw in speed shoes because I think I can see where this is going.
     
  18. I forgot about the speed shoes, I'll have to replace the 50 rings with that instead (Seeing as how I want the monitor to work as similar to Super Sonic as possible, without adding in to much coding, along with not adding in a seventh special stage.

    Heres what I put for the outcome
    Code (ASM):
    1. Obj2E_ChkS:
    2.         cmpi.b  #7,d0       ; does monitor contain 'S'
    3.         bne.s   Obj2E_ChkRings
    4.         move.b  #1,($FFFFFE2D).w ; make Sonic invincible
    5.         move.w  #$4B0,($FFFFD032).w ; time limit for the power-up
    6.         move.b  #$38,($FFFFD200).w ; load stars object ($3801)
    7.         move.b  #1,($FFFFD21C).w
    8.         move.b  #$38,($FFFFD240).w ; load stars object ($3802)
    9.         move.b  #2,($FFFFD25C).w
    10.         move.b  #$38,($FFFFD280).w ; load stars object ($3803)
    11.         move.b  #3,($FFFFD29C).w
    12.         move.b  #$38,($FFFFD2C0).w ; load stars object ($3804)
    13.         move.b  #4,($FFFFD2DC).w
    14.         tst.b   ($FFFFF7AA).w   ; is boss mode on?
    15.         bne.s   Obj2E_NoMusic   ; if yes, branch
    16.         move.w  #$87,d0
    17.         jmp (PlaySound).l   ; play invincibility music
    18.                 bne.s   Obj2E_ChkShield
    19.         move.b  #1,($FFFFFE2E).w ; speed up the BG music
    20.         move.w  #$4B0,($FFFFD034).w ; time limit for the power-up
    21.         move.w  #$C00,($FFFFF760).w ; change Sonic's top speed
    22.         move.w  #$18,($FFFFF762).w
    23.         move.w  #$80,($FFFFF764).w
    24.         move.w  #$E2,d0
    25.         jmp (PlaySound).l   ; Speed up the music
    26.         nop
    27.  
    But when I built and test the game, it just brings me to a blank screen and nothing happens. Anything I should modify to fix it? (I know its "yes," but I'm not sure how to fix it)
     
  19. SephyUK

    SephyUK

    WHY SO CURIOUS? Member
    597
    0
    0
    Qatar
    Some Freakishly Long Anime
    Hey guys, theoretically, is it possible to make it so that S1 loads both of GHZ 8x8 patterns as one file rather than 2?
     
  20. Destructiox

    Destructiox

    Masochistic Maniac, Raving Lunatic Member
    237
    0
    0
    East Midlands, England
    Sonic 1 Lunacy.
    Personally, I would change that to

    Code (ASM):
    1. Obj2E_ChkS:
    2.         cmpi.b  #7,d0
    3.         bne.s       Obj2E_Goggles
    4. [S monitor code here]
    5.  
    6. Obj2E_Goggles
    7.         bra     Obj2E_ChkEnd
    8.  
    Reason for that being, if you hit a goggle monitor at your current point in time, it would hang up the game, since at no point would the game be able to reach the goggle code, because you branch back to ChkRings, which would run again to ChkS, then back to ChkRings, and repeat.

    Aside from that, are you sure there are no building errors? The code seems somewhat sloppy. For instance, I placed your code into a rom, and it claimed that there was an out of range error for that bra.s Obj2E_NoMusic, si change that to a bne.w. Also, why do you randomly have a bne.s Obj2E_ChkShield in there? You're not even making a compare for the branch to work with.

    (Quick Edit: If you're trying to make it so that the S monitor gives Sonic a shield as well, try 'move.b #1,($FFFFFE2C).w ; give Sonic a shield' instead of bne.s Obj2E_ChkShield)

    Last but not least, get rid of that nop at the end, it's not necessary.

    Another Edit: And as someone pointed out to me, You appear to have a jmp. (Playsound).l half-way through your code, this would stop the game from carrying on with the rest of the code after that point.