I also only have the S&K disassembly, cause that's what the Mercurial had. I just want to try building that disasm with that converted level in the place of Mushroom Hill Act 1, just to see what would happen. But I haven't a clue what I'm doing here.
Basic Questions & Answers thread NEWBIES: Start here!
#4066
Posted 07 March 2012 - 05:38 AM
I also only have the S&K disassembly, cause that's what the Mercurial had. I just want to try building that disasm with that converted level in the place of Mushroom Hill Act 1, just to see what would happen. But I haven't a clue what I'm doing here.
#4067
Posted 07 March 2012 - 12:26 PM
#4068
Posted 07 March 2012 - 10:45 PM
Hitaxas, on 06 March 2012 - 09:20 PM, said:
I am working more on that giant motobug boss that I posted a little while back, but I want to do something more with it. I won't go much into details, but here is what I want to do for right now.
I want the boss to check for if it has reached a certain point on the screen, and branch if it has not.
I tried something like this
cmpi.w #$29C0,x_pos(a1) ; Is the boss at this location on the map?
bgt + ; if not, branch
However, this does nothing at all. The enemy is loaded at a1, and set at a greater x position than the check at first. Any help would be appreciated.
Where is this code located? You don't show where you set a1, so I can't tell if it's initialized properly. If this is in the boss object's code, the object should be in a0.
What do you mean by "this does nothing at all"? What is it supposed to do? If you don't have any better debugging tools, try putting an ILLEGAL instruction at the point you want to reach and when the game crashes with an illegal instruction exception, it means the branch was taken.
#4069
Posted 08 March 2012 - 02:06 AM
; ===========================================================================
; loc_E6B0:
LevEvents_EHZ2_Routine2:
cmpi.w #$28F0,(Camera_X_pos).w ; is Sonic at this position on the cameras x_pos?
bcs.s return_E6EC ; if not, don't do this yet
move.w #$28F0,(Camera_Min_X_pos).w ; lock the minimum x_pos for the camera here
move.w #$2940,(Camera_Max_X_pos).w ; lock the maximum x_pos for the camera here
move.w #$28F0,(Tails_Min_X_pos).w
move.w #$2940,(Tails_Max_X_pos).w
addq.b #2,(Dynamic_Resize_Routine).w ; => LevEvents_EHZ2_Routine3
move.w #$F9,d0 ; Set to fade the level music out
bsr.w JmpTo3_PlayMusic ; play the fading "music"
clr.b ($FFFFF73A).w ; clear this
move.b #2,(Current_Boss_ID).w ; Turns on boss flag
moveq #$29,d0 ; set PLC 29 (EHZ boss)
bsr.w JmpTo2_LoadPLC ; load said plc
return_E6EC:
rts
; ===========================================================================
; loc_E6EE:
LevEvents_EHZ2_Routine3:
cmpi.w #$388,(Camera_Y_pos).w
bcs.s +
move.w #$388,(Camera_Min_Y_pos).w
move.w #$388,($FFFFEEFC).w
+
addq.b #1,($FFFFF73A).w ; add 1 to this
cmpi.b #$5A,($FFFFF73A).w ; is it 5A
bcs.s return_E736 ; if the result is greater than...
bsr.w JmpTo_SingleObjLoad ; set to load an object (this prepares for the boss loading)
bne.s + ; if not, play music and jump to the 4th routine
moveq #$5F+$80,d0 ;
jsr (PlaySound).l ; play it!
move.b #$4E,(a1) ; load obj56 (EHZ boss)
move.b #$81,subtype(a1)
move.w #$2AFE,x_pos(a1) ; x position to load object ; 29C0 For original spot/ center screen
move.w #$426,y_pos(a1) ; y position to load object
cmpi.w #$29C0,x_pos(a1) ;
bgt + ;
clr.w x_vel(a1)
move.b #$15,($FFFFF622).w ; Flash the Screen
move.b #$56,(a1) ; load obj56 (EHZ boss)
+
addq.b #2,(Dynamic_Resize_Routine).w ; => LevEvents_EHZ2_Routine4
move.w #$93,d0
bsr.w JmpTo3_PlayMusic
return_E736:
rts
; ===========================================================================
That is how this is set up currently.
#4070
Posted 08 March 2012 - 09:57 AM
#4071
Posted 08 March 2012 - 10:24 AM
AerosolSP, on 07 March 2012 - 05:38 AM, said:
I also only have the S&K disassembly, cause that's what the Mercurial had. I just want to try building that disasm with that converted level in the place of Mushroom Hill Act 1, just to see what would happen. But I haven't a clue what I'm doing here.
You would start by replacing MHZ's files in the Levels folder with the files you got from LevelConverter, then... I'm not sure. I've never ported a level to S3K.
#4072
Posted 08 March 2012 - 11:00 AM
flamewing, on 08 March 2012 - 09:57 AM, said:
The thought behind that was if the position is higher, branch and ignore the lines following.
I changed loc_E6EE to look like this, which I thought would work better, but nothing happens when the boss reaches $29C0.
; loc_E6EE:
LevEvents_EHZ2_Routine3:
cmpi.w #$388,(Camera_Y_pos).w
bcs.s +
move.w #$388,(Camera_Min_Y_pos).w
move.w #$388,($FFFFEEFC).w
+
addq.b #1,($FFFFF73A).w ; add 1 to this
cmpi.b #$5A,($FFFFF73A).w ; is it 5A
bcs.s return_E736 ; if the result is greater than...
bsr.w JmpTo_SingleObjLoad ; set to load an object (this prepares for the boss loading)
bne.s + ; if not, play music and jump to the 4th routine
moveq #$5F+$80,d0 ;
jsr (PlaySound).l ; play it!
move.b #$4E,(a1) ; load obj56 (EHZ boss)
move.b #$81,subtype(a1)
move.w #$2AFE,x_pos(a1) ; x position to load object ; 29C0 For original spot/ center screen
move.w #$426,y_pos(a1) ; y position to load object
cmpi.w #$29C0,x_pos(a1) ;
beq + ;
addq.b #2,(Dynamic_Resize_Routine).w ; => LevEvents_EHZ2_Routine4
move.w #$93,d0
bsr.w JmpTo3_PlayMusic
rts
+
clr.w $14(a1)
move.b #$15,($FFFFF622).w ; Flash the Screen
move.b #$56,(a1) ; load obj56 (EHZ boss)
return_E736:
rts
; ===========================================================================
#4073
Posted 08 March 2012 - 07:42 PM
Hitaxas, on 08 March 2012 - 11:00 AM, said:
You are basically persisting on the same error; you missed my subtlety, which is partly my fault for being too terse and cryptic, so let me elaborate: the code you gave creates a new boss at position $2AFE whenever it runs; immediately after creating this new boss, the code compares the position of this newly created boss to $29C0 and branch if the boss' position is higher than this (that is, always). You are always creating a brand new boss and using its position; you are never checking the position of the true boss. Thus, the code will never work as you intend it to.
For it to have a chance of working, you have a couple options: you can either scan SST to find the boss object; or you can save a pointer to it in RAM after you create the boss, loading it back to check its position; or you can move the check into the boss' code.
#4074
Posted 08 March 2012 - 11:50 PM
flamewing, on 08 March 2012 - 07:42 PM, said:
Hitaxas, on 08 March 2012 - 11:00 AM, said:
You are basically persisting on the same error; you missed my subtlety, which is partly my fault for being too terse and cryptic, so let me elaborate: the code you gave creates a new boss at position $2AFE whenever it runs; immediately after creating this new boss, the code compares the position of this newly created boss to $29C0 and branch if the boss' position is higher than this (that is, always). You are always creating a brand new boss and using its position; you are never checking the position of the true boss. Thus, the code will never work as you intend it to.
For it to have a chance of working, you have a couple options: you can either scan SST to find the boss object; or you can save a pointer to it in RAM after you create the boss, loading it back to check its position; or you can move the check into the boss' code.
After Routine3 creates the boss, it also increases the routine counter by 2, so the eventual Routine4 will run on subsequent frames. Unless your boss should react to something that is handled in the dynamic level events, you should really put code of this nature in the boss object's code instead; that way, you won't have to find the boss in object RAM. If you really want or need this code to be in the DLE, put it in Routine4.
#4075
Posted 11 March 2012 - 08:57 AM
Thanks.
#4076
Posted 15 March 2012 - 08:00 PM
#4078
Posted 17 March 2012 - 10:51 PM
#4079
Posted 18 March 2012 - 10:02 AM

Now, this seems like an easy fix, but I'm stupid so HALP PLZ? I've undone everything that I had recently applied. But still, same problem. I even went for the copy that I made and even that shares the same problem. So basically, I've fucked up! If there's a lesson to be learnt there, it's that you cannot make enough back-ups in case issues like this ever surfice.
EDIT: I managed to fix a problem with the ring sprite. But now Sonic is totally invisible. I'm just going to leave the it alone until I get some help.
#4080
Posted 20 March 2012 - 01:56 PM
