#Modding the MGS1 emulator
1 messages ยท Page 19 of 1
lol
i guess I want wmemset
now red
but none of this displaying
no that disappeared the first time i wrote to it
nvm, derp
so i went to menu and let it go back to the opening sequence
oh
now i broke title big time
what the fuck
LOOOL
what
guys computer in the sub intro sequence was going totally schiz
cycling through all colours
even though i didnt write to it during the cutscene
stuff just not getting reloaded i guess
_>
but the "TITLE" thing
if I overwrite it, I have to leave this screen, let it start playing the intro, and then come back here to see it change
it doesn't immediately update
ah man how the fuck do video games work
Magic, I think
there can't be anything in the framebuffer area
100%
i painted that purple at "TITLE"
it went to the menu screen and then back to the cutscene
and its still purple but everything in the bottom half is animating with cutscene textures
streaming upwards for rocks and stuff
ignore bro's expensive technicolor DJ decks
so its clearly like
"TITLE" is painted from i guess, a foreground / background colour in the texture memory
to the framebuffer, which I can't see
coz its not there
and by overwriting the i guess, two pixels in the texture memory, i get coloured squares
kind of explains the lights party going on with the computers here too
so where is it taking the framebuffers, only to plop them onto this before sending it to the host GPU
well that categorically confirms something I believed but wasn't sure about before
framebuffers are not in the PSX VRAM
but by the time its in the GPU frame capture, they're a package deal
at least renderdoc isn't making it obvious that they're composited somehow
Huh, neat
maybe they were planning for psycho mantis to read way more types of save data
That's on the list of things he does read
SLUS-00067 Castlevania: Symphony of the Night
I think I thought it was text from the emulator, not text from the game itself
buh
Have you tried being optimized?
the last thing I am is optimised
But we love you regardless
god i should've added this sooner. gonna save so much time troubleshooting people's crap lol
really? not sure what I'd even do with that information
Me: Restarts my computer
Also me: Why is WinDbg running first thing in the morning?
It's not as much an issue with MGS1, but MGS2 & MGS3 pretty much refuse to launch on Intel integrated gpu's, I have at least 2 people a week message me complaining about the game refusing to launch and it's always that
Have the box say "hey get a refund bro." lol
Gog Galaxy
The PC autorestarted overnight for an update, so it probably just crashed out during the shutdown
rofl, just closed and reopened GOG and it crashy-crashed
ah yeah i use it to install them
apparently the titanfall games use squirrel lol
(our hooks are way better though)
yeah nothing here that's useful, we're lightyears ahead
That's wild
lol
my native code hooking stuff now is great but
if you typo it produces some insanely cryptic errors
actually crashes microsoft's compiler
mh
Ooo.
hmm
i managed to make the framebuffers disappear in renderdoc
so maybe my live memory viewer is lying to me
it would make a lot of sense as it would mean I was looking for something that doesn't exist
and simultaneously the thing I was looking for was in front of me the whole time
so i guess i need to try something else to prove that the framebuffers are in fact there
i was using this https://github.com/SNMetamorph/mem2pix
apparently i don't understand pixels
it's actually transparent
well that is fucking interesting
_>
there has to be other good tools like renderdoc
i have all the sekrit tools for anything but graphics
someone needs to spill the beans
hmm this thing categorically says the whole area is ARGB(255, 0, 0, 0)
well this is fun
trying graphics debugging in visual studio
wonder if this will shine new light
Iiiinteresting
okay
that has actually revealed something that renderdoc did not
the UpdateSubresource call has missing framebuffers
they appear via CopySubresourceRegion
copy from where though
this guy
who are you LOL
that's fascinating
finally, some clarity
ID3D11Device->CreateTexture2D({Width=2400,Height=1440,MipLevels=1,ArraySize=1,Format=DXGI_FORMAT_R8G8B8A8_UNORM,{Count=1,Quality=0},Usage=D3D11_USAGE_DEFAULT,BindFlags=D3D11_BIND_SHADER_RESOURCE|D3D11_BIND_RENDER_TARGET,CPUAccessFlags=0,MiscFlags=0},{{addr,SysMemPitch=9600,SysMemSlicePitch=13824000}},obj:32)=S_OK
that's the chap
then you get
ID3D11DeviceContext->CopySubresourceRegion(obj:40,0,0,0,0,obj:32,0,{left=0,top=0,front=0,right=320,bottom=224,back=1})
and its obvious why it doesn't work
copy 320x224 from 2400x1440, nice one
so next step is find how this is created
finally a thread to pull on
since when the hell can you debug rendering in VS
first you have to open some DirectX control panel I've never seen before to enable the debug layers
then I think you also need the optional Windows graphics debugging component
then change some random settings in VS until the "start graphics debugging" option is not greyed out
but this seems to have slightly more information than renderdoc in this case
or renderdoc does an incredibly good job of hiding it
this
XP-ass dialog box is part of the process
and this
its greyed out for me now because i have a session already going
sounds very directx specific
most probably yeah
even if you enabled validation layers in any other graphics api I get the feeling it wouldnt work
hopefully i have enough info now to go back to IDA, my comfy place
a few minutes?!
even this is a little unintuitive and clicking random things reveals an entire universe within
renderdoc is terrible for that
well its still collecting that object data
fire up doom while we wait
this is my first time using chatgpt as well, no idea how it can answer these questions because google can't
whoa
is VS actually telling me where CreateTexture2D is called in METAL GEAR SOLID.exe
METAL GEAR SOLID.exe!634f02 Symbol file not found. Ln:0
seems really unrelated code, it's an accelerator routine for acc_mgs_r3000_us
maybe it's trying to produce that via stack frame analysis
i'll find it anyway
well I found the CreateTexture2D calls but it seems they are created at startup and then updated on frame
this is a crazy merry-go-round
you can create them with "initial data" but since they're not recreated each time, i need to look for the update
thanks ChatGPT
Usage=D3D11_USAGE_DEFAULT,BindFlags=D3D11_BIND_SHADER_RESOURCE|D3D11_BIND_RENDER_TARGET,CPUAccessFlags=0
lets see if ChatGPT is correct
two functions call UpdateSubresource, cross-referencing with my v1.2.2 database (lol)
so one of these should be 2400x1440 rgba8888
otherwise, more merry-go-round
aight, back to it
whoa.
that's new
i need to renderdoc this
../emu_psxbase/emu_psx/gpu.c:576: 'tp < 3' failed
clearly doing some render to texture here and multiple passes
those framebuffers are never in CPU land
then the wires get crossed because it tries to recreate the PSX VRAM in the GPU
i need to resize that VRAM texture to create space for this
or shrink this down (but then we lose upscaling i figure which kind of defeats the point)
this guy
coz he only 1024x1024
but all the shit already there needs to scale up with it
๐ค
that means loading my own shader tho
isn't this avoidable by redirecting accesses to the framebuffer area (which has the broken copy) to the source rendered texture
i.e. if in "that range", use this texture instead
there's so many ways of solving this in theory but what is easiest
mhhh
i can conceive of a way of doing this
maybe i'll need to link the d3d11 sdk... otherwise will go mad
"i enjoy locating vtable methods" said no one ever
this GW_DX11_ProcessCommandBuffer hook ought to be sufficient for knowing when to jump in and rescue it
at a certain point in that pipeline, would need to run a shader to upscale the texture, I think
as a basic test of the theory maybe i'll just hack the creation of the VRAM texture so it's bigger, that should be visible ingame (and even more wrong at the moment)
then "unhack" that because the upscaling will be a separate texture
it would be like
let the game do what it's going to do up to a certain point
run upscaling shader to render to a larger texture
inject that texture instead of the game's original
then resume the original pipeline
if we're right about the original shader's math that should work
information here is pretty obviously sufficient for watching the pipeline
everything is there if you probe it enough
dx11 vtable indexes are easy to find online, I did it for master collection rain fix
oh yeah i can do it but
programmatically
thats how i know what the different parts of this function are doing
but to actually call it myself in the mod at least needs a header lol
I just did this cool shit, no actual sdk references, chatgpt helped a lot
in this house we engineer graphics with large language models
lifes too short to really fully give a fuck about magic computer bullshit
ngl i have not really found anything else to use chatgpt for
but it has been helpful here i will admit
is that shader you use builtin to the game? or a custom one?
coz i suspect (because chatgpt said it) i will need a custom one but a very simple one
its a custom one
aight cool so there's prior art here
oh damn compiled on the fly
thx, thats helpful
MGS1 is very strange
it has precompiled shaders
right next to the source which is also included
I didnt immediately find raw shader source in mgs2/3 either, probably precompiled everywhere
but d3dcompiler_43 is there.. soo..
might as well use it
what a beautiful string
meanwhile:
this is whats actually used
so no idea why the source is there
im going to hook the d3d11 methods themselves to get even moar logging i think
then we're really cooking with gas
works lol
surprised the mod loads before D3D11CreateDevice, tbh
m2fix new hooking stuff is metal lets be real
that's one way of getting the ID3D11Device
hell yeah
now should be able to change the texture sizes
ok conceptually it works
lmao
inevitably it reads more data from the CPU and causes an access violation
so i guess i just proceed with the grand plan now
the headache means it's bedtime
that seems like a good point to interject
swap out the texture passed to CreateShaderResourceView
but keep track of the original
then at some stage to be determined, upscale the original texture with that shader to my replacement texture
and it will surely just work first time

I know for certain that's the texture
it's the only one with that size and pixel format
this would not have been possible with how m2fix worked before the rewrite
complete fucking mess, would take half a day to do something that now takes a minute
i think i have all the important d3d11 stuff hooked
and all of it cascades from D3D11CreateDevice lol
no game knowledge required
hooks hooking hooks hooking hooks
the power of hooking
this is some good stuff
this is the draw call using the too-small texture
as per usual not throwing all this logging away when done, will just turn it off by default 
it's too much work to discard
hopefully I will get some sleep
woahhhh, so much to catch up on 
i have slept and i am moderately refreshed
started sketching what's required... im crashing my GPU now, but i'd prefer that to crashing the game ๐
it's gonna be a lot of fiddling
I guess this is where renderdoc will be most useful
cool, its my draw call crashing the GPU
so i guess i just havent set it up correctly
the rest of the stuff im doing doesnt interfere
duh, would help if i actually uploaded my shader to the GPU
i think i need a vertex shader as well
(which chatgpt has also generated)
ok good sign, GPU no longer crashes
yuss, I see my "activity" in renderdoc
now i need to make it work loool
thats progress
looks like i have the pipeline fuckery sorted but my texture upscaler isnt doing anything lmao
that drawcall is my doing
we're really fuckin in there now
LOL
OH GOD
MGS The Matrix Edition
dude that is honestly such a vibe
๐
Hype intensifying
oh my god
the pipeline interpolator just fucked me for like an hour and a half
i specified TEXCOORD0 but it ended up binding it to register 1
thanks chatgpt for eventually getting me there
now we have this!!!
it's upside down and flipped horizontally as well, but
it's a start!
better....
I hate thanking chatgpt, but it's for a worthy cause
i need to turn all these debug prints off now as its massacring my framerate
now we have more space for framebuffers
for now im just doubling it
but it'll need to work it out from resolution eventually
so now i need to copy moar framebuffer data in
which I can do outside of all this new logic and shader stuff thankfully
there we go, normal framerate again
oof, surely huge breakthrough here haha
oooooh shit
it begins...
now we're here we can say konami definitely could've done this themselves
epic
i had a linear filter on by mistake, changing to nearest neighbour has made "TITLE" render correctly
1700 lines of code, fuck me
i was kinda worried about "TITLE" for a sec but it was easily fixed
YEA BUDDY
its a lot lol
the last bits here are extremely fiddly lol
faffing around with loads of numbers again
the framebuffer effects are very trippy unless i get them exactly right
oh shit i kinda got it
that's almost lined up haha
im actually glad i got this close, it was miles out until just now
it's got a bit of the "pirated film that was recorded in a cinema" look to it
but given it's so minor now it can't be too hard to tune that out
i suspect there's some coefficients being passed to a shader that control things like the scale of underwater "wobble" and such
and those are being amplified rather than scaling correctly
so might need to scale them manually idk
well this wont be tedious at all
if (pDstResource == reinterpret_cast<ID3D11Resource *>(texVram)) {
pDstResource = reinterpret_cast<ID3D11Resource *>(texVramRemastered);
}
lining up the codec digits is probably the way to go
everything should fall into place then (besides the extreme jitter)
then i need to work out how this is going to scale with different desktop resolution
that's horizontal done
it might not look like it because of the extreme shaking going on
50% of the time it overhangs left, 50% overhang right
wow is it hard to time that screenshot correctly
phwoar
definitely playable now
hard not to be delighted
if i never have to see OOoZ? again ill be happy
nice, fixed the pause menu and borders
bedtime, good progress
https://www.reddit.com/r/metalgearsolid/comments/1kpbnh7/mgsm2fix_update_teaser_mgs1_with_fullnative/ damn someone shared the info so quickly lol
that's me xP
huh I remember you have an account that is also Afevis
Unfortunately an automated spam detector flagged this link (which is the likely RL location of MGS3) as spam and I got shadowbanned on the spot. Been waiting on an admin to review the appeal - their estimate said it can take a few months for them to get around to looking at it though ๐ฆ
https://eurasia.travel/tajikistan/bokhtar/tigrovaya-balka/
Discover the breathtaking Tugay forests of the Tigrovaya Balka Nature Reserve in Tajikistan! This video guides you through the lush greenery and unique biodiversity that make this region a hidden gem. From towering trees to vibrant wildlife, explore the stunning landscapes that define the Tugay ecosystem. Learn about the importance of conservati...
ah I see
i wake up and visual fucking studio has reset my fonts again with no user input
standard
literally hasnt been touched i have been asleep
tidied it up a bit so it doesn't create the logging-only hooks if logging is disabled
so these are all the functionally necessary hooks for the fix
still a lot tbh
ClearDepthStencilView is the key one, ended up being a good trigger for most of the pipeline adjustment
it only appears once and at a safe point
i had no chance trying to fix this the way i would've tried last year
i didnt expect to have to fuck with d3d11 so much
because we got so far without doing that
but there really was no other way
ALSO absolutely no fucking chance i could do it last year with how i was hooking stuff then, even if i knew what to do
sorry ppl had to wait but there was no alternative lol
alright got rid of all the stuff hardcoding it for 1440p lol
i've fixed the "recorded in a cinema" look
and things wobbling/shifting!
huh, that's really all the bugs fixed
how did i do that
sharp image borders now
no dancing digits was an unexpected outcome
the bugs are falling like flies now

there is really only one issue left here
which can't be as hard to solve as everything else
it's not that things are actually "shifted", it seems like there's a scaling issue, like the aspect ratio somewhere is wrong
so i just need to fiddle with the numbers a bit
i have no idea what is going on with the PSX resolution
sometimes I see 320x256, sometimes 320x240, sometimes 320x224
the game is using any two of those seemingly simultaneously
so making sense of that will probably fix it
to be precise: the choice of game version selects one of the first two
the last one is always used for some part of the rendering pipeline
the first two must be PAL vs NTSC
no idea what the last thing is
but its very important in this emu
other than that issue it's perfect now
bbl
Metal Gear Solid PSX reimpl repo. Contribute to FoxdieTeam/mgs_reversing development by creating an account on GitHub.
Metal Gear Solid PSX reimpl repo. Contribute to FoxdieTeam/mgs_reversing development by creating an account on GitHub.
Metal Gear Solid PSX reimpl repo. Contribute to FoxdieTeam/mgs_reversing development by creating an account on GitHub.
Metal Gear Solid PSX reimpl repo. Contribute to FoxdieTeam/mgs_reversing development by creating an account on GitHub.
Definitely seeing those exact numbers around DG_InitDispEnv() a bunch in the decomp
back
oh awesome
with the new stuff, those values i didnt understand so stuck them in the ini file no longer need overriding
so i can remove some user-facing complexity here
the "layer width" "layer height" stuff can go
224 must be the size it uses to perform the framebuffer effects on
that would make some sense maybe
224 is a "cinematic" thing
according to psx-spx that's generally how its used
that is without me shifting it
with some updates to the ratio & scaling
now why is it vertically wrong
the digits also look the right size now
i think?
need to thimke
there is some beautiful solution here without hacking it, must be
the scaling is right now if i hack the vertical offset
i was worried for a bit because the text was too big
this is so close its unreal
im afraid to touch it in case i make it worse lol
scalpel precision needed at this point
the game is internally actually doing this
this is without the mod
so it being there in the non-presented framebuffer is 'normal'
crude way of measuring it, but that is clearly too low
and it comes from a CopySubresourceRegion, supposedly
so in the unmodded game its sourced from a texture of 640x512
the mod currently causes that texture to be created as 2250x1440, no idea where it gets 2250 from
that is not the same ratio
lets see where that gets created
hopefully some dots about to get connected
gonna say they're lined up in the vertex shader
๐
god am i glad to get rid of the shift shite
why does this happen man
last 3 days
i go to bed
suddenly have eureka
get up, and something gets fixed straight away
spend hours sitting here trying to fix it
lie in bed for 5 min and gg
yeah
im calling it
it's fixed
it's done
job done
works flawlessly
just closed about a million things, feels good
and all the screen modes work fine as well
nice
no hacks here its all science
3am pizza to celebrate
so glad i can get rid of these lol
that's a good progress
Amazing!
mind blown
Is there a way to change the border wallpapers when playing 4:3? I don't remember
there's a few you can choose from ingame
unless you meant like custom ones
custom ones could probably be done as well tbh
Was thinking custom ones, but I'll throw in a feature req after this version goes up ๐
yeah, its probably not too difficult, certainly not as difficult as all this shit was
lol
i really opened a can of worms here
ty! โค๏ธ
Did someone give you extra ko-fi donations? ๐
Works a little iffy right now, but I'll toss you a couple bucks when things are a little more stable
I wonder if it's doable that makes text and UI non-stretched when play it in widescreen
That'd be ideal, but like Snake, nuggs deserves to rest :p
Definitely would love to see it down the road
just gonna leave it playing the intro on my monitor tonight lol
it's not just that it works from my POV, it's how elegant it is lol
very satisfying solution
thx to the two people who sent me ko-fi if you're in here โค๏ธ
am I tripping or does it seem a few pixels to the left (the 1 looks like that at least)
it's not
the texture just upscales in a strange way
it's not a positioning thing, that's just how the shader decided to colour the pixel via nearest neighbour
maybe that can be tuned a bit more, but the positioning is correct
tuning that is much less stressful lol
Yeah thf it might just be me trying to find an issue even when it isn't there, some projects I make take a long time because of that lol
i have to define the sampler for the vram upscaling
and i have no idea what im doing, this is just the first thing that worked
lol
positioning must be correct now because there's no hacky alignment or shifting in my stuff anymore, it's all based on ratios
that is where it should end up, apparently
Comparing it to a screenshot I took off a psx mgs1 video on YouTube it looks spot on to me
yeah
yea so I was right on that lol
sorry for wasting your time
To be fair most of us are probably used to seeing this on an old crt screen. I didnโt know it looked like that normally either lol
alright, time to fix PAL
this shouldnt be too bad
i think i already found the problem
that's some PAL progress
but yes, compressed horizontally
but at least the text has appeared now
oh now i know why integral has black borders
not sure if that's intentional or a mistake lol
got it
Be interested to see if any of the upscaling works with the 2d Castlevania games
Oh hello. Where are you hooking for that?
I've been trying to hook into d3d11createdevice with MGSHDFix to redirect it to d3d11createdeviceandswapchain, but it's just been crashing on me. I figure there's probably somewhere further down that I need to hook it to inject my own d3d11_sampler_desc
(since that controls refresh rate, antialiasing levels, ECT.)
why do you need to redirect to D3D11CreateDeviceAndSwapChain to set a D3D11_SAMPLER_DESC?
(i am not)
I'm hooking D3D11CreateDevice, letting it run, and then using that to springboard more hooks into the ID3D11Device methods
and so on for ID3D11DeviceContext when it runs CreateDeferredContext
looks like this
but I don't do anything with D3D11CreateDeviceAndSwapChain
FUCK YEAH
completely fixed PAL
now has NTSC broken
a bit
FUCK
Ah! Not super familiar with the d3d API so I was throwing darts at the board really, that helps out!
I definitely hear you lmao
cool, fixed NTSC again
we are zeroing in here haha
now does PAL still work..
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSS
disgusting dude, it's perfect
party time
once again this needs to get the fuck into git
it's in git, we are safe
well fuck, now to... work on something else
I'm sure we can find something for you to do
Is it even possible to split the HUD and Subs out of the widescreen effect? Like was mentioned the other day
funny you mention that, i just reworked the widescreen so it doesn't need PsyX anymore
so we're back to using M2's GTE
the new widescreen hack
extremely tidy
wow i can delete so much shit due to this
and i'd rather be using as much of the original master collection code as possible
this is gr8
Holy balls dude, you're on a roll
Jesus

lol
"asking for donations" is having a tip-jar link now
I mean, I do kinda get that the project looks dead if you only have the github to go on
But also, don't be a dick
well its the personal attacks and assumptions yeah
Oh fer sure
he's being an arsewipe
When are you thinking you'll throw the latest build up for release?
not even dignifying him with what is wrong with "you", it's what is wrong with "people" haha
like dude it's a project with passion, not a real job
well im keen to prevent what happened last time where i rushed it out and that started this whole pressure and complaint cycle that probably didnt help with it taking so long to get fixed
Ah, totally fair.
i will take my time
Fer sure
you've waited long enough already, a bit longer won't kill ya
Yep! Just kinda curious what the gameplan was, since things are looking real solid (lol)
honestly i probably need to play through it now in both PAL and NTSC
and maybe with one of them at a different desktop res
then re-test all the non-MGS1 games again
petrified of what happened last time haha
about time i fucking play this goddamn piece of shit
also shit like the readme needs updating
these things all add up lol
if he replies again he's getting this gif
i am done speaking
I wish I was getting hairdryered
@pure radish If you need a playtester, lemme know. Am happy to assist ๐
bang and the dirt is gone
who needs this shit in their life
i wonder if he's the same cunt i blocked from the nexus pages saying the same crap lol
Probs
https://github.com/nuggslet/MGSM2Fix/issues/39 huh, I think the background is in different folders?
Nah, I don't see any folders for that in the MGS gamedata
Unless it's unpacked on first launch or somethinfg
Probably
Well, and then it gets messy depending on your aspect ratio etc
But might also be handy for folks who have ultrawides, where the stock images could potentially be borked.
i don't have any ultrawides but I think I can still test it
by just setting a silly resolution in the ini
like it'll be a horizontally thin window
Are all the options from the OG launcher in the M2Fix config?
well, not all of them, things like sound and controller ports are not lol
but there aren't ingame resolution settings
even for the window
the ini was supposed to just have options that arent ingame
I'm not gonna post an issue for it, but it would be very cool to either include the M2fix options in the OG launcher, or have a fresh GUI that includes the settings from both
yeah, it's probably quite doable
Yeah, there are no folders
I would think so Edit: That way anyone can get into the config and make those changes without dicking around with the launcher if they don't want to.
This would also, in theory, make Steamdeck support better since you don't need to dick around with the keyboard
Nice big holistic solution to wrap the whole thing up
But again, down the road
Did you ever figure out what was up with the chaff grenade audio?
never even looked at it yet
i was hesitant to look at anything else until sorting the upscaling
the only exception was to rewrite the entire project because i couldn't do upscaling without doing that haha
As always: Thank you for continuing with this project. It's amazing to see what you've done to take a decent-mediocre port and take it above and beyond
I'm also looking at all the issues you'll be able to squish in the tracker when the next release goes live ๐
here's a preview of the updated README
great to see all those games in there
maybe I can combine the "Steam Deck/Linux additional instructions", need to try
i've been thinking about that for a while
Redirect the MGSM2Fix repo to it
it'll automatically do that i think
Handy
it's still very MGS-focused though
For sure
But I could imagine a lot of people who play those other games completely missing out on it
yeah i mean i was already thinking about it so
i haven't really decided yet
i swing both ways haha
๐
If there's any generic config vs MGS config, I'd maybe split that out in the readme. Also include a folder location example for installation that isn't for MGS
Maybe that first bit is more in the ini rather than the readme
Don't want people flipping switches that do nothing in, I dunno, G-Darius HD.
also going to put some more screenshots in there to show off the fixed intro and codec ๐
it's crazy it supports so many games haha
Right?
like that's a lot
the credits changed a lot in the rewrite as well
haha
stuff taken out new stuff added
technology innit
"Countless people in the MGN Discord for encouraging the project along; " It me!
and you!

i'd put names in there but i think the line is "you need a github account"
(so i can link it)
don't want to name people if i can't link a profile
i might try to automate some testing here
at least something that checks each game works
so i don't have to do it by hand coz its fucking tedious
That's probably a good idea regardless
will also start drafting the release notes
wow we really got a lot done
your monitor fix?
Corrects the monitor going to sleep during long periods with no input (e.g. during cutscenes.)
yeah i caught it after i sent the screenshot lol
this stuff is all WIP, ill be tweaking it for a few days at least
so if some stuff seems missing i might add it (but still tell me)
this is why we don't rush releases ๐
always stuff to catch before it goes out
extended my installer script so that it can also unpack the release zip
the release zip is structured differently to how i develop the mod so useful to have that
awesome that all works
oh wait a sec, you mod is an asi, right?
kay one sec, i'll make a pr for something
the release now looks like that
but when I develop it's just "MGSM2Fix.asi"
so M2Install.py if called from Visual Studio, deletes "MGSM2Fix32.asi" and "MGSM2Fix64.asi" before copying "MGSM2Fix.asi"
but if you call M2Install.py --package, it extracts the zip and deletes "MGSM2Fix.asi"
chaos lol
want me to build off the old master / are you waiting for release to push?
yeah waiting for release
will be just a few minutes then!
just bringing over some asi loader related fixes from mgshdfix
more that the framework we originally used weren't implemented properly, you're supposed to be able to load asi mods from /plugins, /scripts, and /update subdirectories
oh

can you believe this was a fork of HDFix
lol
thats how i created the project
its some weird thing that looks like HDFix in some places but in other places its radically different lol
i stripped down everything and have been using it as a base for other games too, it's definitely solid lol
right i think this is good to start some kinda automated test thingy
no fuckin idea how but
i need it to run the installer and then try launch each game and then close it
yeah i was thinking of doing cli stuff for mgshdfix too but i have no clue how you'd do that without hosting the .exe files with their dll's somewhere
why would you need to host exe files to do that
which, with lyall getting supended from github with no warning the other day, i'm now super hesistant to do lol
i have a "console" window now and the idea is to have some sorta commands u can enter eventually
atm all you can do on the console window is ctrl+c which triggers a breakpoint
er, countinous intergration tests*, cli was my brain being off in lalaland
ohh
yeah I'm not bothered about CI, I just want some manual process that is consistent that I can run before releases
rather than going fishing through my steam list and hoping they all have the latest build and a consistent .ini
now i think, this automated test can try different ini options as well
start the game with different setups
i just need some sorta test harness basically
is this something i need to assemble myself or can i use pytest or something heh
god, I used to copy paste files around while working on this
what a tit
how did I cope
i think im changing it to be borderless by default in the ini
game behaves well with it so why not
i really need to figure out changing the keyboard bindings
that's a personal high priority
why the fuck is pause E+M
surely its possible to find a more natural conventional binding layout
how about escape for pause, honestly
oh right, master doesn't compile
oh it requires the shitty intel compiler
quite trippy to launch VR Missions with that border lol
that freaked me out for a sec
that's another thing for the release notes
no more Intel compiler
hell yeah lmao
nice, i'll take a look
https://github.com/ANTIBigBoss/MGS-MC-Mod-Manager-and-Tool huh, I guess someone sort of made a GUI for your ini lol
i dig that
saves me a job ๐
finished porting your PR, it was never gonna merge properly lol, everything has changed
i'll merge your PR to master, but force-push over it with a ported version to the mod rewrite
(will keep commit author though)
lets see how this works
not sure about the steam deck thing
there probably is a way to detect it, but i doubt that works
I would expect _WIN32 to be set on every system running the mod
ayy
i quite like that
Module Version: 0.0.0
that doesnt seem to work tho
tbh I imagine the M2 system requirements are lower, the GPU one will be most useful considering how much DirectX fuckery is going on now
operating system would be another good one to print
the directory stuff seems to be working
just module version is borked (but maybe it's just an M2 vs HD Collection thing idk)
not sure what it would be supposed to print
there has to be a way to detect steam deck coz loads of games do even with Proton
with the log directory maybe log rotation would make sense
i.e. keep the last X number of logs
I'll keep playing with it
That guy should khs (criticism) because he is an asshole (valid point)
aww shit. sorry yeah that won't function, i made the mistake of assuming they put the file version in the descriptors, but even that's not consistent lmao.
oh well, when life gives you lemons
here's the date in a human readable format at least, confirmed it does work with mgs1 this time lol
std::string GetModuleVersion(void* module) { auto dosHeader = (PIMAGE_DOS_HEADER)module; auto ntHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)module + dosHeader->e_lfanew); uint32_t timestamp = ntHeaders->FileHeader.TimeDateStamp; // Convert the timestamp to a human-readable date format (YYYY-MM-DD) std::time_t time = static_cast<std::time_t>(timestamp); std::tm* tm = std::gmtime(&time); // Convert to UTC time std::ostringstream oss; oss << std::put_time(tm, "%Y-%m-%d"); return oss.str(); // Return the formatted date as a string }
cleaned up my game dir a lot haha
this was FULL of shit
i had memory dumps, multiple exes and ida databases, just so much shit
all i need is that v1.2.2 lol
Yeah one of the big reasons I fixed the ASI directory thing was cause I have 13 ASI mods for MGS2, each with a config, a log, a pdb, ECT. Had wayyyyy too much shit in there and it was getting annoying lol
im prob gonna keep the asi in the root tbh, mine is the only mod
Especially since all my shit is symlinked, so I couldn't even sort by type
though I guess.. in the release there are two ASIs
quite cool that the 32-bit vs 64-bit thing works as well as it does
relies on Windows silently rejecting a DLL for the wrong architecture
so that d3d11.dll is ignored by MGS1 and it uses the system one, and vice versa dinput8.dll is ignored by bonus content etc
I spent like 15 minutes a few weeks back trying to figure out why an ASI I was working on for an old game wasn't initializing till I realized that it did behave like that, definitely a handy little thing to be able to just bundle both together
oh my god i am retarded at work today
context switching between work and MGS is dizzying haha
Howwwwww
seems like there's a lot of small separate mods for the HD games
I think I've seen like.. 3?
but not for M2 coz im the only one interested haha
10/10
the squirrel hook can only kinda exist in one plugin anyway
i have a lot of projects going xP
why dont you combine em
one day maybeeeeeee. i like to keep mods pretty atomic just out of habit
also, hello therrrrrrrreeeeeee
did you use the real d3d11 headers?
yup
that should've been really obvious lol
i also obviously don't need to commit the header because anyone building can just do the same
fool moment
i'll need to see how my hooking/invocation stuff handles this though
__thiscall is a bitch to hook
but
this stuff is __stdcall
hmm
so what can i just do #include <d3d11.h>
i imagine i already have the bullshit installed
cretin
lets include it and witness all the errors that appear
alright well its in git lets totally demolish it
i mean that is nicer but what does it mean for hooking
ur mom lmao
yeah that's like
game over for hooking
I would still need to access the raw vtbl to hook them
i don't think you can cast away that error
every time ive seen it its pretty final
i don't think using the official header is worth it in my case
it makes my own calls look a bit neater but then I have no idea what's happening with this and I'll have some structs where it's explicit and some where it isn't
undo undo undo
i guess i'll finish off merging/enhancing your PR
fucking microsoft
tfw no IsWindows98OrGreater
best OS
maybe chatgpt can solve this as well
loool.
silly world
eyy
it's also wrong
11 is not detected
Going by their documentation, this shoullllld return it as Microsoft Windows 11 Professional (build 22621)
pain in the ass to include all that for it though
chatgpt has a solution
without using WMI
yea bro
getting GPU driver version would also be neat
but probably even more difficult
oh no chatgpt has an answer for that too
nice, found a bug
not in the upscaling
in the darius games, i had the wrong borderless patch assigned to them
this is why we take our time
dno how that happened, they were set to the MGS1 patch but they need the contra/castlevania one
Holy moly, I'm so happy the MGS 1 native res with filters got fixed, can't wait for release
I'm so happy I'll finally be able to play the game properly
Thank you for all your work, dude
hmm,
I think ideal layout would be like
\plugins\MGSM2Fix32.asi
\plugins\MGSM2Fix64.asi
\logs\MGSM2Fix.log
\MGSM2Fix.ini
but i dunno about separating the asi from the ini, your code doesn't allow for that
but just having the ini in the root would be elegant
and hiding the 32bit 64bit shit
i had set it up like that since asi loader's documentation says that you're supposed to keep config files alongside the asi file if you're using /plugins / /scripts, though since this is gonna be used for M2 and the likelihood of other mods ever coming out for the emulator being slim, i definitely do like the idea of just keeping the ini in the main folder too
sweeeeeeeet, got @crude zinc 's shader injection stuff all working using the actual d3d11 header/functions. shaved 150 lines off of everything and reduced the initialization time from 115ms to 6ms
nice
yeah, I just can't do that coz I need to hook the methods
idk how you know when to trigger it
I hook d3d11 itself to know where in the pipeline I am
I'm still hook the d3d11createdevice and dxgicreatefactory functions just to make sure everything is initialized first & to cache the d3ddevice and d3dcontexts, most of it was just getting rid of all the hacky vtbl and global strut stuff that was going on in our implementation and replacing it with the proper d3d calls
yeah but they aren't bound functions
you don't hook something like CreateRasterizerState
try doing that and you'll see the problem
you call it, but that's a big difference
so
supposedly there's a hacky way to do it
but it's undefined behaviour
but i mean this only has to work on MSVC
so lets see what happens
the horrors
I avoided using the real d3d11 stuff assuming it would be a bad idea to add dependencies
it seems like there's different versions(?) of D3D11 as well?
like I can hook the wrong version of a function
(and am doing, with the official headers)
i got this far
but that is the "wrong" version of CreateDeferredContext, and the game doesnt call it
so the pointer I was getting from the vtable was different
it's a shame because it looks nicer lol
"The latest version of this interface is ID3D11Device5 introduced in the Windows 10 Creators Update. Applications targetting Windows 10 Creators Update should use the ID3D11Device5 interface instead of ID3D11Device."
yeah
yeah the whole d3d11 thing is a mess, there's d3d11_1.h,CreateDeferredContext1, d3d11_2.h, d3d11_3, d3d11_4.h, ect.
you'd change the number after CreateDeferredContext to match with the header too. theoretically it should lol
so annoying that they decided to split everything up by feature levels (ie directx 11 feature level 1_2) instead of just calling shit directx 12, directx 13, directx 14
they match with the header file
ie d3d11_1 uses CreateDeferredContext1, d3d11_2 CreateDeferredContext2
so fucking stupid lmao
thanks, i hate it
not sure i have the energy to brute force the correct versions for everything lol
what a waste of time that would be
nope.avi
not worth it even
it would make the code less portable
to other games
i guess you could template it, but yikes, really enjoyed when i had to do that for squirrel
I'm sticking with vtbl

could use this + some pointer arithmetic to work out the index
let me sketch how that would look
im apparently absolutely shattered today lol
got home, had a coffee, still took a 2 hour nap
alright that can work
holy fuck
i did it
gorgeous shit dude
oh I don't need that explicit template parameter either
Hell yeah haha
basically
MSVC generates "thunks" in my binary that I can disassemble to find the vtable offset
even though they're the wrong version, the offsets are the same
so I can work out the offset and then take that across to the real vtable
it's rly fkn mental
but it works
and I can use the official header now
right
now i need to restore all the code i deleted and rewrite it to use this
im using the zydis for the disassembly that safetyhook itself is using
so no new dependency
i might not even need the "d3d11.dll" either


