Recover OMT resources, morph topology, and original engine evidence
This commit is contained in:
1 parent
d62e2ab4de
commit
3df20ac19a
12 files changed
+1648
No files matched your search
@@ -0,0 +1,141 @@
|
||||
# Asset recovery evidence
|
||||
|
||||
Verified against local originals on 2026-10-23. No original files were modified.
|
||||
`Original/` is outside the modern local Git repository. Analysis/extraction uses
|
||||
Python standard library only; nothing is uploaded.
|
||||
|
||||
## Verified corpus
|
||||
|
||||
`python3 tools/extractors/audit.py ../Original --report artifacts/extracted/audit.json`
|
||||
successfully parsed all 100 `.omt` databases, 7,027 resource entries, with no
|
||||
conversion failures:
|
||||
|
||||
| Resource | Count | Verification |
|
||||
|---|---:|---|
|
||||
| `3DSh` | 2,155 | Every shape v2 consumed exactly; positions finite; corner indices bounded |
|
||||
| `3DMa` | 2,183 | Every material v1 consumed exactly; original texture links recovered |
|
||||
| `Canv` | 1,614 | All RLE decoded to exact row lengths and all resource bytes consumed |
|
||||
| `Wave` | 875 | RIFF/WAVE header and bounded RIFF lengths present |
|
||||
| `mCTy` | 100 | Indexed metadata preserved; internal interpretation outstanding |
|
||||
| `0HDR` | 100 | Indexed allocation metadata preserved; not runtime geometry |
|
||||
|
||||
Texture counts are 866 RGB555, 736 32-bit RGB, and 12 indexed 8-bit.
|
||||
All 875 sound resources contain intact RIFF data: 874 PCM and one format-tag 85
|
||||
(MP3 in WAVE). PCM rates/channels/sample widths vary; do not assume one audio
|
||||
format. Loop and cue behavior in the surrounding OMT metadata remains unverified.
|
||||
|
||||
## Recovered scene outputs
|
||||
|
||||
Run from `GamePort/`:
|
||||
|
||||
```sh
|
||||
python3 tools/extractors/prepare.py
|
||||
python3 -m unittest discover -s tests -p test_extractors.py -v
|
||||
```
|
||||
|
||||
Preparation produces ignored local files below `artifacts/extracted/`:
|
||||
|
||||
- `level1b/scene.json`: 8,607 expanded vertices, 2,869 triangles, 33 textures.
|
||||
- `VR01/scene.json`: 240 expanded vertices, 80 triangles, 7 textures.
|
||||
- Texture `.rgba` files plus PNG previews, preserving material ID links.
|
||||
- `sounds/`, `musicjimmyshouse/`, `musicneighborhood/`: exact embedded WAV bytes.
|
||||
- `animations/{jimstop,jimrun,jimjump}/`: original morph samples and manifests.
|
||||
- `animations/jimycarl.rgba`: original normal Jimmy atlas, 256 x 256 indexed PNG decoded to RGBA.
|
||||
|
||||
Individual archive recovery:
|
||||
|
||||
```sh
|
||||
python3 tools/extractors/omt.py ../Original/omt/level1b.omt --scene --output artifacts/extracted/level1b
|
||||
python3 tools/extractors/omt.py ../Original/omt/sounds.omt --output artifacts/extracted/sounds --raw
|
||||
python3 tools/extractors/ase.py ../Original/ASE/jimrun.ASE --base ../Original/ASE/jimstop.ase --output artifacts/extracted/animations/jimrun
|
||||
```
|
||||
|
||||
The static OMT scene is geometry/material recovery, not a complete level state.
|
||||
GAM entity transforms, object visibility, character meshes, lighting, camera,
|
||||
gameplay collision masks, triggers and task progression must be applied separately.
|
||||
All source scene polygons examined in these first scene exports are triangles;
|
||||
the exporter supports polygon fans and warns for any larger polygons whose
|
||||
concavity has not been validated.
|
||||
|
||||
## Executable evidence used
|
||||
|
||||
Preferred virtual addresses in the supplied `OMT2.dll` (image base `0x10000000`):
|
||||
|
||||
| Routine | Address | Supporting behavior |
|
||||
|---|---|---|
|
||||
| `OMedia3DShape::read_class` | `0x10007b60` | `3DSP` signature, version, vectors and polygon arrays |
|
||||
| `OMedia3DPolygon::read_class` | `0x10003e20` | Version-dependent corners, UVs, normal indices, material links |
|
||||
| `OMedia3DMaterial::read_class` | `0x10001490` | Compact v1 styles, color triplets and texture stream link |
|
||||
| `OMediaCanvas::read_class` | `0x10025b80` | Dispatches OmCv through canvas converter |
|
||||
| `OMediaOMTConverter::convert` | `0x10027df0` | OmGW dimensions, packing/key/palette header and row RLE |
|
||||
| RLE unpack helper | `0x1006c230` | Byte/word/dword PackBits variants; LE signed controls |
|
||||
| `OMediaOMTConverter::create_canvas` | `0x10028620` | Pixel RGB and alpha/color-key conversion |
|
||||
| `OMediaOMTConverter::read_palette` | `0x10027b40` | OmPa/OPa2 palette with 4,096-byte accelerator |
|
||||
| `OMediaDBObjectStreamLink::read_class` | `0x10030260` | BE16 present + fourcc + BE32 ID |
|
||||
| Bool stream operator | `0x10073a80` | Booleans occupy two bytes on disk |
|
||||
| `OMedia3DMorphAnim::render_draw_shape` | `0x10002df0` | Retains base shape while overriding per-index vectors |
|
||||
|
||||
RGB555 channels are expanded by `<< 3`, **not** normalized to 255. Instructions
|
||||
at `0x10028815` onward verify this; maximum channels therefore remain 248.
|
||||
The 32-bit path at `0x100288ab` selects RGB bits 16/8/0 and derives alpha from
|
||||
color-key equality. Stored high-byte alpha is not copied by that converter.
|
||||
Raw byte-exact resources remain available using `--raw`.
|
||||
|
||||
## ASE geometry and animation
|
||||
|
||||
The supplied ASE assets include standard ASCII mesh vertex/face tables, per-corner
|
||||
texture indices, scene timing and vertex morph samples. `jimstop.ase` differs in
|
||||
filename case from most other ASE files. Resolve filenames case-insensitively.
|
||||
|
||||
Two matching assets provide independent coordinate evidence, covered by tests:
|
||||
|
||||
- All eight `gate1.ASE` vertices and all eight `yokianpart.ASE` vertices match the
|
||||
corresponding `objects.omt` resources after `(x,y,z) -> (x,z,y)`.
|
||||
- Face index order remains identical; the reflection is not accompanied by an
|
||||
index swap in the stored original.
|
||||
- Every corner UV matches `(u,v) -> (u,-v)`.
|
||||
- No additional `NODE_TM` is applied to these already exported vertex positions.
|
||||
|
||||
Source ASE normal fields are not assumed authoritative; exported preview normals
|
||||
currently use flat triangle normals. Original smoothing must still be replicated.
|
||||
|
||||
Jimmy uses 426 source vertices and 814 faces. `jimstop.ase` has two samples,
|
||||
`jimrun.ASE` five, and `jimjump.ASE` three, all with file scene speed 10 FPS and
|
||||
480 ticks/frame. These establish asset sample timing, not state-specific playback
|
||||
speed or loop policy in gameplay code.
|
||||
|
||||
The EXE stores `jimyshock.png` at file offset `0xef0c8`, followed by `jimstop.ase`
|
||||
at `0xef0d8`. **Primary integration corrected an early inference from string
|
||||
proximity:** InitObject at `0x422C96..0x422CB0` binds `jimycarl.png` (VA
|
||||
`0x4EEAC4`) to texture slot 0 and `jimyshock.png` to slot 1. The latter is the
|
||||
shock/skeleton effect, not normal appearance. Prepared animation textures and
|
||||
runtime defaults now use `jimycarl.png`; both have been visually inspected.
|
||||
The ASE bitmap path `D:\\Jimmy\\jimmy\\jimmylast.bmp` is not a runtime dependency.
|
||||
Run/jump filenames follow in the same initialization string cluster.
|
||||
|
||||
### Morph topology retention
|
||||
|
||||
Run/jump/scratch ASE files omit UV tables. Zero UVs would show a single texel and
|
||||
are rejected by the animation exporter. The original morph renderer validates
|
||||
the sample vector count against the base shape and interpolates per-index vectors
|
||||
(`0x10002ed3`, `0x10002eee`, `0x10002f9a..0x10002fd9`), then submits the base
|
||||
shape plus override vectors (`0x10003396..0x100033ab`). Its topology/UV remain
|
||||
on the base shape. Therefore the prepared Jimmy animations explicitly use the
|
||||
textured `jimstop.ase` base and original sample vertex indices. This also matters
|
||||
because 23 face records in run/jump differ from the later dated stop asset even
|
||||
though all sample vertex counts remain 426. `morphBase` provenance in each
|
||||
animation manifest records the source and hash of the retained shape.
|
||||
|
||||
## Limits and next work
|
||||
|
||||
- Static asset decoding is verified, but visual fidelity needs comparison with an
|
||||
isolated original game run.
|
||||
- Legacy material booleans and polygon flags remain numerically preserved rather
|
||||
than assigned unproven lighting/culling/collision meanings.
|
||||
- Color triplet roles are conventional labels inferred from the legacy material
|
||||
layout; exact renderer use should be cross-checked against recovered DX states.
|
||||
- Animation exporter supports all supplied mesh records, but character bundles
|
||||
prepared so far cover Jimmy stop/run/jump only. Original smooth normal and
|
||||
state-driven playback behavior remain incomplete.
|
||||
- Native runtime renderer/audio integration and package validation belong to the
|
||||
primary/infrastructure work; successful extraction is not runtime verification.
|
||||
@@ -0,0 +1,181 @@
|
||||
# Executable investigation
|
||||
|
||||
Static analysis, 2026-10-23. No original code was executed or modified. Addresses
|
||||
below are preferred-base virtual addresses of **Neutron.exe** or **OMT2.dll**;
|
||||
patch variants must be checked independently. No Ghidra/Rizin/Wine was available
|
||||
on PATH initially; the initial investigation uses Python, strings and objdump.
|
||||
|
||||
## Verified identity and toolchain
|
||||
|
||||
| File | Format | Preferred base | Entry | Header timestamp |
|
||||
|---|---|---|---|---|
|
||||
| Neutron.exe | PE32 GUI, native Intel 80386 | 0x00400000 | 0x004802F2 | 2001-09-29 21:07:40 UTC |
|
||||
| OMT2.dll | PE32 DLL, native Intel 80386 | 0x10000000 | 0x10105753 | 2001-08-27 10:27:41 UTC |
|
||||
|
||||
Both have linker 6.0, MSVC decorated C++ exports/imports, C++ RTTI, x87 code and
|
||||
MSVC exception handling. Together these strongly identify Microsoft Visual C++ 6
|
||||
era C++; the linker header alone does not prove the exact compiler build. CLR
|
||||
directories are zero. The normal `.text`, `.rdata`, `.data` sections, extensive
|
||||
readable symbols and direct instructions support an unpacked build. No packer
|
||||
was detected; absence is a static inference, not an exhaustive packer test.
|
||||
|
||||
The runtime is **Open Media Toolkit 2.0 DR4**. DLL assertion paths literally name
|
||||
`C:\Open Media Toolkit 2.0 DR4\Sources\OMTClasses\...`, including graphics,
|
||||
database, compression and DirectX implementations. `OMT2Old.dll` is byte-identical
|
||||
to `OMT2.dll` (SHA-256
|
||||
`3ec41ead011adf56387a6dbd4580e5b5a9721b5f8020c8a56420f42824354943`).
|
||||
|
||||
Neutron SHA-256:
|
||||
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
|
||||
Five EXE variants have distinct hashes; filenames imply software/HD/no-CD behavior
|
||||
but no behavior should be assigned solely from filenames.
|
||||
|
||||
## Dependencies and system boundaries
|
||||
|
||||
Neutron imports the OMT DLL and Win32 USER32/KERNEL32/ADVAPI32; consult the
|
||||
generated PE inventory for full lists. The DLL imports DirectDrawCreateEx and
|
||||
DirectDrawEnumerateA from DDRAW, DirectInput8Create from DINPUT8, DSOUND ordinal1,
|
||||
WINMM PlaySoundA, USER32, GDI32, COMDLG32, KERNEL32. Direct3D is obtained through
|
||||
COM rather than a D3D8 import; see [graphics.md](graphics.md).
|
||||
|
||||
The engine has named exports for database objects, shape and morph animation,
|
||||
collision caches, sphere/triangle picking, light/material state, world updates,
|
||||
sound channels, event manager and periodical dispatch. These exports are useful
|
||||
evidence and stable starting points, not complete recovered game logic.
|
||||
|
||||
## Initialization and loop map
|
||||
|
||||
| Module/address | Identified behavior | Evidence |
|
||||
|---|---|---|
|
||||
| EXE 0x4802F2 | CRT entry | PE header, MSVC CRT setup |
|
||||
| EXE 0x4789B0 | WinMain wrapper | CRT calls it with four WinMain args at 0x4803BB; stores OMT start info, sets current directory, calls 0x46A4A0 |
|
||||
| EXE 0x46A4A0 | Application bootstrap | Calls window existence/dialog code, creates CAweReal and CGfx objects |
|
||||
| DLL 0x100218A0 | OMediaApplication::start | Repeatedly invokes OMediaPeriodical::devote_time until application byte +0x18 is true |
|
||||
| DLL 0x10060720 | OMediaPeriodical::devote_time | Named export; dispatch list must be analyzed further |
|
||||
| DLL 0x100215C0 | OMediaAnimPeriodical::spend_time | Sends messages -604 for logic, -605 for animation/render dispatch |
|
||||
| DLL 0x100F9B10 | OMediaWorld::update_logic | Uses timer at world+0x48, pause/max/min-period controls, dispatches update_elements with float elapsed |
|
||||
| DLL 0x100F9C80 | OMediaWorld::update_elements | Named export, recursively dispatches element logic |
|
||||
| EXE 0x47E470 | Reset game performance timer | QueryPerformanceCounter into 0x696018 |
|
||||
| EXE 0x47E490 | Elapsed time in seconds | (counter-lastCounter)/frequency, updates lastCounter when nonzero |
|
||||
| EXE 0x47E4F0 | Game frame callback | Calls timer via virtual slot 0xD4, stores seconds at 0x696030; only processes `0 < dt < 1` |
|
||||
|
||||
QueryPerformanceFrequency IAT is EXE 0x48D0BC, frequency global 0x696020.
|
||||
QueryPerformanceCounter IAT is 0x48D0B8. Engine GetTickCount exists separately.
|
||||
The frame callback forwards seconds to 0x479BC0, 0x462A20, 0x4693A0, 0x47D8F0
|
||||
and 0x477DB0. Their exact roles require further call graph analysis. Timing is
|
||||
mixed: time-based motion plus per-call speed increments, so a proposed fixed
|
||||
simulation rate is a compatibility choice until the original cadence is observed.
|
||||
|
||||
## Player class and recovered movement evidence
|
||||
|
||||
MSVC RTTI identifies C3DJimmy, derived C3DPlayer/C3DAnimated/C3DObject and OMT
|
||||
classes. C3DJimmy type descriptor: **0x4EEFF8**; main game interface vtable:
|
||||
**0x4A373C**, object displacement **0xC0**; OMT element vtable at **0x4A3BDC**.
|
||||
The unusual multiple inheritance means offsets below explicitly distinguish
|
||||
complete object pointers from game-interface pointers.
|
||||
|
||||
| Address | Behavior |
|
||||
|---|---|
|
||||
| 0x422AC0 | C3DJimmy::InitObject (embedded exact debug label) |
|
||||
| 0x422D30 | Jimmy object event/message handler; identified from vtable but exact name unverified |
|
||||
| 0x424600 | Jimmy per-frame update, game-interface virtual slot 0x3C4 |
|
||||
| 0x426030 | Jimmy input/movement handler, game-interface slot 0x3CC; calls base 0x438A60 |
|
||||
| 0x438A60 | Player movement-mode dispatcher; mode0 invokes walking, mode1 no action, mode2 flying, mode3 seated |
|
||||
| 0x438BC0 | Walking handler; receives complete object pointer, `float dt` |
|
||||
| 0x437C40 | Applies player speed/turn to world velocity; receives complete object pointer |
|
||||
| 0x437740 | Sets default follow-camera offsets/scales (complete object pointer) |
|
||||
| 0x472980 | Rotates local point by object Euler rotation then adds object position |
|
||||
|
||||
Complete-object fields from C3DPlayer constructor and walking usage:
|
||||
|
||||
| Offset | Initial value | Confirmed use |
|
||||
|---|---|---|
|
||||
| +0x6BC | 30.0f | Speed increment per input invocation |
|
||||
| +0x6C0 | 35.0f | Speed decay per invocation with no movement input |
|
||||
| +0x6C4 | 600.0f | Speed cap |
|
||||
| +0x6C8 | 0.0f | Current speed |
|
||||
| +0x6D4 | 0.0f | Current turn rate, later multiplied by dt |
|
||||
| +0x7C8,+0x7CC,+0x7D0 | 0,200,-350 | Camera local follow offset |
|
||||
| +0x7D8,+0x7DC,+0x7E0 | 0,80,0 | Camera local look target offset |
|
||||
| +0x854,+0x858,+0x85C | 1.6,1,1.6 | Camera interpolation coefficients |
|
||||
|
||||
**Correction to a preliminary investigation hypothesis:** -350 at +0x7D0 is
|
||||
camera offset, not gravity. Do not use it as a physics constant.
|
||||
|
||||
Walking input uses global booleans 0x50985D/0x50985F for left/right and
|
||||
0x50985E/0x509860 for forward/backward, plus analog axes. The precise mapping
|
||||
is inferred from signed +/- turn behavior and must be checked against input
|
||||
assignment code. Left/right branches set turn contribution +/-1000, adjust a
|
||||
local angle by +/-20 and increase speed by30 capped600. Forward also adds30.
|
||||
No movement input decays speed by35 toward0. These changes omit dt deliberately
|
||||
in the original. Forward plus turn can increment twice; don't simplify silently.
|
||||
|
||||
The application uses 16384 angular units per revolution (mask0x3FFF); conversion
|
||||
from degrees multiplies by float45.5111122 at EXE 0x48E5E8, followed by x87-to-int
|
||||
conversion0x47F940. Original trigonometry uses OMediaCosSinTable, 16384 floats per
|
||||
sin/cos array with cosine base offset0x10004. Position is X/Y/Z with Y vertical,
|
||||
matching follow-camera local offset and level placement data.
|
||||
|
||||
Walking follow-camera logic is in 0x4395CF–0x4398E4. It rotates local offsets,
|
||||
subtracts prior target positions, applies dt-dependent interpolation, adds to
|
||||
global viewport position at `[0x509A50]+0x44`, and computes viewport angles. This
|
||||
is richer than a rigid chase camera; a simple chase camera is an approximation.
|
||||
|
||||
Random behavior at0x438D52 uses wrapping uint32 LCG
|
||||
`seed = seed * 1664525 + 32767; value = seed >> 16`. Verified from instruction
|
||||
sequence; seed object pointer is global0x509A40. This differs from MSVC rand().
|
||||
|
||||
## Reproducible tooling and next work
|
||||
|
||||
From GamePort:
|
||||
|
||||
```sh
|
||||
python3 tools/binary/pe_inspect.py ../Original/Neutron.exe
|
||||
python3 tools/binary/pe_inspect.py ../Original/OMT2.dll --symbols 'render|update_logic'
|
||||
python3 tools/binary/rtti_map.py ../Original/Neutron.exe C3DJimmy
|
||||
objdump -d -M intel --start-address=0x438bc0 --stop-address=0x4398f2 ../Original/Neutron.exe
|
||||
```
|
||||
|
||||
Generated complete PE inventories/disassemblies are cached under ignored
|
||||
`artifacts/binary/`; regenerate with the commands above rather than versioning
|
||||
the full dumps. Read-only parser output was cross-checked against objdump header,
|
||||
import and named-export results. Full physics/collision, jump impulse, cadence,
|
||||
AI, save/load and dynamic initialization remain unresolved. Next investigate the
|
||||
game-object dispatch0x479BC0, shared physics collision function via game slot0x130
|
||||
in0x462520, input assignment and compare a copied original in isolated Wine.
|
||||
|
||||
## Follow-up evidence preserved by primary integration
|
||||
|
||||
The last agent updates below refine earlier unresolved fields. General physics
|
||||
arithmetic is implemented/tested separately; the full controller is not recovered.
|
||||
|
||||
- Generic gravity initially (0,-5000,0) at `0x478D50`; CJimmyGame initialization
|
||||
`0x44D414` overrides it to **(0,-800,0)**. World physics dispatch `0x479BC0`
|
||||
calls per-object `0x479D20`. At `0x479EBB..0x479EF2`, queued impulse is added
|
||||
to velocity and cleared; then object acceleration*dt and gravity*dt are added,
|
||||
and updated velocity*dt becomes displacement at `0x479F8D` onward.
|
||||
- Jump branch `0x438397` selects JUMP; `0x4383B3` queues impulse (0,550,0) via
|
||||
interface slot0x28C. **Gravity -800 alone is not the full player jump model.**
|
||||
Air handler `0x437F90`, branch `0x438148`, sets extra accelerationY to
|
||||
`gravityY*1.33f-gravityY` when jump state<3, producing approximately -1064
|
||||
total acceleration. Constant `0x4AFCE4` is float1.33000004. Other air states
|
||||
use 0.1/0.3 factors and require further tracing before implementation.
|
||||
- Jump-held predicate `0x42A730` includes right mouse/Insert/Shift/numpad0 and
|
||||
controller/gadget gates. Mode dispatch `0x437A8C`: state0 requires grounded;
|
||||
jump queues impulse and state1; release state1->2; holding0.4s can enter
|
||||
state3 with jetpack gating. Exact landing/retrigger table is still unresolved.
|
||||
- Walking +/-20 affects destination yaw through `0x472660`; `0x43A430` smooths
|
||||
wrapped Y-angle difference by `dt*3.7`. Forward vector at `0x472B10` for
|
||||
zero pitch/roll is **(-sin(yaw)*speed,0,cos(yaw)*speed)**. Ground motion
|
||||
`0x437C40` preserves vertical velocity. A right vector (cosYaw,0,sinYaw) is
|
||||
scaled by `(turnRate*(1-friction)*speed/45 + keyboardStrafe)*dt`, with strafe
|
||||
+1000 left / -1000 right (`0x4391B1` / `0x439226`). Friction source and full
|
||||
state gates still require recovery; a simple tank controller would differ.
|
||||
- Key state array `0x509838` is indexed by Windows key code; handlers `0x46A360`
|
||||
and `0x46A380` set/clear it; consuming function `0x46A3E0` clears on read.
|
||||
- C3DJimmy::InitObject `0x422C96..0x422CB0`: texture slot0 uses **jimycarl.png**
|
||||
(stringVA `0x4EEAC4`), slot1 uses **jimyshock.png**. Inferring normal texture
|
||||
from neighboring strings alone was incorrect and has been corrected.
|
||||
|
||||
Original execution was subsequently attempted in an isolated Wine copy; see
|
||||
`../reference-testing.md`. No usable original gameplay frames are verified yet.
|
||||
@@ -0,0 +1,124 @@
|
||||
# Original rendering evidence
|
||||
|
||||
Static analysis of supplied OMT2.dll / Neutron.exe, 2026-10-23. No rendered
|
||||
reference frame has been captured yet. All DLL addresses use preferred base
|
||||
0x10000000; EXE addresses use0x400000.
|
||||
|
||||
## API and backend
|
||||
|
||||
The supplied DLL implements **Direct3D7 fixed-function rendering over DirectDraw7**
|
||||
and an **OMT software rasterizer**. This is more specific than readme's DirectX8
|
||||
runtime requirement: input uses DirectInput8 but rendering uses D3D7 interfaces.
|
||||
|
||||
Evidence:
|
||||
|
||||
- DDRAW imports DirectDrawCreateEx and DirectDrawEnumerateA; there is no D3D8 import.
|
||||
- IID_IDirect3D7 `{F5049E77-4861-11D2-A407-00A0C90629A8}` occurs at DLL0x10116E0C;
|
||||
IID_IDirectDraw7 `{15E65EC0-3B9C-11D2-B92F-00609797EA5B}` at0x10116E1C.
|
||||
- OMediaDXRenderPort::draw at0x100372A0 calls device vtable offset0x64 (D3D7
|
||||
DrawPrimitive) with FVF0x152. SetTransform uses offset0x2C and SetRenderState0x50.
|
||||
- Named exports OMediaDXRenderer/DXRenderPort, OMediaOMTRenderer/OMTRenderPort,
|
||||
software texture16/texture32 rasterization functions and a CPU pipeline coexist.
|
||||
- Executable contains renderer labels OPENGL, DIRECT3D HAL and DIRECT3D T&L HAL.
|
||||
The OPENGL label does **not** prove this supplied DLL implements an OpenGL backend:
|
||||
no matching GL import/backend exports were found. Do not implement one by assumption.
|
||||
|
||||
## Function map
|
||||
|
||||
| Preferred DLL VA | Named export / behavior |
|
||||
|---|---|
|
||||
| 0x10035D80 | OMediaDXRenderPort constructor |
|
||||
| 0x10036320 | begin_render, initializes/reuses device state |
|
||||
| 0x10036560 | end_render |
|
||||
| 0x100372A0 | draw, translates OMediaRenderVertex vector to D3D vertices |
|
||||
| 0x100374B0 | draw_shape, polygon/material path |
|
||||
| 0x10037AC0 | draw_surface, canvas quad path |
|
||||
| 0x10036AF0 | set_model_view, D3D transform1 |
|
||||
| 0x10036B10 | set_projection, D3D transform3 |
|
||||
| 0x1004D650 | OMediaLayer::prepare_projection_matrix |
|
||||
| 0x1004E650 | perspective projection with symmetric -1..1 clip Z |
|
||||
| 0x1004E6E0 | perspective projection with 0..1 clip Z |
|
||||
| 0x1003FC00 | OMediaElement::compute_model_matrix overload |
|
||||
| 0x1003FF70 | compute_model_matrix overload using parent matrix |
|
||||
| 0x100EE740 | OMediaViewPort::update_render_ports |
|
||||
|
||||
## Vertex formats
|
||||
|
||||
OMediaDXRenderPort::draw reads input vertices with **68-byte stride**, converts
|
||||
them to **36-byte D3D vertices**, and passes **FVF0x152**:
|
||||
|
||||
| D3D vertex offset | Contents | OMT input offset |
|
||||
|---|---|---|
|
||||
| 0x00 | float3 position |0x00 |
|
||||
| 0x0C | float3 normal |0x34 |
|
||||
| 0x18 | packed ARGB diffuse |float RGBA0x10,0x14,0x18,0x1C |
|
||||
| 0x1C | float2 texture UV |0x2C |
|
||||
|
||||
FVF = XYZ0x2 + NORMAL0x10 + DIFFUSE0x40 + TEX10x100. It does not contain
|
||||
pretransformed RHW coordinates. Source color packing multiplies each channel by
|
||||
DLL constant0x10114A10 and converts through x87 integer conversion. Primitive enum
|
||||
mapping in this function and exact polygon triangulation still need examination.
|
||||
|
||||
## State translations proven by disassembly
|
||||
|
||||
| OMT function | Address | D3D state evidence | Vulkan requirement |
|
||||
|---|---|---|---|
|
||||
| enable_faceculling |0x10036570 |CULLMODE22=2 (CW) | Match winding after coordinate/viewport transforms |
|
||||
| disable_faceculling |0x10036590 |CULLMODE22=1 (none) | Per-material culling flag |
|
||||
| turn_fog_on |0x100365F0 |FOGENABLE28=1; FOGVERTEXMODE140=3 (linear) | Vertex-derived linear fog compatible with reference |
|
||||
| set_fog_color |0x10036650 |FOGCOLOR34 | Preserve packed color |
|
||||
| set_fog_range |0x10036670 |FOGSTART36, FOGEND37 | Float fog distances |
|
||||
| set_zbuffer_write |0x10036910 |ZWRITEENABLE14 | Pipeline depth-write enable |
|
||||
| set_zbuffer_test |0x10036940 |ZENABLE7 | Pipeline depth-test enable |
|
||||
| set_zbuffer_func |0x10036970 |ZFUNC23 | Map each original comparison enum |
|
||||
| set_blend |0x10036A50 |ALPHABLENDENABLE27 | Pipeline blend enable |
|
||||
| set_blend_func |0x10036AB0 |SRCBLEND19, DESTBLEND20 | Preserve original factors |
|
||||
|
||||
begin_render default setup0x10036484 onward sets CW culling, NORMALIZENORMALS142=1,
|
||||
LIGHTING137=0, texture stage0 COLOROP1=4 (MODULATE), COLORARG12=2 (TEXTURE),
|
||||
COLORARG23=0 (DIFFUSE). Thus an unlit texture-times-diffuse baseline is evidence
|
||||
based; game/material overrides still need full tracing. Lighting, fog and alpha
|
||||
capabilities in the engine do not prove that every game scene enables them.
|
||||
|
||||
## Projection and coordinates
|
||||
|
||||
OMT angles are16384 units/revolution. Perspective0x1004E6E0 uses
|
||||
`s=cot(fov/2)`, matrix entries `m00=s*height/width`, `m11=s`,
|
||||
`m22=far/(far-near)`, `m23=1`, `m32=-near*far/(far-near)` with other perspective
|
||||
entries zero except unused m33 initialized1. This is the positive-Z-forward,
|
||||
0..1 depth form. The alternative0x1004E650 uses `(far+near)/(far-near)` and
|
||||
`-2*near*far/(far-near)` for -1..1 depth. Matrix storage includes a trailing type
|
||||
word at+0x40 beyond the16 floats. These are engine constructors; game-selected FOV,
|
||||
near/far and projection mode remain to be recovered from viewport/layer setup.
|
||||
|
||||
The game uses **Y-up** world placement, while exported ASE files are3ds Max
|
||||
coordinates; don't apply guessed axis changes to OMT geometry. The exact ASE
|
||||
converter's rotation/UV policy must be confirmed against OMT geometry, not inferred
|
||||
from application conventions. Vulkan requires handling viewport Y and winding
|
||||
consistently. No claim of full handedness equivalence is made without a frame test.
|
||||
|
||||
## Implementation priorities and remaining evidence
|
||||
|
||||
Implement original geometry/UV/material colors, D3D0..1 projection, texture modulation,
|
||||
depth and material culling/blending first. Add recovered fog and fixed-function
|
||||
lights as actually required. Do not replace with PBR. Reuse original morph animation
|
||||
data, not invented skeletal animation. Validate triangle order, UV orientation,
|
||||
alpha, depth, filtering and camera against original before claiming visual fidelity.
|
||||
|
||||
Not yet recovered: complete material enum maps, game-selected sampler modes, light
|
||||
values, FOV/clips, render sorting, alpha thresholds, animation timing and visual
|
||||
reference captures. See asset report for archive model/material recovery.
|
||||
|
||||
## Projection follow-up
|
||||
|
||||
OMediaLayer ctor `0x1004D340`: projection mode3, FOV word+0x78=`0x0AAA`
|
||||
(59.9853515625 degrees), near+0xC4=20, far+0xC0=3200. Game creates five layers
|
||||
at `0x47664C` onward. Sky layer global0x509A38 far1,000,000 at `0x47682C`;
|
||||
geometry globals0x509A30/0x509A3C. CLevel01BGame setup `0x44F5A0` sets far
|
||||
10000 on both geometry layers. No game FOV writes were found by initial static
|
||||
search; that is evidence for inherited FOV, not a proof of every possible path.
|
||||
|
||||
Primary renderer review additionally recovered null-material skipping and v2
|
||||
polygon culling flags from DX draw_shape; see `../rendering.md`. The previous
|
||||
white fallback for unresolved material18 incorrectly rendered invisible lab
|
||||
proxy surfaces and is fixed. Full material state mapping remains incomplete.
|
||||
Reference in new issue
Block a user