Magic Autorefill
Zeldix :: Zelda III Hacking :: Patches :: ASM
Page 1 of 1
20201231
Magic Autorefill
This code is adapted from Euclid. It refills your magic by 1 point (max: $80) every 256 cycles ~ 4 seconds (roughly).
You can compile the code with the restriction of autorefill only if in possession of Book Mudora.
Patch files:
http://bszelda.zeldalegends.net/stuff/Con/magic_autorefill.zip
- Code:
lorom
org $808056
JSL freespace
org $A2F4D0 ;some free space in All-in
freespace:
;optionally require book mudora for auto-refill. remove the semicolons if you like this restriction.
;LDA $7ef34e
;BEQ end
LDA $1A
CMP #$7F
BNE end
LDA $7EF36E
CMP #$80
BEQ end
INC A
STA $7EF36E
end:
JSL $8080B5
RTL
You can compile the code with the restriction of autorefill only if in possession of Book Mudora.
Patch files:
http://bszelda.zeldalegends.net/stuff/Con/magic_autorefill.zip
Conn- Since : 2013-06-30
Magic Autorefill :: Comments
Re: Magic Autorefill
Thanks Conn. This is great! I have 2 questions.
1. What value updates the speed? In my game, this is very slow, with about 1 bar every 20 seconds or so. I'd like it to be closer to every 2-3 seconds. I've tried editing the 1A, 7F, and 80, but none of them seem to be affecting the speed.
2. How would I go about tieing this to the Moon Pearl instead of the Book of Mudora?
1. What value updates the speed? In my game, this is very slow, with about 1 bar every 20 seconds or so. I'd like it to be closer to every 2-3 seconds. I've tried editing the 1A, 7F, and 80, but none of them seem to be affecting the speed.
2. How would I go about tieing this to the Moon Pearl instead of the Book of Mudora?
2. How would I go about tieing this to the Moon Pearl instead of the Book of Mudora?
Change this section:
;optionally require book mudora for auto-refill. remove the semicolons if you like this restriction.
;LDA $7ef34e
;BEQ end
Now change LDA $7ef34e to
LDA $7ef357
I know how to edit the speed in the "long version" of another code, which does the same, no idea if it is doable on this "short version".1. What value updates the speed?
Default jump by one unit for this version is around 30 seconds.
A5 1A (lda 1A)
C9 7F (compare value to 7F)
D0 0D (branch 0D bytes)
AF 6E F3 7E (load ram for green magic)
C9 80 (this defines the max amount it will autofill to,
change to C9 40 and it will autofill only to half and
you have to get the other half with green magic bottles)
F0 05 (branch 05 bytes)
1A (increment accumulator)
8F 6E F3 7E (store to ram for green magic)
22 B5 80 80 6B (jsl and rtl)
I don't think you can change the speed by just changing values, you would need the code changed?
Let's see. Puzz already answered your question.
1. You need the moon pearl instead of book mudora:
;LDA $7ef34e
;BEQ end
change this to
LDA $7ef357
BEQ end
2. you can simply write more matches to increase the speed, like in the counter it only happens at 7f. Here is an example which also does it at also at 3f
LDA $1A
cmp #$3f
BEQ increase
(next to the moon pearl change:
PS: If you want it even faster you can multiply the values:
LDA $1A
cmp #$3f
BEQ increase
cmp #$7f
BEQ increase
cmp #$bf
BEQ increase
CMP #$fF
BNE end
increase:
Last edited by Conn on Mon 15 Feb 2021 - 13:40; edited 1 time in total
1. You need the moon pearl instead of book mudora:
;LDA $7ef34e
;BEQ end
change this to
LDA $7ef357
BEQ end
2. you can simply write more matches to increase the speed, like in the counter it only happens at 7f. Here is an example which also does it at also at 3f
LDA $1A
cmp #$3f
BEQ increase
(next to the moon pearl change:
- Code:
lorom
org $808056
JSL freespace
org $A2F4D0 ;some free space in All-in
freespace:
;moon pearl required
LDA $7ef357
BEQ end
LDA $1A
cmp #$7f
BEQ increase
CMP #$fF
BNE end
increase:
LDA $7EF36E
CMP #$80
BEQ end
INC A
STA $7EF36E
end:
JSL $8080B5
RTL
PS: If you want it even faster you can multiply the values:
LDA $1A
cmp #$3f
BEQ increase
cmp #$7f
BEQ increase
cmp #$bf
BEQ increase
CMP #$fF
BNE end
increase:
Last edited by Conn on Mon 15 Feb 2021 - 13:40; edited 1 time in total
Thank you Conn and Puzzle Dude you guys are awesome.
Conn that makes a ton of sense. So 1A is some sort of global timer, and the code right now has the refresh kicking off at 7F (decimal = 127)? Does this timer go up to 80 or FF?
Conn that makes a ton of sense. So 1A is some sort of global timer, and the code right now has the refresh kicking off at 7F (decimal = 127)? Does this timer go up to 80 or FF?
Oh yes, I mixed it up a bit:
So the magic is max $80 (dec 128) and you need 4.26 seconds for one frame hit, it is 128*4.26 seconds=546 seconds= 9 minutes to recover the empty magic meter completely.
So basically if you want 9 minutes you should give
cmp #$7F
if you want double speed (4.5 minutes)
cmp #$7F
cmp #$FF
if you want ~2 minutes
cmp #$3F
cmp #$7F
cmp #$bF
cmp #$FF
so it is balanced.
The code for a 2 minutes refill would be:
- Code:
$1A[0x01] - (Main)
Frame Counter that, given its 8-bit size, wraps after 255 back to 0. It is
often used for calculating timing delays.
Example: Generate a sparkle effect if the value of $1A & 0x07 is zero.
This would produce a sparkle effect once every eight frames.
So the magic is max $80 (dec 128) and you need 4.26 seconds for one frame hit, it is 128*4.26 seconds=546 seconds= 9 minutes to recover the empty magic meter completely.
So basically if you want 9 minutes you should give
cmp #$7F
if you want double speed (4.5 minutes)
cmp #$7F
cmp #$FF
if you want ~2 minutes
cmp #$3F
cmp #$7F
cmp #$bF
cmp #$FF
so it is balanced.
The code for a 2 minutes refill would be:
- Code:
LDA $1A
cmp #$3f
BEQ increase
cmp #$7f
BEQ increase
cmp #$bf
BEQ increase
CMP #$FF
BNE end
Great Conn, I also decoded everything in hex and stopwatch timed the time needed for one unit to increase:
Original code:
needs around 30 seconds for one green unit to increase:
no item needed::
000057, pointer
D0 F4 A2
1174D0,
A5 1A C9 7F D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
needs around 30 seconds for one green unit to increase:
needs Book of Mudora::
000057, pointer
D0 F4 A2
1174D0,
AF 4E F3 7E F0 13 A5 1A C9 7F D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-1
needs around 15 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 17 A5 1A C9 7F F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-2
needs around 8 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 1F A5 1A C9 3F F0 0C C9 7F F0 08 C9 BF F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-3
needs around 4 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 2F A5 1A C9 1F F0 1C C9 3F F0 18 C9 5F F0 14 C9 7F F0 10 C9 9F F0 0C C9 BF F0 08 C9 DF F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-1 (main increase code in ASM)
LDA $1A
cmp #$7F
BEQ increase
CMP #$FF
BNE end
Fast-2 (main increase code in ASM)
LDA $1A
cmp #$3F
BEQ increase
cmp #$7F
BEQ increase
cmp #$BF
BEQ increase
CMP #$FF
BNE end
Fast-3 (main increase code in ASM)
LDA $1A
cmp #$1F
BEQ increase
cmp #$3F
BEQ increase
cmp #$5F
BEQ increase
cmp #$7F
BEQ increase
cmp #$9F
BEQ increase
cmp #$BF
BEQ increase
cmp #$DF
BEQ increase
CMP #$FF
BNE end
You can do a Fast-4 too if the start is at 0F, thus
0F, 1F, 2F, 3F etc to FF (basically addressing all the xF values and the jump is then 10 in hex), this would mean increase one green unit every 2 seconds (a bit too fast I would say).
Original code:
needs around 30 seconds for one green unit to increase:
no item needed::
000057, pointer
D0 F4 A2
1174D0,
A5 1A C9 7F D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
needs around 30 seconds for one green unit to increase:
needs Book of Mudora::
000057, pointer
D0 F4 A2
1174D0,
AF 4E F3 7E F0 13 A5 1A C9 7F D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-1
needs around 15 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 17 A5 1A C9 7F F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-2
needs around 8 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 1F A5 1A C9 3F F0 0C C9 7F F0 08 C9 BF F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-3
needs around 4 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 2F A5 1A C9 1F F0 1C C9 3F F0 18 C9 5F F0 14 C9 7F F0 10 C9 9F F0 0C C9 BF F0 08 C9 DF F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Fast-1 (main increase code in ASM)
LDA $1A
cmp #$7F
BEQ increase
CMP #$FF
BNE end
Fast-2 (main increase code in ASM)
LDA $1A
cmp #$3F
BEQ increase
cmp #$7F
BEQ increase
cmp #$BF
BEQ increase
CMP #$FF
BNE end
Fast-3 (main increase code in ASM)
LDA $1A
cmp #$1F
BEQ increase
cmp #$3F
BEQ increase
cmp #$5F
BEQ increase
cmp #$7F
BEQ increase
cmp #$9F
BEQ increase
cmp #$BF
BEQ increase
cmp #$DF
BEQ increase
CMP #$FF
BNE end
You can do a Fast-4 too if the start is at 0F, thus
0F, 1F, 2F, 3F etc to FF (basically addressing all the xF values and the jump is then 10 in hex), this would mean increase one green unit every 2 seconds (a bit too fast I would say).
Thanks, Puzzledude. I tried out Fast-2 and Fast-3, and found that Fast-3 was just a little too quick. It made magic jars totally useless, rather than just sort of useless.
I think this code needs one more pass though. I noticed 2 "bugs" (features?) with it.
1. Magic continues to refill when you are on the item screen. So if you want a full magic meter in the middle of battle, just press start and wait for a couple of minutes to get a full magic meter.
2. Magic just continues to refill, all the time. With the 1/2 magic meter, and the amount of time it takes to cast Bombos, you have half of the magic from that medallion re-filled by the time you are finished casting it!
Is there some sort of ram value that gets set that pauses enemy movement? Is it the same for using the medallions and the pause menu? I'm just not familiar enough with this game (FF6 is the main game I hack). But I'm sure that value is set somewhere. If the code can check to see if the screen is paused, and if so branch to the end, I think this would be perfect!
I think this code needs one more pass though. I noticed 2 "bugs" (features?) with it.
1. Magic continues to refill when you are on the item screen. So if you want a full magic meter in the middle of battle, just press start and wait for a couple of minutes to get a full magic meter.
2. Magic just continues to refill, all the time. With the 1/2 magic meter, and the amount of time it takes to cast Bombos, you have half of the magic from that medallion re-filled by the time you are finished casting it!
Is there some sort of ram value that gets set that pauses enemy movement? Is it the same for using the medallions and the pause menu? I'm just not familiar enough with this game (FF6 is the main game I hack). But I'm sure that value is set somewhere. If the code can check to see if the screen is paused, and if so branch to the end, I think this would be perfect!
You could use $11 to see whether you are in menu or select screen:
bombos would be
So your code would be
LDA $11
BNE end
LDA $1A
cmp #$3f
bombos would be
LDA $5d
cmp #$09
BEQ end
LDA $1A
cmp #$3f
So your code would be
- Code:
LDA $11
BNE end
LDA $5d
cmp #$09
BEQ end
LDA $1A
cmp #$3f
...
Okay, I'm almost done with this. I did a different frame counter check that checks 3 times per cycle, at 55, AA, and FF. This increases the magic meter every 8-ish seconds, and seemed to be the most balanced as I was playing. I also found MoN's ram map, and added in skips if you're currently using Ether, Bombos, Quake, or the Magic Cape.
There is only one more thing I'm looking for before I consider this "done for now", which is the RAM value that checks if the Cane of Bynna is active. That value's not in MoN's map. I tried looking in Geiger's SNES9x Debugger, but I'm pretty new to checking for RAM values, and I haven't been able to figure it out. Do either of you know?
Anyway, here's my hex, with "plain english" descriptions next to it.
There is only one more thing I'm looking for before I consider this "done for now", which is the RAM value that checks if the Cane of Bynna is active. That value's not in MoN's map. I tried looking in Geiger's SNES9x Debugger, but I'm pretty new to checking for RAM values, and I haven't been able to figure it out. Do either of you know?
Anyway, here's my hex, with "plain english" descriptions next to it.
- Code:
AF 57 F3 7E Do you have the Moon Pearl?
F0 31 If not, jump to the end
A5 11 Do you have any subscreens open?
D0 2D If so, jump to the end
A5 55 Check to see if the Magic Cape is in use
D0 1B If so, jump to the end
A5 5D Check Link's state
C9 08 Casting Ether?
F0 27 If so, jump to the end
C9 09 Casting Bombos?
F0 23 If so, jump to the end
C9 0A Casting Quake?
F0 1F If so, jump to the end
A5 1A Check the frame counter
C9 55 Is the value 55?
F0 08 If so, jump to increase routine
C9 AA Is the value AA?
F0 04 If so, jump to increase routine
C9 FF Is the value FF?
D0 0D If so, jump to increase routine
AF 6E F3 7E Check the magic meter
C9 80 Is it already full?
F0 05 If so, jump to the end
1A Add 1 bar of magic
8F 6E F3 7E Save the new value
22 B5 80 80 The end (Jump back to the regular part of the code)
6B End routine
Would this help?
Be sure you also have fastrom patch applied, your code is executed each frame and can lead to slowdowns. It is very costly, esp. Since you check all sort of stuff.
037b is 01 when cane byrna active to enable invincibility. Might be also 1 after hit by enemy to have short invincibility here, I didn't check (means, I'm not sure it is exclusively set on byrna), but this is negligible imo. I'd not know another simple way.$037B[0x01] - (Player)
If nonzero, disables Link's ability to receive hits from
sprites. (But not pits)
Be sure you also have fastrom patch applied, your code is executed each frame and can lead to slowdowns. It is very costly, esp. Since you check all sort of stuff.
Good point. If I re-arrange the code so that the frame count check is out front, then it should only do the additional checks once every 85 frames (1.4 seconds). I'll play around with it later today.
Good idea, if you first check if the frame is a refill hit and only then if it is allowed, you safe a lot of cpu time instead of doing all checks each frame
Well I tested this and if you use this code it will bug out (Link gets invisible and game freezes) when you use the Bombos, since you set the jump to 6B rather then 8 bytes earlier
A5 5D Check Link's state
C9 08 Casting Ether?
F0 27 If so, jump to the end
C9 09 Casting Bombos?
F0 23 If so, jump to the end
C9 0A Casting Quake?
F0 1F If so, jump to the end
should be
A5 5D Check Link's state
C9 08 Casting Ether?
F0 1F If so, jump to the end
C9 09 Casting Bombos?
F0 1B If so, jump to the end
C9 0A Casting Quake?
F0 17 If so, jump to the end
But now further problem: Bombos used makes an abnormal reduction of green magic. So this is far from debugged. The only debugged version is for you to use the original code, which indeed makes the increase every cicle regardless (that's from the debugging perspective), since this is how the "short code" works. Unless you can debug everything.
Alternatively you could use the "long code" which already addresses what you want and thus does not increase in menu mode or while in monologue mode, but it does increase using items: yet the speed is set so, that the use of item make green magic drain faster than it fills - so you do actually lose green magic while using: bombos, ether, quake, cape or byrna.
In the long version you can also set the green magic to rise faster when you have none or small amount and then is rising slower once you have more of it.
Long version of autofill (if you are interested):
A5 5D Check Link's state
C9 08 Casting Ether?
F0 27 If so, jump to the end
C9 09 Casting Bombos?
F0 23 If so, jump to the end
C9 0A Casting Quake?
F0 1F If so, jump to the end
should be
A5 5D Check Link's state
C9 08 Casting Ether?
F0 1F If so, jump to the end
C9 09 Casting Bombos?
F0 1B If so, jump to the end
C9 0A Casting Quake?
F0 17 If so, jump to the end
But now further problem: Bombos used makes an abnormal reduction of green magic. So this is far from debugged. The only debugged version is for you to use the original code, which indeed makes the increase every cicle regardless (that's from the debugging perspective), since this is how the "short code" works. Unless you can debug everything.
Alternatively you could use the "long code" which already addresses what you want and thus does not increase in menu mode or while in monologue mode, but it does increase using items: yet the speed is set so, that the use of item make green magic drain faster than it fills - so you do actually lose green magic while using: bombos, ether, quake, cape or byrna.
In the long version you can also set the green magic to rise faster when you have none or small amount and then is rising slower once you have more of it.
Long version of autofill (if you are interested):
- Code:
pointer,
at 000034, write
22 00 80 23
at 118000,
08 20 0F 80 20 80 80 20 66 81 20 62 80 28 6B 08 E2 20 A5 F6 29 20 F0 06 A5 9B 49 20 85 9B A5 F6 29 10 F0 3C AF EA B0 7F F0 04 C9 15 90 11 A9 00 8F 08 B0 7F AD 02 02 F0 27 8F 08 B0 7F 80 21 48 AD 02 02 48 8F 08 B0 7F 68 68 8D 02 02 22 6C FA 0D AE 02 02 BF 15 FA 0D 8D 03 03 A9 20 8D 2F 01 28 60 E2 20 AF 0D B0 7F CF 0C B0 7F F0 05 A9 20 8D 2F 01 A5 12 F0 FC AF 0D B0 7F 8F 0C B0 7F 60 08 E2 30 A5 11 05 5D D0 46 A6 10 BF 52 81 23 F0 3E AD 02 02 C9 0F D0 13 AF 04 B0 7F 18 69 10 8F 04 B0 7F 90 06 A9 FF FF 04 B0 7F AF 6E F3 7E AA BF D1 80 23 18 6F 04 B0 7F 8F 04 B0 7F AF 6E F3 7E 69 00 10 02 A9 80 8F 6E F3 7E 8F 05 B0 7F 28 60 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 08 AF 00 B0 7F 3A C9 00 10 02 A9 1F 8F 00 B0 7F 0A AA C2 20 BF 15 82 23 8F 06 B0 7F BF 95 8D 23 8F 0A B0 7F 28 60 EB 00 00 00
alt version: speed set to 02
08 20 0F 80 20 80 80 20 66 81 20 62 80 28 6B 08 E2 20 A5 F6 29 20 F0 06 A5 9B 49 20 85 9B A5 F6 29 10 F0 3C AF EA B0 7F F0 04 C9 15 90 11 A9 00 8F 08 B0 7F AD 02 02 F0 27 8F 08 B0 7F 80 21 48 AD 02 02 48 8F 08 B0 7F 68 68 8D 02 02 22 6C FA 0D AE 02 02 BF 15 FA 0D 8D 03 03 A9 20 8D 2F 01 28 60 E2 20 AF 0D B0 7F CF 0C B0 7F F0 05 A9 20 8D 2F 01 A5 12 F0 FC AF 0D B0 7F 8F 0C B0 7F 60 08 E2 30 A5 11 05 5D D0 46 A6 10 BF 52 81 23 F0 3E AD 02 02 C9 0F D0 13 AF 04 B0 7F 18 69 10 8F 04 B0 7F 90 06 A9 FF FF 04 B0 7F AF 6E F3 7E AA BF D1 80 23 18 6F 04 B0 7F 8F 04 B0 7F AF 6E F3 7E 69 00 10 02 A9 80 8F 6E F3 7E 8F 05 B0 7F 28 60 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 08 AF 00 B0 7F 3A C9 00 10 02 A9 1F 8F 00 B0 7F 0A AA C2 20 BF 15 82 23 8F 06 B0 7F BF 95 8D 23 8F 0A B0 7F 28 60 EB 00 00 00
third version: speed set to complex fill (fast first and then slower).
08 20 0F 80 20 80 80 20 66 81 20 62 80 28 6B 08 E2 20 A5 F6 29 20 F0 06 A5 9B 49 20 85 9B A5 F6 29 10 F0 3C AF EA B0 7F F0 04 C9 15 90 11 A9 00 8F 08 B0 7F AD 02 02 F0 27 8F 08 B0 7F 80 21 48 AD 02 02 48 8F 08 B0 7F 68 68 8D 02 02 22 6C FA 0D AE 02 02 BF 15 FA 0D 8D 03 03 A9 20 8D 2F 01 28 60 E2 20 AF 0D B0 7F CF 0C B0 7F F0 05 A9 20 8D 2F 01 A5 12 F0 FC AF 0D B0 7F 8F 0C B0 7F 60 08 E2 30 A5 11 05 5D D0 46 A6 10 BF 52 81 23 F0 3E AD 02 02 C9 0F D0 13 AF 04 B0 7F 18 69 10 8F 04 B0 7F 90 06 A9 FF FF 04 B0 7F AF 6E F3 7E AA BF D1 80 23 18 6F 04 B0 7F 8F 04 B0 7F AF 6E F3 7E 69 00 10 02 A9 80 8F 6E F3 7E 8F 05 B0 7F 28 60 04 04 04 04 04 04 04 04 04 04 04 04 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 08 AF 00 B0 7F 3A C9 00 10 02 A9 1F 8F 00 B0 7F 0A AA C2 20 BF 15 82 23 8F 06 B0 7F BF 95 8D 23 8F 0A B0 7F 28 60 EB 00 00 00
fourth version: speed set to 08 (close to what you have now)
08 20 0F 80 20 80 80 20 66 81 20 62 80 28 6B 08 E2 20 A5 F6 29 20 F0 06 A5 9B 49 20 85 9B A5 F6 29 10 F0 3C AF EA B0 7F F0 04 C9 15 90 11 A9 00 8F 08 B0 7F AD 02 02 F0 27 8F 08 B0 7F 80 21 48 AD 02 02 48 8F 08 B0 7F 68 68 8D 02 02 22 6C FA 0D AE 02 02 BF 15 FA 0D 8D 03 03 A9 20 8D 2F 01 28 60 E2 20 AF 0D B0 7F CF 0C B0 7F F0 05 A9 20 8D 2F 01 A5 12 F0 FC AF 0D B0 7F 8F 0C B0 7F 60 08 E2 30 A5 11 05 5D D0 46 A6 10 BF 52 81 23 F0 3E AD 02 02 C9 0F D0 13 AF 04 B0 7F 18 69 10 8F 04 B0 7F 90 06 A9 FF FF 04 B0 7F AF 6E F3 7E AA BF D1 80 23 18 6F 04 B0 7F 8F 04 B0 7F AF 6E F3 7E 69 00 10 02 A9 80 8F 6E F3 7E 8F 05 B0 7F 28 60 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 AF 00 B0 7F 3A C9 00 10 02 A9 1F 8F 00 B0 7F 0A AA C2 20 BF 15 82 23 8F 06 B0 7F BF 95 8D 23 8F 0A B0 7F 28 60 EB
The long code works beautifully when set to a speed of 2. I think you should release it as a patch on places like RHDN.
One last question. With the long code, I don't know where to add in the hook for checking to see if you have the Moon Pearl.
One last question. With the long code, I don't know where to add in the hook for checking to see if you have the Moon Pearl.
I don't like that site, so I have no interest in doing that.The long code works beautifully when set to a speed of 2. I think you should release it as a patch on places like RHDN.
One last question. With the long code, I don't know where to add in the hook for checking to see if you have the Moon Pearl.
The "long code" is different. Doesn't work that way, so it would need further ASM. Math on Napkins also made it Book of Mudora dependent, if you change at 1180A7 from FF to 8F, this feature will be turned on, but the fill will be faster if the Book is equiped in the item-box, it will fill automatically in any case, so not what you want. Just swapping the book for moonpearl will not work, since the RAM is different, and the Moonpearl can not be equipped into item-box.
I tried this for the Moonpearl infront of the code, but the game crashed when Moonpearl was equiped. So basically this checks for Moonpearl RAM first, compares value to 01 and if not, do the regular code which is A5 12 F0 FC and return 6B, otherwise branch those 5 bytes and go to the main code which comes after. But it crashed.
AF 57 F3 7E C9 01 F0 05 A5 12 F0 FC 6B
MoN's code also may interfere with other stuff. It bugs with the msu video code (lyra island had to remove the video) and I think I also the map bugged on lyra a bit, the reason is the A5 9B:
So use with care.$9B[0x01] - (NMI)
HDMA channels to write to $420C [HDMAEN]
Yes, I never thought of that, since I never tested it with MSU, only with native music.Conn wrote:MoN's code also may interfere with other stuff. It bugs with the msu video code (lyra island had to remove the video) and I think I also the map bugged on lyra a bit, the reason is the A5 9B:So use with care.$9B[0x01] - (NMI)
HDMA channels to write to $420C [HDMAEN]
I personally would use the short code with the Moonpearl restrain and no other edits, since I would not need those additional things (like not increase magic if in menu or using ether, bombos etc):
Thus I would use this code, if I ever needed the magic autofill:
Fast-1
needs around 15 seconds for one green unit to increase:
needs Moonpearl::
000057,
D0 F4 A2
1174D0,
AF 57 F3 7E F0 17 A5 1A C9 7F F0 04 C9 FF D0 0D AF 6E F3 7E C9 80 F0 05 1A 8F 6E F3 7E 22 B5 80 80 6B
Similar topics
» help in Hyrule-Magic
» Magic Sword
» I need some help with Hyrule Magic
» hyrule magic
» Zeldix Magic
» Magic Sword
» I need some help with Hyrule Magic
» hyrule magic
» Zeldix Magic
Permissions in this forum:
You cannot reply to topics in this forum