Using that routine but changing it to aim at a position one tile lower will make it always hit Mario.
In this case, that's not the problem. What I need is about twice as much accuracy. As in, if Mario moves 4 pixels to the left, then the angle should change to accommodate. Right now it takes 8 or so pixels for any change to occur. In my case, 4 would probably be the minimum that would be allowable, but more accuracy is always better.
I should get a new layout.
Probably won't, though.
imamelia SMW ASM & Music Moderator
Location: Montana, USA
Does anybody have an aiming routine I could use? I'd use the default one that Magikoopas use but it's too inaccurate for what I'm trying to do.
Replace "inaccurate" with "uncustomizable", and you'd get what I've always said about the aiming routine edit1754 used for some of his dynamic sprites. I really wish he'd make a version of that that was more flexible; it could really be useful.
What I really need is a routine that will fire an object from point A to point B with a large amount of precision (within 4 or so pixels to any side), hence why SMW's default routine won't work. But I've found a formula for finding the value of an arctangent, only problem is it involves a lot of division and multiplication. In that case, can the division and multiplication registers work at the same time? If not then this method might not be so feasible.
Does anyone know anything about the GFX uploading routine beginning at $00AA6B? I'm trying to figure out what $1BA2-$1BE2 are for, but I'm getting nowhere fast. About all I can figure out is that $1BBC-$1BBD seem to be either FFFF or 0000 depending on whether or not the GFX file being uploading is GFX01 (to check for the Special World GFX). I also discovered that $1BA2 is definitely used in some of the Mode 7 bosses, including Reznor and Bowser.
In theory, this should add one to $C681 (which is free RAM according to the SNES9x debug) and then write that to the coin counter, and back to itself. But for some reason it writes 1 to the coin counter every frame (this is in LevelASM).
Also the last INC works fine (I just put that in to make sure the code was being run).
the problem is with the $C681, if anything is past $8000, it's considered loading the ROM Address from Bank 00. you have to use long addressing mode instead, so $C681 would become $7EC681
Edit: Also, are you trying to make it so when the freeram is a specified value, it increses your coin counter? if so, then you would use this code instead
CMP #$xx ; replace xx with the specified value
BCC + ; If less than specified value, branch
LDA #$00 ;\ Can't STZ $7EC681 since it's
STA $7EC681 ;/ a invalid opcode/command
I'm trying to use Multiple Midway Points patch. Whenever I touch in a midway point and die, I am redirected to level 0. Any suggestions?
I'm inserting the midway point custom blocks. But nothing changes.
It works properly when I don't expand the table. I'm trying to expand to 10. After this change nothing works normally.
!MIDWAY_NUMBER = $0009 ; max number of midway points per level
; using more vastly increases the size of the table
; if you changed it to, for example, 0003
; the tables for EVERY level would look similar to this:
; dw $0001 : dw $0001 : dw $0001
; the maximum of midway points would be 00FF (256 decimal)
dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 ;
dw $0001 : dw $0001 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 ; place the level number which you want to use here
dw $0002 : dw $0002 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 ;
I want Ladida's scroll code to effect layer 3, but when I change the 1E to 22, nothing happens. Why is that? It's especially odd because it will work fine on layer two when it is 1E.
(Here's the code.)
LDX #$06 ; The amount of bytes in the scroll table.
db $00 ; End byte, don't remove it
LDA #$00 ; Last byte of free RAM address
LDA #$A0 ; Middle byte of RAM address
LDA #$7F ; First byte of RAM address
LDA $22 ; Layer 3 X-position