#Modding the MGS1 emulator

1 messages · Page 18 of 1

pure radish
#

it's not helped by the language barrier

glad frost
#

haha

#

yeah

pure radish
#

that was probably really clear in their native tongue

glad frost
#

yeah

pure radish
#

translated it can mean anything

glad frost
#

and i guess the tendency to keep patch notes succinct

pure radish
#

just need to get them to say it again in a different way

graceful nacelle
#

Given that the stream is at 11PM my time, I hope I wake up tomorrow to good news. I heard that the resolution change got added with 2.0 but only just now realized that they only applied that to 2 and 3

glad frost
#

Yeah

#

Much different beast for 1

pure radish
#

new squirrel debugger dropped

#

Debug Adapter Protocol

#

that would work nicely in VSCode with the Squirrel extension

#

instead of that 2008 version of Eclipse or w/e it was

#

i don't think its a priority for me at the mo tho

#

would probably need some adaptation to work in the M2Fix env

#

the one in place atm needed a little adaptation

#

i dont rly use it tho besides the eval() i added

pure gazelle
#

was there a new mod update for 2.0?

pure radish
#

did we even get 2.0

pure gazelle
#

thought i saw a while ago another file update for mgs1 my bad

#

for mgsm2fix that is

woeful flare
#

it's been a while, so i'm assuming we won't get a 2.0

#

not for a long while anyway

pure radish
#

welp guess we have to fix it ourselves

hoary pier
#

I think the main reasons it's taking so long are the fucked up reverb effects and the muted audio on Switch

#

I actually think they might try to rerecord or splice in audio for the button prompts to get around it. They said they'd address it and I can't really see any other way if Nintendo won't let them say "Circle button" on their console

#

Or they might use TTS audio since I think the only characters who directly mention buttons are Campbell and Ocelot. If there are any lines from Mei Ling or Naomi though then TTS wouldn't be a viable option (I totally wouldn't put it past them to use it anyway though)

cerulean coral
#

hello warm people

pure radish
#

hello

cerulean swift
#

👋

cerulean swift
glad frost
#

The latest version will remain Ver.1.5.0. Note that this is not a patch for Ver.2.0.0.

#

FWIW, I emailed Konami requesting clarification on this / the possibility of upscaling MGS1 in the next Hotline, and they got back to me and said the message had been passed on, but let's be realistic they probably won't address it

cerulean coral
#

Epic Store Free

pure radish
#

wow, had no idea these were outside Steam

timid hemlock
timid hemlock
hearty dirge
#

Thank you

pure radish
#

will grab it l8r and see what the diff is with Steam

pure radish
#

alright we got the tag now

#

surprised i didnt do that sooner

#

also surprised the other collections arent on epic

#

specifically anniversary is

#

anyway exe is subtly different and so is the alldata package, but I figure it's gonna be just the delta to support epic instead of steam

#

maybe it has a replacement for steam input

#

though not sure castlevania anniversary on steam uses steam input

#

btw hopefully i have a bit more time for this again as a long-term (but very important) distraction has recently finished

#
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Name: CastlevaniaAnniversaryCollection.exe
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Path: E:\Epic Games\CastlevaniaAnniversaXJ2A3\CastlevaniaAnniversaryCollection.exe
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Address: 0xad0000
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Module Timestamp: 1730185635
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] ----------
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (app -1).
[2024-11-14 22:26:54.650] [MGSM2Fix] [info] ----------
[2024-11-14 22:26:54.651] [MGSM2Fix] [info] M2-32: sq_vm_realloc is 0xbc9c10.
[2024-11-14 22:26:54.652] [MGSM2Fix] [info] M2-32: printf is 0xb42020.
[2024-11-14 22:26:54.652] [MGSM2Fix] [info] M2-32: printf hook succeeded.
[2024-11-14 22:26:54.692] [MGSM2Fix] [info] SQ-32<AlignObject>: SQVM::SQVM pattern scan failed.
[2024-11-14 22:26:54.720] [MGSM2Fix] [info] SQ-32<AlignObject>: SQVM::CallNative pattern scan failed.
[2024-11-14 22:26:54.750] [MGSM2Fix] [info] SQ-32<AlignObject>: Sqrat::BindFunc pattern scan failed.
[2024-11-14 22:26:54.779] [MGSM2Fix] [info] M2-32: MWinResCfg::GetValue pattern scan failed.
[2024-11-14 22:26:54.807] [MGSM2Fix] [info] M2-32<Legacy>: Borderless: MWin::CreateWindow pattern scan failed.
[2024-11-14 22:26:54.807] [MGSM2Fix] [info] ----------```
#

waow

#

really

pure radish
#

i wonder if its been compiled "like MGS1"

#

therefore the best approach would probably be to try both "styles" regardless of the game

#

there's clearly some bizarro compiler flag differences between games that changes things like struct layout and integer types used

#

might as well just try to scan for anything we recognise rather than prescribe based on the detected game

#

hoping this isnt like a "third style", but even if it is, i already did all the work to support variations like this so adding another would be easy

#

this shits so much more stable now so basically once the signatures are found and any struct differences understood it should all work instantly

#

m2fix was basically working due to luck originally

#

now it works because it does the right thing

dawn flare
#

I love seeing a flurry of posts in here, it's my signal to redownload MGS1 😛

pure radish
#

OK

#

so it is like a "third style"

#

a fusion between what MGS1 looks like and what Castlevania on Steam looks like

#

FFS lol

#

ohhh

#

it just doesn't have this mystery extra object slot

#

otherwise same as castlevania on steam

#

WEIRD

#

why does porting it to epic remove that

#

was always weird that bonus content didn't have it, either

#

M2's schizophrenic squirrel implementation

#

so just need to move this into the domain of the compiler with templates rather than the preprocessor

#

I think I proved at one point that this object slot isnt even used either

pure radish
#

something like this? love this language

pure radish
#

I have SQSharedState off by 4 bytes it seems, so it's getting closer

pure radish
#

LOOOOL

#

"_m2_unknown" has moved from SQVM to SQSharedState

#

that's it, that's the change

#

this codebase is still in development?

#

oh, that might also explain what we see in vol1 bonus content

#

in some titles the extra SQObjectPtr is in SQVM, in some its in SQSharedState

#

it's a clean swap and everything lines up now

#

they've just dumped it right at the end of the struct this time

pure radish
#

heck yea

#

got further after silly battles with C++

#

since you can't have an object with no size

#

has to be like this i guess?

#

xD

#

couldn't get any purchase out of [[no_unique_address]]

#

there is a similar one for SQSharedState

#

not recommended...

pure radish
#

eyy

#

it works

#
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Name: CastlevaniaAnniversaryCollection.exe
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Path: E:\Epic Games\CastlevaniaAnniversaXJ2A3\CastlevaniaAnniversaryCollection.exe
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Address: 0xb90000
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Module Timestamp: 1730185635
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] ----------
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (app -1).
[2024-11-17 02:28:44.153] [MGSM2Fix] [info] ----------
...
[2024-11-17 02:28:44.503] [MGSM2Fix] [info] ----------
[2024-11-17 02:28:45.114] [MGSM2Fix] [info] Squirrel: SQVM is 0xe637000, SQSharedState is 0x7585e10 & scratchpad is 0x0 (0 bytes).
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: SQVM is 0x12e91768, SQSharedState is 0x7585e10 & scratchpad is 0x7677b10 (0 bytes).
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: SQVM 0x12e91768 hooked: debug info is enabled, exceptions are disabled.
[2024-11-17 02:28:45.390] [MGSM2Fix] [info] Squirrel: printf: スクリプティング開始
[2024-11-17 02:28:45.420] [MGSM2Fix] [info] Squirrel: printf: -------- init_system_1st() : start
...
[2024-11-17 02:28:46.007] [MGSM2Fix] [info] Squirrel: printf: -------- init_system_create_systemdata() : start
[2024-11-17 02:28:46.099] [MGSM2Fix] [info] Squirrel: printf: dev_name : CollectionDracula```
#

hehe

#

at least i didnt have to rewrite the entire project this time

#

not sure how the scratchpad gets allocated a pointer with no size, looks like M2 found some of those zero-sized objects :^)

#

it eventually has a size (and things would crash badly if this was wrong anyway)
[2024-11-17 02:29:04.578] [MGSM2Fix] [info] Squirrel: SQVM is 0x1354d018, SQSharedState is 0x7585e10 & scratchpad is 0x1322f8e0 (219 bytes).

#

once all the scratchpad stuff is sorted it basically just works after that

pure radish
#

tryna rationalise how bonus content was done with this new understanding

#

basically means there's 4 variants of squirrel "ABI" so far which is actually just all permutations of two variables

#

is the mystery object in SQVM or SQSharedState, and are objects aligned to 8 byte boundary

pure radish
#

lool

#

seems a bit too easy for m2fix to bypass that one

#

but also the game is free so

pure radish
#

ok cool that all works

#

means bizarrely the epic games release of castlevania has some stuff in common with mgs bonus content

#

but not the steam release of castlevania

#

extremely weird all of this

pure radish
#

// EPIC Online Service 用
EOS_PRODUCT_NAME=Castlevania Anniversary Collection
EOS_PRODUCT_VERSION=1.0.15
EOS_PRODUCT_ID=1ff2f74ba0ef4019b6905d8abe268819
EOS_SANDBOX_ID=247d4d4b4e424afd9b474334fe450a43
EOS_DEPLOYMENT_ID=c375e68f5f5a4cfa8c1d8840066f9a92
EOS_CLIENT_CREDENTIALS_ID=xyza7891HpULODUKVkXYv3RCk2W10VAh
EOS_CLIENT_CREDENTIALS_SECRET=wEclS2uL3tZ/yPCbZEB3wCX4cb4cfXw3ou3W8v1e+yk
EOS_ENCRYPTION_KEY=1111111111111111111111111111111111111111111111111111111111111111

#

F

#

lets have a nose at alldata

#

g_win_is_epic

#

so it can be easily detected as long as it successfully attaches to squirrel (guess you could also just use the filepath but)

#

that is

#

g_win_is_epic = "Epic" in getroottable();

#

so i guess there is some Epic class

#

yeah with methods login, getProductUserId, getLoginError, queryAchievement

#

lol shits obfuscated

pure radish
#

lol.. omg

#

the component I hook to override things like the window settings

#

different compiler optimisation options has led to completely different codegen and I have to completely rework the hook

#

and i don't think I can just return a pointer to value anymore

#

I think I have to return an out-of-bounds index into the original array

#

this is so batshit i kind of want to see if it can be done

pure radish
#

HAHAHAHAHAH

#

the daft thing works

cerulean coral
pure radish
#

yeah and a "license check"

#

which is disturbingly easy to patch out with M2Fix haha

#

either attaching to squirrel, or the wincfg hook that I usually use for window settings e.g. fullscreen is probably enough to also bypass the license check

#

with just like the simplest tweak to kill it

#

i hope there is some other layer of DRM because this is too simplistic

zinc ferry
#

@pure radish Not sure if this is helpful to you at all, but this is interesting behavior when using increased internal res on a 4:3 monitor

pure radish
pure radish
#

i would guess the framebuffer effects in cutscenes are still a bit scuffed (but maybe less so)

#

i think the way to go is just to rebuild the shaders

#

for a while I was thinking to do the bare minimum to patch the shaders and then (extensively!) patch the gpu pipeline but that is just going to turn into an unmanageable mess

#

i'd spend a year getting that right with all the hooks etc that would be required

#

but if we properly rebuild the shaders, then it might just be a framebuffer geometry tweak required

#

whats happening is its uploading the psx framebuffers & texture area to the host gpu but the sizes are such that it eventually overlaps

#

so you'll see things like the codec numbers being overwritten by another part of the copy

#

it all works fine when framebuffer effects arent used coz that screw up has no effect, its not sampling from the framebuffer

#

hopefully if i finish tidying up the project someone who knows more about gpus than me can hop on and fix it for us 😄

#

at times like these i curse not being a game dev

cerulean coral
#

I would like to try reverse engineering on PS1 games again, but I don't want to be stuck on the PC all day trying to figure out how to do the process right. I envy those people who make progress in just a few months and find collaboration. 🥲

cerulean coral
#

I found that Metal Slug Awakening uses Lua, but I don't know if it's in the Launcher or in the Unity game. There are many remote communication instructions.

pure radish
#

hook it!

scarlet roost
#

Hello, I've been reading this forum and I've seen some efforts on unpacking the alldata.bin file so it could run into an external emulator. Is it possible? The main game looks fucking horrible on my system for some reason (slowdowns and sound cracking) so maybe I could use the roms to play in duckstation or something

pure radish
#

yeah it can be done

#

its an imperfect process (you don't get an identical dump to a retail CD) but its playable on external emulators

#

i wrote a script to do it

#

(except germany, we can't do the german version yet)

scarlet roost
pure radish
scarlet roost
scarlet roost
pure radish
#

no errors, should be totally playable and flawless, just has a different hash (md5/sha-1) to a dumped CD

#

since the process has been lossy over data that doesn't affect the gameplay

#

needs alldata full-unpacked with MArchiveBatchTool first before you run that

scarlet roost
#

They changed the key i think, the fullunpack gives a header checksum illegal error

pure radish
#

did they? huh, i'll check

#

castlevania dominus had a new key so maybe they're using that

scarlet roost
#

.\MArchiveBatchTool-Windows\MArchiveBatchTool.exe fullunpack .\alldata.psb.m zlib "Illegal function call" 92

pure radish
#

that is the dominus key

#

you want

scarlet roost
#

Fuck I missread it

pure radish
#

MArchiveBatchTool.exe fullunpack alldata.psb.m zlib 25G/xpvTbsb+6 64

scarlet roost
#

How can I look for the key in case they change it? Is a bruteforce attack of the header?

#

Thankss

pure radish
#

just code RE in the executable where it mounts the archive

scarlet roost
#

Okay, tysm

pure radish
#

you'll need these as well to produce working disk images

#

in system/roms

#

contains PSX SDK stuff that they stripped out

scarlet roost
#

Damn, I guess I will make a script so the process is more automatic

pure radish
#

yeah it could do with being made more convenient for sure

scarlet roost
#

Amazing work. Don't even know how you got those libraries. Mad code wizard fuckery I guess

pure radish
#

they're from original CDs, the bit that is missing is all FF bytes so just need to splice in the missing code

#

it is the reason we can't do germany

#

the german version is different to any CD that has been dumped

#

probably can be made to work with some effort (but that would be mad code wizard fuckery :P)

#

the code is missing because its all HLE'd in native x86, so the libraries don't get instruction-level simulated in master collection

#

just need to understand the differences between libraries and how they pertain to the rest of the game, and then modify one for germany

#

im assuming its things like constant materialisation (i.e. addresses that are wrong)

scarlet roost
#

Tried all of this, but the new bin doesn't boot on duckstation, it keeps either stuck on the bios screen or it asks me to add a ps1 disk

#

Maybe I'm doing the patch wrong?

pure radish
#

did you repack the CD image with the fixed executable?

#

need dumpsxiso/mkpsxiso

scarlet roost
#

The .exe inside the roms dir?

pure radish
#

yeah

#

this is a very manual process sorry lol

scarlet roost
#

Nope, gonna try it out. Sorry for the inconvenience

scarlet roost
pure radish
#

so those 700mb bin files are disk images, unpack those with dumpsxiso

#

then replace the SLESwhatever file with the exe that was generated

scarlet roost
#

I'm making a powershell script so it's one click and go

pure radish
#

then pack it back up with mkpsxiso

#

that should run

#

the original SLESwhatever will be all zeroed so they won't boot without all these steps

#

people made like xdelta patches for this but its a bit of a sledgehammer to crack a nut

#

that gets you a 1:1 accurate CD dump but with little regard for how it does it

#

plus this approach allows keeping some master collection patches like button prompts in theory

scarlet roost
pure radish
scarlet roost
#

Still can't make it work. You mean replace the exe with this exe inside this dir?

pure radish
#

oh yeah, some actually call it MGS1.EXE

#

yeah, the M2Patch.py script should've created .exe files in the roms dir

#

need to pick the right one of course

scarlet roost
#

This i gess

pure radish
#

yes

red cradle
#

it's so good to see this thread is thriving again

scarlet roost
red cradle
#

you even can use PPF Patch on MGS1 master collection

hearty dirge
#

Like the mc already has an emu, is it just because you prefer duckstation?

scarlet roost
hearty dirge
#

Makes sense

#

Although I could think of several easier ways to get mgs1

#

But nvm that lol

scarlet roost
#

Yeah, for example just downloading on the internet lol

#

Technically I already own the game so whaat gives

#

But having just an extractor is better

#

But overall the M2 emulator is pretty slow honestly

#

Fucking finally, Steam Input works

#

Had to completely remove steam using the revo uninstaller

pure radish
#

could be kinda fun to teach other emulators how to launch the master collection roms directly

#

dunno how extensible they are for stuff like that tho

#

then it would make sense to use it to store the roms

scarlet roost
#

Just need to fork it

pure radish
#

easily extensible i guess

#

carving it up and having something to maintain, upstream or rebase is probably not worth it

#

if its just some script that can be loaded into it, very different thing

scarlet roost
#

Maintaining it's a headache

woeful flare
#

i was just thinking "oh shit maybe i should do this with my copies" but i literally have MGS1 on disc from the essential collection, and already dumped to my PC too 😭

woeful flare
#

another patch day, and MGS1 is still safe

#

do they even plan on updating the game again...

glad frost
#

I wish

#

I literally emailed Konami asking them to address in their next Hotline if they were planning to tackle the resolution

#

honestly kind of preventing me from playing the entire series as I'm pedantic enough to want to play them in order

pure radish
#

GTA definitive got a huge patch after years of nothing

timid hemlock
glad frost
#

i somehow feel like it's a fundamentally more difficult problem to upscale MGS 1 though

timid hemlock
#

Yes and no. If they can mange to make their emulator work as well as other psx emus, we'll be good I think. But that may not be easy, as you say.

pure radish
#

it's not intractable to do what other emus can do (and likely a little better than that if it only has to work for one specific game)

#

it's a few man-months though

#

tbh i won't give up hope until vol2 releases

#

though remastering it would be... ambitious to say the least

humble ravine
#

Needs the Night Dive Studio touch

timid hemlock
#

Something just happened. I think they may have moved it to a private branch

red cradle
#

oooh?

glad frost
#

my poor heart, it can't take it 😅

#

I want to believe...

#

would it not just be the 'community items' thing at the top?

pure radish
#

nah it's the one underneath that

#

doubt the thing at the top is related to it

#

the branches are about the installed game files

rancid hare
#

Well it was fun watching them while it lasted I guess

#

(steam just added that private branches feature a few weeks ago iirc.)

glad frost
#

rip

pure radish
#

it's for the best really

#

the activity it previously reported was like

#

50/50 something is happening soon or it isn't

#

which is as good as coin toss

#

would prefer clearer communication though but there's language issues so what ya gonna do

pure radish
#

visual studio update broke the m2fix compile in a really strange place

#

"The latest MSVC is significantly stricter about standards compliance than previous versions"

#

aha, fixed it

#

doesnt really help that intellisense and the toolchain are using different C++ frontends tbh

timid hemlock
pure radish
#

yeah i mean you're not seeing their entire workflow lol

#

there can be no activity there and they're working on a huge update, or there can appear to be a lot of activity there but in reality they're not doing much

pure radish
#

cool, that works

#

now i don't have to stare at text files

pure radish
#

oh

#

they added this at some point

#

// SteamDeckチェック
function _is_steam_deck() {
if ("isRunningOnSteamDeck" in SystemEtc) {
return SystemEtc.isRunningOnSteamDeck();
}
return false;
}

#

so m2fix could detect steam deck this way

#

not sure why would want to do that but neat

#

wonder what the native side of that actually does

#

oh, it's an actual SteamAPI call

pure radish
#

// NXでのCPUブーストモードを使用するか否か
if ("setEnableCpuBoostMode" in ::g_emu_task) {
local title_prof = ::get_current_title_prof();
local version_info = title_prof.m2epi.version[regionTag];
if ("use_cpu_boost_mode" in version_info) {
::g_emu_task.setEnableCpuBoostMode(version_info["use_cpu_boost_mode"]);
}
}

#

they added CPU boosting on Switch as well

#

(first time really diffing between game versions properly)

timid hemlock
#

Thats pretty neat. I'm guessing it's hardware cpu, and not some emu overclocking thing?

pure radish
#

yeah its a switch OS / hardware feature

#

which is getting plumbed up to squirrel so they can enable it from the scripts

#

looks like the individual titles have to request it though

#

i.e. its on a per-game basis, so e.g. integral could ask for it but another version might not

#

i didnt know performance on switch was so marginal for MGS1, I had a friend who played it at release and didn't complain

#

but this definitely arrived in a post-release update

pure radish
#

lol

#

wrote a script i can plug into visual studio that automatically copies each build to every game

#

how long have i been manually copying files around xD

#

i also have a nicer way to attach a debugger now

#

ctrl+c on the console window triggers a breakpoint

#

(the console is optional and enabled with an ini setting)

#

maybe I should add some commands u can type

rancid hare
pure radish
#

symlinks on windows aren't great tbh

#

my thing takes this file

pure radish
#

oh my god

#

i think i got that replacement config hook needed for castlevania on epic working

#

but how the fuck do i tidy this code up

pure radish
#

my god

#

this has no right to work but it does xD

#

just have the borderless patch to do now for the epic version

pure radish
#

huh

#

just discovered what looks like dev tools built into the game

#

it can create another window called "edit"

#

associated with MEditDialogTask

#

should try and stimulate that l8r

pure radish
#

cool, got borderless working

#

so all fully ported to epic now at last

pure radish
#

so if you start up without epic launcher open you get this

#

can we bypass it

#

just crashes if you force g_win_is_epic to false

pure radish
#

wonder if we can port the xinput stuff across

pure radish
cerulean coral
timid hemlock
#

Yes, I was thinking more in line of virtual overclocking, like in Duckstation, where virtually overclocking the psx cpu by around 130% enables you to have more stable framerates. But it's definitely not that, like you say.

pure radish
#

wonder if I can put an automated test suite together for M2Fix

#

its a lot of manual testing with 10 games now

scarlet roost
#

I would love to have cpu overclock mode

#

The M2 emulator is so fucking horrible

#

I hope we could replace the M2 emulation part with another emulator and literally forgot all these problems

pure radish
#

the M2 emulator is more advanced in some sense than other emulators tbh so its not fair to say its "fucking horrible"

#

most of the game is ahead-of-time converted to x86 which is even better than JIT in theory

#

it doesn't have a lot of the graphics bells and whistles for sure

#

there's already some functionality for overclocking the "virtual CPU" IIRC, but that thing above pertains to a Switch-specific OS feature which adjusts the hardware power mode

cerulean coral
# timid hemlock Yes, I was thinking more in line of virtual overclocking, like in Duckstation, w...

but of course they can't use overclocking all the time... this is just to prioritize loading logic content fast at the beginning of the emulation, then the second time it will stop using overclocking. Emulators are using some precompiled logic to fix many bugs or crashes, avoiding using overclocking. It's like a hot replacement where if it takes too long to load a scene causing a stutter, the emulator anticipates loading precompiled logic, without overclocking, for a perfect loading. I'm not sure if it's associated with JIT or elf.

#

Dolphin Cached Interpreter 2.0 is good

pure radish
#

that gif is surely more appropriate for a JIT

#

insane that there isn't really a good Win32 API wrapper for C++

scarlet roost
#

I mean, I have no idea how a PS1 emulator works, but at the end M2 emulator has somehow worse performance and audio cracking than other options.

pure radish
#

the audio crackling seems like a bug on some systems because only some people report it

#

it runs flawlessly for me and even the switch seems fine ¯_(ツ)_/¯

scarlet roost
#

Hopefuly they will update it, because I have this problem and it's annoying

#

I'm gonna report then

pure radish
#

I didn't really bother to debug that further tbh 😛

rancid hare
scarlet roost
#

You would think I'm mad trying to play on this laptop, but the processor and GPU meets the recommended requirements, and I could play perfectly other games

hearty dirge
#

hmm like you mentioned if you're having issues with mgs1, might as well play it on a frendlier emu

scarlet roost
#

Emulating the PS1 is not a problem though

hearty dirge
#

would probably run better

scarlet roost
hearty dirge
#

ah i see

scarlet roost
#

Also 16GB RAM, using SSD

#

MGS2 works flawlessly on the laptop for example

pure radish
surreal dawn
scarlet roost
#

However, I would not like to keep the pc running compiling shaders for a ps3 game

#

Unless there's any other way arround

cerulean coral
#

Merry crisis

dawn flare
#

Hey Nuggs, any plans to expand the scope (lol, suffering) to the other M2 Castlevania Collections, Advance & Dominus?

Edit: Not expecting, just curious 🙂

pure radish
#

yeah that work is mostly done, just hasn't been released yet coz I want to get some more things in

dawn flare
bitter halo
#

Hello Nuggs, here a big fan of your modding work. Happy new year 🙂

Little question: for your MGS1 mod, is there any way to use something similar to "geometry correction" that is on duckstation? if no, where I can request this (if this is possible).

Thank you and nice day!

rancid hare
bitter halo
#

@rancid hareOh!, thank you!, nice to know 🙂

scarlet harbor
#

Hey @pure radish! Been a heck of a while! Did you ever figure out how to get rid of the letterboxing for 16:10?

glad frost
#

IIRC the main stumbling block was that it was all fucked up during cutscenes

#

a shame, we came so close

pure radish
#

ayo we're still that close

#

havent gone backwards

glad frost
#

i dont know if i can cling onto hope, i might prefer to live in denial 😆

woeful flare
#

denial is a river in egypt

pure radish
rancid hare
#

https://retrocomputing.stackexchange.com/questions/23750/what-is-the-tpg-file-format-used-in-the-playstation-release-of-zork-i
@pure radish Not sure if it's any help, but found a little writeup + tooling for the PS1's vram

pure radish
#

just renamed a template parameter in the entire codebase from when I started templating squirrel

#

xD not fun

#

I started using <T> without realising that might be a bad idea for other uses of T

#

since T is very common

#

needed to do like 100 find and replace operations

#

somehow, it still builds, which means it must be correct because there's no way this would build by accident

#

so now it's always "Squirk Q"

dawn flare
#

How goes? What's the focus these days?

pure radish
#

battling stupid bullshit xD

#

trying to really sort out technical debt

#

im most of the way there but perfectionism kicked in and i hit a couple hard problems im still working through

#

this has turned into like an entire rewrite of the whole thing so

dawn flare
#

Oh god

#

Good luck friend

cerulean coral
#

Hi, I was wondering if it is possible to load new instructions or hook games on Nintendo Switch like you do on Windows. At least this would help me know if it is possible to port mgsfix to arm-arch

pure radish
#

yea it is

#

fundamentally

#

the method of hacking the system to load custom code will obviously be different

#

ideally you want something like the game loading an extra NSO/NRO very early in startup

#

i'd look at how other games have custom code loaded on switch for inspiration

cerulean coral
#

On Nintendo Switch I only see these elf which is the executable in the exefs folder, but I don't see a way to inject any dll or function to load the additional nro/elf. I remember once noticing that the main nro tries to load a config file into romfs but this would cause the system to crash.

#

Ok, ok. I've noticed that some people create cheat code based on asm and some hook, but I could never get access to their python code that converted their plain code into cheatcode.

pure radish
#

if you can load "cheat codes" the problem is tooling, not the fundamentals

#

it's really about getting a nice execution environment within the process

cerulean coral
#

I want to focus on Unity Engine mods. There are few or no ModLoaders, like MelonLoader, I don't know how it will modify the apk but it works on ARM64 (specifically arm64-v8a) I hope this will help me understand how to modify and compile native code to arm. There is one achievement I want to achieve and that is to run hidden scenes in games that use this engine on Nintendo Switch. From there I will see if it can be expanded to Mgsfix mods for arm-nro

#

I recently moved from modifying memory to modifying runtime code for a game on Windows PC and it's been a challenging process but it gives more flexibility when modifying. I want to do it with this console as well.

pure radish
#

can you emulate it?

#

probably quicker to get going

rancid hare
pure radish
#

incheresting

#

I like all the filenames being in all caps

#

it's a choice

#

they hadn't invented lowercase back then

pure radish
#

that last link might be extremely useful, supports PGXP so I assume it's an upscaling renderer

#

and it's D3D11 and so is MGS1

#

and it's very readable/accessible code, very dense with information

#

with a bit of luck it might tell us exactly what we have to do (I think we know, but having such a good example/reference should give the complete picture)

#

open source emulators are really hard to follow with this stuff

#

this looks much more tight

pure radish
#

it's tempting to say "just replace the entire renderer" but that feels cheap and also I don't think it actually saves any time/effort

#

basically the same work is involved in fixing this one or replacing it

#

so I guess the primary reasons might not be ideological in terms of keeping as much of the original product as possible, but it is nice to keep it 🙂

#

though we already replaced the GTE I guess

#

but the GTE is tiny, really, any old implementation will suffice

#

that above link is really handy in showing the D3D11 API usage & shaders without ludicrous abstraction

cerulean coral
#

I still think that C++ is not as universal as .net (you can recover the code if it is not obfuscated) and it is difficult to find .net emulators, only parts of the core, but not a complete emulator. With the exception of Ryujinx (discontinued Switch emulator), it uses .Net and it is wonderful. On Psx I managed to use a .net emulator in development and run it in Unity with some changes and with that it becomes multiplatform.

#

libValkyrie I think was used in the Driver 2 port (or KAIN2 I think) and I find it more readable and easier to use (if I knew C++ perfectly)

pure radish
#

Driver 2 used Psy-Cross

#

also it's easy to be universal when your only target is a virtual machine

cerulean coral
#

They are even using rust to create sdk 😪

#

I'm still surprised that WebGL is so universal haha ​​it runs on any architecture that has a browser

glad frost
#

Anyone got some copium for me about the chances of Konami upscaling MGS1?

#

I remember people saying the steamdb package was being updated not long ago

#

a man can dream....

rancid hare
glad frost
#

😦

pure radish
#

I've given up waiting, should prob just get on with it ourselves now

#

I'd wait way longer if they hadn't gone quiet

indigo quartz
#

I'm just still hoping for audio fixes

pure radish
#

need a way to reproduce those

#

either I'm deaf or I don't have them

#

there must be something about each system idk

rancid hare
# pure radish need a way to reproduce those

Got an example here. Not home ATM so I don't have my notes, but iirc the chaff grenade (and possibly other sfx) is missing a reverb effect, and then at 40 seconds - the armory BGM is using an incorrect synth instrument
https://youtu.be/DI2d9XWMKic?si=AIE1DFznrhsYLDFi

'Metal Gear Solid: Master Collection Vol.1' is slowly being patched into an acceptable state, but there's still some issues. Most notably, the audio reverb settings are inaccurate to the original. I made this video in the hopes of brining these issues to Konami's attention so that they will be addressed in a future patch.

I also made recommenda...

▶ Play video
glad frost
#

and i'm starting to think that cryptic patch note they had for MGS1 is actually meant to mean "MGS1 wont get any more major patches"

#

The latest version will remain Ver.1.5.0. Note that this is not a patch for Ver.2.0.0.

timid hemlock
#

Too bad if that's the case. Wish they'd at least fix the audio issues. Guess it's up to modders then. And the decomp project, when a pc port is ready in god knows how many years.

pure radish
#

prob switched over to vol2 now

timid hemlock
#

Man I hope they do a good job with MGS4. I've never played that game, been holding out for over 20 damn years lol 😅 hopefully they'll base it on the cancelled xbox port, and the pc port will be smooth

dawn flare
#

Honestly, even if they do a bad job, at least the data will be available for modders to fix it up

dawn flare
pure radish
#

yep, not mad at all

dawn flare
#

My body is ready for more

pure radish
#

just be nice if their intentions were clearer, but can't have everything

dawn flare
#

btw, I picked up the Castlevania collections on PC specifically because you mentioned you were working on them 😛

dawn flare
glad frost
#

Yeah it's definitely a hard one to pass, the two sentences almost contradict each other depending on how you read them

#

But again, isn't it just copium for us to think it's likely they're working an mgs1 resolution bump? I mean they've given no indication that was part of the plan. As much as we'd like it

dawn flare
#

Yeah. I think if it was "easy" we'd have gotten it. I'm totally happy with a close-to-actual-PS1 release.

rancid hare
#

@pure radish Er, would you happen to still have the installer for the version of intel c++ compiler you used for m2fix? intel apparently removed it completely from their website a year and a half ago & M2fix doesn't build on the 2025 version :x

pure radish
#

maybe

#

but I'm away from home atm so can't check

#

but

#

locally I have it ported off the Intel compiler

#

will check when I'm back soon

#

decent chance I have it

rancid hare
pure radish
#

I'm sure it will work

pure radish
pure radish
#

not sure it's really relevant though anymore 😛

#

I need to get the rework finished & pushed

#

it's a classic case of the first 99% of the work was easy and getting the last 1% is painful

#

how tf is that just 13mb

#

surely its just a downloader

pure radish
dawn flare
pure radish
#

lol

#

i've been doing this manually, probably should start using this

#

might regenerate all my signatures to see if they're any better

#

i do: copy bytes, replace anything that looks like an offset/immediate with ??, and search for it until there are no duplicates

#

im super old school

scenic kelp
pure radish
#

oh boy sourcemod

#

that's where i started programming

scenic kelp
#

Heh, high five then

#

Most of my projects revolve around sourcemod or the source engine in general

pure radish
#

before that i was doing html/php xD

#

i have a corpus of scripts/extensions that are basically my first real attempt at programming

#

fun to look back at

scenic kelp
#

I learnt reverse engineering and most of my coding knowledge by making plugins for TF2 servers

pure radish
#

lol

#

very similar

#

then i moved into AOSP

#

this is like 2011-2014

scenic kelp
#

I just moved to projects revolving source engine games ( not the games themselves ) in Rust lol

scenic kelp
pure radish
#

don't worry, you too in 10 years can be a greybeard

#

one of the plugins i wrote let you play as the l4d1 survivors in l4d2 the passing

#

good times

scenic kelp
#

My back already aches. Does it count? 👴

pure radish
#

im 30 this year and i have no back pain, must have evolved a titanium spine

scenic kelp
#

Flexing, are we

pure radish
#

i don't know how, i've treated myself like absolute shit

#

the body hardware is all good, the brain hardware is a bit lackluster

scenic kelp
#

I just like to write something and visually see what it does I guess

pure radish
#

the sourcemod guys (like the core team) are crazy smart

#

huge respekt

scenic kelp
#

Oh a b s o l u t e l y. Genuinely speechless

#

The main one, dvander ( bailopan ), has a crazy resume too

pure radish
#

yep

scenic kelp
#

He's worked at mozilla too. I think he still does

#

He's recently come back from his slumber ( I think it was probably absent because he had a child ) and he's been rewriting huge parts of Sourcepawn

pure radish
#

I've been watching 😄

#

very interesting stuff

glad frost
#

On that note - as you probably heard - TF2 was today released into open source

#

or something like that

#

officially, too, not some weird hack

scenic kelp
#

Yes. The SDK now contains TF2 too

red cradle
pure radish
#

hype

cerulean coral
#

Hi, how is it going with the mgs port?

#

I'm curious if you are familiar with the error "SEHException (0x80004005): External component has thrown an exception" caused by IL2CPP Interop from .net

pure radish
hearty dirge
#

Mgs one day 🙏

glad frost
#

damn

#

i checked in here, saw Nuggs posting a github link right after someone asked how the widescreen fix was coming, and almost blew my load

#

and then.... sadness.....

rancid hare
pure radish
#

all this effort to preserve a bad game

meager ice
#

Do it for MGS4 man

red cradle
#

MGS4 isn't on Xbox, so can't recomp with this lol

meager ice
#

I don’t need Xbox recompilation tools…I need a team..

cerulean coral
#

That one was missing opcode for commercial games

pure radish
cerulean coral
#

I would like to modify a mips instruction for psx, but it has an if and goto

glad frost
#

Nuggs shoutout detected

pure radish
#

isn't that a Lyall shoutout detected? 😛

glad frost
#

oh

#

lmao

#

The first port of call is the MGSHDFix mod - by author, Afevis

pure radish
#

games journos are terrible at covering mods

#

i mean, fair play to them for trying though

glad frost
#

Need a trump soundboard for "SAD!"

pure radish
#

though by covering them they increase DMCA risk

#

swings and roundabouts

glad frost
#

Going back to M2's port of the original 1998 Metal Gear Solid, this currently sits on patch 1.5. It remains a PS1 emulation effort, running at the original 240p resolution and 30fps target - or 25 on the PAL releases

#

😦

#

Full 360 degree analogue movement is reinstated, allowing for finer control of Snake's run through Shadow Moses, albeit with a noticeable hint of input lag.

#

😦

pure radish
#

s'all good bro

#

it'll get fixed (at some stage)

rancid hare
#

I feel really bad about stealing Lyall's thunder on that, the Nexus page they showed literally says "Creator: Lyall" right in the video lol

glad frost
#

haha

#

you're like the polar opposite of whoever that guy was

#

the one that took someone else's mod and threw on a reshade filter then started promoting it here as his 'Full HD rework fix' mod or whatever it was 😄

cerulean coral
#

Add multiplayer

pure radish
cerulean coral
#

you have to look for the entity spawn system

pure radish
#

you have to look for the git commit && git push

#

spent today training to become an IRL racing marshal boys

cerulean coral
#

I spent the last week adding a vehicle coloring system for cars in Vigilante 8, from a Playstation game, because it doesn't have them.

pure radish
#

i vaguely remember this game

cerulean coral
#

I guess this is what it feels like to decompile games

pure radish
#

welcome to autism

cerulean coral
#

But there are more mysterious doors after solving a case

rancid hare
#

Hey nuggs, could I rack your brain for a sec when you get a moment?

I'm hooking into some functions to print to a debug log - a file name is passed to a3 as an int64, which I assume is a pointer? Would you happen to know a way to resolve it to either the aDProjectsNhtVo_10 value, or the actual filename it's pointing to? (I'm hooked into the Print_CodecHook function that it's calling, perhaps I'm just hooking too late?)

pure radish
#

Looks like it's some kind of assert/similar where the game's source file effectively embeds itself into any debug print. It's definitely a pointer (to the string containing the original source file name)

#

"aDProjectsNhtVo_10" is probably just what IDA has named one of those strings, fundamentally it's probably not of great significance

#

I would just dereference a3, essentially it will always point to a string containing the original source file name

#

(unless there's some weird cases where it's null etc)

#

these things tend to be macro-ized, most compilers provide some macro that provides the definition for a string that contains the original source file name

#

it's pretty common to have some debug print that compiles down to a source file name and line number

#

essentially you have like, assert(whatever, "bob", FILE, LINE) in some incarnation

#

so the compiler has to embed the string as specified by the engineer, the auto-generated file path, and the line number in the original source file

#

personally I'd just hook the fundamental print, at some point the rubber hits the road and you're looking at something like printf

#

that's what M2Fix does

#

whatever bullshit is done to format/produce a string, it reaches a point where it's submitted to some output device

#

for a "release" build that might be some sort of "stub" device, where the compiler wasn't clever enough to realise that there was no outcome of the debug code

#

if it was, the whole thing would've been eliminated

#

lmk if if ya want more info 🙂

glad frost
#

I can't wait any longer, think I'm gonna play MGS1, just trying to recall which setting it was that 'breaks' cutscenes?

; MGS1 only: Enables render resolution scaling
; What most people would call a "4K mod" or a resolution upscaler.
; Only height is needed - width is set intrinsically by the game.
; Leave the height at 0 if you wish to use the external resolution.
;
; Additionally, set Widescreen to 'true' to enable proper widescreen without horizontal stretching.
; (Note: the in-game settings must also be set to 'Widescreen' for this to take effect, and won't kick in until you exit the settings menu)
; 
Enabled = false
Height = 0
Widescreen = false```
#

it was the widescreen, wasn't it? can internal resolution upscale still be used or is that part of the same thing?

#

it's been a while

rancid hare
glad frost
#

And IIRC, the 'proper' widescreen fix also can't be enabled unless the internal resolution is upscaled as well? Which is what that code block^ suggests

#

In short, neither the widescreen nor the internal resolution upscaler work fully 'properly'?

pure radish
#

didnt you write that comment? 😛

#

i thought it worked without the upscaling

#

i don't see why it wouldn't

glad frost
pure radish
#

if it doesn't then that's me being daft rather than something more fundamental

glad frost
#

(also i never actually played it lol)

#

sweet, I'll give it a shot later

pure radish
#

anyway yeah just play it bro lol, no point waiting, i complete the game at least once a year

#

each year im sure rex gets harder

glad frost
#

Yeah it's definitely time

#

you know it's time when literally every day you're thinking about metal gear 😄

glad frost
#

limited testing, but yeah it seems like the widescreen (without upscaling) 'works' albeit it's stretched (things are fatter horizontally)

#

unless I'm mistaken with how I set it up

#

but that's all G

twilit junco
#

just out of curiosity how come the gog version upscales graphics fine but the mgsm2 mod has problems with cutscenes and water

hearty dirge
#

Well for one the gog version is a native pc port while this is an emulator packed version

red cradle
#

regarding to MGS1, some people choose gog (aka the old pc port) to play. While mods can fix some issues, it lacks key features that made the game special, like the Psycho Mantis fight. They changed the P2 controller gimmick and scrapped the whole reading memory card & controller vibration part. So it's really hit or miss

hoary pier
#

PC port also looks too smooth imo

#

The way graphics look on PS1 is how MGS1 looks to me

cerulean coral
#

Poooooooooooooooort

pure radish
cerulean coral
#

Spiderpan

warm rune
#

Is there a way to use MGSM2Fix to increase internal resolution and keep the CRT filter provided by the game?

So far, I've noticed that if I change the internal resolution, the filter goes away (on top of the bug when underwater)

rancid hare
warm rune
#

There's no way to do it with the filter built in the game?

pure radish
#

the built in filters are very crude, not surprised they break with native internal resolution

red cradle
#

https://youtu.be/nc_BOKSqJDk?t=1119 MGSM2Fix mentioned, although uploader linked the wrong mod in the description lol

woeful flare
#

i think it's fixed now

autumn raft
#

yea it's fixed

red cradle
pure radish
#

we know about that one I think

#

probably same issue as the cutscenes

pure radish
#

pretty sure it is, I investigated it once and it was doing the same framebuffer pixel sampling thing in the shader

#

which ends up not being scaled correctly so it selects the wrong pixel

bitter halo
#

@pure radish hello friend! Do you have any plan to update your mod with the geometry / texture pop up fix? (Big fan of your work) Thanks!

rancid hare
# pure radish i think the way to go is just to rebuild the shaders

Oh you know what, it may be worth poking @crude zinc over here to see if they have any ideas on how to help out, they wrote a shader for MGSHDFix to fix all the line scaling issues 2 & 3 had.

Brief rundown of the issue - MGSM2Fix adds internal resolution options to MGS1, but some of the framebuffer effects (notably font overlays & water distortion) don't get scaled up properly
https://github.com/nuggslet/MGSM2Fix/issues/15

https://github.com/nuggslet/MGSM2Fix/issues/23

GitHub

A fix that adds custom resolutions, analog input, pixel perfect scaling and more to the original Metal Gear Solid within the Master Collection. - nuggslet/MGSM2Fix

GitHub

(Missing area info) (Missing numbers/PTT/Vox indicator) (The dropdown memory area is working correctly) My ingame settings: MGSM2Fix.log MGSM2Fix.log DxDiag.txt How it should look:

GitHub

Hi, i don't know if it's the same bug reported about Snake not visible when under water but in my case with the internal resolution on all cutscenes are like super zoomed and you can only s...

crude zinc
#

That doesnt sound entirely straightforwardly shader related, that sounds like a draw call issue or framebuffer size or aspect mismatch issue in some form, but I actually have no idea from just that summary

Im really not an authority on the subject (but if I can for some reason help I dont mind)

pure radish
#

the shaders have hardcoded framebuffer offsets

#

which is obv for two 320x256 FBs

#

and that's how they're arranged in the VRAM

#

it's controlled by that tex_type thing, all the scenes that break have tex_type == 1

#

i have no idea what im looking at but it seems like they abandoned the hardware renderer for some scenes

#

and that just samples the VRAM

#

so with the current behaviour it selects the wrong pixel data, and it seems that even if the framebuffer and software rendering was adjusted it would still need the shader changed

#

but i am not a graphics person by trade haha

#

maybe the whole renderer needs swapped

#

i doubt whatever it's doing to create that 320x256 framebuffer is going to scale well to native res

#

(performance-wise)

#

any insight would be helpful (this doesn't really look like what I see other emulators doing but I may be failing to recognise some pattern)

#

i think at one point i tried overriding that tex_type thing to use the "working" type, and it just makes a total mess of those scenes haha

#

missing lots of effects

crude zinc
#

I might just be stupid but Im not getting how this is relevant - it LOOKS relevant, but the actual factor here is the uv coordinates per vertex for presumably the screen corners being given in (in vec3 f_TexCoord), so Id think it should only matter if you've messed with the uvs.
f_TexCoord isnt like a pixel-tied thing or in other words something that has real awareness of its own ratio/proportions/positioning, its just a vec2 thatd be in the range of (0,0) to (1,1)

pure radish
#

so we're saying rather than there being 2 things to do here there is just one (and its not in the shader)

#

well i am looking forward to finding out how their code scales with a larger framebuffer

#

i think i even tried that once and wasn't very impressed

#

well that saves me a whole bunch of work that would've achieved nothing, nice

#

i kinda assumed this needed adjusting before the PSX framebuffer stuff was even worth doing

#

i know nothing about graphics its a great shame of mine because i can do a lot hacking games right up until it hits graphics stuff 😛

#

i feel almost too old to pick it up

crude zinc
#

In this shader it just looks like it refuses to do blending if the input texture coord is over (0.625, 0.25), which is insane stupid logic that I dont understand the point of. But my point is that no matter the box size this shader runs on, if the uvs were unchanged, that effective portion of the box would just squash and stretch to match the ratio of the box
It would look like this assuming Im not making a horrendous mistake

pure radish
#

super useful

#

if it's over (0.625, 0.25), presumably its texture memory?

#

sounds like how I remember MGS1 VRAM

#

you've got two framebuffers adjacent in top left and the rest is textures

crude zinc
#

That sounds like a valid explanation yeah

pure radish
#

well that was probably very obvious (but not to me :P)

crude zinc
#

not really, Im probably about as confused as you here, just about different aspects

pure radish
#

probably the most useful info i've received during all 18 months or whatever of the project

crude zinc
#

oh, actually, I was being stupid, its more likely like this given the whole vram packing concept

I have no idea what happens if you change the resolution of what is presumably actually one framebuffer packed into a texture in the red region on the right. it seems like it'd just leak out and overwrite other parts of the image. And if it somehow didnt, and you somehow changed the aspect ratio without changing the uvs, then even at best that region is now inaccurate.
So if thats what you're doing, youd want to modify the incoming, presumably kind of hardcoded uvs to match the framebuffer region. But youd maybe also need to remove or adjust the hardcoded region clamping in the shader? ..? ??? ? ?? ? ? ?

I might also still be misunderstanding something here, I dont know, but thats my input for now

pure radish
#

i think i have observed stuff leaking out and overwriting other stuff in renderdoc in some experiment

#

also lol at the retarded comment about donations, not dignifying that with a response

#

agree with the recommendation to buy gog integral! buy all the versions they are all different in some way

#

i mean it seems like the PSX VRAM needs to grow, and then the texture memory + framebuffers repositioned (?) that seems to be a requirement

#

how are normal emulators handling that generically?

#

i guess it works fine if aspect ratio is the same

#

hmm well things to try anyway

cerulean coral
#

🫡

crude zinc
#

I would imagine emulators can just detect if a framebuffer is infact a framebuffer and not a random texture tile in vram and redirect texture reads/writes to a more flexible dedicated buffer or something (its all fixed function stuff so Id imagine very easy to detect and deal with)

#

That also kind of assumes that emulators often even treat texture collections as literal raw texture atlases like that

#

Honestly though Im not sure why you'd even go to this extent for this game in particular, it seems like the obvious easy choice is to just inject duckstation in or something

pure radish
#

to have the steam version be nice

#

im uhhh a heavy steam user

#

also all the game versions are in one place

#

it's a nice frontend framework as well, which we understand very well now

#

we thought about using it to drive gog or a ported decomp at some stage

#

also it's just become my pet project haha

#

how neat the squirrel hooking turned out has me hooked

#

and it's nice if all the master collection stuff has mods

pure radish
#

also tbh the mod extends beyond MGS1, it targets any m2engage title but this "upscaling" stuff is for just the PSX backend

pure radish
#

i'll give some things a go this weekend (might need to do some hopefully quick mod housekeeping first tho)

#

not sure what state i left it in

#

some problem i was struggling to solve for maximum game portability coz it's really stretching C++ (at least, my ability within it) so maybe MGS1 won't even work lol idk need to see

#

that stuff got deep into advanced template fuckery

pure radish
#

mh maybe i found why the above didnt work lol

pure radish
#

loool

#

i've broken all the steam 32bit games basically

#

thankfully its obvious

#

i had to add some new stuff to the interop string class for the config hook for the epic release (which uses an entirely new hook anyways) but that has retroactively applied itself to the steam stuff as well

#

so its trying to delete a string with the wrong allocator

#

coz this string is passed by value in this case

#

i wonder if its worth adopting the epic-style hook, if its possible on steam

#

but for now ill just kludge it

#

phew, glad it wasnt anything more fundamental

#

hahahahahaha

#

"only delete the string on epic" sure is a riot

#

now we're cooking with gas

pure radish
#

where does that "MGS1_JP_JAPAN.log" string come from

#

weird

#

never seen it before

#

oh, you cant see it

#

oh

#

::g_emu_task.setLogFilename( format("%s_%s.log", dev_name, regionTag) );

#

well that answers that

#

i never got that log to do anything so i just substituted it with my own lol

pure radish
#

would be nice if i could get this to launch the games

#

guess i could. nothing stopping me kek

pure radish
#

tryna fix something else (still housekeeping)... did i ever fucking test this function

#

ah shit. probably not

#

i was probably too excited to have it compile

pure radish
#

[S_API WARN] GetAchievement() failed, achievement MEDAL_TROPHY_MASTER does not exist - needs to be first configured on the Steamworks site

#

i do wonder what that was

#

achievement for getting all the achievements? bit pointless

rancid hare
#

Must be a canned achievement, PS5 doesn't have it either

pure radish
#

well at least the mod works again and I understand this separate issue

#

good start ig

pure radish
#

oh my fucking god

#

I had

#

data->event_type = SQHelper<Q>::GetObject(2).Cast<char>();

#

apparently sqrat can't cope with a cast to char, so that set the error flag, which broke a downstream cast, because the error flag wasn't cleared

#

so that needs to be

#

data->event_type = SQHelper<Q>::GetObject(2).Cast<int>();

#

even though data->event_type is char

#

that is extremely daft

#

like I get that char doesn't exist in Squirrel but, still, just treat it like int

#

that needs a comment

#

i may try to fix it myself

#

being able to attach the VS debugger like this is vital haha

#

how would i have fixed this without getting this set up

#

M2: Loaded ROM image: roms/mgs_jp_disc1-20230407.lz4a.
M2: Mounted CD-ROM image: roms/mgs-disc1-ripped-washed.bin.

#

good, that's working again

#

locally this works completely different to how it did before

#

it used to be some script hook but now the mod directly asks for the info

#

im excited to work on this again, motivation is back heh

pure radish
#

yeah imma try and get the VS play button to launch the games

#

investing in workflow stuff has made everything far more tolerable

#

oh that works huh

pure radish
#

aha, solved the insanely complicated multi-game support stuff

#

apparently i just needed a break lol

#

the amount of pain ive solved in one day

#

need to check the 64bit titles but i think i have an approach that should work for everything

#

only dominus is broken! with an extremely strange reason

#

[2025-05-11 15:21:53.883] [MGSM2Fix] [info] MGSM2Fix v3.0-eng started for Castlevania Dominus.
[2025-05-11 15:21:53.883] [MGSM2Fix] [info] ----------
[2025-05-11 15:21:53.993] [MGSM2Fix] [info] M2-64: sq_vm_realloc pattern scan failed.

#

easy fix

#

so epic castlevania working, every other steam game working

#

just dominus to fix

#

cool, dominus fixed

#

great place to be

#

we're ready to start looking at this upscaling stuff again

#

can't believe everything works

red cradle
#

so it really is everything works

pure radish
#

yep, at last

#

stable on every game and store

#

great base to build from now

#

gonna get it all checked into git so i have a good checkpoint lol

red cradle
#

nice, we can look into the problems deeper now

pure radish
#

its all MGS upscaling stuff for now I think

red cradle
#

#modding-general message I also hope that this modder's mod from last year also get a fix

#

iirc it's about the model swap stuff, modder can't make it into MC version mod

pure radish
#

iirc that looked like some of konami's stuff fiddled with snake rendering because even bypassing my crude modding system it still didn't work

#

maybe we can figure it out but one thing at a time

red cradle
#

ye

pure radish
#

so much more exciting to work on when there isn't a load of broken crap lol

#

i knew i was almost there before

red cradle
#

yeah fortunately you had that break

pure radish
#

it wouldn't have taken one day back then

#

it was necessary

#

i woulda still been trying to sort this shit haha

pure radish
#

i know these are famous last words but we genuinely have a lot of techniques here now that should apply if future new games break us

#

anyway for context anyone who lost track or is new: this is basically the completion of a massive rewrite of the entire project that started some time back to make it more robust and less terrifying to work on

#

now it actually makes sense 😄

#

i don't think we ever had all of the "supported" games all working flawlessly at the same time

#

so that is new

#

this stuff is key to the multi-game support, worked out in the end

#

the pain i went through to templatize the whole thing error

#

it was getting to the point where it was way too fiddly for me to work on it, but now i can understand my own project again

#

core stuff was: changing all the hooking so no asm stubs, fixing the allocator, this std::conditional_t stuff, and using sqrat to clean up the squirrel interactions so the code can actually be followed

#

none of the games even crash when you close em now (other than the one that's konami's fault and crashes without the mod), a sign that everything is kosher

#

that one might just be something to do with my machine tbh, it crashes in some nvidia driver crap

#

it's castlevania advance if anyone wants to try and repro ;o

#

if you have some sorta postmortem debugger it should trap it

pure radish
#

[2025-05-11 16:54:54.744] [MGSM2Fix] [info] Detected game: Metal Gear Solid (Steam app 2131630).
[2025-05-11 16:52:56.544] [MGSM2Fix] [info] Detected game: Castlevania Anniversary (Epic Games).

#

hehe, thats nice

pure radish
#

out for a bit, I'll get this in git later before I break it again

dawn flare
pure radish
#

i am back

pure radish
#

cool, its in git

#

now we can do things with it

#

312 files changed, 117982 insertions(+), 11096 deletions(-)

#

😬

dawn flare
#

Oh that's all

dawn flare
# pure radish i am back

Castlevania Anniversary Coll., does platform matter, and what's the process to reproduce the bug?

pure radish
#

the process will be "close the game"

#

it crashes on exit

#

even with no mod

pure radish
#

you'll need some kind of way of observing the crash like a postmortem debugger

#

for most people they won't notice the difference, but it does indeed crash (at least on my machine)

pure radish
#

there's no trick

#

it just always crashes when u close it

dawn flare
#

Huh, weird. Okay, I'll take a look tmr

pure radish
#

might require an NVIDIA GPU, when I looked into it once it faulted in some driver module, but who knows really

#

maybe an equivalent thing can happen with other GPUs

#

anyway it won't bother most people and I guess maybe even Konami didn't notice it

pure radish
#

months ago I assumed it was the mod until I deleted it and it still happened

#

but yeah it's just that one game, the rest are fine

dawn flare
pure radish
#

lol, committed

dawn flare
#

Eh, I was gonna get it eventually anyway, and $13CAD ain't bad.

pure radish
#

WinDbg can do it

#
#

(on top of being good to have)

dawn flare
#

Ah, perf. I didn't want to have to fuck around with VS

pure radish
#

it's somewhere in the settings to enable post-mortem debugging

dawn flare
#

I actually don't think I've got WinDBG installed on this Winstall yet.

pure radish
#

and if you leave it enabled you'll become horrified at how many things crash without you noticing normally

dawn flare
#

Woof

pure radish
#

eventually you'll get tired of that and turn it off

dawn flare
pure radish
#

thats the one

#

popping to the shop and then it might be time to revisit upscaling

dawn flare
#

This would be a lot easier if the game would work with my gamepad...

#

Uh, so no crashing?

pure radish
#

huh, it's my machine then

#

that doesn't surprise me

dawn flare
#

Yeah, no fault found here. Except that controller support is bugged

#

If you want I can up/downgrade my drivers as required

pure radish
#

it's been persistent, over many months, so I doubt it's something like that as I've gone thru updates

#

my upgrade from 10 to 11 was far from painless though

dawn flare
#

Ah, this is a full Win11 install

#

So could be something related to that

pure radish
#

I don't care all that much as long as its not a consequence of the mod and no one else sees it haha

dawn flare
#

If you want I can grab the mod and see if it crashes?

pure radish
#

sure, the current release might have issues I've fixed locally though, but I believe it should be fine

#

the local stuff is bulletproof

dawn flare
#

Okay, using 2.2, and I can just use the MGS1 version?

pure radish
#

yeah

dawn flare
#

Stock config?

#

No crash AFAIK

pure radish
#

shouldn't make a difference for this

dawn flare
#

Yeah, seems fine here

#

Unable to reproduce

pure radish
#

cool computer nuggs

dawn flare
#

Hey, on the plus side it means you don't need to fuck with it

pure radish
#

yeah i looked into it ages ago and was puzzled

#

then i deleted the mod and it still happened

#

lol

pure radish
#

so

#

i was fairly convinced we don't need to change shaders, but i don't think fucking with the PSX VRAM is right either

#

here we are again

dawn flare
#

Those textures look fine to me

#

Super normal

pure radish
#

oh i just figured out more of how to use renderdoc

#

this tool is so hard to use man

#

hidden buttons everywhere

dawn flare
#

I love Symphony of the Nightmanage

#

Wait, why is there a SOTN item in there?

pure radish
#

beats me

dawn flare
#

Silly question, but have we tried injecting other games into the M2-MGS1 emulator? Kinda wondering how much (if at all) SotN is supported

#

Be interesting to see how much work M2 would have to do to get SotN ported over

pure radish
#

requires either restoring the bits of the emulator that get stripped for releases, or a lot of work on each individual game

dawn flare
#

Ah, right, it gets pared down per game

#

nvm then!

#

I don't know why I didn't just buy CV Advance normally, then just refund it after testing... Oh well.

pure radish
#

say what?

dawn flare
#

lolol

#

Like I said, I was gonna buy it (again) eventually.

#

But next time I'll make sure I have coffee first 😛

pure radish
#

oh its so nice that i can build and restart debugging in VS and it copies the mod to the game and handles launching it and attaching the debugger for me

#

like a normal software project

dawn flare
#

Oh that does sound convenient

#

Glad you were able to get that foundation squared away

pure radish
#

instead of the manual copy paste shite i had to do before

rancid hare
pure radish
#

so i wrote a python script that consumes a file like this

#
# nuggs's Visual Studio install manifest for M2Fix.
# This obviously isn't immediately useful to anyone but serves as an example.
x64:
  - F:\Steam\steamapps\common\MGS Master Collection Bonus Content\MGSM2Fix.asi
  - I:\Steam\steamapps\common\Castlevania Dominus Collection\MGSM2Fix.asi
  - F:\Steam\steamapps\common\Ray’z Arcade Chronology\MGSM2Fix.asi
x86:
  - F:\Steam\steamapps\common\MGS1\MGSM2Fix.asi
  - I:\Steam\steamapps\common\Contra Anniversary Collection\MGSM2Fix.asi
  - I:\Steam\steamapps\common\Castlevania Advance Collection\MGSM2Fix.asi
  - I:\Steam\steamapps\common\Castlevania Anniversary Collection\MGSM2Fix.asi
  - F:\Steam\steamapps\common\Darius Cozmic Collection Arcade\MGSM2Fix.asi
  - F:\Steam\steamapps\common\G-Darius HD\MGSM2Fix.asi
  - E:\Epic Games\CastlevaniaAnniversaXJ2A3\MGSM2Fix.asi
#

it's just

#
#!/usr/bin/env python

'''M2Install.py: Installer utility for M2Fix.'''

import os
import yaml
import shutil

__author__ = 'nuggslet'
__license__ = 'MIT'

def main():
    import argparse
    parser = argparse.ArgumentParser('M2Install', description='Installer utility for M2Fix')

    parser.add_argument('file')
    parser.add_argument('arch')
    args = parser.parse_args()

    rules = os.path.join(os.path.dirname(__file__), 'M2Install.yml')
    rules = open(rules, 'r', encoding='utf-8')
    rules = yaml.load(rules, Loader=yaml.Loader)

    if args.arch not in rules: return
    for rule in rules[args.arch]:
        shutil.copy(args.file, rule)

if __name__ == "__main__":
    main()
#

(this stuff will be in git eventually)

#

then i set up a post-build action in VS that calls the script

#
    <PostBuildEvent>
      <Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
    </PostBuildEvent>
#

then in the project settings I have

#

you might also need to un-steamstub the game (dunno if the HD games use steamstub, probably)

#

and then create steam_appid.txt in the game root

#

with all of that it should all just work lovely

#

i didn't figure out multiple "debug targets" yet so I can just select the game from a list, so I have to change these paths if I need to debug another game

#

but for now, this is good enough for me

#

and just straight away you have breakpoints and stuff

#

and can call __debugbreak() to break programmatically etc

#

I also have a .ini option "Break" which calls __debugbreak() as soon as the mod can, in case you don't have this nice setup and need to attach to process rather than launch in a debugger

#

that lets you set up further breakpoints in the debugger etc

#

but yeah I just build and press play, restart button even works

#

stop will terminate my debug session and kill the game for me

#

really really tidy

#

the python / yaml stuff might be a bit overkill for HDFix

#

but i have way too many fucking games here to keep updated

#

and the architecture difference

#

its nice knowing i just build and the correct architecture build is synchronised with every game automatically lol

#

it feels self-indulgent to spend time on workflow stuff but damn its SO much nicer and tests my patience less

#

this is just normal software development now

#

no more wanting to pull my fingernails out

#

some day i will have an automated regression test suite but

#

with this many games its hard to manually test it all

#

but when stuff is seen working in all of them, it's probably not working by luck

#

which is very reassuring

#

ah some of my squirrel hooks were disabled lol

#

need to fucking explicitly instantiate a std::vector template now

#

explicit instantiation suuucks, please can i just say somewhere "explicitly instantiate everything that takes this enum"

#

we are back in

pure radish
#

i never understood this

#

the framebuffers in the PSX VRAM are blank

#

where is "TITLE"

#

but somehow what gets sent to the GPU has them

#

black squares

dawn flare
pure radish
#

not in this region though

dawn flare
#

Ah yeah, at least not that I can see

pure radish
#

this region always being black is sus

#

just what is it doing with that pixel data

#

after this long looking at it it still eludes me lol

#

very well hidden

dawn flare
#

Caaan you get the texture window there to render with a white background rather than black?

#

I wonder if the text is rendering black with transparency or something, and it's being obfuscated because the window uses a black BG

#

'cause for example, this text is black, but there's a white BG field

pure radish
#

i spose its worth seeing what happens if i write to it

dawn flare
#

¯_(ツ)_/¯

pure radish
#

i managed to make "TITLE" disappear

#

WHAT

pure radish
#

white doesnt show up ingame though

dawn flare
#

womp womp