• Please stop embedding files/images from Discord. Discord has anti-hotlinking logic in place that breaks links to Discord hosted files and images when linked to from anywhere outside of Discord. There are a multitude of file/image hosting sites you can use instead.

    (more info here)

Need help hacking Cave Story's Organya

Jan 25, 2026 at 5:12 PM
Bi_N Online
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 18, 2024
Location: First Cave
Posts: 103
Pronouns: He/him
Gender Notes: Cats are fluffy beings, this therefore makes them aliens.
Alright, I don't know a lot about ASM but I believe I've at least found something's related to how Cave Story plays Organya.
I'm trying to mod the game to where you can play 32 tracks for my ORG-16 format.

I think this is somewhat related to the "MakeSoundObject8" function
Code:
0041C8F0  | 55                          | push ebp                                     |
0041C8F1  | 8BEC                        | mov ebp,esp                                  |
0041C8F3  | 83EC 08                     | sub esp,8                                    |
0041C8F6  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041C8FD  | EB 09                       | jmp doukutsu2.41C908                         |
0041C8FF  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041C902  | 83C0 01                     | add eax,1                                    |
0041C905  | 8945 F8                     | mov dword ptr ss:[ebp-8],eax                 |
0041C908  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |  Lowering 100 causes the quality of SFX to drop, Drams are part of SFX.
0041C90F  | 7D 40                       | jge doukutsu2.41C951                         |
0041C911  | DB45 F8                     | fild dword ptr ss:[ebp-8]                    |
0041C914  | DC0D E8C64800               | fmul qword ptr ds:[48C6E8]                   |
0041C91A  | DC35 E0C64800               | fdiv qword ptr ds:[48C6E0]                   |
0041C920  | 83EC 08                     | sub esp,8                                    |
0041C923  | DD1C24                      | fstp qword ptr ss:[esp]                      |
0041C926  | E8 E9510600                 | call doukutsu2.481B14                        |
0041C92B  | 83C4 08                     | add esp,8                                    |
0041C92E  | DC0D D8C64800               | fmul qword ptr ds:[48C6D8]                   |
0041C934  | E8 77520600                 | call doukutsu2.481BB0                        |
0041C939  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041C93C  | 8881 004F4A00               | mov byte ptr ds:[ecx+4A4F00],al              |
0041C942  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041C945  | 0FBE82 004F4A00             | movsx eax,byte ptr ds:[edx+4A4F00]           |
0041C94C  | 8945 FC                     | mov dword ptr ss:[ebp-4],eax                 |
0041C94F  | EB AE                       | jmp doukutsu2.41C8FF                         |
0041C951  | C745 FC 00000000            | mov dword ptr ss:[ebp-4],0                   |
0041C958  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041C95F  | EB 09                       | jmp doukutsu2.41C96A                         |
0041C961  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041C964  | 83C1 01                     | add ecx,1                                    |
0041C967  | 894D F8                     | mov dword ptr ss:[ebp-8],ecx                 |
0041C96A  | 837D F8 40                  | cmp dword ptr ss:[ebp-8],40                  | 40:'@'
0041C96E  | 7D 23                       | jge doukutsu2.41C993                         |
0041C970  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C973  | C1E0 06                     | shl eax,6                                    |
0041C976  | 99                          | cdq                                          |
0041C977  | 83E2 3F                     | and edx,3F                                   |
0041C97A  | 03C2                        | add eax,edx                                  |
0041C97C  | C1F8 06                     | sar eax,6                                    |
0041C97F  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041C982  | 8882 00504A00               | mov byte ptr ds:[edx+4A5000],al              |
0041C988  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C98B  | 83C0 01                     | add eax,1                                    |
0041C98E  | 8945 FC                     | mov dword ptr ss:[ebp-4],eax                 |
0041C991  | EB CE                       | jmp doukutsu2.41C961                         |
0041C993  | C745 FC 00000000            | mov dword ptr ss:[ebp-4],0                   |
0041C99A  | EB 09                       | jmp doukutsu2.41C9A5                         |
0041C99C  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041C99F  | 83C1 01                     | add ecx,1                                    |
0041C9A2  | 894D F8                     | mov dword ptr ss:[ebp-8],ecx                 |
0041C9A5  | 817D F8 C0000000            | cmp dword ptr ss:[ebp-8],C0                  |
0041C9AC  | 7D 2A                       | jge doukutsu2.41C9D8                         |
0041C9AE  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C9B1  | C1E0 06                     | shl eax,6                                    |
0041C9B4  | 99                          | cdq                                          |
0041C9B5  | 83E2 3F                     | and edx,3F                                   |
0041C9B8  | 03C2                        | add eax,edx                                  |
0041C9BA  | C1F8 06                     | sar eax,6                                    |
0041C9BD  | BA 40000000                 | mov edx,40                                   | 40:'@'
0041C9C2  | 2BD0                        | sub edx,eax                                  |
0041C9C4  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041C9C7  | 8890 00504A00               | mov byte ptr ds:[eax+4A5000],dl              |
0041C9CD  | 8B4D FC                     | mov ecx,dword ptr ss:[ebp-4]                 |
0041C9D0  | 83C1 01                     | add ecx,1                                    |
0041C9D3  | 894D FC                     | mov dword ptr ss:[ebp-4],ecx                 |
0041C9D6  | EB C4                       | jmp doukutsu2.41C99C                         |
0041C9D8  | C745 FC 00000000            | mov dword ptr ss:[ebp-4],0                   |
0041C9DF  | EB 09                       | jmp doukutsu2.41C9EA                         |
0041C9E1  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041C9E4  | 83C2 01                     | add edx,1                                    |
0041C9E7  | 8955 F8                     | mov dword ptr ss:[ebp-8],edx                 |
0041C9EA  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |
0041C9F1  | 7D 26                       | jge doukutsu2.41CA19                         |
0041C9F3  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C9F6  | C1E0 06                     | shl eax,6                                    |
0041C9F9  | 99                          | cdq                                          |
0041C9FA  | 83E2 3F                     | and edx,3F                                   |
0041C9FD  | 03C2                        | add eax,edx                                  |
0041C9FF  | C1F8 06                     | sar eax,6                                    |
0041CA02  | 83E8 40                     | sub eax,40                                   |
0041CA05  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041CA08  | 8881 00504A00               | mov byte ptr ds:[ecx+4A5000],al              |
0041CA0E  | 8B55 FC                     | mov edx,dword ptr ss:[ebp-4]                 |
0041CA11  | 83C2 01                     | add edx,1                                    |
0041CA14  | 8955 FC                     | mov dword ptr ss:[ebp-4],edx                 |
0041CA17  | EB C8                       | jmp doukutsu2.41C9E1                         |
0041CA19  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041CA20  | EB 09                       | jmp doukutsu2.41CA2B                         |
0041CA22  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041CA25  | 83C0 01                     | add eax,1                                    |
0041CA28  | 8945 F8                     | mov dword ptr ss:[ebp-8],eax                 |
0041CA2B  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |
0041CA32  | 7D 16                       | jge doukutsu2.41CA4A                         |
0041CA34  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041CA37  | 99                          | cdq                                          |
0041CA38  | 2BC2                        | sub eax,edx                                  |
0041CA3A  | D1F8                        | sar eax,1                                    |
0041CA3C  | 83E8 40                     | sub eax,40                                   |
0041CA3F  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041CA42  | 8881 00514A00               | mov byte ptr ds:[ecx+4A5100],al              |
0041CA48  | EB D8                       | jmp doukutsu2.41CA22                         |
0041CA4A  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041CA51  | EB 09                       | jmp doukutsu2.41CA5C                         |
0041CA53  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041CA56  | 83C2 01                     | add edx,1                                    |
0041CA59  | 8955 F8                     | mov dword ptr ss:[ebp-8],edx                 |
0041CA5C  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |
0041CA63  | 7D 1A                       | jge doukutsu2.41CA7F                         |
0041CA65  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041CA68  | 99                          | cdq                                          |
0041CA69  | 2BC2                        | sub eax,edx                                  |
0041CA6B  | D1F8                        | sar eax,1                                    |
0041CA6D  | B9 40000000                 | mov ecx,40                                   | 40:'@'
0041CA72  | 2BC8                        | sub ecx,eax                                  |
0041CA74  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041CA77  | 888A 00524A00               | mov byte ptr ds:[edx+4A5200],cl              |
0041CA7D  | EB D4                       | jmp doukutsu2.41CA53                         |
0041CA7F  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041CA86  | EB 09                       | jmp doukutsu2.41CA91                         |
0041CA88  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041CA8B  | 83C0 01                     | add eax,1                                    |
0041CA8E  | 8945 F8                     | mov dword ptr ss:[ebp-8],eax                 |
0041CA91  | 817D F8 80000000            | cmp dword ptr ss:[ebp-8],80                  |
0041CA98  | 7D 0C                       | jge doukutsu2.41CAA6                         |
0041CA9A  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041CA9D  | C681 00534A00 40            | mov byte ptr ds:[ecx+4A5300],40              | 40:'@'
0041CAA4  | EB E2                       | jmp doukutsu2.41CA88                         |
0041CAA6  | EB 09                       | jmp doukutsu2.41CAB1                         |
0041CAA8  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041CAAB  | 83C2 01                     | add edx,1                                    |
0041CAAE  | 8955 F8                     | mov dword ptr ss:[ebp-8],edx                 |
0041CAB1  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |
0041CAB8  | 7D 0C                       | jge doukutsu2.41CAC6                         |
0041CABA  | 8B45 F8                     | mov eax,dword ptr ss:[ebp-8]                 |
0041CABD  | C680 00534A00 C0            | mov byte ptr ds:[eax+4A5300],C0              |
0041CAC4  | EB E2                       | jmp doukutsu2.41CAA8                         |
0041CAC6  | 6A 00                       | push 0                                       |
0041CAC8  | E8 304C0600                 | call doukutsu2.4816FD                        |
0041CACD  | 83C4 04                     | add esp,4                                    |
0041CAD0  | C745 F8 00000000            | mov dword ptr ss:[ebp-8],0                   |
0041CAD7  | EB 09                       | jmp doukutsu2.41CAE2                         |
0041CAD9  | 8B4D F8                     | mov ecx,dword ptr ss:[ebp-8]                 |
0041CADC  | 83C1 01                     | add ecx,1                                    |
0041CADF  | 894D F8                     | mov dword ptr ss:[ebp-8],ecx                 |
0041CAE2  | 817D F8 00010000            | cmp dword ptr ss:[ebp-8],100                 |
0041CAE9  | 7D 1D                       | jge doukutsu2.41CB08                         |
0041CAEB  | E8 1A4C0600                 | call doukutsu2.48170A                        |
0041CAF0  | 25 FF000000                 | and eax,FF                                   |
0041CAF5  | 0FBEC0                      | movsx eax,al                                 |
0041CAF8  | 99                          | cdq                                          |
0041CAF9  | 2BC2                        | sub eax,edx                                  |
0041CAFB  | D1F8                        | sar eax,1                                    |
0041CAFD  | 8B55 F8                     | mov edx,dword ptr ss:[ebp-8]                 |
0041CB00  | 8882 00544A00               | mov byte ptr ds:[edx+4A5400],al              |
0041CB06  | EB D1                       | jmp doukutsu2.41CAD9                         |
0041CB08  | 8BE5                        | mov esp,ebp                                  |
0041CB0A  | 5D                          | pop ebp                                      |
0041CB0B  | C3                          | ret                                          |
I think this has to do with storing the amount of Tracks

Code:
00480D5F  | C1E0 08                     | shl eax,8                                    | <- Amount of Tracks for Melody and Dram
00480D62  | 03C1                        | add eax,ecx                                  |
00480D64  | 8BC8                        | mov ecx,eax                                  |
00480D66  | C1E0 10                     | shl eax,10                                   | <- Total Amount Of Tracks
00480D69  | 03C1                        | add eax,ecx                                  |
00480D6B  | 8BCA                        | mov ecx,edx                                  |
00480D6D  | 83E2 03                     | and edx,3                                    |
00480D70  | C1E9 02                     | shr ecx,2                                    |
00480D73  | 74 06                       | je doukutsu2.480D7B                          |
00480D75  | F3:AB                       | rep stosd                                    |
00480D77  | 85D2                        | test edx,edx                                 |
00480D79  | 74 0A                       | je doukutsu2.480D85                          |
00480D7B  | 8807                        | mov byte ptr ds:[edi],al                     | edi:"minkernel\\ntdll\\ldrinit.c"
00480D7D  | 83C7 01                     | add edi,1                                    | edi:"minkernel\\ntdll\\ldrinit.c"
00480D80  | 83EA 01                     | sub edx,1                                    |
00480D83  | 75 F6                       | jne doukutsu2.480D7B                         |
00480D85  | 8B4424 08                   | mov eax,dword ptr ss:[esp+8]                 | [esp+08]:"LdrpInitializeProcess"
00480D89  | 5F                          | pop edi                                      | edi:"minkernel\\ntdll\\ldrinit.c"
00480D8A  | C3                          | ret                                          |
I don't know what these two do, but they're nearly identical and the first one causes the game not to work if you mess with 0041C816. Might have to do with MAXTRACK having 16 total tracks...
Code:
0041C7F0  | 55                          | push ebp                                     |
0041C7F1  | 8BEC                        | mov ebp,esp                                  |
0041C7F3  | 51                          | push ecx                                     |
0041C7F4  | 833D E8574A00 00            | cmp dword ptr ds:[4A57E8],0                  |
0041C7FB  | 75 02                       | jne doukutsu2.41C7FF                         |
0041C7FD  | EB 6F                       | jmp doukutsu2.41C86E                         |
0041C7FF  | E8 4CFAFFFF                 | call doukutsu2.41C250                        |
0041C804  | C745 FC 00000000            | mov dword ptr ss:[ebp-4],0                   |
0041C80B  | EB 09                       | jmp doukutsu2.41C816                         |
0041C80D  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C810  | 83C0 01                     | add eax,1                                    |
0041C813  | 8945 FC                     | mov dword ptr ss:[ebp-4],eax                 |
0041C816  | 837D FC 08                  | cmp dword ptr ss:[ebp-4],8                   |
0041C81A  | 7D 14                       | jge doukutsu2.41C830                         |
0041C81C  | 6A 00                       | push 0                                       |
0041C81E  | 8A4D FC                     | mov cl,byte ptr ss:[ebp-4]                   |
0041C821  | 51                          | push ecx                                     |
0041C822  | 6A 02                       | push 2                                       |
0041C824  | 6A 00                       | push 0                                       |
0041C826  | E8 95E5FFFF                 | call doukutsu2.41ADC0                        |
0041C82B  | 83C4 10                     | add esp,10                                   |
0041C82E  | EB DD                       | jmp doukutsu2.41C80D                         |
0041C830  | 6A 10                       | push 10                                      |
0041C832  | 68 FF000000                 | push FF                                      |
0041C837  | 68 80374900                 | push doukutsu2.493780                        |
0041C83C  | E8 EF440600                 | call doukutsu2.480D30                        |
0041C841  | 83C4 0C                     | add esp,C                                    |
0041C844  | 6A 10                       | push 10                                      |
0041C846  | 6A 00                       | push 0                                       |
0041C848  | 68 884D4A00                 | push doukutsu2.4A4D88                        |
0041C84D  | E8 DE440600                 | call doukutsu2.480D30                        |
0041C852  | 83C4 0C                     | add esp,C                                    |
0041C855  | 6A 10                       | push 10                                      |
0041C857  | 6A 00                       | push 0                                       |
0041C859  | 68 984D4A00                 | push doukutsu2.4A4D98                        |
0041C85E  | E8 CD440600                 | call doukutsu2.480D30                        |
0041C863  | 83C4 0C                     | add esp,C                                    |
0041C866  | 6A 64                       | push 64                                      |
0041C868  | FF15 20C14800               | call dword ptr ds:[<Sleep>]                  |
0041C86E  | 8BE5                        | mov esp,ebp                                  |
0041C870  | 5D                          | pop ebp                                      |
0041C871  | C3                          | ret                                          |
Code:
0041C880  | 55                          | push ebp                                     |
0041C881  | 8BEC                        | mov ebp,esp                                  |
0041C883  | C705 104E4A00 01000000      | mov dword ptr ds:[4A4E10],1                  |
0041C88D  | 5D                          | pop ebp                                      |
0041C88E  | C3                          | ret                                          |
0041C88F  | CC                          | int3                                         |
0041C890  | 55                          | push ebp                                     |
0041C891  | 8BEC                        | mov ebp,esp                                  |
0041C893  | 51                          | push ecx                                     |
0041C894  | 833D E8574A00 00            | cmp dword ptr ds:[4A57E8],0                  |
0041C89B  | 75 02                       | jne doukutsu2.41C89F                         |
0041C89D  | EB 47                       | jmp doukutsu2.41C8E6                         |
0041C89F  | E8 ACF9FFFF                 | call doukutsu2.41C250                        |
0041C8A4  | B9 184E4A00                 | mov ecx,doukutsu2.4A4E18                     |
0041C8A9  | E8 C2F1FFFF                 | call doukutsu2.41BA70                        |
0041C8AE  | C745 FC 00000000            | mov dword ptr ss:[ebp-4],0                   |
0041C8B5  | EB 09                       | jmp doukutsu2.41C8C0                         |
0041C8B7  | 8B45 FC                     | mov eax,dword ptr ss:[ebp-4]                 |
0041C8BA  | 83C0 01                     | add eax,1                                    |
0041C8BD  | 8945 FC                     | mov dword ptr ss:[ebp-4],eax                 |
0041C8C0  | 837D FC 08                  | cmp dword ptr ss:[ebp-4],8                   |
0041C8C4  | 7D 20                       | jge doukutsu2.41C8E6                         |
0041C8C6  | 6A 00                       | push 0                                       |
0041C8C8  | 8A4D FC                     | mov cl,byte ptr ss:[ebp-4]                   |
0041C8CB  | 51                          | push ecx                                     |
0041C8CC  | 6A 00                       | push 0                                       |
0041C8CE  | 6A 00                       | push 0                                       |
0041C8D0  | E8 EBE4FFFF                 | call doukutsu2.41ADC0                        |
0041C8D5  | 83C4 10                     | add esp,10                                   |
0041C8D8  | 8A55 FC                     | mov dl,byte ptr ss:[ebp-4]                   |
0041C8DB  | 52                          | push edx                                     |
0041C8DC  | E8 BFE9FFFF                 | call doukutsu2.41B2A0                        |
0041C8E1  | 83C4 04                     | add esp,4                                    |
0041C8E4  | EB D1                       | jmp doukutsu2.41C8B7                         |
0041C8E6  | 8BE5                        | mov esp,ebp                                  |
0041C8E8  | 5D                          | pop ebp                                      |
0041C8E9  | C3                          | ret                                          |
 
Last edited:
Jan 27, 2026 at 3:30 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Jul 7, 2019
Location: Mimiga Village
Posts: 81
Age: 22
Pronouns: he/him
okay gonna just say
probably not possible with just ASM hacking, might need to mess with CSE2 or freeware DLLs or something
idk you could try tho
 
Jan 27, 2026 at 5:40 AM
Bi_N Online
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 18, 2024
Location: First Cave
Posts: 103
Pronouns: He/him
Gender Notes: Cats are fluffy beings, this therefore makes them aliens.
Well I've been thinking and it's probably entirely possible: all you have to do to make extra tracks is update buffers in orgmaker so, why wouldn't it be the same for Cave Story? Plus, with Noxid's drum hack I think it might be entirely possible.
 
Jan 31, 2026 at 6:07 AM
Bi_N Online
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 18, 2024
Location: First Cave
Posts: 103
Pronouns: He/him
Gender Notes: Cats are fluffy beings, this therefore makes them aliens.
Update:
Important Offsets:
0041C8F0; Make SoundObject8 function?

00480D5F; Terminates track sounds if the window focus is lost. Lower value means the tracks above said value
will sustain their note once window focus is lost until the game is closed.

00480D66; No clue but will make your ears bleed.
0049371A; Makes some tracks have a lower octave
0041B3C8; Total wave samples to load in, in bytes.
0041BBFF; How many total tracks to read(Max 7F)
0041BC9A; How many total tracks to play(Anything over the maxtrack limit will crash the game.)



Address Notes:
(00480D66):
If changed from 8 to any other number, it'll make a loud high-pitched sound that hurts your ears.
(0041BBFF):
If any Melody tracks are over the number specified they'll be set to WAVE00 I think. This does nothing to drams since they're hard-coded to play a certain dram.

(0041B3C8):
Lowering the value at keeps tracks from playing certain waves; it'll completely ignore the track's notes,
notes.

Anything above 6448 or lower than 80 causes an error.



Misc. Offsets:
004200C0; Loads in Wave.dat.
0041BB3E; How much of the ORG header it reads. (Ex. Org-02)
00483650; Max number of notes for each track?
If only I could find MAXTRACK I could make the hack...
 
Last edited:
Back
Top