| Official Hex/ASM/Etc. Help Thread |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |
|
|
|
|
| Posted on 2010-10-09 06:51:59 PM |
Link | Quote |
|
Originally posted by yoshicookiezeusUsing 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.
|
|
| Posted on 2010-10-09 06:52:45 PM |
Link | Quote |
|
Originally posted by KipernalDoes 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.
|
|
| Posted on 2010-10-09 07:15:06 PM |
Link | Quote |
|
|
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.
|
|
| Posted on 2010-10-10 01:30:46 AM |
Link | Quote |
|
Quick question:
Is it possible reference a register using long addressing? Or are they only writable using absolute?
|
|
| Posted on 2010-10-10 02:10:36 AM |
Link | Quote |
|
|
If you mean hardware registers, LDA #$80 STA $002100 works fine. It's just a little slower and larger than STZ $2100, but that shouldn't matter.
|
|
| Posted on 2010-10-10 02:30:34 AM |
Link | Quote |
|
|
So they use bank 00 then. Alright.
|
|
| Posted on 2010-10-10 02:42:58 AM |
Link | Quote |
|
|
They actually exist in all of banks 00 through 3F. LDA #$00 STA $292100 would give exactly the same results. Using bank 00 is probably less confusing, that's the only difference.
|
|
| Posted on 2010-10-10 02:51:39 AM |
Link | Quote |
|
|
Well it was my biggest fear if I ever had to use banks $40+ for code that I wouldn't be able to write to registers without changing the bank. Guess I don't need to worry.
|
|
| Posted on 2010-10-10 02:52:54 AM |
Link | Quote |
|
|
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.
|
|
| Posted on 2010-10-10 07:03:31 AM |
Link | Quote |
|
Is there a part of the whole palette that's not used by anything?
I'm trying to find space for extra Mario palettes.
|
| Last edited on 2010-10-10 07:04:03 AM by deffon1993. |
|
| Posted on 2010-10-10 11:58:33 AM |
Link | Quote |
|
Originally posted by deffon1993Is there a part of the whole palette that's not used by anything?
I'm trying to find space for extra Mario palettes.
well let's see, the second half of Palettes C-F and there's also the second half of Palettes 5-7 that aren't used at all in levels so you can use those.
|
|
| Posted on 2010-10-10 02:58:03 PM |
Link | Quote |
|
Could somebody tell me what I'm doing wrong here?
CodeLDA $C681
CLC
ADC #$01
STA $0DBF
STA $C681
INC $0DBE
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).
|
| Last edited on 2010-10-10 03:40:31 PM by VideoGuy. |
|
| Posted on 2010-10-10 03:05:53 PM |
Link | Quote |
|
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
CodeLDA $7EC681
CMP #$xx ; replace xx with the specified value
BCC + ; If less than specified value, branch
INC $0DBF
LDA #$00 ;\ Can't STZ $7EC681 since it's
STA $7EC681 ;/ a invalid opcode/command
RTS
+:
LDA $7EC681
CLC
ADC #$01
STA $7EC681
RTS
|
| Last edited on 2010-10-10 03:12:52 PM by Ramp202. |
|
| Posted on 2010-10-10 05:08:05 PM |
Link | Quote |
|
|
That was actually an extremely simplified version of my code, the actual thing is much different. But putting 7E in front fixed the problem perfectly, thanks!
|
|
| Posted on 2010-10-11 05:32:01 PM |
Link | Quote |
|
Hi everybody.
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.
Code
dw $01C0 : dw $11C1 : dw $11C2 : dw $11C3 : dw $11C4 : dw $11C5 : dw $11C6 : dw $11C7 : dw $11C8 : dw $11C9
This happens in all levels.
|
| Last edited on 2010-10-11 05:33:08 PM by Yan. |
|
| Posted on 2010-10-11 05:54:18 PM |
Link | Quote |
|
First, make sure you're not loading from a savestate to check. The title screen needs to be run.
Still it's rather baffling that you'd always be sent to level 0. Does it do the same on a lunar magic edited but otherwise clean ROM?
|
| Last edited on 2010-10-11 06:06:22 PM by Kaijyuu. |
|
| Posted on 2010-10-11 06:31:26 PM |
Link | Quote |
|
It works properly when I don't expand the table. I'm trying to expand to 10. After this change nothing works normally.
Code!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)
LEVEL_TABLES:
;levels 0-F
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 ;
etc...
|
| Last edited on 2010-10-11 06:32:39 PM by Yan. |
|
| Posted on 2010-10-11 06:34:43 PM |
Link | Quote |
|
|
Ah, are you using $000A or $0010?
|
|
| Posted on 2010-10-11 06:40:10 PM |
Link | Quote |
|
|
I tried using $000A and nothing happens. I'm still being transferred to level 0.
|
|
| Posted on 2010-10-13 02:48:01 PM |
Link | Quote |
|
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.)
Init.
Code
LDX #$06 ; The amount of bytes in the scroll table.
LOOP:
LDA ScrollTable,x
STA $7FA000,x
DEX
BPL LOOP
RTS
ScrollTable:
db $7F,$01,$01
db $10,$01,$01
db $00 ; End byte, don't remove it
Level.
Code REP #$20
LDA #$0F02
STA $4330
SEP #$20
LDA #$00 ; Last byte of free RAM address
STA $4332
LDA #$A0 ; Middle byte of RAM address
STA $4333
LDA #$7F ; First byte of RAM address
STA $4334
REP #$20
LDA $22 ; Layer 3 X-position
STA $7FA000+$4
LSR
STA $7FA000+$1
SEP #$20
LDA #$08
TSB $0D9F
RTS
Thanks.
|
| Last edited on 2010-10-13 02:49:56 PM by Lynnes. |
|
|
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |