If you want to check if down and A is being pressed, you need to do this check: Code (ASM): move.b ($FFFFF603).w,d0 ; move the current button press to d0 and.b #$42,d0 ; and the your value on it ($42/A+down in this case) beq.s JD_Return ; if A + down is not being pressed, branch And as an explaination, here you have a tiny guide about button presses. If you want to check for multiple buttons being pressed at the same time, you just need to add the values together (so: $40=A + $02=down = $42=A+down). Oh, almost forgot something: I'd like to help you with your problems on MSN or something. If you agree, just shoot me a PM and I'll see what I can do (and don't be shy, I won't byte =P).
Okay, two things. Does anybody know how to change the SEGA logo sound especially if you are using an assembler? Also, is there a way to import Sonic 3D Blast music into Sonic 1? I tried using the ESEII Sound Importer, but the version 2 beta is a little complicated for me to understand.
The problem here is that it'll not branch if A "OR" Down is pressed, this is how it works. Lets say you are pressing A, Down & C at the same time, "ReadJoypads" is a subroutine of which will dump the controls from the ports to ram (Obviously to prevent having to read from the port constantly which would take more processing to do). move.b ($FFFFF603).w,d0 So, we've loaded all the buttons from that ram space to d0 so we can modify it for checking. The way that the controls are read is in bits (0000 0000) each bit represents a button (SACB RLDU). S = Start A = Button A C = Button C B = Button B R = D-Pad Right L = D-Pad Left D = D-Pad Down U = D-Pad Up If the bit is set (1), then the button has been pressed, is it is clear (0), then the button has not been pressed, in our example we have A, Down & C pressed, so in bits that would be 0110 0010, and in Hex bytes that would be $62. The purpose of this command below is to clear ALL other buttons being pressed except the buttons you want checking: and.b #$42,d0 This is clearing all bits except the ?'s 0?00 00?0, so now only button statuses A or Down are held in d0 (C was cleared). beq.s JD_Return Due to the ccr there is an automatic branch if certain requirements are met, this in a basic term asks the question, "If the ? bits (0?00 00?0) are null (if they are both 0), then branch. If ANY of those two ? bits are set (if any are 1), DO NOT BRANCH." ---- So it seems your jumpdash will dash if A + Down are pressed, or is only A is pressed, or if only Down is pressed. It might be a simple idea to put: Code (ASM): move.b ($FFFFF603).w,d0 ; move the current button press to d0 and.b #$42,d0 ; get only buttons A and Down cmp.b #$42,d0 ; were both A and Down pressed? bne.s JD_Return ; if not, branch ..and there you have it.
Unusual question, but I feel like doing a bit of hacking again, albeit simple stuff (adding levels and art, swapping music and level orders, maybe swapping bosses and such in Sonic 2). Problem is I'm running on Mac OSX, and stuff like SonEd and even disassemblies are unavailable to me, and I don't really want to be running parallels or anything as I have neither the disk space or the money. So yeah, to my question ~ How feasible would it be for me to actually do any of this stuff? What tools would I need, what would the processes be required, and how difficult would it be?
While it has corrected the button activation it still hardly ever works. It seems random whether pressing the buttons activate a normal jump attack or the dash. If it helps here is my reworked code. It is assigned to Md_Jump2 and placed after Sonic_Roll Code (Text): ; --------------------------------------------------------------------------- ; Subroutine for Sonic's hammer spin animation ; --------------------------------------------------------------------------- ; ||||||||||||||| S U B R O U T I N E ||||||||||||||||||||||||||||||||||||||| Sonic_HammerSpin: move.b ($FFFFF603).w,d0; move the current button press to d0 and.b #$42,d0 ; get only buttons A and Down cmp.b #$42,d0 ; were both A and Down pressed? bne.s JD_End ; if not, branch tst.b ($FFFFFFEB).w; was jumpdash flag set? bne.w JD_End ; if yes, branch move.b #1,($FFFFFFEB).w; if not, set jumpdash flag move.b #$20,$1C(a0); show hammer animation move.w #$BC,d0 ; set jumpdash sound jsr (PlaySound).l; play jumpdash sound bclr #4,$22(a0); clear double jump flag move.w #$800,d0; set normal jumpdash speed tst.b ($FFFFFE2E).w; do you have speed shoes? beq.s JD_ChkUW; if not, branch move.w #$A00,d0; set speed shoes jumpdash speed JD_ChkUW: btst #6,$22(a0); is Sonic underwater? beq.s JD_ChkDirection; if not, branch move.w #$400,d0; set underwater jumpdash speed JD_ChkDirection: btst #0,$22(a0); is sonic facing left? beq.s JD_Move ; if yes, branch neg.w d0 ; if not, negate d0 (for jumping to the right) JD_Move: move.w #$F00,$12(a0); move sonic forward (y-velocity) JD_End: rts ; return ; End of function Sonic_JumpDash There are different animations for jumping (the spring animation plus a landing transition $21) and the animation for the dash is $20 rather than a roll, it works fine the times it activates it just seems to work rarely and randomly. Is the normal jump attack interfering or something?
I'm not sure about this, but I think it's because you are using the same flag as a normal jumpdash ($FFFFFFEB). I'm not sure if you have any other moves using this flag anyway, but try using a different one. I'll just give you $FFFFFFB0, hoping you haven't used it yet. Also, make sure you are clearing that flag in Sonic_ResetOnFloor.
I don't even know how to give flags to moves anyway. How do you clear a flag in Sonic_ResetOnFloor? I take it this is why it only works once. Still same thing otherwise, works on a whim, almost never first time, activating A jump attack instead. Aside from the Touch_Enemy/Monitor and Bounce coding, is there any other coding I'm supposed to add or edit?
OK, this one, I need to know. Suppose you want to make a Sonic 1 level using a special project template. However, I have not seen a lot of templates for novice hackers. If anyone can make a GHZ template or find one off the internet, I'm sure to get started.
I think Selbi means something like this: Code (ASM): Sonic_ResetOnFloor: ; XREF: PlatformObject; et al clr.b ($FFFFFFEB).w ; clear jumpdash flag clr.b ($FFFFFFB0).w ; clear HammerSpin flag btst #4,$22(a0) beq.s loc_137AE nop nop nop loc_137AE: bclr #5,$22(a0) bclr #1,$22(a0) bclr #4,$22(a0) btst #2,$22(a0) beq.s loc_137E4 bclr #2,$22(a0) move.b #$13,$16(a0) move.b #9,$17(a0) move.b #0,$1C(a0) ; use running/walking animation subq.w #5,$C(a0) loc_137E4: move.b #0,$3C(a0) move.w #0,($FFFFF7D0).w rts
Stumbled upon something, didn't know how useful it could be. Would this program help anybody here at Retro with anything at all?
I have a question about porting music from another game. Is it possible to change what DAC voices are used in a music file by using a hex editor? The music that I ported plays fine but when it comes to the DAC playing I usually hear the messed up Sega sound playing. Also, is it possible to change how a music file plays because I have some music that I ported from xm to smps which plays from beginning to end and starts over again. With a hex editor, is there anyway I can loop the music from a certain point in the song? Also, I want to add a new monitor that gives out a random amount of rings when hit. It probably works somewhat the same as getting 10 rings but how exactly could this be done?
Yes. Assuming that you want to port songs from Sonic 3 to Sonic 1, for example, you'll have (at least) to change the kick from $86 to $81, and the snare from $81 to $82 (complete tables can be found here). Of course make sure to change the snare first, or you'll end up with a bunch of $81s and you wouldn't know what to do with them. To find the portion of the smps song which contains the DAC channel, you have to look at the header: get the pointer to the DAC channel, and the first pointer which is higher than that (it's usually the pointer to the voices). For example, if your pointer to the DAC channel is $1234, and amongst the other pointers you have $1200, $963, and $2345, your DAC channel will be between $1234 and $2345-1, unless there are crazy jumps around the song (if that's the case you're pretty much fucked unless you feel like following the pointers around). So just go to that range and do the needed replacements I bet you can if you have an infinite amount of time and patience. But every converter in the xm2/3/4smps series has built-in support to set a custom loop point. Just define it in your XM file and it will be automatically ported over. In Mod Plug Tracker, this setting is called "Restart Position", and it's in the General tab; it's measured in patterns, so you might need to split a pattern by hand in order to have it loop properly, but most of the times it's an easy cut and paste job. Good luck!
Sorry if this a dumb question, but how do I get a level to use different enemies in Sonic 2? I want to use the Metropolis Zone crab in Emerald Hill Zone, and I think I might have to edit the graphics.
Start playing around with the code around ArtLoadCues:. You may want to also edit the palletes as well.
Why was searching around some locations the best thing I could do to take a break from an epic huge 10 pages report? I really don't know... Anyway, the ArtLoadCues routine is... oh... well... I just noticed: What the hell? Is it really that hard to press Ctrl + F in the ASM file and seach for ArtLoadCues:? In other words, yes it is there (s2.asm), but even if it's not, you could just check out the other files and search there, because it's gotta be somewhere. Ok, end of post. Enough break time.