Go to the spikes code, do the opposite of what the remove spike bug guide tells you to do, so remove a few lines. Most likely errors, open up your build.bat in notepad, and add 'pause' at the end. Run it again, it'll say if you have any errors. Use playsound #sound effect number It could be different in s1, to double check look at any playsound you can find, or anything similar. It follows the same rule
The game froze because you branch from Obj2E_ChkGoggles to Obj2E_ChkGoggles so it's stuck in an infinite loop. Assuming that 8 is the last monitor subtype you have, you should branch to the end. Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? bne.s Obj2E_ChkEnd move.w #$1E,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 jmp (PlaySound_Special).l ; play collecting bubble sound
To add a sound effect, the following bit of code will do fine: Code (ASM): moveq #$xx,d0 jsr PlaySound ...where xx is the sound test ID of what you want to play. Pretty simple. EDIT: Fuck, new page. Beaten
Thank you. There is only one problem though: When I compile the ROM I get this error: SN 68k version 2.53 C:\USERS\ANTHONY HALL\DESKTOP\HACKING PROJECT\HIVEBRAIN\SONIC1.ASM(12668) : Erro r : Symbol 'obj2e_chkend' not defined Assembly completed. 1 error(s) from 47598 lines in 0.14 seconds Lightning's ROM Padder Reported Size: 0 Reported Checksum: 0 Size applied: 7F Checksum Applied: 0 Press any key to continue . . . Any ideas why obj2e_chkend is not defined?
No, obj2e_chkend exists in a clean disassembly, he probably removed it by mistake. For this reason I'm not going to paste here what to put there, even if I could. He should download another clean disassembly and fix that.
Besides that, I'm pretty sure the routine is nothing but an rts, anyway. Just define the label and slap an rts in there. Sorted.
Sorry, I'm not very experienced at this. What do you mean, you have to make it your self? EDIT: Tweaker, What should I define the label? Thanks
Defining a label is basically sticking the name of the routine with a colon at the end. You'd want to make something like this: Code (ASM): Obj2E_ChkEnd: rts ...and stick it below the end of Obj2E_ChkGoggles. That should sort everything out.
Sorry, but the file still doesn't compile (Your probably getting bored...Sorry ), Here is the code I presently got: ; =========================================================================== Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? bne.s Obj2E_ChkEnd rts move.w #$1E,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 jmp (PlaySound_Special).l ; play collecting bubble sound ; =========================================================================== I then tried using Tweaker's advice: ; =========================================================================== Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? move.w #$1E,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 jmp (PlaySound_Special).l ; play collecting bubble sound bne.s Obj2E_ChkEnd rts ; =========================================================================== and for both attempts I got: The batch file output is: SN 68k version 2.53 C:\USERS\ANTHONY HALL\DESKTOP\HACKING PROJECT\HIVEBRAIN\SONIC1.ASM(12668) : Erro r : Symbol 'obj2e_chkend' not defined Assembly completed. 1 error(s) from 47599 lines in 0.22 seconds Lightning's ROM Padder Reported Size: 0 Reported Checksum: 0 Size applied: 7F Checksum Applied: 0 Press any key to continue . . . For the first code, and for the second code it was exactly the same (Apart from the line No of course)
I think you have to define the label then the program can call it - try this...... Code (ASM): ; =========================================================================== Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? move.w #$1E,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 jmp (PlaySound_Special).l ; play collecting bubble sound bne.s Obj2E_ChkEnd Obj2E_ChkEnd: rts ; ===========================================================================
Whoa, you're confusing me now! Haha. Okay, what you're going to want is something like this: Code (ASM): Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? bne.s Obj2E_ChkEnd ; if not, stop checking for different monitor types move.w #$FFFF,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 ; move bubble collecting sound to d0 jmp (PlaySound_Special).l ; play collecting bubble sound Obj2E_ChkEnd: rts Let me explain the flow of the code. The first thing we're doing is checking if the monitor contains the Goggles subtype. If it does, then it's going to skip over that branch to Obj2E_ChkEnd, which will ONLY execute if the monitor is not the Goggles subtype. That routine will pop the stack, backing out of the monitor code entirely as it should. The code after that branch is the stuff you wrote. It's going to set Sonic's oxygen level, as well as play the bubble collection sound. Once these two instructions are completed, it will then move onto the next routine, which is Obj2E_ChkEnd. As before, this will pop the stack and exit the monitor code. This is the correct flow of logic—once everything is done executing, it backs out so it doesn't attempt to execute unrelated code (or sometimes data, which can obviously not be exectuted). The code you wrote was wrong the first time because you set an rts before your custom code could execute. This means that any additions you made were null and void, and were never even parsed. The second code you wrote was wrong because it checks if the monitor is Goggle, but never exits if it's not. This would make it so any subtypes added after this monitor would always have the Goggle monitor effect, which is something you don't want. Anyway, the code I wrote should work fine; I also took the liberty of maxing out the oxygen level so it appears to be infinite. Is there anything you still don't understand that I can explain to you?
Ok, I tried both Tweaker's and Adam2k7's code scripts, and Adam2k7's script states that there is a "Zero Branch Length" and Tweaker's code results in the monitor still freezing the game. Should I post the whole monitor code from Obj2E (Monitor source code)? Thanks EDIT: I thing I was wondering: If I can get the monitor working, If I set the monitor to give Sonic half the air of an air bubble, If I break the monitor with full oxygen (Which I will call one unit), will I have one and a half units (It adds air), or will I have only half a unit (Overwrites the air Sonic had before breaking the box)?
OH, I know the problem. That was extremely stupid of me to overlook. Change the jmp to PlaySound to a jsr. That should handle everything.
What should the line be exactly, I tried three diffrent combinations, and only one compiled which still froze the game when I hit the monitor, the code I wrote was: jsr (PlaySound_Special).l ; play collecting bubble sound In the code I added the S Block which gives Sonic 50 rings, and a Robotnik which hurts Sonic Will any of that affect the code?
Actually, you know what, I think I might know what the problem is. Did you edit Obj2E_ChkS at all? You need to edit that to recognize the new monitor code. Try going to Obj2E_ChkS, and replacing that and the Obj2E_ChkGoggles you tried to put in before. This should sort everything out. Code (ASM): ; =========================================================================== Obj2E_ChkS: cmpi.b #7,d0 ; does monitor contain 'S' bne.s Obj2E_ChkGoggles rts ; =========================================================================== Obj2E_ChkGoggles: cmpi.b #8,d0 ; does monitor contain Googles? bne.s Obj2E_ChkEnd ; if not, stop checking for different monitor types move.w #$FFFF,($FFFFFE14).w ; Add Oxygen to Sonic move.w #$AD,d0 ; move bubble collecting sound to d0 jmp (PlaySound).l ; play collecting bubble sound Obj2E_ChkEnd: rts ; ===========================================================================
Here's an example of a working bubble monitor, I used the ring monitor but change the references to the goggles monitor: Code (ASM): Obj2E_ChkRings: move.w ($FFFFF646).w,d0 cmp.w $C(a0),d0 ; is Sonic above the water? beq Obj2E_Chk3End cmpi.b #8,d0 ; does monitor contain Googles? bne.s Obj2E_Chk2End ; if not, stop checking for different monitor types move.w #$FFFF,($FFFFFE14).w ; Add Oxygen to Sonic bcs Obj2E_BubbleSound Obj2E_BubbleSound jsr ResumeMusic ; cancel countdown music move.w #$AD,d0 jmp (PlaySound_Special).l ; play collecting bubble sound lea ($FFFFD000).w,a1 Obj2E_Chk3End: rts For some reason, it's only working at various times.
Do you mind pasting your original S monitor code? I don't mind editing the bit I have to adapt to your edits.
Nevermind I solved it. I now know that bne.s means GOTO There is only two problems. 1. When I get a bubble, the immunity to drowning is removed. 2. When Sonic exits the water, the immunity of drowning is removed. Anyway Thanks for everything.