clownacy / cave-story-mod-loader Goto Github PK
View Code? Open in Web Editor NEWDLL mod loader for Freeware Cave Story (+ sample mods)
DLL mod loader for Freeware Cave Story (+ sample mods)
This will allow the Cave Story Arranged playlist to work without messing with files (since A. I'm pretty sure all songs fade instead of looping perfectly and B. the jingles + Game Over tracks are squished into one file), and could also be potentially useful for other songs.
It restarts at the beginning of the song instead.
Enabling ogg_music as well restores the intended behavior.
So I've tried using MSYS2 to compile this but I keep getting a bunch of linker errors.
$ make
src/mod_loader_bootstrapper/main.c: In function 'DllMain':
src/mod_loader_bootstrapper/main.c:96:63: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
96 | const unsigned int relative_address = (unsigned int)&ASM_LoadDLLModLoader - (0x412429 + 5);
| ^
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCaptureCreate: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCaptureCreate8: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCaptureEnumerateA: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCaptureEnumerateW: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCreate: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundCreate8: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundEnumerateA: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundEnumerateW: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DirectSoundFullDuplexCreate: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DllCanUnloadNow: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_DllGetClassObject: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export New_GetDeviceID: symbol not found
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x1): undefined reference to `_LoadDLLModLoader'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0xe): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x15): undefined reference to `_Original_DirectSoundCreate'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x15): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x1a): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x21): undefined reference to `_Original_DirectSoundEnumerateA'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x21): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundEnumerateA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x26): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x2d): undefined reference to `_Original_DirectSoundEnumerateW'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x2d): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundEnumerateW'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x32): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x39): undefined reference to `_Original_DllCanUnloadNow'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x39): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DllCanUnloadNow'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x3e): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x45): undefined reference to `_Original_DllGetClassObject'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x45): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DllGetClassObject'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x4a): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x51): undefined reference to `_Original_DirectSoundCaptureCreate'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x51): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundCaptureCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x56): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x5d): undefined reference to `_Original_DirectSoundCaptureEnumerateA'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x5d): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundCaptureEnumerateA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x62): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x69): undefined reference to `_Original_DirectSoundCaptureEnumerateW'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x69): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundCaptureEnumerateW'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x6e): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x75): undefined reference to `_Original_GetDeviceID'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x75): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_GetDeviceID'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x7a): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x81): undefined reference to `_Original_DirectSoundFullDuplexCreate'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x81): relocation truncated to fit: R_X86_64_32S against undefined symbol `_Original_DirectSoundFullDuplexCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x86): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x8d): undefined reference to `_Original_DirectSoundCreate8'
obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x8d): additional relocation overflows omitted from the output
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x92): undefined reference to `_LoadDSound'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.text+0x99): undefined reference to `_Original_DirectSoundCaptureCreate8'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x0): undefined reference to `Init_New_DirectSoundCaptureCreate8'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x8): undefined reference to `Init_New_DirectSoundCreate8'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x10): undefined reference to `Init_New_DirectSoundFullDuplexCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x18): undefined reference to `Init_New_GetDeviceID'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x20): undefined reference to `Init_New_DirectSoundCaptureEnumerateW'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x28): undefined reference to `Init_New_DirectSoundCaptureEnumerateA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x30): undefined reference to `Init_New_DirectSoundCaptureCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x38): undefined reference to `Init_New_DllGetClassObject'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x40): undefined reference to `Init_New_DllCanUnloadNow'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x48): undefined reference to `Init_New_DirectSoundEnumerateW'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x50): undefined reference to `Init_New_DirectSoundEnumerateA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.data+0x58): undefined reference to `Init_New_DirectSoundCreate'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj/mod_loader_bootstrapper/main.o:main.c:(.rdata$.refptr.ASM_LoadDLLModLoader[.refptr.ASM_LoadDLLModLoader]+0x0): undefined reference to `ASM_LoadDLLModLoader'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:126: bin/dsound.dll] Error 1
How do I fix this?
I have an idea to fix all or most of the character spawning / despawning on screen during cutscenes:
put black bands on screen to get the 4/3 resolution during cutscenes. That would look cool too, like the letterbox effect in other games even though the letterbox is supposed to be used on the top and bottom of the screen. The only problem with that would be the HUD: either hide it or make sure it's always fully covered by the black bands.
There's an invisible object in the level that spawns that boss when Quote touches it. It needs moving.
Self-explanatory.
Of note, this doesn't seem to be an issue in 16:9.
This probably only applies to 21:9. Not really sure how to fix this, unless I feel like scripting an entire scenario, where Toroko comes through the door, and walks up to the hill.
Omega is centred, but not this one. Of course, the cause is pretty obvious. Just another map fix to throw on the pile...
Self-explanitory. Apparently this is a feature in NICE.
This applies to 16:9 and above.
The Graphics Enhancement Pack seems to be what's breaking it. I'll probably have to write my own TIMG hack, that actually plays nice with it.
When you change the screen resolution the information saved to window.rect is wrong. I suggest a way to toggle a modified window.rect writing system, or a way to disable writing to window.rect.
This might also apply to the Good Ending. With the spawner in the current location, clouds spawn on-screen.
This should be easy, really. From the user's point of view, there should just be a 'settings.txt' that looks like this:
jump = z
shoot = x
up = up
down = down
left = left
right = right
...Actually, now that I think about it, virtual vs. physical key locations will be tricky. I can just see the flood of '';' doesn't actually use ';'' issues already.
Well, this won't be an issue for controllers anyway... or will it? I guess I can just force XInput button names.
Or maybe even SDL2's own keycodes. They're not something I can just expect the user the know, however, so I may need to add comment support first.
I need to change the clip rect's right side, and I think the maps need adjusting.
I already have something in the works, but I'll get to that in a bit.
This issue here is that Cave Story relies on the monitor supporting its selected resolution to run in fullscreen properly. This works for 640x480, but not for 800x480. When the monitor doesn't support the resolution, it doesn't stretch the output image to fill the screen: rather, it just displays it at its native size, resulting in a tiny window in the middle of your monitor (or, at least, that's how mine handles it).
My idea for a solution is ditching true fullscreen, and instead using borderless-fullscreen. This is surprisingly easy to do, and in fact I already have a quick-and-dirty PoC that works great.
While the PC version (and this mod) scroll 'off-centre', the 3DS eShop version actually centres it.
That's kind of why this is called a mod loader, not just a DLL loader.
There is already a 21:9 one, but it ruined the easter egg. Also, a 16:9 one is needed.
(This bug is present in the 3DS port, by the way. Heh.)
In the cutscene right before the Undead Core fight, the stationary 'mini-cores' despawn while on-screen. They're normally off-screen in 4:3. Obviously I can't just not let them despawn, so I guess I'll have to either move them a little, or make their disappearing a little more presentable (maybe some dust clouds?).
Any possibility to play Cave Story with remastered music and/or graphics from Cave Story+?
Read above.
See title.
This might also happen in the WiiWare music mod, but I haven't tested it yet.
Somewhere, the Org file redirection is interfering with NICE's Ogg playback.
The Beetle spawner object in Egg Corridor spawns a Beetle off-screen when Quote touches it. The problem here is that, because of the wider screen, these enemies spawn in places they're not meant to, like inside the Igor boss arena.
What I'm wondering is exactly how to fix this... should I 'fix' the map file so spawners are in better locations, or should I edit the spawner's code so it spawns the Beetle before Quote actually touches it? There's no way to get 100% vanilla behaviour.
Without the override the mod loader will not be loaded, and the game will crash without dsound actually installed (built-in dll won't work)
Edit: Sorry, my bad. Installing through winetricks should automatically add an override.
SDL2_mixer sucks: it doesn't let you get the time of the currently-playing song, nor does it let two songs be loaded at once.
Manually playing the music with DirectSound is a nightmare, and bares haunting similarities to programming for the Mega CD's PCM chip, so I don't want to go with that option, either (not to mention, DirectSound is legacy, only supported by a software emulator...).
These will be built into the mod loader itself. They will be enabled via settings. Mods will be able to override these settings, in the event that they depend on a particular bugfix (the WASD and SDL2 controller mods require the door input masking bug be fixed, for example).
https://www.cavestory.org/forums/threads/dll-mod-loader-ogg-music-mod.13879/page-2#post-358551
After some experimentation with Booster's Lab and applying TSC+, I found that the .ogg mod does not function anymore once <CMU in the script elicits.
This should have been fixed in 7083fd9, but I'll have to check.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.