mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2025-01-23 03:46:54 +00:00
first pass at hacking credits to expand 16-entry on-screen limit
This commit is contained in:
parent
d1ecb67666
commit
b5115d4d03
62
cs-hacks/credits-optimzations/ActionStripper.txt
Normal file
62
cs-hacks/credits-optimzations/ActionStripper.txt
Normal file
|
@ -0,0 +1,62 @@
|
|||
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
|
25
cs-hacks/credits-optimzations/InitCreditScript.txt
Normal file
25
cs-hacks/credits-optimzations/InitCreditScript.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
offset 40d3e0
|
||||
|
||||
#define
|
||||
size=50
|
||||
MAX_STRIP=7F
|
||||
Strip_addr=0049d628
|
||||
#enddefine
|
||||
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
PUSH 18
|
||||
PUSH 0
|
||||
PUSH 0049D610
|
||||
CALL 00480D30
|
||||
ADD ESP,0C
|
||||
|
||||
PUSH size
|
||||
PUSH MAX_STRIP
|
||||
CALL 00487701
|
||||
ADD ESP,8
|
||||
MOV [Strip_addr],EAX
|
||||
|
||||
POP EBP
|
||||
RETN
|
||||
INT3
|
|
@ -0,0 +1,2 @@
|
|||
offset 4115e6
|
||||
PUSH 7E0
|
7
cs-hacks/credits-optimzations/Multi-File-List.txt
Normal file
7
cs-hacks/credits-optimzations/Multi-File-List.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
ActionStripper.txt
|
||||
InitCreditScript.txt
|
||||
LoadGenericDataMAX_STRIP.txt
|
||||
PutStripper.txt
|
||||
RestoreStripper.txt
|
||||
SetStripper.txt
|
||||
StartCreditScript.txt
|
120
cs-hacks/credits-optimzations/PutStripper.txt
Normal file
120
cs-hacks/credits-optimzations/PutStripper.txt
Normal file
|
@ -0,0 +1,120 @@
|
|||
offset 40D010
|
||||
|
||||
#define
|
||||
count=EBP-14
|
||||
Strip_addr=0049D628
|
||||
Credit=49D620
|
||||
MAX_STRIP=7F
|
||||
size=50
|
||||
grcFull=0048f92c
|
||||
|
||||
rc = EBP-10
|
||||
rcleft=EBP-10
|
||||
rcright=EBP-8
|
||||
rctop=EBP-0C
|
||||
rcbottom=EBP-4
|
||||
|
||||
DIV200=data 99 81 E2 FF 01 00 00 03 C2 C1 F8 09
|
||||
#enddefine
|
||||
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
SUB ESP,14
|
||||
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 EBX,[count]
|
||||
INC EBX
|
||||
MOV [count],EBX
|
||||
:loop
|
||||
CMP EBX,MAX_STRIP
|
||||
JGE :end
|
||||
|
||||
IMUL EBX,EBX,size //EBX = s * sizeof(STRIP)
|
||||
|
||||
MOV EDX,[EBX+Strip.flag]
|
||||
AND EDX,00000080
|
||||
JE :increment
|
||||
|
||||
//rects
|
||||
MOV [rcleft],0
|
||||
MOV [rcright],140
|
||||
MOV EAX,[count]
|
||||
SHL EAX,4
|
||||
MOV [rctop],EAX
|
||||
ADD EAX,10
|
||||
MOV [rcbottom],EAX
|
||||
|
||||
//arg5 = SURFACE_ID_CREDIT_CAST
|
||||
PUSH 23
|
||||
//arg4 = &rc
|
||||
LEA EDX,[rc]
|
||||
PUSH EDX
|
||||
//arg3 = Strip[s].y / 0x200
|
||||
MOV EAX,[EBX+Strip.y]
|
||||
DIV200
|
||||
PUSH EAX
|
||||
//arg2 = Strip[s].x / 0x200
|
||||
MOV EAX,[EBX+Strip.x]
|
||||
DIV200
|
||||
PUSH EAX
|
||||
//arg1 = &grcFull
|
||||
PUSH grcFull
|
||||
//PutBitmap3()
|
||||
CALL 0040C3C0
|
||||
ADD ESP,14
|
||||
|
||||
//rects
|
||||
MOV EAX,[EBX+Strip.cast]
|
||||
CDQ
|
||||
PUSH ECX
|
||||
MOV ECX,0D
|
||||
IDIV ECX
|
||||
POP ECX
|
||||
IMUL EDX,EDX,18
|
||||
MOV [rc.left],EDX
|
||||
ADD EDX,18
|
||||
MOV [rc.right],EDX
|
||||
IMUL EAX,EAX,18
|
||||
MOV [rc.top],EAX
|
||||
ADD EAX,18
|
||||
MOV [rc.bottom],EAX
|
||||
|
||||
//arg5 = SURFACE_ID_CASTS
|
||||
PUSH 25
|
||||
//arg4 = &rc
|
||||
LEA EAX,[rc]
|
||||
PUSH EAX
|
||||
//arg3 = Strip[s].y / 0x200 - 8
|
||||
MOV EAX,[EBX+Strip.y]
|
||||
DIV200
|
||||
SUB EAX,8
|
||||
PUSH EAX
|
||||
//arg2 = Strip[s].x / 0x200 - 24
|
||||
MOV EAX,[EBX+Strip.x]
|
||||
DIV200
|
||||
SUB EAX,18
|
||||
PUSH EAX
|
||||
//arg1 = &grcFull
|
||||
PUSH grcFull
|
||||
//PutBitmap3()
|
||||
CALL 0040C3C0
|
||||
ADD ESP,14
|
||||
|
||||
JMP :increment
|
||||
|
||||
:end
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
INT3
|
79
cs-hacks/credits-optimzations/RestoreStripper.txt
Normal file
79
cs-hacks/credits-optimzations/RestoreStripper.txt
Normal file
|
@ -0,0 +1,79 @@
|
|||
offset 40d240
|
||||
|
||||
#define
|
||||
count=EBP-14
|
||||
Strip_addr=0049D628
|
||||
Credit=49D620
|
||||
MAX_STRIP=7F
|
||||
size=50
|
||||
|
||||
rc = EBP-10
|
||||
rcleft=EBP-10
|
||||
rcright=EBP-8
|
||||
rctop=EBP-0C
|
||||
rcbottom=EBP-4
|
||||
#enddefine
|
||||
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
SUB ESP,14
|
||||
MOV [count],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]
|
||||
INC EAX
|
||||
MOV [count],EAX
|
||||
:loop
|
||||
CMP [count],MAX_STRIP
|
||||
JGE :end
|
||||
|
||||
MOV EBX,[count]
|
||||
IMUL EBX,EBX,size
|
||||
|
||||
MOV EDX,[EBX+Strip.flag]
|
||||
AND EDX,00000080
|
||||
JE :increment
|
||||
|
||||
MOV [rcleft],0
|
||||
MOV [rcright],140
|
||||
MOV EAX,[count]
|
||||
SHL EAX,4
|
||||
MOV [rctop],EAX
|
||||
ADD EAX,10
|
||||
MOV [rcbottom],EAX
|
||||
|
||||
PUSH 23
|
||||
PUSH 0
|
||||
LEA EDX,[rc]
|
||||
PUSH EDX
|
||||
CALL 0040CA80
|
||||
ADD ESP,0C
|
||||
|
||||
PUSH 23
|
||||
PUSH 0FEFFFF
|
||||
LEA EAX,[EBX+Strip.str]
|
||||
PUSH EAX
|
||||
MOV EAX,[rctop]
|
||||
PUSH EAX
|
||||
PUSH 0
|
||||
CALL 0040CEB0
|
||||
ADD ESP,14
|
||||
|
||||
JMP :increment
|
||||
|
||||
:end
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
INT3
|
92
cs-hacks/credits-optimzations/SetStripper.txt
Normal file
92
cs-hacks/credits-optimzations/SetStripper.txt
Normal file
|
@ -0,0 +1,92 @@
|
|||
offset 40d150
|
||||
|
||||
#define
|
||||
count=EBP-14
|
||||
Strip_addr=0049D628
|
||||
Credit=49D620
|
||||
MAX_STRIP=7F
|
||||
size=50
|
||||
|
||||
rc=EBP-10
|
||||
rcleft=EBP-10
|
||||
rcright=EBP-8
|
||||
rctop=EBP-14
|
||||
rcbottom=EBP-0C
|
||||
#enddefine
|
||||
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
SUB ESP,14
|
||||
MOV [count],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]
|
||||
INC EAX
|
||||
MOV [count],EAX
|
||||
:loop
|
||||
MOV EBX,[count]
|
||||
IMUL EBX,EBX,size //EBC = s * sizeof(STRIP)
|
||||
CMP [count],MAX_STRIP
|
||||
JGE :break
|
||||
MOV EDX,[EBX+Strip.flag]
|
||||
AND EDX,00000080
|
||||
JNE :increment
|
||||
JMP :break
|
||||
|
||||
:break
|
||||
CMP [count],MAX_STRIP
|
||||
JNE :initcast
|
||||
JMP :end
|
||||
|
||||
:initcast
|
||||
MOV [EBX+Strip.flag],80
|
||||
MOV [EBX+Strip.x],[EBP+8]
|
||||
MOV [EBX+Strip.y],[EBP+0C]
|
||||
MOV [EBX+Strip.cast],[EBP+14]
|
||||
|
||||
MOV EAX,[EBP+10]
|
||||
PUSH EAX
|
||||
LEA EAX,[EBX+Strip.str]
|
||||
PUSH EAX
|
||||
CALL 00481100
|
||||
ADD ESP,8
|
||||
|
||||
MOV [rcleft],0
|
||||
MOV [rcright],140
|
||||
MOV EAX,[count]
|
||||
SHL EAX,4
|
||||
MOV [rctop],EAX
|
||||
ADD EAX,10
|
||||
MOV [rcbottom],EAX
|
||||
|
||||
PUSH 23
|
||||
PUSH 0
|
||||
LEA EDX,[rc]
|
||||
PUSH EDX
|
||||
CALL 0040CA80
|
||||
ADD ESP,0C
|
||||
|
||||
PUSH 23
|
||||
PUSH 0FEFFFF
|
||||
MOV EAX,[EBP+10]
|
||||
PUSH EAX
|
||||
MOV EAX,[rctop]
|
||||
PUSH EAX
|
||||
PUSH 0
|
||||
CALL 0040CEB0
|
||||
ADD ESP,14
|
||||
|
||||
:end
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
INT3
|
131
cs-hacks/credits-optimzations/StartCreditScript.txt
Normal file
131
cs-hacks/credits-optimzations/StartCreditScript.txt
Normal file
|
@ -0,0 +1,131 @@
|
|||
offset 40d440
|
||||
|
||||
#define
|
||||
Strip_addr=0049D628
|
||||
MAX_STRIP=7F
|
||||
sizeof=50
|
||||
|
||||
fp=EBP-4
|
||||
path=EBP-110
|
||||
Credit.pData=49D614
|
||||
Credit.size=49d610
|
||||
Credit.offset=49d618
|
||||
Credit.wait=49d61c
|
||||
Credit.mode=49d620
|
||||
Illust.x=49d60c
|
||||
Illust.act_no=49d608
|
||||
grcGame.left=48f91c
|
||||
#enddefine
|
||||
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
SUB ESP,110
|
||||
MOV EAX,[498B20]
|
||||
MOV [EBP-8],EAX
|
||||
|
||||
CMP [Credit.pData],0
|
||||
JE :openfile
|
||||
MOV EAX,[Credit.pData]
|
||||
PUSH EAX
|
||||
CALL 0048128B
|
||||
ADD ESP,4
|
||||
MOV [Credit.pData],0
|
||||
|
||||
:openfile
|
||||
MOV ECX,[48F918]
|
||||
PUSH ECX
|
||||
PUSH 0049E220
|
||||
PUSH 0048C374
|
||||
LEA EDX,[path]
|
||||
PUSH EDX
|
||||
CALL 00481010
|
||||
ADD ESP,10
|
||||
|
||||
LEA EDX,[path]
|
||||
PUSH EDX
|
||||
CALL 00410D80
|
||||
ADD ESP,4
|
||||
MOV [Credit.size],EAX
|
||||
CMP EAX,-1
|
||||
JNE :allocatebuffer
|
||||
XOR EAX,EAX
|
||||
JMP :end
|
||||
|
||||
:allocatebuffer
|
||||
MOV ECX,[Credit.size]
|
||||
PUSH ECX
|
||||
CALL 004813A3
|
||||
ADD ESP,4
|
||||
MOV [Credit.pData],EAX
|
||||
CMP EAX,0
|
||||
JNE :fopen
|
||||
JMP :end //EAX must be 0, return false
|
||||
|
||||
:fopen
|
||||
PUSH 0048C37C
|
||||
LEA EAX,[path]
|
||||
PUSH EAX
|
||||
CALL 00480FFD
|
||||
ADD ESP,8
|
||||
MOV [fp],EAX
|
||||
CMP EAX,0
|
||||
JNE :readdata
|
||||
MOV EDX,[Credit.pData]
|
||||
PUSH EDX
|
||||
CALL 0048128B
|
||||
ADD ESP,4
|
||||
JMP :end //EAX must be 0, return false
|
||||
|
||||
:readdata
|
||||
MOV ECX,[fp]
|
||||
PUSH ECX
|
||||
MOV EDX,[Credit.size]
|
||||
PUSH EDX
|
||||
PUSH 1
|
||||
MOV EAX,[Credit.pData]
|
||||
PUSH EAX
|
||||
CALL 00480F55
|
||||
ADD ESP,8
|
||||
|
||||
MOV EDX,[Credit.size]
|
||||
PUSH EDX
|
||||
MOV ECX,[Credit.pData]
|
||||
PUSH ECX
|
||||
CALL 004215C0
|
||||
ADD ESP,8
|
||||
|
||||
MOV [Credit.offset],0
|
||||
MOV [Credit.wait],0
|
||||
MOv [Credit.mode],1
|
||||
MOV [Illust.x],FFFEC000
|
||||
MOV [Illust.act_no],0
|
||||
|
||||
MOV [grcGame.left],0A0
|
||||
|
||||
PUSH 25
|
||||
PUSH 0048C380
|
||||
CALL 0040BFD0
|
||||
ADD ESP,8
|
||||
TEST EAX,EAX
|
||||
JNE :clearcasts
|
||||
JMP :end //EAX is 0, return false
|
||||
|
||||
:clearcasts
|
||||
MOV EDX,sizeof
|
||||
IMUL EDX,EDX,MAX_STRIP
|
||||
PUSH EDX
|
||||
PUSH 0
|
||||
MOV EAX,[Strip_addr]
|
||||
PUSH EAX
|
||||
CALL 00480D30
|
||||
ADD ESP,0C
|
||||
|
||||
MOV EAX,1
|
||||
|
||||
:end
|
||||
MOV ECX,[EBP-8]
|
||||
CALL 00480DC1
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
INT3
|
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -956,7 +956,7 @@ l2069
|
|||
/
|
||||
|
||||
l3000
|
||||
-0480
|
||||
-0048
|
||||
f7001:3002f7000:3001
|
||||
+0030[N.A]0221j3003
|
||||
l3001
|
||||
|
@ -1010,6 +1010,101 @@ l3017
|
|||
|
||||
l3018
|
||||
-0096
|
||||
j3000
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
+0050[pup?]0132
|
||||
+0100[pup?]0155
|
||||
+0150[pup?]0168
|
||||
+0200[pup?]0181
|
||||
+0250[pup?]0194
|
||||
-0024
|
||||
/
|
||||
j0999
|
Loading…
Reference in a new issue