21 Commits
Author SHA1 Message Date
Tempus3214andClaude Opus 5.5 21c65ec065 Zoom the map with the scroll wheel
On the map the mouse moves the cursor, so it had no way to zoom: the zoom is the right stick's y, which only the
keys and a pad reached. While the map is open, each wheel notch is now a full-tilt push of that stick for 100 ms with
50 ms of neutral after it (a turn away from the player zooms in). A fast scroll's notches wait their turn, at most four,
and a turn the other way drops them. The wheel stays unbound elsewhere.

The back ends count the notches while the cursor is captured (input_win.c from raw input's usButtonData, input_sdl.c
from SDL_EVENT_MOUSE_WHEEL), keeping a high-resolution wheel's part of a notch (ikb_wheel_take).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 03:48:13 -03:00
Valiantsin DzerakhandClaude Opus 5.5 ff49f6b62f Keep the gamepad unchanged under the direct mouse and the menu pointer, and fix the mouse activity flags
The camera input's activity hook wrote the flags to +0x418, but the game's next instruction stores w8 over them
(1.4.3 main+0x874d80), so a mouse-only turn still read as idle. The hook now changes w8.

The free-orbit hooks rewrote the camera stick input from the last sample even in steps without mouse motion; they now
take a step only when the mouse moved in it or holds the pitch, so a gamepad-only step reaches the camera as the game
made it.

The mouse shake gesture for detaching parts is gone: three 24-count reversals fire while a held object is turned back
and forth. Arrow keys or the pad's right stick shake as before.

The menu pointer comes only while the keyboard and mouse are the device used last (input_kbm_last): a gamepad player
sees the menus as on the console. Raw mouse travel is counted while the cursor is released too, so moving the mouse
brings the pointer back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 08:10:59 +03:00
local 8ff29be86f Use the mouse in the game's menus on 1.4.3
While one of the game's menus has its focus box (the title, the save list, the inventory, Options, shops,
dialogue choices), the cursor is released from the mouse camera and shown; the item under the pointer takes
the focus as the d-pad would, a left click is A on it and a right click is B. runtime/menu_cursor.c reads
eui's screens at each pad read and moves the focus with the writes eui::BoxCursorMgr::moveBoxCursor makes,
adapted from Weeping of the Empire's totk_menu_cursor.cpp (1.0.0, MIT), with eui::ScreenMgr's instance placed
in 1.4.3 at main+0x3acf960. menu_cursor = 0 turns it off.
2026-11-04 07:56:03 +03:00
Wellington Dias 1d51343ac1 Build and run the runtime natively on Linux.
Shared runtime code now goes through runtime/platform/platform.h, implemented by platform/win32.c and a new
platform/linux.c: futex locks, a userfaultfd and PAGEMAP_SCAN write watch, signal-based async preemption, our own
fiber switch, and a SIGSEGV handler for the thaw and crash hooks. The window, input, menu and software keyboard get
SDL3 back ends beside the Win32 ones, with the swapchain (gfx_present.c) and input merging (input.c) shared. SHA-256
replaces BCrypt, ELF builds get their own override sections, and the build tools gain Linux branches.

On Linux the selftest and the gfx-abi, astc, nvn and window probes pass. probe-vkmem still fails: imported guest
memory cannot be write-watched on Linux, which the shadow buffers in vk_memory.c will address.
2026-10-29 16:56:56 -03:00
Valiantsin DzerakhandClaude Opus 5.5 8691f6d724 Remap keys, mouse buttons and controller buttons from the Controls tab
Every Switch button and the eight stick directions the keys drive get two key cells and a controller cell under the
button layout. A cell takes the next key, mouse button or controller button pressed; a key in use moves over, a
controller button swaps. The tab writes bind_ lines (new: bind_LSTICK_* / bind_RSTICK_*, key:default, pad:default) and
input_win.c builds the tables again when one changes, so remapping applies while the game runs. More keys can be
bound: Enter, Backspace, right Shift and Ctrl, Alt, the numpad, punctuation, F2-F7, F9, F12, mouse buttons 4 and 5.
Alt alone no longer enters the window menu loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:53:57 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ba0f33e044 Pick the gamepad button layout by the pad's labels, with a Button layout row on the Controls tab
The gamepad map was by position only, so on an Xbox pad the button labelled A pressed Switch B. pad_layout = auto
(default) keeps the Nintendo layout for a pad whose east button SDL reports labelled A and uses the Xbox layout (south
A, east B, west X, north Y; cross A on a PlayStation pad) for the others; nintendo and xbox force one. It applies at
once; bind_ lines name physical buttons and apply on top of either layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:20:03 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9dc738c045 Count untimed script lines in 60 Hz ticks of game time instead of presents, so the title menus get scripted presses at the same game time at any frame limit; in a recording the untimed lines stop when the world clock starts, and the recorder cuts a button or stick held at that moment and continues it as a timed event
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:49:41 +03:00
Valiantsin DzerakhandClaude Opus 5.5 ecc90b5678 Record and replay input on a world clock: game seconds stepped since the player first stands away from the title screen's origin
With the real-time frame step, a frame advances the game by its own length, so a recording keyed by presents replayed at another frame rate pressed at other game times, and every load of another length shifted the rest. Lines after the first save load are now written as "@<ms> <what> <hold ms>" and replayed on that clock; menu input before it stays in presents. Two replays of one recording whose loads ended at presents 1887 and 2094 kept the player within 2 m for 15 game seconds, until the fight's own nondeterminism took over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:40:33 +03:00
Valiantsin DzerakhandClaude Opus 5.5 581b5a8731 Read the gamepad again in every input poll: the menu's Minus+Plus change dropped the pad_read call from poll_merged, so the game saw no gamepad buttons or sticks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:56:51 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4d4b0efeb8 Latch the Minus+Plus combo until both are released, serialise menu open and close, pack the cursor release flags into one word, and drop menu_available
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:51:56 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0cfc489bbf Open the menu for everyone: F1, Esc and Minus+Plus toggle it, the combo never reaches the game, the page offers Continue and Quit game, and closing after Esc gives the mouse capture back
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:49:15 +03:00
Valiantsin DzerakhandClaude Opus 5.5 8b514f6ead Keep every default in the settings table: cfg_value, cfg_int, cfg_double and cfg_bool read it, and the consumers of table keys drop their own defaults
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:32:30 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c3b3c297cf Merge main into task/menu: keep main's button remapping, Esc cursor release and new settings beside the live settings, with one live mouse sensitivity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:27:26 +03:00
Valiantsin DzerakhandClaude Opus 5.5 10a933bc08 Park the menu's input block, gamepad read and C++ build patterns as work in progress
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:25:10 +03:00
Valiantsin DzerakhandClaude Opus 5.5 e8697659ac Remap gamepad buttons and keys with bind_<button> lines in totk.ini, one data-driven table for the pad and one for keys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:50:48 +03:00
Valiantsin DzerakhandClaude Opus 5.5 cb9ea1ae05 Release the mouse cursor with Esc, recapture on a client click and skip capture when a title bar click activates the window
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:29:49 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b9a7896095 Make settings changeable while the game runs and save them back to totk.ini
cfg_set stores a value in memory and bumps cfg_version; consumers that keep a
parsed value compare the version and parse again when it changed. cfg_save
rewrites only the changed lines of totk.ini, keeps comments, and adds a missing
key under its section (after its commented example line when there is one).
The environment still wins over both.

Live consumers: volume (new TOTK_VOLUME host gain in the mixer), frame limit
(TOTK_FPS60 switches the fps60 patch set and the pacer caps at 30 or 60),
rumble strength, curve and triggers, gyro on or off, mouse sensitivity.
TOTK_MOTION=0 and rumble strength 0 now keep their hid handles and read at
rest or stay silent, so they can be turned back on. --probe-cfg covers
cfg_set and cfg_save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:54:56 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f0b5c6e5ae Count mouse buttons only while the cursor is captured and ignore a button held when the capture began
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:33:27 +03:00
Valiantsin DzerakhandClaude Opus 5.5 dc80c88490 Add the PC keyboard and mouse layout with a data-driven binding table and a raw-input mouse camera
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:26:45 +03:00
Valiantsin DzerakhandClaude Opus 5.5 dda22f6e01 Add rumble strength, curve and trigger settings for Xbox pads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:12:15 +03:00
Valiantsin DzerakhandClaude Opus 5.5 19c9b648d1 Add the recompiler, Windows runtime, tools and docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:27:54 +03:00