cave-story-randomizer/cs-hacks/credits-optimzations/ActionStripper.txt

62 lines
798 B
Plaintext
Raw Normal View History

offset 40cf90
#define
count=EBP-4
Strip_addr=0049D628
Credit=49D620
MAX_STRIP=7F
size=50
#enddefine
:ActionStripper
PUSH EBP
MOV EBP,ESP
PUSH ECX
MOV [count],0 // s = 0
MOV ECX,[Strip_addr] // ECX = *Strip
#define
Strip.flag=ECX
Strip.x=ECX+4
Strip.y=ECX+8
Strip.cast=ECX+0C
Strip.str=ECX+10
#enddefine
JMP :loop
:increment
MOV EAX,[count]
ADD EAX,1
MOV [count],EAX // s++
:loop
CMP [count],MAX_STRIP // s < MAX_STRIP
JGE :end
MOV EBX,[count]
IMUL EBX,EBX,size // EBX = s * sizeof(STRIP)
:move_up
MOV EAX,[EBX+Strip.flag]
AND EAX,00000080
JE :remove_offscreen
CMP [Credit],0
JE :remove_offscreen
MOV EAX,[EBX+Strip.y]
SUB EAX,100
MOV [EBX+Strip.y],EAX
:remove_offscreen
CMP [EBX+Strip.y],-2000
JG :endloop
MOV [EBX+Strip.flag],0
:endloop
JMP :increment
:end
MOV ESP,EBP
POP EBP
RETN
INT3