https://github.com/capsterx-switch/iortcw/releases/tag/pre-release
The code is not pushed because the source tree is a mess and I dont feel like cleaning it up right now.
Ok, this game was a pain. The build system is designed to either A) use a hardware specific bytecode reader or B) dynamically link to code. Lucky for me there is A) not a arm8-a encoder there and B) there is no support for dynamic loading! There is however a fully software implementation...... but the vm_interpreted was a nightmare for me to trackdown a 'simple' bug that would not exist on x86 or 64 or other strong memory machines. However arm has no such memory guarantees so I *think* my patch fixes it, it at least appears to. I spent the first long while where all the fonts were totally unreadable so I had to pull the game up on my mac just to see what to click on. It's also very annoying how it interacts with the SDL mouse events and only uses relative motions when enabled, so my generic touch screen -> mouse events never worked right. The SDL version does work, but i dont want to have to drag the curser around like an actual mouse, i just want to click on things.
Ok, so note, this is a fully software, non hardware specific loading of the quake virtual machine bytecode. That means loading the next menu or stage is slow. Takes around 20 seconds or so to get to the title screen. If someone wants to write a bytecode compiler for arm8a or implement dynamic loading or figure out how to build a static library with gcc so that all symbols are hidden except an entry point....well let me know!
I would also like to yell very loudly at the person did not allow for cut sceen skipping. In developing this i have seen the first set of cut scenes so many times I almost threw my switch at a wall (well, not really).
Ok, now for the key mappings. There are basically 3 sets of mappings currently configured: default (gameplay), UI (in a menu) and console (the command console `). For the default one I do not override anything in switch code land as the game has pretty good gamepad support. I did include a default key mapping in switch/iortcw/main/autoexec.cfg. This comes from https://steamcommunity.com/sharedfiles/filedetails/?id=1118116602 edit it as you see fit.
In UI and console
lstick/dpad map to up/down/left/right
minus=escape
plus=enter
a=space
L=` (console)
R=keyboard
touch screen and r stick act as a mouse
So when you are in a game, you can press + to get into the menu, click on save, the click the save until it blinks, click R and the keyboard should pop up, and when you close it, it should fill in the name. There is no way to edit a mistake as the way i hacked the virtual keyboard in it just dumps all the text you enter into the games event loop. It's a lil finicky but it works. Just back out and try again. This is similar when you are in the console. To get into the console from a game, you have to get into a UI state, hit +.
The controls can be overridden by create files:
sdmc:/switch/iortcwsp/ui.switch_keys
sdmc:/switch/iortcwsp/console.switch_keys
sdmc:/switch/iortcwsp/default.switch_keys
I dont think there should be much reason to do so, but let me know if there is something missing that should be a default.
As for setting up the game, extract the zip onto your sd card from the github. Then you will need the original game installed (https://store.steampowered.com/app/9010/Return_to_Castle_Wolfenstein/) and you have to install it in windows. As I use a mac, it was anyoing as I had to load up a VM, buy the game, install the game, and then copy files I need to the sd card. Once you have installed the game copy pak0.pk3, sp_pak1.pk3, sp_pak2.pk3, and sp_pak3.pk3 from the "Main" to sdmc:/switch/iortcwsp/main
If you dont have it setup right the game will just bail and for right now. If you dont run under nxlink -s, you wont be able to see the errors. It took me some time to fidangle it the first time and I have not tried from a clean state, so, let me know if these instructions are not right or something doesnt work (if the game just bails and you dont use nxlink i prob wont be able to help you).
Im not sure how well the game works with the switch sleep state. Ive seen it hang when i wasnt looking at it and the switch went to sleep. Not really sure if there is anything I can do about that. I dont think I can hijack home key or context switch?
There are a few things I hardcoded to enable which I'll likely remove and move to the autoexec.cfg, but that should not effect the use of it (I cant imagine someone wanting to disable the gamepad and such).
I havent done much actual playing of the game, it's not really my style of game and I really only bought it to see if i could make it run. So let me know how it plays beyond the first room
And I have not even *looked* at the multiplayer code, so dont ask...
PS: i just realized I misspelled wolfenstein in the title...whoops
The code is not pushed because the source tree is a mess and I dont feel like cleaning it up right now.
Ok, this game was a pain. The build system is designed to either A) use a hardware specific bytecode reader or B) dynamically link to code. Lucky for me there is A) not a arm8-a encoder there and B) there is no support for dynamic loading! There is however a fully software implementation...... but the vm_interpreted was a nightmare for me to trackdown a 'simple' bug that would not exist on x86 or 64 or other strong memory machines. However arm has no such memory guarantees so I *think* my patch fixes it, it at least appears to. I spent the first long while where all the fonts were totally unreadable so I had to pull the game up on my mac just to see what to click on. It's also very annoying how it interacts with the SDL mouse events and only uses relative motions when enabled, so my generic touch screen -> mouse events never worked right. The SDL version does work, but i dont want to have to drag the curser around like an actual mouse, i just want to click on things.
Ok, so note, this is a fully software, non hardware specific loading of the quake virtual machine bytecode. That means loading the next menu or stage is slow. Takes around 20 seconds or so to get to the title screen. If someone wants to write a bytecode compiler for arm8a or implement dynamic loading or figure out how to build a static library with gcc so that all symbols are hidden except an entry point....well let me know!
I would also like to yell very loudly at the person did not allow for cut sceen skipping. In developing this i have seen the first set of cut scenes so many times I almost threw my switch at a wall (well, not really).
Ok, now for the key mappings. There are basically 3 sets of mappings currently configured: default (gameplay), UI (in a menu) and console (the command console `). For the default one I do not override anything in switch code land as the game has pretty good gamepad support. I did include a default key mapping in switch/iortcw/main/autoexec.cfg. This comes from https://steamcommunity.com/sharedfiles/filedetails/?id=1118116602 edit it as you see fit.
In UI and console
lstick/dpad map to up/down/left/right
minus=escape
plus=enter
a=space
L=` (console)
R=keyboard
touch screen and r stick act as a mouse
So when you are in a game, you can press + to get into the menu, click on save, the click the save until it blinks, click R and the keyboard should pop up, and when you close it, it should fill in the name. There is no way to edit a mistake as the way i hacked the virtual keyboard in it just dumps all the text you enter into the games event loop. It's a lil finicky but it works. Just back out and try again. This is similar when you are in the console. To get into the console from a game, you have to get into a UI state, hit +.
The controls can be overridden by create files:
sdmc:/switch/iortcwsp/ui.switch_keys
sdmc:/switch/iortcwsp/console.switch_keys
sdmc:/switch/iortcwsp/default.switch_keys
I dont think there should be much reason to do so, but let me know if there is something missing that should be a default.
As for setting up the game, extract the zip onto your sd card from the github. Then you will need the original game installed (https://store.steampowered.com/app/9010/Return_to_Castle_Wolfenstein/) and you have to install it in windows. As I use a mac, it was anyoing as I had to load up a VM, buy the game, install the game, and then copy files I need to the sd card. Once you have installed the game copy pak0.pk3, sp_pak1.pk3, sp_pak2.pk3, and sp_pak3.pk3 from the "Main" to sdmc:/switch/iortcwsp/main
If you dont have it setup right the game will just bail and for right now. If you dont run under nxlink -s, you wont be able to see the errors. It took me some time to fidangle it the first time and I have not tried from a clean state, so, let me know if these instructions are not right or something doesnt work (if the game just bails and you dont use nxlink i prob wont be able to help you).
Im not sure how well the game works with the switch sleep state. Ive seen it hang when i wasnt looking at it and the switch went to sleep. Not really sure if there is anything I can do about that. I dont think I can hijack home key or context switch?
There are a few things I hardcoded to enable which I'll likely remove and move to the autoexec.cfg, but that should not effect the use of it (I cant imagine someone wanting to disable the gamepad and such).
I havent done much actual playing of the game, it's not really my style of game and I really only bought it to see if i could make it run. So let me know how it plays beyond the first room
And I have not even *looked* at the multiplayer code, so dont ask...
PS: i just realized I misspelled wolfenstein in the title...whoops
Last edited by capsterx,