#Modding the MGS1 emulator
1 messages · Page 18 of 1
that was probably really clear in their native tongue
yeah
translated it can mean anything
and i guess the tendency to keep patch notes succinct
just need to get them to say it again in a different way
Given that the stream is at 11PM my time, I hope I wake up tomorrow to good news. I heard that the resolution change got added with 2.0 but only just now realized that they only applied that to 2 and 3
new squirrel debugger dropped
Debug Adapter Protocol
that would work nicely in VSCode with the Squirrel extension
instead of that 2008 version of Eclipse or w/e it was
i don't think its a priority for me at the mo tho
would probably need some adaptation to work in the M2Fix env
the one in place atm needed a little adaptation
i dont rly use it tho besides the eval() i added
was there a new mod update for 2.0?
did we even get 2.0
welp guess we have to fix it ourselves
I think the main reasons it's taking so long are the fucked up reverb effects and the muted audio on Switch
I actually think they might try to rerecord or splice in audio for the button prompts to get around it. They said they'd address it and I can't really see any other way if Nintendo won't let them say "Circle button" on their console
Or they might use TTS audio since I think the only characters who directly mention buttons are Campbell and Ocelot. If there are any lines from Mei Ling or Naomi though then TTS wouldn't be a viable option (I totally wouldn't put it past them to use it anyway though)
hello warm people
hello
👋
Sadly the recent patch from Konami didn't touch MGS1, they just left this cryptic note about it:
The latest version will remain Ver.1.5.0. Note that this is not a patch for Ver.2.0.0.
FWIW, I emailed Konami requesting clarification on this / the possibility of upscaling MGS1 in the next Hotline, and they got back to me and said the message had been passed on, but let's be realistic they probably won't address it
Epic Store Free
wow, had no idea these were outside Steam
Nice!
It's up now, free for a week: https://store.epicgames.com/en-US/p/castlevania-anniversary-collection-a61f94
Thank you
will grab it l8r and see what the diff is with Steam
alright we got the tag now
surprised i didnt do that sooner
also surprised the other collections arent on epic
specifically anniversary is
anyway exe is subtly different and so is the alldata package, but I figure it's gonna be just the delta to support epic instead of steam
maybe it has a replacement for steam input
though not sure castlevania anniversary on steam uses steam input
btw hopefully i have a bit more time for this again as a long-term (but very important) distraction has recently finished
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Name: CastlevaniaAnniversaryCollection.exe
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Path: E:\Epic Games\CastlevaniaAnniversaXJ2A3\CastlevaniaAnniversaryCollection.exe
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Address: 0xad0000
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Timestamp: 1730185635
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] ----------
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (app -1).
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] ----------
[2024-11-14 22:26:54.651] [MGSM2Fix] [info] M2-32: sq_vm_realloc is 0xbc9c10.
[2024-11-14 22:26:54.652] [MGSM2Fix] [info] M2-32: printf is 0xb42020.
[2024-11-14 22:26:54.652] [MGSM2Fix] [info] M2-32: printf hook succeeded.
[2024-11-14 22:26:54.692] [MGSM2Fix] [info] SQ-32<AlignObject>: SQVM::SQVM pattern scan failed.
[2024-11-14 22:26:54.720] [MGSM2Fix] [info] SQ-32<AlignObject>: SQVM::CallNative pattern scan failed.
[2024-11-14 22:26:54.750] [MGSM2Fix] [info] SQ-32<AlignObject>: Sqrat::BindFunc pattern scan failed.
[2024-11-14 22:26:54.779] [MGSM2Fix] [info] M2-32: MWinResCfg::GetValue pattern scan failed.
[2024-11-14 22:26:54.807] [MGSM2Fix] [info] M2-32<Legacy>: Borderless: MWin::CreateWindow pattern scan failed.
[2024-11-14 22:26:54.807] [MGSM2Fix] [info] ----------```
waow
really
i wonder if its been compiled "like MGS1"
therefore the best approach would probably be to try both "styles" regardless of the game
there's clearly some bizarro compiler flag differences between games that changes things like struct layout and integer types used
might as well just try to scan for anything we recognise rather than prescribe based on the detected game
hoping this isnt like a "third style", but even if it is, i already did all the work to support variations like this so adding another would be easy
this shits so much more stable now so basically once the signatures are found and any struct differences understood it should all work instantly
m2fix was basically working due to luck originally

now it works because it does the right thing
I love seeing a flurry of posts in here, it's my signal to redownload MGS1 😛
OK
so it is like a "third style"
a fusion between what MGS1 looks like and what Castlevania on Steam looks like
FFS lol
ohhh
it just doesn't have this mystery extra object slot
otherwise same as castlevania on steam
WEIRD
why does porting it to epic remove that
was always weird that bonus content didn't have it, either
M2's schizophrenic squirrel implementation
so just need to move this into the domain of the compiler with templates rather than the preprocessor
I think I proved at one point that this object slot isnt even used either
I have SQSharedState off by 4 bytes it seems, so it's getting closer
LOOOOL
"_m2_unknown" has moved from SQVM to SQSharedState
that's it, that's the change
this codebase is still in development?
oh, that might also explain what we see in vol1 bonus content
in some titles the extra SQObjectPtr is in SQVM, in some its in SQSharedState
it's a clean swap and everything lines up now
they've just dumped it right at the end of the struct this time
heck yea
got further after silly battles with C++
since you can't have an object with no size
has to be like this i guess?
xD
couldn't get any purchase out of [[no_unique_address]]
there is a similar one for SQSharedState
not recommended...
eyy
it works
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Name: CastlevaniaAnniversaryCollection.exe
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Path: E:\Epic Games\CastlevaniaAnniversaXJ2A3\CastlevaniaAnniversaryCollection.exe
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Address: 0xb90000
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Timestamp: 1730185635
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] ----------
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (app -1).
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] ----------
...
[2024-11-17 02:28:44.503] [MGSM2Fix] [info] ----------
[2024-11-17 02:28:45.114] [MGSM2Fix] [info] Squirrel: SQVM is 0xe637000, SQSharedState is 0x7585e10 & scratchpad is 0x0 (0 bytes).
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: SQVM is 0x12e91768, SQSharedState is 0x7585e10 & scratchpad is 0x7677b10 (0 bytes).
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: SQVM 0x12e91768 hooked: debug info is enabled, exceptions are disabled.
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: printf: スクリプティング開始
[2024-11-17 02:28:45.420] [MGSM2Fix] [info] Squirrel: printf: -------- init_system_1st() : start
...
[2024-11-17 02:28:46.007] [MGSM2Fix] [info] Squirrel: printf: -------- init_system_create_systemdata() : start
[2024-11-17 02:28:46.099] [MGSM2Fix] [info] Squirrel: printf: dev_name : CollectionDracula```
hehe
at least i didnt have to rewrite the entire project this time
not sure how the scratchpad gets allocated a pointer with no size, looks like M2 found some of those zero-sized objects :^)
it eventually has a size (and things would crash badly if this was wrong anyway)
[2024-11-17 02:29:04.578] [MGSM2Fix] [info] Squirrel: SQVM is 0x1354d018, SQSharedState is 0x7585e10 & scratchpad is 0x1322f8e0 (219 bytes).
once all the scratchpad stuff is sorted it basically just works after that
tryna rationalise how bonus content was done with this new understanding
basically means there's 4 variants of squirrel "ABI" so far which is actually just all permutations of two variables
is the mystery object in SQVM or SQSharedState, and are objects aligned to 8 byte boundary
lool
seems a bit too easy for m2fix to bypass that one
but also the game is free so
ok cool that all works
means bizarrely the epic games release of castlevania has some stuff in common with mgs bonus content
but not the steam release of castlevania
extremely weird all of this
// EPIC Online Service 用
EOS_PRODUCT_NAME=Castlevania Anniversary Collection
EOS_PRODUCT_VERSION=1.0.15
EOS_PRODUCT_ID=1ff2f74ba0ef4019b6905d8abe268819
EOS_SANDBOX_ID=247d4d4b4e424afd9b474334fe450a43
EOS_DEPLOYMENT_ID=c375e68f5f5a4cfa8c1d8840066f9a92
EOS_CLIENT_CREDENTIALS_ID=xyza7891HpULODUKVkXYv3RCk2W10VAh
EOS_CLIENT_CREDENTIALS_SECRET=wEclS2uL3tZ/yPCbZEB3wCX4cb4cfXw3ou3W8v1e+yk
EOS_ENCRYPTION_KEY=1111111111111111111111111111111111111111111111111111111111111111
F
lets have a nose at alldata
g_win_is_epic
so it can be easily detected as long as it successfully attaches to squirrel (guess you could also just use the filepath but)
that is
g_win_is_epic = "Epic" in getroottable();
so i guess there is some Epic class
yeah with methods login, getProductUserId, getLoginError, queryAchievement
lol shits obfuscated
neato
lol.. omg
the component I hook to override things like the window settings
different compiler optimisation options has led to completely different codegen and I have to completely rework the hook
and i don't think I can just return a pointer to value anymore
I think I have to return an out-of-bounds index into the original array
this is so batshit i kind of want to see if it can be done
for trophies?
yeah and a "license check"
which is disturbingly easy to patch out with M2Fix haha
either attaching to squirrel, or the wincfg hook that I usually use for window settings e.g. fullscreen is probably enough to also bypass the license check
with just like the simplest tweak to kill it
i hope there is some other layer of DRM because this is too simplistic
@pure radish Not sure if this is helpful to you at all, but this is interesting behavior when using increased internal res on a 4:3 monitor
Unburdened (2007) ending scene and credits
credits: The Zioms Media @theziomsmedia for generating the AI reporter's voice
whoever it was that first put the "but it came out in 2007" meme to the famous biden clip (possibly @obibyn)
possibly @thesilentshape1978 for the idea of "Trump won by 1 vote" to the above mentioned clip
whoever owns the copy...
probably because there's enough texture memory at that resolution
i would guess the framebuffer effects in cutscenes are still a bit scuffed (but maybe less so)
i think the way to go is just to rebuild the shaders
for a while I was thinking to do the bare minimum to patch the shaders and then (extensively!) patch the gpu pipeline but that is just going to turn into an unmanageable mess
i'd spend a year getting that right with all the hooks etc that would be required
but if we properly rebuild the shaders, then it might just be a framebuffer geometry tweak required
whats happening is its uploading the psx framebuffers & texture area to the host gpu but the sizes are such that it eventually overlaps
so you'll see things like the codec numbers being overwritten by another part of the copy
it all works fine when framebuffer effects arent used coz that screw up has no effect, its not sampling from the framebuffer
hopefully if i finish tidying up the project someone who knows more about gpus than me can hop on and fix it for us 😄
at times like these i curse not being a game dev
I would like to try reverse engineering on PS1 games again, but I don't want to be stuck on the PC all day trying to figure out how to do the process right. I envy those people who make progress in just a few months and find collaboration. 🥲
I found that Metal Slug Awakening uses Lua, but I don't know if it's in the Launcher or in the Unity game. There are many remote communication instructions.
hook it!
Hello, I've been reading this forum and I've seen some efforts on unpacking the alldata.bin file so it could run into an external emulator. Is it possible? The main game looks fucking horrible on my system for some reason (slowdowns and sound cracking) so maybe I could use the roms to play in duckstation or something
yeah it can be done
its an imperfect process (you don't get an identical dump to a retail CD) but its playable on external emulators
i wrote a script to do it
(except germany, we can't do the german version yet)
Nice, can you share it please? Or put into a gh gist
Ich bin kein Deutscher, lol
wdym? Very game breaking errors?? I'm gonna try it out thanks
no errors, should be totally playable and flawless, just has a different hash (md5/sha-1) to a dumped CD
since the process has been lossy over data that doesn't affect the gameplay
needs alldata full-unpacked with MArchiveBatchTool first before you run that
They changed the key i think, the fullunpack gives a header checksum illegal error
did they? huh, i'll check
castlevania dominus had a new key so maybe they're using that
.\MArchiveBatchTool-Windows\MArchiveBatchTool.exe fullunpack .\alldata.psb.m zlib "Illegal function call" 92
Fuck I missread it
MArchiveBatchTool.exe fullunpack alldata.psb.m zlib 25G/xpvTbsb+6 64
How can I look for the key in case they change it? Is a bruteforce attack of the header?
Thankss
just code RE in the executable where it mounts the archive
Okay, tysm
you'll need these as well to produce working disk images
in system/roms
contains PSX SDK stuff that they stripped out
Damn, I guess I will make a script so the process is more automatic
yeah it could do with being made more convenient for sure
Amazing work. Don't even know how you got those libraries. Mad code wizard fuckery I guess
they're from original CDs, the bit that is missing is all FF bytes so just need to splice in the missing code
it is the reason we can't do germany
the german version is different to any CD that has been dumped
probably can be made to work with some effort (but that would be mad code wizard fuckery :P)
the code is missing because its all HLE'd in native x86, so the libraries don't get instruction-level simulated in master collection
just need to understand the differences between libraries and how they pertain to the rest of the game, and then modify one for germany
im assuming its things like constant materialisation (i.e. addresses that are wrong)
Tried all of this, but the new bin doesn't boot on duckstation, it keeps either stuck on the bios screen or it asks me to add a ps1 disk
Maybe I'm doing the patch wrong?
The .exe inside the roms dir?
Nope, gonna try it out. Sorry for the inconvenience
It's okay, thanks for being so helpful
so those 700mb bin files are disk images, unpack those with dumpsxiso
then replace the SLESwhatever file with the exe that was generated
I'm making a powershell script so it's one click and go
then pack it back up with mkpsxiso
that should run
the original SLESwhatever will be all zeroed so they won't boot without all these steps
people made like xdelta patches for this but its a bit of a sledgehammer to crack a nut
that gets you a 1:1 accurate CD dump but with little regard for how it does it
plus this approach allows keeping some master collection patches like button prompts in theory
Yeah at this point why don't just download the rom.

Still can't make it work. You mean replace the exe with this exe inside this dir?
oh yeah, some actually call it MGS1.EXE
yeah, the M2Patch.py script should've created .exe files in the roms dir
need to pick the right one of course
This i gess
yes
it's so good to see this thread is thriving again
Yeah I would like to see the Master Collection version as a good way to store the roms
you even can use PPF Patch on MGS1 master collection
Why exactly would you do this though?
Like the mc already has an emu, is it just because you prefer duckstation?
Because I have severe slowdowns on my system, steam input does not work for some reason and duckstations have better support with PGXP and those stuff
Makes sense
Although I could think of several easier ways to get mgs1
But nvm that lol
Yeah, for example just downloading on the internet lol
Technically I already own the game so whaat gives
But having just an extractor is better
But overall the M2 emulator is pretty slow honestly
Fucking finally, Steam Input works
Had to completely remove steam using the revo uninstaller
could be kinda fun to teach other emulators how to launch the master collection roms directly
dunno how extensible they are for stuff like that tho
then it would make sense to use it to store the roms
Well technically they are 100 extensible since they are open source lol
Just need to fork it
easily extensible i guess
carving it up and having something to maintain, upstream or rebase is probably not worth it
if its just some script that can be loaded into it, very different thing
It doesn't need to, you just need to work well on MGS1 and just MGS1
Maintaining it's a headache
i was just thinking "oh shit maybe i should do this with my copies" but i literally have MGS1 on disc from the essential collection, and already dumped to my PC too 😭
another patch day, and MGS1 is still safe
do they even plan on updating the game again...
I wish
I literally emailed Konami asking them to address in their next Hotline if they were planning to tackle the resolution
honestly kind of preventing me from playing the entire series as I'm pedantic enough to want to play them in order
GTA definitive got a huge patch after years of nothing
Yeah, and a decent one at that. Still plenty of issues, but a huge leap in the right direction. I have hope 🤞
i somehow feel like it's a fundamentally more difficult problem to upscale MGS 1 though
Yes and no. If they can mange to make their emulator work as well as other psx emus, we'll be good I think. But that may not be easy, as you say.
it's not intractable to do what other emus can do (and likely a little better than that if it only has to work for one specific game)
it's a few man-months though
tbh i won't give up hope until vol2 releases
though remastering it would be... ambitious to say the least
Needs the Night Dive Studio touch
Something just happened. I think they may have moved it to a private branch
oooh?
please don't do this to me
my poor heart, it can't take it 😅
I want to believe...
would it not just be the 'community items' thing at the top?
nah it's the one underneath that
doubt the thing at the top is related to it
the branches are about the installed game files
Fuck they did that for all the games 😦
Well it was fun watching them while it lasted I guess
(steam just added that private branches feature a few weeks ago iirc.)
rip
it's for the best really
the activity it previously reported was like
50/50 something is happening soon or it isn't
which is as good as coin toss
would prefer clearer communication though but there's language issues so what ya gonna do
visual studio update broke the m2fix compile in a really strange place
"The latest MSVC is significantly stricter about standards compliance than previous versions"
aha, fixed it
doesnt really help that intellisense and the toolchain are using different C++ frontends tbh
Agreed, lurking steamdb can kinda become an obsession
yeah i mean you're not seeing their entire workflow lol
there can be no activity there and they're working on a huge update, or there can appear to be a lot of activity there but in reality they're not doing much
oh
they added this at some point
// SteamDeckチェック
function _is_steam_deck() {
if ("isRunningOnSteamDeck" in SystemEtc) {
return SystemEtc.isRunningOnSteamDeck();
}
return false;
}
so m2fix could detect steam deck this way
not sure why would want to do that but neat
wonder what the native side of that actually does
oh, it's an actual SteamAPI call
// NXでのCPUブーストモードを使用するか否か
if ("setEnableCpuBoostMode" in ::g_emu_task) {
local title_prof = ::get_current_title_prof();
local version_info = title_prof.m2epi.version[regionTag];
if ("use_cpu_boost_mode" in version_info) {
::g_emu_task.setEnableCpuBoostMode(version_info["use_cpu_boost_mode"]);
}
}
they added CPU boosting on Switch as well
(first time really diffing between game versions properly)
Thats pretty neat. I'm guessing it's hardware cpu, and not some emu overclocking thing?
yeah its a switch OS / hardware feature
which is getting plumbed up to squirrel so they can enable it from the scripts
looks like the individual titles have to request it though
i.e. its on a per-game basis, so e.g. integral could ask for it but another version might not
i didnt know performance on switch was so marginal for MGS1, I had a friend who played it at release and didn't complain
but this definitely arrived in a post-release update
lol
wrote a script i can plug into visual studio that automatically copies each build to every game
how long have i been manually copying files around xD
i also have a nicer way to attach a debugger now
ctrl+c on the console window triggers a breakpoint
(the console is optional and enabled with an ini setting)
maybe I should add some commands u can type
I usually just end up symlinking stuff after not too long myself xP
oh my god
i think i got that replacement config hook needed for castlevania on epic working
but how the fuck do i tidy this code up
my god
this has no right to work but it does xD
just have the borderless patch to do now for the epic version
huh
just discovered what looks like dev tools built into the game
it can create another window called "edit"
associated with MEditDialogTask
should try and stimulate that l8r
so if you start up without epic launcher open you get this
can we bypass it
just crashes if you force g_win_is_epic to false
wonder if we can port the xinput stuff across
Overclocking. Nintendo always does this when starting games on Nintendo 64 - Nintendo Switch Online, it also happens for both handle and dock mode. The MGSMasterCollection version also does it.
Yes, I was thinking more in line of virtual overclocking, like in Duckstation, where virtually overclocking the psx cpu by around 130% enables you to have more stable framerates. But it's definitely not that, like you say.
wonder if I can put an automated test suite together for M2Fix
its a lot of manual testing with 10 games now
Wait. Does it mean it could be added on a later update?
I would love to have cpu overclock mode
The M2 emulator is so fucking horrible
I hope we could replace the M2 emulation part with another emulator and literally forgot all these problems
the M2 emulator is more advanced in some sense than other emulators tbh so its not fair to say its "fucking horrible"
most of the game is ahead-of-time converted to x86 which is even better than JIT in theory
it doesn't have a lot of the graphics bells and whistles for sure
there's already some functionality for overclocking the "virtual CPU" IIRC, but that thing above pertains to a Switch-specific OS feature which adjusts the hardware power mode
but of course they can't use overclocking all the time... this is just to prioritize loading logic content fast at the beginning of the emulation, then the second time it will stop using overclocking. Emulators are using some precompiled logic to fix many bugs or crashes, avoiding using overclocking. It's like a hot replacement where if it takes too long to load a scene causing a stutter, the emulator anticipates loading precompiled logic, without overclocking, for a perfect loading. I'm not sure if it's associated with JIT or elf.
Dolphin Cached Interpreter 2.0 is good
that gif is surely more appropriate for a JIT
insane that there isn't really a good Win32 API wrapper for C++
Microsoft abandoned theirs https://github.com/microsoft/cppwin32
In theory, in practice somehow this port runs horrible
I mean, I have no idea how a PS1 emulator works, but at the end M2 emulator has somehow worse performance and audio cracking than other options.
the audio crackling seems like a bug on some systems because only some people report it
it runs flawlessly for me and even the switch seems fine ¯_(ツ)_/¯
Hopefuly they will update it, because I have this problem and it's annoying
I'm gonna report then
I didn't really bother to debug that further tbh 😛
What's your specs? So I can document it on the bug tracker too
(GPU/CPU/RAM/SSD or HDD)
I'm playing using a laptop, a MSI Modern 14, with a i7-1255U inside, integrated graphics.
You would think I'm mad trying to play on this laptop, but the processor and GPU meets the recommended requirements, and I could play perfectly other games
hmm like you mentioned if you're having issues with mgs1, might as well play it on a frendlier emu
Emulating the PS1 is not a problem though
would probably run better
I did in the past, beated MGS1, but I'm playing for the archievements lol
ah i see
on reflection it is quite funny that the flag is called g_win_is_epic
Out of sheer curiosity, have you tried running RPCS3 on your laptop? They recently got it running on an RPI5, albeit with crappy graphics, but as I said, I'm curious.
No. Great news!
However, I would not like to keep the pc running compiling shaders for a ps3 game
Unless there's any other way arround
Merry crisis
Hey Nuggs, any plans to expand the scope (lol, suffering) to the other M2 Castlevania Collections, Advance & Dominus?
Edit: Not expecting, just curious 🙂
yeah that work is mostly done, just hasn't been released yet coz I want to get some more things in
https://old.reddit.com/r/castlevania/comments/1hsp4l7/is_there_any_way_to_upscale_the_castlevania/ I saw this and thought of you 😛
Hello Nuggs, here a big fan of your modding work. Happy new year 🙂
Little question: for your MGS1 mod, is there any way to use something similar to "geometry correction" that is on duckstation? if no, where I can request this (if this is possible).
Thank you and nice day!
already requested :>
https://github.com/nuggslet/MGSM2Fix/issues/19
@rancid hareOh!, thank you!, nice to know 🙂
Hey @pure radish! Been a heck of a while! Did you ever figure out how to get rid of the letterboxing for 16:10?
IIRC the main stumbling block was that it was all fucked up during cutscenes
a shame, we came so close
i dont know if i can cling onto hope, i might prefer to live in denial 😆
denial is a river in egypt
not what im currently working on, but I haven't forgotten about it (also I don't think it will be that hard either)
https://retrocomputing.stackexchange.com/questions/23750/what-is-the-tpg-file-format-used-in-the-playstation-release-of-zork-i
@pure radish Not sure if it's any help, but found a little writeup + tooling for the PS1's vram
just renamed a template parameter in the entire codebase from when I started templating squirrel
xD not fun
I started using <T> without realising that might be a bad idea for other uses of T
since T is very common
needed to do like 100 find and replace operations
somehow, it still builds, which means it must be correct because there's no way this would build by accident
so now it's always "Squirk Q"
How goes? What's the focus these days?
battling stupid bullshit xD
trying to really sort out technical debt
im most of the way there but perfectionism kicked in and i hit a couple hard problems im still working through
this has turned into like an entire rewrite of the whole thing so
Hi, I was wondering if it is possible to load new instructions or hook games on Nintendo Switch like you do on Windows. At least this would help me know if it is possible to port mgsfix to arm-arch
yea it is
fundamentally
the method of hacking the system to load custom code will obviously be different
ideally you want something like the game loading an extra NSO/NRO very early in startup
i'd look at how other games have custom code loaded on switch for inspiration
On Nintendo Switch I only see these elf which is the executable in the exefs folder, but I don't see a way to inject any dll or function to load the additional nro/elf. I remember once noticing that the main nro tries to load a config file into romfs but this would cause the system to crash.
Ok, ok. I've noticed that some people create cheat code based on asm and some hook, but I could never get access to their python code that converted their plain code into cheatcode.
if you can load "cheat codes" the problem is tooling, not the fundamentals
it's really about getting a nice execution environment within the process
I want to focus on Unity Engine mods. There are few or no ModLoaders, like MelonLoader, I don't know how it will modify the apk but it works on ARM64 (specifically arm64-v8a) I hope this will help me understand how to modify and compile native code to arm. There is one achievement I want to achieve and that is to run hidden scenes in games that use this engine on Nintendo Switch. From there I will see if it can be expanded to Mgsfix mods for arm-nro
I recently moved from modifying memory to modifying runtime code for a game on Windows PC and it's been a challenging process but it gives more flexibility when modifying. I want to do it with this console as well.

didn't know about https://github.com/Gh0stBlade/libValkyrie either
incheresting
I like all the filenames being in all caps
it's a choice
they hadn't invented lowercase back then
that last link might be extremely useful, supports PGXP so I assume it's an upscaling renderer
and it's D3D11 and so is MGS1
and it's very readable/accessible code, very dense with information
with a bit of luck it might tell us exactly what we have to do (I think we know, but having such a good example/reference should give the complete picture)
open source emulators are really hard to follow with this stuff
this looks much more tight
it's tempting to say "just replace the entire renderer" but that feels cheap and also I don't think it actually saves any time/effort
basically the same work is involved in fixing this one or replacing it
so I guess the primary reasons might not be ideological in terms of keeping as much of the original product as possible, but it is nice to keep it 🙂
though we already replaced the GTE I guess
but the GTE is tiny, really, any old implementation will suffice
that above link is really handy in showing the D3D11 API usage & shaders without ludicrous abstraction
Pragma fanatics
I still think that C++ is not as universal as .net (you can recover the code if it is not obfuscated) and it is difficult to find .net emulators, only parts of the core, but not a complete emulator. With the exception of Ryujinx (discontinued Switch emulator), it uses .Net and it is wonderful. On Psx I managed to use a .net emulator in development and run it in Unity with some changes and with that it becomes multiplatform.
libValkyrie I think was used in the Driver 2 port (or KAIN2 I think) and I find it more readable and easier to use (if I knew C++ perfectly)
Driver 2 used Psy-Cross
also it's easy to be universal when your only target is a virtual machine
They are even using rust to create sdk 😪
I'm still surprised that WebGL is so universal haha it runs on any architecture that has a browser
Anyone got some copium for me about the chances of Konami upscaling MGS1?
I remember people saying the steamdb package was being updated not long ago
a man can dream....
Valve disabled being able to view development SteamDB packages 5 months ago.
😦
I've given up waiting, should prob just get on with it ourselves now
I'd wait way longer if they hadn't gone quiet
I'm just still hoping for audio fixes
need a way to reproduce those
either I'm deaf or I don't have them
there must be something about each system idk
Got an example here. Not home ATM so I don't have my notes, but iirc the chaff grenade (and possibly other sfx) is missing a reverb effect, and then at 40 seconds - the armory BGM is using an incorrect synth instrument
https://youtu.be/DI2d9XWMKic?si=AIE1DFznrhsYLDFi
'Metal Gear Solid: Master Collection Vol.1' is slowly being patched into an acceptable state, but there's still some issues. Most notably, the audio reverb settings are inaccurate to the original. I made this video in the hopes of brining these issues to Konami's attention so that they will be addressed in a future patch.
I also made recommenda...
yeah I was waiting for another hotline after the big patch last year, but you're right, there's been nothing
and i'm starting to think that cryptic patch note they had for MGS1 is actually meant to mean "MGS1 wont get any more major patches"
The latest version will remain Ver.1.5.0. Note that this is not a patch for Ver.2.0.0.
Too bad if that's the case. Wish they'd at least fix the audio issues. Guess it's up to modders then. And the decomp project, when a pc port is ready in god knows how many years.
prob switched over to vol2 now
Man I hope they do a good job with MGS4. I've never played that game, been holding out for over 20 damn years lol 😅 hopefully they'll base it on the cancelled xbox port, and the pc port will be smooth
Honestly, even if they do a bad job, at least the data will be available for modders to fix it up
At this point, I can't be too mad about it. All the games are in relatively good places, at least for casual/normal players.
yep, not mad at all
My body is ready for more
just be nice if their intentions were clearer, but can't have everything
btw, I picked up the Castlevania collections on PC specifically because you mentioned you were working on them 😛
Eh, could just be lost in translation
Yeah it's definitely a hard one to pass, the two sentences almost contradict each other depending on how you read them
But again, isn't it just copium for us to think it's likely they're working an mgs1 resolution bump? I mean they've given no indication that was part of the plan. As much as we'd like it
Yeah. I think if it was "easy" we'd have gotten it. I'm totally happy with a close-to-actual-PS1 release.
@pure radish Er, would you happen to still have the installer for the version of intel c++ compiler you used for m2fix? intel apparently removed it completely from their website a year and a half ago & M2fix doesn't build on the 2025 version :x
maybe
but I'm away from home atm so can't check
but
locally I have it ported off the Intel compiler
will check when I'm back soon
decent chance I have it
Alrighty! 😄
Also, pr'd a small feature/fix https://github.com/nuggslet/MGSM2Fix/pull/35
nice one, thanks for that!
I'm sure it will work
^ maybe that's what you need?
not sure it's really relevant though anymore 😛
I need to get the rework finished & pushed
it's a classic case of the first 99% of the work was easy and getting the last 1% is painful
how tf is that just 13mb
surely its just a downloader

Okay, so we're gonna need you to get Delta running in the M2 Emulator.
lol
i've been doing this manually, probably should start using this
might regenerate all my signatures to see if they're any better
i do: copy bytes, replace anything that looks like an offset/immediate with ??, and search for it until there are no duplicates
im super old school
I've just been using this for as long as I can remember
https://github.com/alliedmodders/sourcemod/blob/master/tools/ida_scripts/makesig7.idc
Heh, high five then
Most of my projects revolve around sourcemod or the source engine in general
before that i was doing html/php xD
i have a corpus of scripts/extensions that are basically my first real attempt at programming
fun to look back at
I learnt reverse engineering and most of my coding knowledge by making plugins for TF2 servers
I just moved to projects revolving source engine games ( not the games themselves ) in Rust lol
Oh aha I see
don't worry, you too in 10 years can be a greybeard
one of the plugins i wrote let you play as the l4d1 survivors in l4d2 the passing
good times
My back already aches. Does it count? 👴
im 30 this year and i have no back pain, must have evolved a titanium spine
Flexing, are we
i don't know how, i've treated myself like absolute shit
the body hardware is all good, the brain hardware is a bit lackluster
Not gonna lie, writing plugins for source games was probably the most fun and focused I've ever been. Need to find something similar. I was thinking of making a sourcemod successor in Rust once I have time
I just like to write something and visually see what it does I guess
Oh a b s o l u t e l y. Genuinely speechless
The main one, dvander ( bailopan ), has a crazy resume too
yep
He's worked at mozilla too. I think he still does
He's recently come back from his slumber ( I think it was probably absent because he had a child ) and he's been rewriting huge parts of Sourcepawn
On that note - as you probably heard - TF2 was today released into open source
or something like that
officially, too, not some weird hack
Yes. The SDK now contains TF2 too
https://discord.com/channels/1116856754920226876/1342290472848195634 woooo finally see someone is working on this mod idea
Hi, how is it going with the mgs port?
I'm curious if you are familiar with the error "SEHException (0x80004005): External component has thrown an exception" caused by IL2CPP Interop from .net

Mgs one day 🙏
damn
i checked in here, saw Nuggs posting a github link right after someone asked how the widescreen fix was coming, and almost blew my load
and then.... sadness.....
Time to speedrun a recomp port of peace walker HD before Konami can release it lol
all this effort to preserve a bad game
Do it for MGS4 man
MGS4 isn't on Xbox, so can't recomp with this lol
I don’t need Xbox recompilation tools…I need a team..
all this time I was using the wrong recompiler?
https://github.com/rexdex/recompiler
That one was missing opcode for commercial games

I would like to modify a mips instruction for psx, but it has an if and goto
Nuggs shoutout detected
isn't that a Lyall shoutout detected? 😛
games journos are terrible at covering mods
i mean, fair play to them for trying though
Need a trump soundboard for "SAD!"
Going back to M2's port of the original 1998 Metal Gear Solid, this currently sits on patch 1.5. It remains a PS1 emulation effort, running at the original 240p resolution and 30fps target - or 25 on the PAL releases
😦
Full 360 degree analogue movement is reinstated, allowing for finer control of Snake's run through Shadow Moses, albeit with a noticeable hint of input lag.
😦
I feel really bad about stealing Lyall's thunder on that, the Nexus page they showed literally says "Creator: Lyall" right in the video lol
haha
you're like the polar opposite of whoever that guy was
the one that took someone else's mod and threw on a reshade filter then started promoting it here as his 'Full HD rework fix' mod or whatever it was 😄
Add multiplayer

you have to look for the entity spawn system
you have to look for the git commit && git push
spent today training to become an IRL racing marshal boys
I spent the last week adding a vehicle coloring system for cars in Vigilante 8, from a Playstation game, because it doesn't have them.
i vaguely remember this game
I guess this is what it feels like to decompile games
welcome to autism
Hey nuggs, could I rack your brain for a sec when you get a moment?
I'm hooking into some functions to print to a debug log - a file name is passed to a3 as an int64, which I assume is a pointer? Would you happen to know a way to resolve it to either the aDProjectsNhtVo_10 value, or the actual filename it's pointing to? (I'm hooked into the Print_CodecHook function that it's calling, perhaps I'm just hooking too late?)
Looks like it's some kind of assert/similar where the game's source file effectively embeds itself into any debug print. It's definitely a pointer (to the string containing the original source file name)
"aDProjectsNhtVo_10" is probably just what IDA has named one of those strings, fundamentally it's probably not of great significance
I would just dereference a3, essentially it will always point to a string containing the original source file name
(unless there's some weird cases where it's null etc)
these things tend to be macro-ized, most compilers provide some macro that provides the definition for a string that contains the original source file name
it's pretty common to have some debug print that compiles down to a source file name and line number
essentially you have like, assert(whatever, "bob", FILE, LINE) in some incarnation
so the compiler has to embed the string as specified by the engineer, the auto-generated file path, and the line number in the original source file
personally I'd just hook the fundamental print, at some point the rubber hits the road and you're looking at something like printf
that's what M2Fix does
whatever bullshit is done to format/produce a string, it reaches a point where it's submitted to some output device
for a "release" build that might be some sort of "stub" device, where the compiler wasn't clever enough to realise that there was no outcome of the debug code
if it was, the whole thing would've been eliminated
lmk if if ya want more info 🙂
https://github.com/nuggslet/MGSM2Fix/blob/master/src/dllmain.cpp#L432-L443 how M2Fix deals with the prints from native code
I can't wait any longer, think I'm gonna play MGS1, just trying to recall which setting it was that 'breaks' cutscenes?
; MGS1 only: Enables render resolution scaling
; What most people would call a "4K mod" or a resolution upscaler.
; Only height is needed - width is set intrinsically by the game.
; Leave the height at 0 if you wish to use the external resolution.
;
; Additionally, set Widescreen to 'true' to enable proper widescreen without horizontal stretching.
; (Note: the in-game settings must also be set to 'Widescreen' for this to take effect, and won't kick in until you exit the settings menu)
;
Enabled = false
Height = 0
Widescreen = false```
it was the widescreen, wasn't it? can internal resolution upscale still be used or is that part of the same thing?
it's been a while
Unfortunately it was internal resolution itself
And IIRC, the 'proper' widescreen fix also can't be enabled unless the internal resolution is upscaled as well? Which is what that code block^ suggests
In short, neither the widescreen nor the internal resolution upscaler work fully 'properly'?
didnt you write that comment? 😛
i thought it worked without the upscaling
i don't see why it wouldn't
Numerous nuggs shall we say have been consumed since I wrote that
if it doesn't then that's me being daft rather than something more fundamental
anyway yeah just play it bro lol, no point waiting, i complete the game at least once a year
each year im sure rex gets harder
Yeah it's definitely time
you know it's time when literally every day you're thinking about metal gear 😄
limited testing, but yeah it seems like the widescreen (without upscaling) 'works' albeit it's stretched (things are fatter horizontally)
unless I'm mistaken with how I set it up
but that's all G
just out of curiosity how come the gog version upscales graphics fine but the mgsm2 mod has problems with cutscenes and water
Well for one the gog version is a native pc port while this is an emulator packed version
regarding to MGS1, some people choose gog (aka the old pc port) to play. While mods can fix some issues, it lacks key features that made the game special, like the Psycho Mantis fight. They changed the P2 controller gimmick and scrapped the whole reading memory card & controller vibration part. So it's really hit or miss
PC port also looks too smooth imo
The way graphics look on PS1 is how MGS1 looks to me
Poooooooooooooooort

Spiderpan
Is there a way to use MGSM2Fix to increase internal resolution and keep the CRT filter provided by the game?
So far, I've noticed that if I change the internal resolution, the filter goes away (on top of the bug when underwater)
ShaderGlass 1.0 has been released! Big update! 🚨
︀︀Apply shaders to any app on your desktop: gaming, pixel art and video. 📺
︀︀Free and open source! Links in reply.
💬 189 🔁 2.8K ❤️ 18.9K 👁️ 1.27M
There's no way to do it with the filter built in the game?
the built in filters are very crude, not surprised they break with native internal resolution
https://youtu.be/nc_BOKSqJDk?t=1119 MGSM2Fix mentioned, although uploader linked the wrong mod in the description lol
👑 Get yourself some great deals on games with Instant Gaming: https://www.instant-gaming.com/?igr=RetroRenew
🥷Get MGS1 Master Collection Version: https://www.instant-gaming.com/en/15227-buy-steam-metal-gear-solid-master-collection-version-pc-game-steam-europe/?igr=RetroRenew
❤️ Support the Channel:
YouTube Member ►► https://www...
i think it's fixed now
yea it's fixed
https://www.reddit.com/r/metalgearsolid/comments/1k90t9j/on_my_first_mgs1_playthrough_and_the_codec_is/ oh I think someone found out a bug in M2FIX mod that can causing problems in codec talk?
pretty sure it is, I investigated it once and it was doing the same framebuffer pixel sampling thing in the shader
which ends up not being scaled correctly so it selects the wrong pixel
@pure radish hello friend! Do you have any plan to update your mod with the geometry / texture pop up fix? (Big fan of your work) Thanks!
Oh you know what, it may be worth poking @crude zinc over here to see if they have any ideas on how to help out, they wrote a shader for MGSHDFix to fix all the line scaling issues 2 & 3 had.
Brief rundown of the issue - MGSM2Fix adds internal resolution options to MGS1, but some of the framebuffer effects (notably font overlays & water distortion) don't get scaled up properly
https://github.com/nuggslet/MGSM2Fix/issues/15
A fix that adds custom resolutions, analog input, pixel perfect scaling and more to the original Metal Gear Solid within the Master Collection. - nuggslet/MGSM2Fix
(Missing area info) (Missing numbers/PTT/Vox indicator) (The dropdown memory area is working correctly) My ingame settings: MGSM2Fix.log MGSM2Fix.log DxDiag.txt How it should look:
Hi, i don't know if it's the same bug reported about Snake not visible when under water but in my case with the internal resolution on all cutscenes are like super zoomed and you can only s...
That doesnt sound entirely straightforwardly shader related, that sounds like a draw call issue or framebuffer size or aspect mismatch issue in some form, but I actually have no idea from just that summary
Im really not an authority on the subject (but if I can for some reason help I dont mind)
the shaders have hardcoded framebuffer offsets
which is obv for two 320x256 FBs
and that's how they're arranged in the VRAM
it's controlled by that tex_type thing, all the scenes that break have tex_type == 1
i have no idea what im looking at but it seems like they abandoned the hardware renderer for some scenes
and that just samples the VRAM
so with the current behaviour it selects the wrong pixel data, and it seems that even if the framebuffer and software rendering was adjusted it would still need the shader changed
but i am not a graphics person by trade haha
maybe the whole renderer needs swapped
i doubt whatever it's doing to create that 320x256 framebuffer is going to scale well to native res
(performance-wise)
any insight would be helpful (this doesn't really look like what I see other emulators doing but I may be failing to recognise some pattern)
i think at one point i tried overriding that tex_type thing to use the "working" type, and it just makes a total mess of those scenes haha
missing lots of effects
I might just be stupid but Im not getting how this is relevant - it LOOKS relevant, but the actual factor here is the uv coordinates per vertex for presumably the screen corners being given in (in vec3 f_TexCoord), so Id think it should only matter if you've messed with the uvs.
f_TexCoord isnt like a pixel-tied thing or in other words something that has real awareness of its own ratio/proportions/positioning, its just a vec2 thatd be in the range of (0,0) to (1,1)
so we're saying rather than there being 2 things to do here there is just one (and its not in the shader)
well i am looking forward to finding out how their code scales with a larger framebuffer
i think i even tried that once and wasn't very impressed
well that saves me a whole bunch of work that would've achieved nothing, nice
i kinda assumed this needed adjusting before the PSX framebuffer stuff was even worth doing
i know nothing about graphics its a great shame of mine because i can do a lot hacking games right up until it hits graphics stuff 😛
i feel almost too old to pick it up
In this shader it just looks like it refuses to do blending if the input texture coord is over (0.625, 0.25), which is insane stupid logic that I dont understand the point of. But my point is that no matter the box size this shader runs on, if the uvs were unchanged, that effective portion of the box would just squash and stretch to match the ratio of the box
It would look like this assuming Im not making a horrendous mistake
super useful
if it's over (0.625, 0.25), presumably its texture memory?
sounds like how I remember MGS1 VRAM
you've got two framebuffers adjacent in top left and the rest is textures
That sounds like a valid explanation yeah
well that was probably very obvious (but not to me :P)
not really, Im probably about as confused as you here, just about different aspects
probably the most useful info i've received during all 18 months or whatever of the project
oh, actually, I was being stupid, its more likely like this given the whole vram packing concept
I have no idea what happens if you change the resolution of what is presumably actually one framebuffer packed into a texture in the red region on the right. it seems like it'd just leak out and overwrite other parts of the image. And if it somehow didnt, and you somehow changed the aspect ratio without changing the uvs, then even at best that region is now inaccurate.
So if thats what you're doing, youd want to modify the incoming, presumably kind of hardcoded uvs to match the framebuffer region. But youd maybe also need to remove or adjust the hardcoded region clamping in the shader? ..? ??? ? ?? ? ? ?
I might also still be misunderstanding something here, I dont know, but thats my input for now
i think i have observed stuff leaking out and overwriting other stuff in renderdoc in some experiment
https://github.com/nuggslet/MGSM2Fix/issues/23#issuecomment-2567203010 that video is the usual thing, not sure if you've seen
also lol at the retarded comment about donations, not dignifying that with a response
agree with the recommendation to buy gog integral! buy all the versions they are all different in some way
i mean it seems like the PSX VRAM needs to grow, and then the texture memory + framebuffers repositioned (?) that seems to be a requirement
how are normal emulators handling that generically?
i guess it works fine if aspect ratio is the same
hmm well things to try anyway
🫡
I would imagine emulators can just detect if a framebuffer is infact a framebuffer and not a random texture tile in vram and redirect texture reads/writes to a more flexible dedicated buffer or something (its all fixed function stuff so Id imagine very easy to detect and deal with)
That also kind of assumes that emulators often even treat texture collections as literal raw texture atlases like that
Honestly though Im not sure why you'd even go to this extent for this game in particular, it seems like the obvious easy choice is to just inject duckstation in or something
to have the steam version be nice
im uhhh a heavy steam user
also all the game versions are in one place
it's a nice frontend framework as well, which we understand very well now
we thought about using it to drive gog or a ported decomp at some stage
also it's just become my pet project haha
how neat the squirrel hooking turned out has me hooked
and it's nice if all the master collection stuff has mods
also tbh the mod extends beyond MGS1, it targets any m2engage title but this "upscaling" stuff is for just the PSX backend
i'll give some things a go this weekend (might need to do some hopefully quick mod housekeeping first tho)
not sure what state i left it in
some problem i was struggling to solve for maximum game portability coz it's really stretching C++ (at least, my ability within it) so maybe MGS1 won't even work lol idk need to see
that stuff got deep into advanced template fuckery
mh maybe i found why the above didnt work lol
loool
i've broken all the steam 32bit games basically
thankfully its obvious
i had to add some new stuff to the interop string class for the config hook for the epic release (which uses an entirely new hook anyways) but that has retroactively applied itself to the steam stuff as well
so its trying to delete a string with the wrong allocator
coz this string is passed by value in this case
i wonder if its worth adopting the epic-style hook, if its possible on steam
but for now ill just kludge it
phew, glad it wasnt anything more fundamental
hahahahahaha
"only delete the string on epic" sure is a riot
now we're cooking with gas
where does that "MGS1_JP_JAPAN.log" string come from
weird
never seen it before
oh, you cant see it
oh
::g_emu_task.setLogFilename( format("%s_%s.log", dev_name, regionTag) );
well that answers that
i never got that log to do anything so i just substituted it with my own lol
would be nice if i could get this to launch the games
guess i could. nothing stopping me kek
tryna fix something else (still housekeeping)... did i ever fucking test this function
ah shit. probably not
i was probably too excited to have it compile
Tell valve you want func_vehicle in Counter-Strike: Global Offensive!
JOIN THE OFFICIAL STEAM GROUP: http://steamcommunity.com/groups/func_vehicle
Join my cause and together we can make a difference.
VALVE SOFTWARE DOESN'T CARE ABOUT CAR MAP PEOPLE
thanks to all the folks who uploaded car map videos to youtube
[S_API WARN] GetAchievement() failed, achievement MEDAL_TROPHY_MASTER does not exist - needs to be first configured on the Steamworks site
i do wonder what that was
achievement for getting all the achievements? bit pointless
Must be a canned achievement, PS5 doesn't have it either
well at least the mod works again and I understand this separate issue
good start ig
oh my fucking god
I had
data->event_type = SQHelper<Q>::GetObject(2).Cast<char>();
apparently sqrat can't cope with a cast to char, so that set the error flag, which broke a downstream cast, because the error flag wasn't cleared
so that needs to be
data->event_type = SQHelper<Q>::GetObject(2).Cast<int>();
even though data->event_type is char
that is extremely daft
like I get that char doesn't exist in Squirrel but, still, just treat it like int
that needs a comment
i may try to fix it myself
being able to attach the VS debugger like this is vital haha
how would i have fixed this without getting this set up
M2: Loaded ROM image: roms/mgs_jp_disc1-20230407.lz4a.
M2: Mounted CD-ROM image: roms/mgs-disc1-ripped-washed.bin.
good, that's working again
locally this works completely different to how it did before
it used to be some script hook but now the mod directly asks for the info
im excited to work on this again, motivation is back heh
yeah imma try and get the VS play button to launch the games
investing in workflow stuff has made everything far more tolerable
oh that works huh
aha, solved the insanely complicated multi-game support stuff
apparently i just needed a break lol
the amount of pain ive solved in one day
need to check the 64bit titles but i think i have an approach that should work for everything
only dominus is broken! with an extremely strange reason
[2025-05-11 15:21:53.883] [MGSM2Fix] [info] MGSM2Fix v3.0-eng started for Castlevania Dominus.
[2025-05-11 15:21:53.883] [MGSM2Fix] [info] ----------
[2025-05-11 15:21:53.993] [MGSM2Fix] [info] M2-64: sq_vm_realloc pattern scan failed.
easy fix
so epic castlevania working, every other steam game working
just dominus to fix
cool, dominus fixed
great place to be
we're ready to start looking at this upscaling stuff again
can't believe everything works

so it really is everything works
yep, at last
stable on every game and store
great base to build from now
gonna get it all checked into git so i have a good checkpoint lol
nice, we can look into the problems deeper now
its all MGS upscaling stuff for now I think
#modding-general message I also hope that this modder's mod from last year also get a fix
iirc it's about the model swap stuff, modder can't make it into MC version mod
iirc that looked like some of konami's stuff fiddled with snake rendering because even bypassing my crude modding system it still didn't work
maybe we can figure it out but one thing at a time
ye
so much more exciting to work on when there isn't a load of broken crap lol
i knew i was almost there before
yeah fortunately you had that break
it wouldn't have taken one day back then
it was necessary
i woulda still been trying to sort this shit haha
i know these are famous last words but we genuinely have a lot of techniques here now that should apply if future new games break us
anyway for context anyone who lost track or is new: this is basically the completion of a massive rewrite of the entire project that started some time back to make it more robust and less terrifying to work on
now it actually makes sense 😄
i don't think we ever had all of the "supported" games all working flawlessly at the same time
so that is new
this stuff is key to the multi-game support, worked out in the end
the pain i went through to templatize the whole thing 
it was getting to the point where it was way too fiddly for me to work on it, but now i can understand my own project again
core stuff was: changing all the hooking so no asm stubs, fixing the allocator, this std::conditional_t stuff, and using sqrat to clean up the squirrel interactions so the code can actually be followed
none of the games even crash when you close em now (other than the one that's konami's fault and crashes without the mod), a sign that everything is kosher
that one might just be something to do with my machine tbh, it crashes in some nvidia driver crap
it's castlevania advance if anyone wants to try and repro ;o
if you have some sorta postmortem debugger it should trap it
[2025-05-11 16:54:54.744] [MGSM2Fix] [info] Detected game: Metal Gear Solid (Steam app 2131630).
[2025-05-11 16:52:56.544] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (Epic Games).
hehe, thats nice
I think I own that. Will take a look
i am back
cool, its in git
now we can do things with it
312 files changed, 117982 insertions(+), 11096 deletions(-)
😬
Oh that's all
Castlevania Anniversary Coll., does platform matter, and what's the process to reproduce the bug?
just castlevania advance, not anniversary
the process will be "close the game"
it crashes on exit
even with no mod
you'll need some kind of way of observing the crash like a postmortem debugger
for most people they won't notice the difference, but it does indeed crash (at least on my machine)
loool, funny really
there's no trick
it just always crashes when u close it
Huh, weird. Okay, I'll take a look tmr
might require an NVIDIA GPU, when I looked into it once it faulted in some driver module, but who knows really
maybe an equivalent thing can happen with other GPUs
anyway it won't bother most people and I guess maybe even Konami didn't notice it
Wing Commander is the first game in Chris Roberts' space flight simulation Wing Commander franchise by Origin Systems. The game was first released for MS-DOS on September 26, 1990, and was later ported to the Amiga, CD32 (256-color), Sega CD and the Super Nintendo Entertainment System, and re-released for the PC as Wing Commander I in 1994. An e...
months ago I assumed it was the mod until I deleted it and it still happened

but yeah it's just that one game, the rest are fine
Luckily, I also have an Nvidia GPU. I've got a meeting in about 30, then once that's done I'll grab something for debugging and give it a shot.
Turned out I didn't own Advanced on Steam, but found a good sale.
lol, committed
Eh, I was gonna get it eventually anyway, and $13CAD ain't bad.
WinDbg can do it
We've updated WinDbg to have more modern visuals, faster windows, a full-fledged scripting experience, and Time Travel Debugging, all with the easily extensible debugger data model front and center. WinDbg is using the same underlying engine as WinDbg (classic), so all the commands, extensions, and workflows you're used to will still work as the...
(on top of being good to have)
Ah, perf. I didn't want to have to fuck around with VS
it's somewhere in the settings to enable post-mortem debugging
I actually don't think I've got WinDBG installed on this Winstall yet.
and if you leave it enabled you'll become horrified at how many things crash without you noticing normally
Woof
eventually you'll get tired of that and turn it off
This would be a lot easier if the game would work with my gamepad...
Uh, so no crashing?
Yeah, no fault found here. Except that controller support is bugged
If you want I can up/downgrade my drivers as required
it's been persistent, over many months, so I doubt it's something like that as I've gone thru updates
my upgrade from 10 to 11 was far from painless though
I don't care all that much as long as its not a consequence of the mod and no one else sees it haha
If you want I can grab the mod and see if it crashes?
sure, the current release might have issues I've fixed locally though, but I believe it should be fine
the local stuff is bulletproof
Okay, using 2.2, and I can just use the MGS1 version?
yeah
shouldn't make a difference for this
cool computer nuggs
Hey, on the plus side it means you don't need to fuck with it
yeah i looked into it ages ago and was puzzled
then i deleted the mod and it still happened
lol
so
in duckstation the vram is a statically sized buffer, equivalent to native PSX resolution: https://github.com/stenzek/duckstation/blob/0483117c7036b1415904b5002ff8573a459e3eb7/src/core/gpu.h#L587C19-L587C29
i was fairly convinced we don't need to change shaders, but i don't think fucking with the PSX VRAM is right either
here we are again
oh i just figured out more of how to use renderdoc
this tool is so hard to use man
hidden buttons everywhere
mh
beats me
Silly question, but have we tried injecting other games into the M2-MGS1 emulator? Kinda wondering how much (if at all) SotN is supported
Be interesting to see how much work M2 would have to do to get SotN ported over
requires either restoring the bits of the emulator that get stripped for releases, or a lot of work on each individual game
Ah, right, it gets pared down per game
nvm then!
I don't know why I didn't just buy CV Advance normally, then just refund it after testing... Oh well.
say what?
lolol
Like I said, I was gonna buy it (again) eventually.
But next time I'll make sure I have coffee first 😛
oh its so nice that i can build and restart debugging in VS and it copies the mod to the game and handles launching it and attaching the debugger for me
like a normal software project
instead of the manual copy paste shite i had to do before
I'm gonna need some deets, I need that for MGSHDFix lol
so i wrote a python script that consumes a file like this
# nuggs's Visual Studio install manifest for M2Fix.
# This obviously isn't immediately useful to anyone but serves as an example.
x64:
- F:\Steam\steamapps\common\MGS Master Collection Bonus Content\MGSM2Fix.asi
- I:\Steam\steamapps\common\Castlevania Dominus Collection\MGSM2Fix.asi
- F:\Steam\steamapps\common\Ray’z Arcade Chronology\MGSM2Fix.asi
x86:
- F:\Steam\steamapps\common\MGS1\MGSM2Fix.asi
- I:\Steam\steamapps\common\Contra Anniversary Collection\MGSM2Fix.asi
- I:\Steam\steamapps\common\Castlevania Advance Collection\MGSM2Fix.asi
- I:\Steam\steamapps\common\Castlevania Anniversary Collection\MGSM2Fix.asi
- F:\Steam\steamapps\common\Darius Cozmic Collection Arcade\MGSM2Fix.asi
- F:\Steam\steamapps\common\G-Darius HD\MGSM2Fix.asi
- E:\Epic Games\CastlevaniaAnniversaXJ2A3\MGSM2Fix.asi
it's just
#!/usr/bin/env python
'''M2Install.py: Installer utility for M2Fix.'''
import os
import yaml
import shutil
__author__ = 'nuggslet'
__license__ = 'MIT'
def main():
import argparse
parser = argparse.ArgumentParser('M2Install', description='Installer utility for M2Fix')
parser.add_argument('file')
parser.add_argument('arch')
args = parser.parse_args()
rules = os.path.join(os.path.dirname(__file__), 'M2Install.yml')
rules = open(rules, 'r', encoding='utf-8')
rules = yaml.load(rules, Loader=yaml.Loader)
if args.arch not in rules: return
for rule in rules[args.arch]:
shutil.copy(args.file, rule)
if __name__ == "__main__":
main()
(this stuff will be in git eventually)
then i set up a post-build action in VS that calls the script
<PostBuildEvent>
<Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
</PostBuildEvent>
then in the project settings I have
you might also need to un-steamstub the game (dunno if the HD games use steamstub, probably)
and then create steam_appid.txt in the game root
with all of that it should all just work lovely
i didn't figure out multiple "debug targets" yet so I can just select the game from a list, so I have to change these paths if I need to debug another game
but for now, this is good enough for me
and just straight away you have breakpoints and stuff
and can call __debugbreak() to break programmatically etc
I also have a .ini option "Break" which calls __debugbreak() as soon as the mod can, in case you don't have this nice setup and need to attach to process rather than launch in a debugger
that lets you set up further breakpoints in the debugger etc
but yeah I just build and press play, restart button even works
stop will terminate my debug session and kill the game for me
really really tidy
the python / yaml stuff might be a bit overkill for HDFix
but i have way too many fucking games here to keep updated
and the architecture difference
its nice knowing i just build and the correct architecture build is synchronised with every game automatically lol
it feels self-indulgent to spend time on workflow stuff but damn its SO much nicer and tests my patience less
this is just normal software development now
no more wanting to pull my fingernails out
some day i will have an automated regression test suite but
with this many games its hard to manually test it all
but when stuff is seen working in all of them, it's probably not working by luck
which is very reassuring
ah some of my squirrel hooks were disabled lol
need to fucking explicitly instantiate a std::vector template now
explicit instantiation suuucks, please can i just say somewhere "explicitly instantiate everything that takes this enum"
we are back in
i never understood this
the framebuffers in the PSX VRAM are blank
where is "TITLE"
but somehow what gets sent to the GPU has them
black squares
There is a TITLE in the screenshot you shared above with all the 2d text
not in this region though
Ah yeah, at least not that I can see
this region always being black is sus
just what is it doing with that pixel data
after this long looking at it it still eludes me lol
very well hidden
Caaan you get the texture window there to render with a white background rather than black?
I wonder if the text is rendering black with transparency or something, and it's being obfuscated because the window uses a black BG
'cause for example, this text is black, but there's a white BG field
i spose its worth seeing what happens if i write to it
¯_(ツ)_/¯
white doesnt show up ingame though
womp womp