Commit Graph
69 Commits
Author SHA1 Message Date
khallaandClaude Opus 5.5 09f7dcc0f4 HUD: stretch full-screen layers of moved windows across the render width
Primitives covering the whole 1024x768 layout inside a moved window, such as
the dimming behind the exit confirmation, were shifted with the window and
left both sides undimmed; they are stretched to the render width instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 09:08:52 +02:00
khallaandClaude Opus 5.5 d39f12ab4b widescreen: draw creatures across the whole view; HUD: copy the cursor per thread
- Creatures were culled beyond 1024+200 x 768+200 screen pixels (cmp 4C8h /
  3C8h in both object passes): invisible in the right part of a wide view,
  and the player too once the centre passed 1224. The bounds follow the
  render size now.
- Centre immediates written as negatives (-200h / -180h), missed before:
  the row renderer's static object origin (0x62babb) and aiming at the
  cursor (0x4fb620).
- HUD: moved windows no longer shift the shared mouse cursor object; the
  cursor accessor (0x6550f0) hands them a per-thread shifted copy and writes
  back what they changed. World input on other threads read the shifted
  position now and then, which made hold-to-move jerky.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 08:16:27 +02:00
khallaandClaude Opus 5.5 ba03672c32 hud: header comment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:57:22 +02:00
khallaandClaude Opus 5.5 03dbbfc5e3 docs: HUD layout mechanism
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:57:15 +02:00
khallaandClaude Opus 5.5 4ebcac713a widescreen: cinematic letterbox bars span the render width
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:56:57 +02:00
khallaandClaude Opus 5.5 d5e3da549a HUD: inventory drag & drop, UI hit tests, centred overlays
- Mouse move events carry previous and current x (+4, +0xc); button events
  x at +8. All are shifted, and restored to the saved values.
- The cursor object's previous x (+0xc) is shifted too: picking up an item
  writes the cursor position into the event (0x6559a0).
- GetMouseClientPos returns the shifted position inside a moved window.
- Window hit tests (vf1c 0x731d40, taskbar 0x6dfb10) called outside a window
  scope, e.g. 'is UI under the cursor' for world picking (0x75a370), use the
  offset the top-level window was last drawn with.
- The item carried by the cursor (0x6555e0) and the UI manager's centred
  status line / message box (0x75bbf0, 0x75c200) draw with the centre offset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:55:37 +02:00
khallaandClaude Opus 5.5 2760b35829 docs: screen-space overlays and activity distance
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:21:37 +02:00
khallaandClaude Opus 5.5 52c67f51c6 widescreen: label areas and remaining world->screen centres
- Alt object labels and floating texts are packed into a 1024x768 area
  (push 300h/400h at 0x6272f8 and 0x60e940): widened to the render size.
- Screen centre immediates in the light/effect position list (0x41b1xx..)
  and the floating text (damage number) projection 0x41e460/0x41eaf0 now use
  the render centre; lights were offset from the player before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:16:16 +02:00
khalla 6f10ccdfad hud: align macro continuation 2026-10-14 04:12:12 +02:00
khallaandClaude Opus 5.5 2853f82627 HUD: hover and tooltips for moved windows
Windows poll the mouse cursor object (0xcdbadc, x +4) for hover; it is
shifted inside a moved window's render/event scope like the events.
Tooltips are separate windows placed by the hovered window in its 1024
layout, so cUI_Tooltip renders with the offset of the moved window under
the cursor. Adds Move-To to the test input helpers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:11:49 +02:00
khallaandClaude Opus 5.5 a640f2fb17 HUD: centre all UI windows, shift mouse events (not UI commands)
Generic cUI_Window2 hooks centre dialogs, inventory, maps, traders and the
ESC menu. Event shifting now targets the cursor position of mouse events
(move/down/up, x at +8) instead of category 5 UI events, whose +0x48 is not
a point for commands such as opening the ESC menu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 04:01:35 +02:00
khallaandClaude Opus 5.5 ed3163d312 HUD: centre the taskbar, move the portrait/health panel to the right edge
New mods/hud: while a HUD window renders, screen-space vertices passed to
D3D7 DrawPrimitive/DrawIndexedPrimitive are shifted by dx; while it handles
an event, the UI event point (category 5, +0x48) is shifted by -dx. Applied
to cUI_Taskbar2 (centred) and cUI_Mercenary (portrait + health, right edge).
3D belt items line up without help (their projection is screen-centred).
re::AttachRuntimeHook hooks functions only known at runtime (COM methods).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 03:37:05 +02:00
khallaandClaude Opus 5.5 f73c4154ad Remove dxwrapper; test scripts focus the game window
The default render size (1835x768) is below Direct3D 7's 2048 limit, so the
D3D7 -> D3D9 wrapper and its device-info workaround are no longer needed.
The game pauses start-up until its window is active; game-input.ps1 now
activates it reliably (Alt + SetForegroundWindow, polled), which dxwrapper
had masked. borderless logs the first failed presents.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 03:17:23 +02:00
khallaandClaude Opus 5.5 df31c9c105 Widescreen: keep original size, extend view horizontally; fix player/camera
- Default render size is 768 high and as wide as the monitor aspect
  (1835x768 on 3440x1440), scaled up: everything keeps the size players
  know and the view only grows sideways. Height=0 keeps native 1:1.
- Ground: 818/888 clip limits, screen centre floats and integer
  immediates, ground quad list (capped at 1749) moved with the tile list.
- 3D: cGranny ortho (+-512 x +-384, incl. HUD items) scaled; inverse
  projection 0x623a20 (1/1024, 1/768) follows the render size, which fixes
  the camera following the player ("outside world") and the missing
  player / ESC menu.
- tools: game-input.ps1 + autotest-load.ps1 drive the game (load the first
  save game, screenshots in-game and with the ESC menu).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 01:48:08 +02:00
khallaandClaude Opus 5.5 795fe8f087 Widescreen experiment: native render size via dxwrapper, classic menus
- mods/widescreen: redirect the world view's reads of the 1024.0/768.0
  constants and the 3D ortho extents to our variables; render size =
  monitor; relocate the world view's tile draw list (1750 entries, no
  bounds check) into an enlarged object (16384 entries).
- mods/dxwrapper: route DirectDraw through dxwrapper (Dd7to9, D3D9) since
  Windows' D3D7 cannot render to targets larger than 2048; fix the game's
  device info GUID pointer that dxwrapper's enumeration leaves invalid.
  Pinned release fetched by CMake (hash-checked), installed next to the DLL.
- Main menu (UI thread) and loading screen render in a 1024x768 viewport
  and are presented scaled ("classic" layout); in-game uses the full size.
- re/patch: verified code patches (operand redirect, push immediates,
  displacements) and startup hooks; build.ps1/CMake download fixes.

In-game view untested yet; HUD still at the top-left.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 00:47:03 +02:00
khallaandClaude Opus 5.5 c8dc689bc6 Name all sacred.exe addresses in src/game/addresses.h
Hooks now refer to addr::* instead of literal addresses; the header also
lists the world view's users of the 1024.0/768.0 constants and the ortho
projection extent pushes for the widescreen work.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 00:20:26 +02:00
khallaandClaude Opus 5.5 b2dc1338d2 Map the world view sizing; add RE tooling
- docs/widescreen.md: render-thread frame, cWorldView0 layout and methods,
  view size = zoom * 1024.0/768.0 float constants and all their users,
  ortho projection extents, open questions (activity radius, buffers).
- tools: find-imm (immediate/regex instruction search), rtti (vtables via
  MSVC RTTI), decompile.ps1 + Ghidra scripts for a persistent project;
  ApplyRtti recovers 410 vtables / ~1200 functions Ghidra misses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 00:19:52 +02:00
khallaandClaude Opus 5.5 1549464af6 Normalize line endings to LF
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 23:55:57 +02:00
khallaandClaude Opus 5.5 d9f5c85430 Initial sacred_re scaffold with borderless fullscreen mod
- Launcher (sacred_re.exe) starts sacred.exe with sacred_re.dll injected
  via Detours; the DLL verifies the Sacred Gold 2.28 build before hooking.
- Hook framework: RE_HOOK for game addresses, RE_HOOK_API for Windows
  APIs, per-hook enable/disable in sacred_re.ini, sacred_re.log.
- Game code: Log (0x66f1c0) hooked, CmdLineHasFlag (0x813140) rewritten.
- Borderless mod: forces windowed mode, covers the monitor, scales the
  1024x768 image aspect-correct, remaps mouse input, keeps running in the
  background with keyboard input hidden while unfocused.
- CMake/Ninja/MSVC x86 build, VS Code setup, disasm tool, function map.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 23:55:50 +02:00