Users browsing this thread: 1 Guest(s)
Debilitator Reset
I've added a "no RAM" hack, it use more ROM space but no free RAM. See original post and readme for details. Here's the code, I don't know if it could be optimized. I tested on monsters that have an have not the ID MSB set and it work in both cases.
Code:
// debilitator special effect hook
seek($C23AA8)
jsl free_space // jump to free space
nop
nop
// new code
seek($EEAF01) // you can change this free space offset as long as it's not in bank $C2
free_space:
phx // save X
pha // save current debilitator element
tya // transfer monster index (#$08 to #$12) to A
lsr // divide by 2
sec
sbc #$04 // subtract 4 (characters are indexes #$00 to #$03)
tax // transfer monster index (#$00 to #$05) to X
phx // save it
lda $3F52 // load monster ID MSB byte, bits 0-5 being the MSB of each monster ID
loop:
cpx #$00
beq end_loop // end loop when X == 0 (decreased monster index)
lsr // shift MSB byte right
dex // X = X - 1
bra loop // branch to check if we've reach 0
end_loop:
and #$01 // isolate monster ID MSB
continue:
rep #$20 // 16-bit A
xba // put monster ID MSB in high byte
sep #$20 // 8-bit A
plx // restore monster index (#$00 to #$05)
lda $3F46,x // load monster ID low byte (#$00 to #$FF)
rep #$30 // 16-bit A, 16-bit X
asl
asl
asl
asl
asl // multiply monster ID by 32
tax // transfer monster data index to X
sep #$20 // 8-bit A
lda $CF0019,x // load weak to element(s) in monster data
sta $3BE0,y // make monster weak to its original elements
pla // restore current debilitator element
ora $3BE0,y // add debilitator element to those already set as weak to
sta $3BE0,y // make monster weak to those elements
sep #$10 // 8-bit X
plx // restore X
rtl
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)