#Modding the MGS1 emulator
1 messages Β· Page 20 of 1
take a steaming dump on it
committee designed monstrosity
thats like 500 lines of code deleted
fuckin chuffed with how that turned out
now where im calling stuff its just normal d3d11 code
and the hooks are neat too
Lmao
here's the magic behind it
wow i actually have that ifdef backwards and it still worked
gonna fix it tho
reinterpret_cast<unsigned char *&>(method);
paranormal activity
i came here to fix MGS not revolutionise x86 hooking
god its nice to just be able to call anything without setting up a bunch of struct/enum defs
best 4 hours ever spent
now m2fix is an ideal d3d11 hacking toolkit loool
from fixing MGS1, to support many games, now evolve to this, damn
yeah i mean if we want to do more gfx enhancements in future we are in a prime place to do them
(PGXP)
floodgates are open now
PGXP is definitely a conversation we can have now, it would've been extremely difficult before all this
https://github.com/libretro/beetle-psx-libretro/blob/master/pgxp/README.md (search what is PGXP) oh interesting
all the versions of it that ive seen require changing the shaders, which we can do easily now
I imagine that will fix a lot issues too
nice, pulled these out into "resources" rather than std::strings
seems like that triggers them to be precompiled
hmm
wonder how I do that
π D π X π B π C π
it's quite weird that it compiles the shader as I'm not sure how to access the compiled version in my code
so basically at the moment, compiling M2Fix compiles the shaders and then throws it away, only to compile it on the fly every time you start the game
Ah, just like Unreal Engine
tbh i think i was gaslit
by adding it as an EXE resource, it became a "source file"
as a source file it was examined for stuff like e.g. file extension
in this case, hlsl
there isn't really any evidence that you can include a shader as an EXE resource and reference the compiler output
but
i will probably keep things as they are, as it's useful to know at compile-time if i borked the shader
i only stumbled upon this quirk because i already use EXE resources
i use one to store the SqDbg Squirrel script
and it seemed sensible to me that if I'm embedding a program in another non-C++ language, that should also be a resource
that's the previous use of EXE resources
i quite like it to signify that it's not your average std::string
mfw three of the features i've been adding to mgshdfix have universal reshade addons already avaiaible
fuck lol
that's a first world problem if I ever heard one
(and i can trigger/toggle them from mgshdfix with reshade's header file)
you have TOO MANY MODDERS
meanwhile m2engage crickets
i like that HDFix and M2Fix share tech though
probably the first online community i've been in that isn't toxic
Eh, means we don't need to dick around with reshade, which is nice
yeah i'm also not a reshade enjoyer
i'm one of those folks who used to spend more time setting up mods for games than actually playing them, so my mindset is definitely a "make the -entire- collection one seamless experience" sorta deal - making things as simplified and universal as they can be between the games so that people don't have to fuck around with 50 billion different mods configs and researching the compatibility between x & y
i get ya
and btw if there's anything useful in m2fix v3.0 feel free to steal it π
^ tbh, I'm more interested in 2&3 being good than 1 (loads of ways to play it), it's just that modding 1 in MC is more my wheelhouse and leverages shit I'm very good at (besides graphics)
so if anything can help HDFix take it, don't even ask
Yeah... But you're making this the best way to play MGS1.
Also, the least fussy for normal users. If I want to introduce a PC-friend to MGS1, I can just tell them to get it on Steam and slap M2Fix in and ez-pz.
No dicking around with emulator settings, no having to wrangle the old GoG release, achievement support, both sets of Ghosts, all versions of the game.
oh yeah im not saying what im doing is worthless
but as a "gamer" it would be more beneficial for the only way of playing 2&3 on PC to be good
i like the MC packaging & launcher
if you can just grab a ROM and duckstation and it's better than MC, i have to overcome that to be superior
we're getting there...
a lot of people seem to have a very different understanding of the passage of time vs mine
if it wasn't all fixed and amazing in 6 months, i abandoned it
no maybe i was busy playing my part in semiconductor manufacturing and life doesnt work like this teenager thinks
i said i was committed to this project, i don't have the fucking bandwidth to be committed to multiple
and the cretin that said i was waiting for more ko-fi donations, yes, the sum total of those so far would not even pay one month rent
definitely making financial decisions on that basis
no, im doing my fucking day job instead
but i guess he wouldn't know what one of those is
people seem to think i entirely forgot about this 9 months ago but no it was ticking away in my mind the whole time
and i also remember being the age where 9 months was a long time
now i blink and that passes
so these teenagers call your project "dead" but actually it's just next Tuesday
as i will evidently prove with 3.0
why do they even care about MGS1 anyway, my dad was alive when that game impacted me on a demo disc
they weren't even born?
the kind of person who genuinely cares about this game would not really protest having to wait a few months
for a game that they played 25 years ago
π«
its like the matrix bro
i envy anyone who saw it in the cinema on release
but i cannot claim my experience of watching it on DVD/BluRay since is comparable to being there in the year 2000
we are all reliving the late 90s
so it's just a bit weird to receive those sorts of comments
these people should have kids now but instead they're starting arguments on a GitHub repository

wyd honestly
man's job: predicting my level of commitment based on when the last git commit was
git commit history is about as useful as the local radio in telling you when the next M2Fix update will come out
even i don't know when the next update will come out, so what chance have they got
90% of this update was ready 6 months ago
Are people still being shitty, or is it just those couple of folks from the other day?
yeah it's just the GitHub idiots, people in here are based
I'm quite glad that I ignored GitHub until like, last week
Yeah, good call
but yeah i mean life just happens like that
Oh absolutely
maybe i don't touch the hobby thing for 9 months
and then suddenly rewrite it and fix major problems in a week
"Feel free to fork off"
with ADHD i definitely cant apologise for that
the timeout was necessary to be revitalised for working on it
100%
and then i ended up working on it thru to 5am, so
how about that for commitment
i could not sleep for several days knowing i was so close
Ugh, I'm sorry
now that impacts my actual day job
which ko-fi does not compensate for
so
yep i was definitely waiting 9 months for people to buy me a coffee
one single coffee
i mean its so absurd, its ridiculous
imagine posting that sincerely with a straight face
dude needs his head felt
Dude needs to go outside
i mean it'd probably be fun to work on this full time but it ain't gonna pay rent
Eh, if it's a job the ADHD will kick in and you'll stop wanting to work on it
so you get what is supposed to be relaxation hours
relaxation hours that i spend looking at visual studio
im extremely lucky in that i have a job that pertains to my natural interests
Right?
so most of the time, the ADHD ends up being a perk
he says, after multiple days working at 2am
because i seem to care about what we do
my mind can't really distinguish between stuff i do because i get paid and stuff i do for fun
i only have this job because i want to do it
so everything is stuff i do for fun
being paid is a bonus
i am basically part of the furniture
so yeah any given problem just requires some background knowledge (previously missing for MGS1) and the attitude of "i can do it because ive fuckin done everything else"
but pragmatically from a gaming POV i would rather HDFix be better than M2Fix
i have a PS2 slim piped to an OSSC here, i am not without ways to play MGS1
so please steal my shit
lol
I have a Gamecube in about 30 pieces on my desk for refurb and flippydrive installation, so I'm not far behind π
(I tore the thermal pads, so I'm waiting on replacements)
lmao
i have never disassembled a console ngl
i got a mate who studied electronics to replace the leaking capacitors on my inherited mega drive
because i am not good in meatspace with my hands
i managed to destroy a socket in our thermal chamber about a week into my job
that was like yeah bro just put me on low level software and i'll pretend the hardware works
and these aren't the kinda sockets you find on commercial motherboards
they are expensive
Even then the DVD & Blu-ray aren't accurate to the original experience, they all got their color grading changed. Only way to have experienced The Matrix in the original format was on the big screen. Same shit with MGS1, without a CRT you're still gonna have terrible dithering on textures that looked like smooth gradients no matter what upscaling & perspective correction you throw at it
YEPPPPP
100%%%%
this stuff wasn't designed for the present day
i mean it was called the HD Collection for a reason
im dealing with a totally different paradigm with MGS1
any sense of it being 3D is basically a cute hack
damn this fucking game i played on a demo disc
played the demo multiple times too
ended right after the darpa chief dies
how can you not be curious after that cliffhanger
you're literally like, 7, bro
now tell me i don't give a shit
just, man
the way i use git at work
extremely sophisticated! by company standards
but has absolutely no bearing on how much work was involved
I have to convince my manager about git features introduced 15 years ago
and you want to moan about a mod for MGS1, a game that released 1.5 years ago on Steam, just what is the perspective here
I cannot feel like I failed these people as they just have zero life experience
Just don't bother with them, a lot of people these days are extremely entitled, I see it in the Linux desktop space as well
Just because they consume something, they think of themselves as a consumer - even when it comes to work that is a fruit of volunteer labour / a community project
They don't get it that such attitude is unwelcome and out of place, when it comes to projects that are free as in beer, with no advertisements and where user data is not monetized either
They eventually fixed this with the 4k release, but the fact it took that long just puts it more into perspective
Or Star Wars. The only version that's totally accurate to the original release is Project 4k, and it's taken about a decade for that to get to where it is now where you can truly call it accurate (and 4k80 1.0 only came out last year)
If people can wait decades to finally see Star Wars in HD as it was originally released, these kids can wait nine months for this one specific MGS1 project
Like, they have other options, this is just to fix a specific release. It'll be nice when it's done, you can play an accurate (or semi-accurate if you wanna bump up the resolution and stuff) MGS1 and get all the epic Steam achievements but they're freaking out over literally nothing
It's funny seeing that when I've been lurking this thread daily lmao, they think nothing's happening but really every week has had some significant amount of progress made
Sorry but this just unlocked a memory as a kid I remember trying to buy The Matrix on VHS in Woolworths. They refused to sell it to me because I was about 9. I reckon if they did theyβd probably still be in business. SMH π€
Hey Nuggs, does m2engage support surround sound?
https://github.com/nuggslet/MGSM2Fix/issues/22 oh yeah, was wondering before that besides ppf, maybe we can see more patch formats in the future, heck even ips for nes Metal Gear / Snake's Revenge. lol
Will there be support for mods in Xdelta format too?
ive not seen it in any of the currently supported games, but m2engage is designed to be extensible
all the console subsystems are in separate "modules" which can even be loaded from separate files
once they go to retail, all those modules get baked into the EXE typically
but it still retains that support
and then there's squirrel which well, can be scripted to do whatever
i briefly looked at xdelta and its not as nice for loading in m2engage for PSX at least
other patch formats might make sense for the other consoles
main problem with ketchup I can see is you have problems with resizing files in the CDROM image, the change propagates through the entire disc
IPS for NES should be doable though
I see, yeah there's some nice IPS hacks for NES MG
as i said before, G-Darius HD actually has a couple of "playstations" and which game you select decides which playstation loads it
so there must be some differences somewhere
that's on top of the accelerator system where each game can have its own overrides in native code
so its very pluggable
a fun one is
spdlog::info("[Emulator] BIOS at {}.", fmt::ptr(cpu->Bus->Machine->ImageBIOS));
that's always zero for us
maybe could naively support other games by putting the BIOS back
ive been doing some fairly boring code cleanup, stuff that has been bugging me for ages, so nothing super fun to share (soonβ’ though)
stuff like
i.e. these are now static class members rather than free global variables, removes all the extern shit and the namespacing is nice
just trying to reorganise stuff now so that dllmain.cpp isnt a huge assortment of totally random shit
In case you haven't caught it yet/it's not intentional, MultiProcessorCompilation isnt enabled for your project file
(Only noticed it the other day with MGSHDFix lol)
ah indeed, I did wonder
Vroom vroom
that's a new feature btw
turn that on (^:
going thru to see if there's any other fun stuff
only makes sense for Release build ofc, presumably your Debug build isn't optimised
the only pain is
i have to enable stuff separately for both 32bit and 64bit lol
gonna have a pop on the new F1 game, realise its shit again, and then get back to this
ooh you can put the mod version in the asi file metadata
EA Javelin Anticheat poggers
wonder if it's allergic to leaving Visual Studio open
not even worth trying with IDA
reverse tracks, lol
LIDAR data wow 2010 called
One day we're just gonna have games running in their own fucking VMs lol
or get this
they'll sell you the ready-made computer to play the game on and you won't be able to do other stuff on it
So a console
reorganisation nearly complete
The MGS Master Collection was a little rough when it launched in 2023. After almost 2 years, did Konami fix it with patches? Let's take a look at the current state of the 3 main games in the collection!
Support me on Patreon: https://patreon.com/The1Ocelot
Follow me on Twitter: https://twitter.com/The1Ocelot
#metalgearso...
You got a mention btw :3
is it a mention with the recent info
Unfortunately no. 2:40, they just said the mod is still experimental/ based it off the current release version
ah
man i really did just dump shit anywhere without much care
i think im actually going to give each game its own class now
base class that exposes some set of shared hooks
inherit from that to define game functionality
Yessssssa
I know it doesn't have any effect on me as an end-user, but that shit makes me so excited
im in so deep here i cant back out now lol
fortunately all the upscaling stuff is in one file im not touching
basically making the rest of the project adhere to how the upscaling stuff was structured
some entire source files here ive had it in for
for a loooong time
dllmain.cpp was weak piss
patch.cpp caused more problems putting it all in one place than it solved
emulator.cpp had a terrible name
since 99% of it pertains to the psx core
mh
this will be gr8 if it works
all the MGS knowledge in an MGS file
all the PSX knowledge in a PSX file
all the squirrel knowledge in a squirrel file
i think im through the worst of it
oh my god it builds for the first time in a day haha
lemme guess it dont work
oh wow it does
dllmain.cpp went from 1400 lines to 110 lines
that kinda surgery
Damn
$5 says the software gets an update after the Switch2 release and we have to start all over
it's working well for too many games at this point for it to break that badly lol
it's just very scary when I put the project in for wholesale open heart surgery like that coz I have no idea where it'll end up or if it'll go back together again
it might be harder than my job or I just become smoothbrained in my own time
original code was fine for a quick mod but not really as a framework for stuff to be built on and loads of games to be supported
hell yea
at some point last night i was like "what the hell am i doing"
felt like i was making a mess
but nah its paying off
random bits of shared code across all games having random bits of MGS1-specific shit in the middle sucked
now that's formalised as a mechanism that any game is entitled to use in the same way
so you can see how the MGS1 modding is done and then do that for e.g. castlevania
obv for a non-PSX system it requires writing an equivalent layer to the PSX module in M2Fix, but that's not actually too difficult with some basic reverse engineering
atm I only have the PSX layer but might do others myself eventually
but that is also better compartmentalised now
so there could be multiple consoles supported in a similar way
dllmain.cpp used to be an extremely random collection of most of the mod
now its just the minimum code to get the ball rolling
as it should be
now we have borderless.cpp, guess what, it has everything responsible for borderless
π
it's set up like this atm
where M2Game is just a basic game with no special stuff
and yes that is a special character in the Ray'z directory name
it's not actually a '
' vs β
that caused so many problems haha
Ah-ha, now we're cooking!
Been trying to line an effect up in MGS2 justttttttt right and 30hz was a bit off - kept poking and 37hz was almost frame perfect to the original.
Plugged this number in and now everything's 1:1. Guessing some of MGS2's effects were bound to the PS1 cpu's clock speed (since it was being used as a I/O subprocessor)
i have big plans
man i have the whole thing worked out in my head now
but i cant type fast enough
Need more caffeine


thinking to reorganise the sources like:
src/m2/
src/m2fix/
src/squirrel/
so "external" is gone
"m2" is purely struct/enum/etc definitions that map onto various games
"m2fix" is the actual mod stuff
so e.g. stuff like this:
would belong under "m2"
as it's describing how the emulator works and m2fix has no authority over that
but when it gets to anything that changes behaviour, that belongs in "m2fix"
basically safetyhook is the only "external" i haven't modified, so partitioning all of that stuff under an "external" directory is a bit silly
Squirrel and Sqrat have been modified (template-ised, so that the mod can support the bizarre differences in the various Squirrel structures etc.)
so it's not really an external distribution anymore
for better or worse I kinda own that "fork" of Squirrel now
i mean it's all working superbly well but it's not verbatim upstream Squirrel
I have a header which is just this:
and basically a "game" (think "Steam app") is associated with one of these, and it controls how the Squirrel structures are laid out
but actually propagating that through the entire Squirrel codebase is a lot of changes
it's all done months ago, it's just that it's not really a "Squirrel release" anymore
e.g. you won't find a Squirrel release with this:
and my god was it extremely painful to template-ise the entire Squirrel codebase
i have PTSD
I'm just glad it works so well and I don't have to think about it anymore
Squirrel is not really an "external" here anymore, I'm basically obligated to extend it
so we have this extremely fun shit
to match the struct layout depending on which game the mod is being loaded into
and the Squirrel hooks underpin everything else, they're critical
maybe people here just care about MGS1 but this stuff supporting other games is great for testing and proving correctness
when this only supported MGS1 it's easy for it to work via luck
not anymore, it works because it's correct
my primary motivation is MGS1 but it made a lot of sense to expand support to all these games to iron out faulty assumptions etc
the mod working flawlessly for every game in that list means the mod is doing something right
esp. when some of those are 32bit and some are 64bit
it's basically a statement that we understand how this shit works
curveballs nbd
and when curveballs nbd, you have something pretty fuckin robust
here endeth the sermon
alright rubber has to hit the road now on reorganising the source folders
kinda decides what happens next so
i won't know if this is a good idea until after i try it i think
ok maybe no "m2fix" dir
this? maybe
d3d11.cpp still 33kb, christ
stuff under "m2" should just be structures from the game and separate from code that might be relevant but is still a construct of the mod
don't like confusing things by having my own inventions next to their stuff
i think this is a good way to proceed
now i have to edit the vcxproj manually because the VS GUI will shit the bed
i want my own header called "d3d11.h", but that overrides the system d3d11.h
fucking C/C++ headers
if I put %(AdditionalIncludeDirectories) at the start does that mean #include <> will see the system one first
ayy i got it to work
that looks a bit cursed but
I hate this lol
it works because the "src" directory is not in the include path
but #include "header.h" will always check the current directory regardless
so #include <header.h> will always fall back to the system one allowing both to coexist
anyway we're basically into finishing touches here
dllmain was 1400 lines it's now 80
right where was i
hell yeah
i think im basically done w/ code
and this is now nice and tidy as well π
crazy how much busy-work involved in that sort of cleanup
surely we can pay a chimp to do this instead
got rid of almost all the explicit template instantiation as well which kinda tells me its better code quality
d3d11 hax got ported to a class as well
you can make the methods static, and then you don't get a this pointer so all the arguments still check out
everything is a class now!
ah my 64bit build is broken because it tries to build the shaders for vs_2_0
this is the VS configuration being duplicated isnt it
what the fuk
what if I don't want a condition
ye u can just delete it
man i would be stuck without being able to manually edit the vcxproj file
you can get lost in the GUI
cool 64bit builds again
and debug also builds
alright
now i want to put together something to test all the games
this'll be pretty basic at first
just "do they start and not shit the bed"
I'll say again, if you need someone to do some testing, I have a good chunk of the supported games (all Castlevania, MGS Coll.)
yeah i may end up doing something like that
but i need some basic automated smoke tests as well
im done reorganising the source anyway
so more release focused now
Hahahahah I did it
I have a script that starts all the games on Steam, closes them
and can tell if it crashed
this might seem extremely dumb (it is) but that will genuinely catch most of my issues
and saves so much hassle
watching them all flash up on my screen one by one

its bonus content's turn
very nice very nice, good splash screen
does this to ur steam list tho
What have you done

really you would be impressed how a simple thing like that catches the vast majority of crashes and shit
"launch everything and try to close it normally"
the problems people report are after all that shit is skimmed off
and require a bit of a deeper manual look at specific features
anyway, I won't forget a game now and I know they were all tested on the same build
good way of knowing if I've completely buggered it and whether it's worth giving to anyone else
i have an idea to even fix shrinking the internal resolution
its the same thing but in reverse
instead of upscaling the texture memory, upscale the framebuffers
don't want to downscale the texture memory as that will just ruin sampling
it's probably quick enough to fart about with tonight
mh, by doing that i found better ways of doing the upscaling as well
still have to do the silly bit of pulling numbers out of my ass for the downscaling but it works in principle
it was a funny bonus of the original upscaling that you could turn it into an 8bit game
has to attach itself to a different point in the pipeline for downscaling
hah, the downscaling is working fine now besides some flickering (which i previously had for the upscaling)
yea bro
hahaha, that can be a feature I guess
should be a competition for who can complete the game at the lowest resolution
that sounds fun, you have to rely on your memories of the game layout
Wx128 is quite playable but you can't rely on text so no item names
Wx64 is a challenge
even with the flickering when downscaling its better than if I didn't bother at all
before if you tried to do it, it applied the upscaling approach but in reverse and totally fucked everything up on screen
they need slightly different techniques so which one you get now depends on whether you ask for higher or lower resolution
the flickering is just in cutscenes tho ofc
I got rid of that issue already for upscaling
so should be a matter of time
some of the changes for this have benefited the upscaling as well coz it's reusing code that I've had to improve
can't wait for the release to try out
not long now 
oh
i mostly fixed the downscaling flickering
that was... not what i expected to be the cause
but again its something that makes even the upscaling more robust
now the only bit that flickers is the "a hideo kojima game" etc text, but the cutscenes don't anymore
fixing that must be along the same lines
there we go
fixed
this is getting silly now π
ok, it worked through renderdoc but crashed without, but i fixed that as well
why does it look so good like this
hahahaha oh boy.
height 32 pixels
this is gonna be a good time
naw man im gonna call 32 pixels unplayable
Game boy color mode
it might seem stupid but the alternative was limiting what number people could enter for internal resolution so it can't go below the game's default
haha
if anyone is interested in testing, DM me (but I must stress I am after testing, if I have no idea who you are its prob not gonna happen)
no hard feelings π
(won't be long to wait, this isn't 6 months early access here)
coz of timezones it'll be tomorrow when I can action it though, need to sleep now
also builds are gonna be watermarked so dont even think about it

been way too long for this release to get fucked up
What was it?
v3.0 beta testing basically
Oh sorry discord was lagging behind, was a reponse to this xP
I'm down to help test, I need a break from MGS2 for a bit lmao
oh, basically the pipeline is more complicated than I expected and there were multiple passes for which I had to replace SRVs when downscaling
upscaling is actually the more simple case
but both are working great now
coz for texture memory it comes from CPU
but for framebuffers they have multiple passes all within GPU
and which I target depends on whether upscaling or not
I'll get back to you after I sleep
3 beta copies dispensed
if any with the beta have non-MGS1 supported games, worth giving them a try as well, but i expect most testing to be on MGS1 obviously π
but yes, pls try to break it
(still happy for more testers, same terms and conditions as above :P)
hm, i seem to be experiencing all the same bugs that 2.2 had.
i do notice that the logs are reporting the external resolution as 3072x1728 - my screen is 3840x2160 (i was one of the folks with a 4k monitor that supports a 17:9 max resolution, 4096x2160, and the vanilla game forces itself to that max resolution which is an issue you had previously fixed - in case that guides you in a direction)
tried with both MGS1 US & Integral
looks like it hasn't activated at all somehow
created all the hooks but they aren't doing anything
lol
that screen bounds thing i wouldn't pay much attention to
it's only used for computing widescreen ratio
can you try setting RendererLevel to 3 and log that?
[2025-06-05 <t:1749122916:t>:35.588] [MGSM2Fix] [info] [D3D11] ID3D11Device::CreateTexture2D(4096, 2048, 87) -> 0x1c362324
ah, it's also pulling my max resolution, 4096
that's unrelated to resolution
[2025-06-05 05:28:06.063] [MGSM2Fix] [info] [D3D11] ID3D11Device::CreateTexture2D(1024, 1024, 28) -> 0x15686c64
[2025-06-05 05:28:06.063] [MGSM2Fix] [info] [D3D11] ID3D11Device::CreateTexture2D(8640, 8640, 28) -> 0x156875a4
this is the texture set the upscaling is applied to in your case
the first one is created by the game, the second one by the mod
Ah!
so that part is working right
on to the next part
ah I see
for whatever reason
the game never calls ClearDepthStencilView for you
but it does for me
???
I used that to attach the main upscaling hook to
that is
fascinating
the plot thickens
i'll find another way to do it
damn good that we tested this
i can hopefully have another build for you later today
does help if the code runs xD
maybe I can recycle the hook I used for downscaling but for upscaling as well now
no way will your system not hit that one
oh hang on
it might be more complicated than that
I don't see CopySubresourceRegion either
there is probably a pattern here
I see
none of the ID3D11DeviceContext hooks are being hit
but you do have a deferred context
[D3D11] ID3D11Device::CreateDeferredContext() -> 0xd7def98
so something funky happened with the vtable cross-referencing
ill have a think l8r
hol up
one quick test to rule something out
sent
that moves the hooks from the deferred context to the immediate one
and well there are only two contexts lol
if that is the issue then I will have to work out a way to detect which one to use
if it isn't the issue then something very bizarre is going on
it'll work as soon as we get you through the front door haha
the context explanation makes sense, at least
as i had the same issue until I attached to the deferred one instead
i initially used the immediate one
surely
that must be it
the virtual-hooking is working for ID3D11Device, just not ID3D11DeviceContext, and that must be because it's selected the wrong context
black screen on game open now
Ooooooooooooooh
ah, but
the hooks are firing now
are they recognisably running the game pipeline, lets see
ID3D11DeviceContext::CopySubresourceRegion(0x1a22cc24, 0x1a22cfa4, 320, 320, 224) # 1 -> 2700 2700 1890
very much looks like it
but
the ClearDepthStencilView hook still isn't doing anything, presumably because it thinks it doesn't have any work to do
based on when the SRVs are released and it clears the mapping
so that explains the black screen
the textures are being swapped, but it's swapping in a blank texture because the upscaling routine didn't run for it
good progress though
gotta head out now
why does the game create a deferred context and not use it in your case
a bit weird
maybe I can just force it to use it π
Are you looking for any Linux testers?
Doesn't seem to be kicking in the WSNeeded to set it in the launcher- No text on load (NG+ initial)
- This intro is super borked.
No codec channel numbers either
Ah hold on, I might be dummy. Lemme test again now that I've set it to WS in the launcher.
Nah, same issues, just not being cropped lol
Also, not sure if this particular one is in the base game, but holding the item-menu button causes Snake's breath to shake.
Switched my OBS output to mp4, so video should embed properly now
will be once these initial issues are sorted
just best not to confuse things more at the moment
can only cope with so many things at once π
seems like you have the same problem as @rancid hare
only 1 of the 3 testers got it working
_>
interesting though, seems like there's two "modes" the game can choose
depending on machine
I have a lotta problems...
That's weird
Uh, any options I should play with for testing Castlevania/MG1?
the other games don't have much special yet
MG1 has the skip notices
the rest is just, external resolution, borderless, debugging/tracing
but really, does it crash
and is the mod working for external resolution / borderless
there isnt a huge amount to test there
it's just one main issue at the moment, i can tell
and it's a fairly obvious thing to learn about directx11
chatgpt moment
man chatgpt is shitting on... some of us
it thinks some of us are running on potato
i think this explains some code i saw ages ago and wondered wtf it was
in some functions the game makes a decision about which context to use
@rancid hare you're probably best placed to do this, can you get me a renderdoc capture during the submarine intro without the mod?
just need to visualise what the immediate pipeline looks like there
i strongly suspect this doesn't require major reworking, it's just getting things running at the right time
so we have 2 ppl deferred 2 ppl immediate
both deferred fundamentally work
i have no idea how the game decides though because the "machine characteristics" are all over the shop
you guys have low-end laptops
well the thing is @rancid hare has a fairly equivalent machine to me
5800X3D vs 5900X
3080 vs 3080
32GB vs 64GB
I mean, my specs are the same aside from the 2060 instead of the 3060/80
would be really interesting to find how that decision is made
Yeah!
because it looks like coin toss
I wonder if there's a way to tweak it through the Nvidia control panel
i just cannot see it caring about RAM
we literally have identical GPUs
it can only be 5800X3D vs 5900 that triggers it for us
and i believe the trade-off there is
loads of cache vs more cores
Core count perhaps?
Just woke up, will get the renderdoc thing in a few
awesome, ta
yeah, core count is my guess
it's a factor chatgpt mentioned
i must've taken hundreds of renderdoc captures of the sub intro, and i finally have a vague idea what im looking at
ideally, we fix this without forcing everyone to deferred, but it's there as a backup option
i really doubt it's going to make a dent in performance for a decent machine emulating a playstation game
i at least need to detect which type is used, which probably requires finding where it's decided
probably impossible to have it work properly for both without knowing which type is used
at the moment the mod has no clue
when i gave you the immediate build i just moved everything that was previously happening for deferred
therefore breaking it for me
as that stuff can't be in both places at the same time
well, it cooouuld... but i'd have to add a buncha hook stubs
my hooking (well, the stuff that allows calling the original function) works by having a big mapping of hooks created to their original functions
so you pass in your own function pointer and it looks it up
e.g.
that can only work if they're unique, so i would need to create a bunch of wrappers to handle each type
im just glad the vtable mapping stuff is working, the whole thing has been written to depend on that π
i'd literally die now if this was the problem
the huge upscale routine is working for downscaling and upscaling at different points in the pipeline, so we have the technique perfected, just need to get it positioned correctly for immediate
Interestingly, Renderdoc seems to work great if I point it to another game (Jedi Fallen Order), but immediately closes the capture tab if I point it to the mgs exe.
Β―_(γ)_/Β―
without even launching mgs?
you might need to remove steamstub so the game can be debugged
Ah, probs
a tool like steamless can do it
or i can just DM you the debuggable EXE
also need to create steam_appid.txt in the game folder
with the contents "2131630"
steamless is safe to use, hasn't stolen my account and mine is... high value
not VAC banned either π
you'll need to rename the original exe and make the debuggable exe called "METAL GEAR SOLID.exe" as well, or the mod won't detect it
Okay cool, now it works
the one good thing about steamstub is how easy and clean it is to remove
Just need to rename the exe
yeah, take some captures and you'll have a view into my personal hell
i like having these set as well
which you find in there
if you do enough backflips you can work out cause and effect
i.e. what output connects to which input and follow the entire pipeline through
it makes associating an output render target view to a new input shader resource view needlessly difficult though
i also run it with all of these
just capture everything lol
oi oi
was missing some capture stuff, 1 sec
Just sent mine over, I didn't set the same capture settings, so @rancid hare' might be more useful
But hey, a data point
Ah, well then
If Afevis doesn't have any luck, I'll come back to it later
suffering, mostly
oh @rancid hare, a capture with the mod's second build would be nice as well
the half-assed immediate mode (black screen) thing
ideally wait until roughly the submarine
unmodded for these
i had the same experience of black screens waiting for sound cues to take captures
Excellent @rancid hare, age hasn't slowed you down one bit.
those are really interesting
quite easy to see that its not gonna work haha
i should have enough info now, cheers
it sounds like the mod "fundamentals" are solid though
nobody has reported a crash yet π
that stuff also took a long time to truly figure out
i had MGS1 fairly solid before because it got the most attention but the other games were a mess
if its been so seamless otherwise, thats great coz it's literally been completely rewritten and with a new structure
challenge you to find a line of code that is the same
the rewrite isn't as sexy as "features" but it makes it so much easier to add em
Gooooood
glad i got ppl to test
i am very foolish and innately think my machine can test everything
but there's a whole new thing to learn which is kinda blessed
Glad we could assist
I'll play around with CV over the next few days just in case it has weird issues there
heres how it was sposed to look
the fact you didn't see the text top-left is also a tell
as that was done at the d3d11 level
if you see that, you have deferred rendering, basically
otherwise immediate
not sure tbh
it's not graffiti, im not here to advertise myself
it's there to reduce the chance of leaks π
which wouldn't be worth doing anyway, coz as soon as this is decent for everyone it's gonna be released
but still the release should come from the proper source i.e. github, not some idiot
especially since its been so long since the last and a lot of people waiting for this feature
maybe i'll keep it but as something you optionally enable, so that people can instantly tell if they have the mod installed or not
but im not about thrusting it upon people
the mod should be invisible unless you want it not to be
im a player of the game as much as anyone else
its actually generated by imgui, the intent was to have some proper hax widgets that would let you fiddle with the game with overlay menus
i.e. use it to display snake position and maybe have game cheats there
but atm it's not used to draw a window it's just drawing a box with some text in, but it's a good demonstration that imgui is working
eventually there might be stuff u can click etc
to screw with the emulator, game and frontend UI
all i ask is that the release comes out when its ready and not before, so we have this stupid text box for now (i also have it)
getting imgui to work on top of my d3d11 hacks was kinda wild
since obv, imgui is also going to walk right into those hacks
so basically when it's imgui's turn to render it all gets "functionally" turned off temporarily
otherwise asplode
It's a good indicator for bug reporting down the road. Even if it only splashes for 10sec or so. Enough that there's an indicator for the end user that it's working and what version is running
there's a logfile for that
Fair
and if you bump the tracing settings in the ini to the max
you're gonna have a MASSIVE log
i really went to town printing stuff
I do also appreciate that the final release version is seamless for the user
So I'm good either way
Maybe if you do future betas leave it in? Then drop is for the actual release
like you can really follow what directx11 is doing from this
following pointers through each line
Nice
some of the games use directx9 instead which would eventually be fun to look at
When you're done this can you fix the post processing pipeline for mgs2 and 3? :p
yeah, betas will have it
the point is testing not early access
For sure.
not trying to be a prick but it's very useful that you two diagnosed the problems and sent as much info as possible without hundreds of ppl storming github issues with personal insults
π
Was just throwing it out there if you did want to take that route in the future
Totally get it, my guy
it was the right call this time
again im foolish and think if it works on my machine it will work on everyone's
so had to suppress that instinct to do a beta
but yeah that's like blatantly an issue i would never have seen even if i spent a year polishing it
Yep
u can see how good it already is on my side
yeah just buy a clone of my machine
ez
want the specs? here you go
[2025-06-02 20:31:07.717] [MGSM2Fix] [info] MGSM2Fix v3.0 loaded.
[2025-06-02 20:31:07.717] [MGSM2Fix] [info] ----------
[2025-06-02 20:31:07.717] [MGSM2Fix] [info] [System] CPU: AMD Ryzen 7 5800X3D 8-Core Processor
[2025-06-02 20:31:07.723] [MGSM2Fix] [info] [System] GPU: NVIDIA GeForce RTX 3080 (driver 32.0.15.7640)
[2025-06-02 20:31:07.726] [MGSM2Fix] [info] [System] RAM: 31.93 GB (32690 MB)
[2025-06-02 20:31:07.726] [MGSM2Fix] [info] [System] OS: Windows 11 Pro (build 26100)
In the year of our Lord 2025
(we should also try to find someone with an Intel chip and an AMD GPU)
better, or worse CPU doesn't mean it works
better, or worse GPU doesn't mean it works
wtf
My wife has a Deck, so I'll get it loaded up on there tonight. I think Deck testing is probably something we should do too
Standardized hw config and all
i was meaning to do deck testing before release but if u wanna do that it saves me a job π
What else... Asus Rog Ally would be handy if we know someone who has one. I think that's the only other big handheld
Can take a look for sure
Oh, hypothetically there's someone out there using one of the new Intel GPU's. I'd be interested to see if those run into any problems since they're so new.
I'd be interested to know if you can set the launch options as WINEDLLOVERRIDES="dinput8=n,b;d3d11=n,b" %command%
Nuggs, are you a fresh win 11 install, or an upgrade from 10?
i.e. combine them rather than have to set the right one for 32bit or 64bit
upgrade from 10
Mines fresh
a rather... rocky one as well
Fresh
had to fix a lot of system stuff in post
_>
100%, I've had to reformat 4 times at the start of the year cause shit just kept breaking
Mine's been good, barring explorer choking up sometimes.
i.e., my plan was to suggest:
WINEDLLOVERRIDES="dinput8=n,b" %command% for 32bit games
WINEDLLOVERRIDES="d3d11=n,b" %command% for 64bit games
but ideally we can combine the two to just have a single instruction
much like the release itself is packaged now
so testing that on deck would be helpful
on both sides, bonus content and MGS1
(bonus content being 64bit and MGS1 being 32bit)
I'll do the full MGS/CV suite.
I don't have... Gradius?
yeah you don't need every game dw
these were the instructions in my proto-readme
which is a bit confusing for a first timer
That's annoying
any game in both lists is useful for this test
Also annoying that we need launch options at all
yeah that's just gonna be deck life really
Yeah. It's the price you pay
most games off-piste need a bit of a tweak
but it's cool that it's just one download now
that seems to have worked for everyone
thanks windows for that neat trick
Feature request: can you have a "create mods folders" in the ini?
Yeah
Just because it's a fair amount of manual work for an end user to build out
Either do it automatically or have a non-default flag to do it
Oh god
Ooooo, be cool if on first run of any of the variants, it generates the mod folder structure for that particular release
This is what happens when I'm checked out of work and the ADHD meds aren't quite working lol
know the feel
i was at work today waiting to be able to think about this stuff again
π
Thank you for keeping on it. I know how easy it is to burn out on a project when you're not getting the results you want
i was always coming back to it π
right circumstances and recovered from some burnout
Yeah. I just know how easy it is for a project to lay on the workbench because it hasn't given you enough dopamine lately
realistically its my only personal programming project so
and also one of few places where there hasn't been internet divorce-worthy drama
yet
being left to basically just crack on most of the time is better than a guy demanding you sign your life over to him coz hes an internet celebrity haha
traumatised
Eeeew
people just help here and i try my best and occasionally theres some code in a repo
π
Your best seems to be pretty good
on the previous thing im glad i kept it closed source so this dude wouldn't steal my shit
here im glad its open source, please steal my shit
world of difference just from the environment
(steal my shit when it's published that is)
well if anyone with beta does do that i can figure out who
Nah, I've seen enough developers stop working on cool shit because of harassment or bad actors. I wouldn't pull that crap
And I'm not smart enough to remove your watermark if I was.
Developer Nuggscelot
the one you can see is just so you know you're being watched
not that i don't trust the people i gave the beta to
I actually don't see any at all on my screenshots
it's "trust, but verify"
Might have been hidden by the background
Aaaaah
but also then im not too worried about it, coz also your upscaling doesnt work either
but if someone had upscaling working they'd be tempted
I was wondering why it didn't look as amazing as I'd expected, but the minimap looked clean enough
either way i can work out where the builds came from
its annoying to have to do it and be like this
it's kinda like defense spending
"nuggs, why is my Social Security number on the screenshots I take?"
but i mean i want it to be done and published and open source more than anyone coz the code visible to the public is fucking shocking
ive seen better sewers
Lolol
Yeah, sucks that you have to put the work into locking it down, but it's for a good cause/goal
it's just that it's been so long and so hyped lol
this is the only way to keep things somewhat calm
Yep. Gotta come out of the gate strong
and i need things to be somewhat calm
I should start writing an article on the project...

it's quite disappointing konami didn't do it because they would've had much better access to do so
Right?
it's not actually that hard when you achieve it
it's just i have to do hundreds of hours of faff to figure out the recipe
I'm just glad that it's something that can be fixed. If the files were encrypted and whatnot, we'd be stuck with the not-great release version.
but from the inside you have perspective over how the entire thing renders
here i have to work within what exists around me
so there is a gfx pipeline, replacing the entire thing is a lot, so you have to try and insert yourself into it without upsetting it
there's a lot of code just restoring state that i temporarily overwrote
this lol
this is just so the remaining pipeline steps can continue as originally intended
i was more worried about performance, but that was when i thought the CPU had a greater role in the rendering than it does
it's mostly GPU for the framebuffers / screen, so unless you take a huge dump on your graphics driver you can basically do whatever you like
coz it's never gonna be a demanding game
Even if it was cpu limited, there's still a gulf in performance I think you'd have been fine
(first ever version of this did crash my GPU)
(that was quickly fixed)
konami logo
device disconnected sound
i mean it's like
it's not exponential, whats the word
but going from 320x256 to WHATEVERx1440 is a huge more amount work for a CPU
True!
coz it's a square
and i remember in various experimentation ages ago (before i knew i had to fuck with directx) i managed to make it run so slowly the sound was crackling
Woof
so i wasn't optimistic if it was more CPU driven
but yeah, CPU just does texture memory
Huh, no idea.
which is always the same size
Glad it panned out
and that's what I upscale on the GPU side
(the texture memory)
but it's cheap there
the essential problem was that the game rendered as what you asked of it, but the texture memory was always the same size (PSX size), so the two didn't line up
Makes sense
so we scale it by the same multiplier as PSX vs the resolution you ask for
then everything is aligned properly and it just works
then there was the whole 320x224 320x240 320x256 kerfuffle
which was obv really fun
Yeah, that was weird
and if this stuff isn't exactly right it's not positioned at the exact right spot and you get all sorts of weird shit like codec digits not aligned properly
and there's that 384x256 mode which is only used in PAL for user interfaces like codec
adding even more fun
on PAL when you enter and exit the codec screen the game switches into an entirely different resolution
NTSC that doesn't happen
That's... Wild.
I wonder how that doesn't cause an HDCP handshake on modern hardware
I guess it's just rendering resolution rather than display res
yeah it'd just be handled behind HDMI
like this emulator "program" is just always 2560x1440 for me
all the weird shite is within
and i strongly suspect
the 320x224 vs 320x{240, 256} difference is responsible for the black borders on NTSC/Integral
iirc it presents a 320x224 render in a 320x240 window
that seems deliberate, not sure why
but maybe we could just change one side to match and get rid of the borders
since there is enough space for 256 pixels height in the VRAM
320x224 is a standard "cutscene" resolution, like FMV, on playstation
but no idea why they have the entire integral game set to it
PAL doesn't have that confusion of being two resolutions at the same time, so no borders
but for now i just kept it coz it was confusing enough already
Yeah. Definitely a tomorrow-problem
removing borders is a separate task yeah
the way it renders the codec digits is frankly insane, not sure the original game did that
it kinda just dumps them in a no-mans-land in the VRAM temporarily
Hm, wonder why
near the framebuffer but not quite in it
then samples it again later
to put it in its final place
#1168512986491670548 message
ah here it was
its actually supposed to be in that neighbourhood and happens unmodded as well
wonder if anyone has done d3d11 api hacks this extensive just to improve graphics for a game
π
maybe you inject a shader
here we've devised a whole system for tracking future resource replacements and mapping them to different stages of the pipeline, injecting a whole new draw pass to be man in the middle
for a ps1 game
the game creates a certain texture? we jump in and create an extra one and associate them
im not sure how this could be done more simply
it seems quite complicated but also what else do you do
The black borders are them just accurately emulating the CRT overscan padding id assume. (This is what the game looks like on CRT if you crop out those black bars on the output signal)
From what I'm reading, PAL TV's had 576 scan lines, NTSC had 480, and doing a linear port without adjusting for the overscan diff would result in a fuzzy image on actual hardware (Or something like that. There's tons of results about it on ancient emulation forums)
......lmao
wazzap
sorry for the dangling ellipsis lol
was doing comparisons on duckstation and i had a realization
m2 fucked up and cropped part of the right side of the screen off on the pal version as well. it's probably just sloppy work xD
aight well

