Homebrew RELEASE Return From Castle Wolfenstein

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
426
Country
United States
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
 
Last edited by capsterx,

cucholix

Banners guy
Member
Joined
Jan 17, 2017
Messages
2,926
Trophies
1
Age
41
XP
3,931
Country
Chile
Thanks for the port :)
Trying to change aspect ratio to 4:3 by setting
Code:
cg_fixedAspect "1"
In wolfconfig.cfg but it doesn't change the AR in game.
 
  • Like
Reactions: ShadowOne333

cucholix

Banners guy
Member
Joined
Jan 17, 2017
Messages
2,926
Trophies
1
Age
41
XP
3,931
Country
Chile
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.
When you click the right stick it kick and fire the weapon at the same time, trying to change autoexe.cfg file but changes are no applied.
It would be useful to have the crouch button mapped to ZL, weapon-alt to R, use item to A, because the crouch method is not toggle.

Could you explain more about how create sdmc:/switch/iortcw/default.switch_keys?
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
426
Country
United States
When you click the right stick it kick and fire the weapon at the same time, trying to change autoexe.cfg file but changes are no applied.
It would be useful to have the crouch button mapped to ZL, weapon-alt to R, use item to A, because the crouch method is not toggle.

Could you explain more about how create sdmc:/switch/iortcw/default.switch_keys?

When I click the right stick it only kicks and when i fire and click it does both. Are you saying when you right click it does both?. Am I missing something?

https://pastebin.com/rk505kKi

Any key combination that is mapped bypasses the normal event loop and sends a keyboard key, everything else is passed to the normal system. So for example if you map L+A as something, but use L as a key in the game, that would not be a great combination as the L press would go though and the L+A would be 'hijacked'

I'll look into the aspect ratio and see if it's something I did.
 
Last edited by capsterx,

octopus

Custom Title
Member
Joined
Sep 6, 2013
Messages
412
Trophies
0
Location
/
XP
1,185
Country
Somalia
For me it crashes back to the hbmenu, I even rolled back mesosphere and that did not help, I also tried disabling sysmodules, that did not help either. Paks are from steam, so I'm not sure what could have gone wrong. AMS 0.15.0, HOS 10.2.0
 

Attachments

  • wolfenstine.zip
    37.1 KB · Views: 148

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
426
Country
United States
For me it crashes back to the hbmenu, I even rolled back mesosphere and that did not help, I also tried disabling sysmodules, that did not help either. Paks are from steam, so I'm not sure what could have gone wrong. AMS 0.15.0, HOS 10.2.0
Hmm, not sure, I'm running 10.1.0|AMS0.14.EJE
Was there any console output in running it in nxlink?

Also, i think it should create a sdmc:/switch//iowolfsp/main/crashlog.txt even if not started with nxlink

The paths are hardcoded for sdmc:/switch/iowolfsp/main/
 
Last edited by capsterx,
  • Like
Reactions: octopus

bad361

Well-Known Member
Member
Joined
Jun 18, 2018
Messages
1,045
Trophies
0
Location
Moscow
XP
1,660
Country
Russia
Yeah when I click right stick it does both kick AND fire
i had the same issue and fixed it just by changing stuff in controls in-game options. I think you shouldn't be supposed to change stuff there, but i tried and it worked, i firstly accidentally mapped fire to right stick and it stopped kicking at all, then i just mapped kicking to right stick and now it works properly.

What i'm wondering about is the sensitivity... Can i turn it down a bit somehow? Its too high for aiming with a stick, too inaccurate.
 
Last edited by bad361,

bad361

Well-Known Member
Member
Joined
Jun 18, 2018
Messages
1,045
Trophies
0
Location
Moscow
XP
1,660
Country
Russia
Can anybody post autoexec.cfg file with fixed right stick button, please?
And i just compared two autoexec files (one before changing controls in options and one after) and they are absolutely the same. So just change it in-game options, that's all. Autoexec seems not be the issue with right stick.
 
General chit-chat
Help Users
    Veho @ Veho: Easy there, Mrs Bobbitt.