Commit graph

90 commits

Author SHA1 Message Date
Anonymous Maarten
f1f4bd14c6
config: remove CCommonDialog, move mfc annotations to StdAfx.h (#544) 2024-02-09 13:52:49 -05:00
Anonymous Maarten
ccb6223d70
Decompiled CONFIG.EXE executable (#533)
* mxdirectdraw: no need to explicitly add a terminating '\0' in C

* mxstopwatch must include LIMITS.H for ULONG_MAX

* Add Config app

* 88.78%

* style fixes

* Test more CONFIG things

* Add a few assertions on MFC classes

* reformat

* actionSSSSSSSSSSSSSSS

* actions again

* decomplint needed a shebang

* Fix annotations of Message Map entries

* ci: We're building CONFIG.EXE, not CONFIG.DLL

* remove ninja.exe

* Fix CAboutDialog::GetMessageMap annotation

* format reloaded

* Fix global CConfigApp object annotation

* trigger worflows

* ci: request at least python 3

* oops :)

* curl CONFIGPROGRESS-OLD.TXT will fail

* Forget about actions/setup-python (for now)

* Annotation fixes

* Config tweaks and MxDirect3d annotations

* It's important to compare against the correct file

* Introduce common CDialog parent for CAboutDialog and CMainDialog

* format

* Remove CSerializer

---------

Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2024-02-07 12:11:45 +01:00
Christian Semmler
a2c1bd66b3
Various changes to IsleApp (#531)
* ISLE experiment

* Annotations

* Remove define.cpp

* Remove header

* Fix types

* Leave as MxLong for now
2024-02-05 15:01:48 +01:00
MS
264b9e815b
Match static function variables (#530)
* Match static function variables

* IsleApp::Tick static variables
2024-02-05 12:43:13 +01:00
Christian Semmler
f0ea8850c4
Match MxDSFile scalar ddtor, add annotations (#523) 2024-02-03 17:33:22 +01:00
Anonymous Maarten
57d5949d84
Implement some Act1State functions (#520)
* Implement some Act1State functions

* ci: push fix commits to pr

* ci fix

* Show diffs generated by clang-format

* Run clang-format

* Fix naming

* re-use _countof + add parentheses

* Fix naming

* Use MxS32

* Annotate Act1State::NamedPlane::~NamedPlane

* Apply suggestions

* Read and Write Mx3DPointFloat's

* Annotations, spacing

* Add Mx3DPointFloat copy ctor, match some functions

* Fix WriteVector3

* Adding more spacing for readability

* Use MxResult as a return type for Serialize

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-02-03 02:03:52 +01:00
Anonymous Maarten
9e686e2a87
cmake+ci: run clang-tidy (#512)
* cmake+ci: run clang-tidy

* Remove DESCRIPTION from LEGO1/LegoOmni.mingw.def

* Add initial .clang-tidy and fixes

* fix file perms

* Comment out DESCRIPTION

* Remove LegoEntity::~LegoEntity and MxPresenter::~MxPresenter from mingw's LEGO1.def

* Looks like clang is allergic to the libs in the directx5 SDK

* Update .clang-tidy

* Fix typo in .clang-tidy

* Attempt to generate an action error

* Revert "Attempt to generate an action error"

This reverts commit 96c4c65fed.

* cmake: test with -Wparentheses + optionally with -Werror

* ci: -k0 is a Ninja argument

* Use -Werror only for msys2 builds

* cmake: only emit warnings for specific warnings

* cmake: and don't do -Werror/-WX anymore

* Fix warnings

* Fix mingw warnings

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-02-01 21:42:10 +01:00
Misha
4314d3e297
Implement LegoControlManager (#500)
* Push changes

* Update score.cpp

* fix

* Update score.h

* Fixes/matches

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-28 22:09:33 +01:00
Nathan M Gilbert
c0acf11f9b
Implement/Match LegoTree (#485)
* Implement/Match LegoTree

* Fix vtable

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-28 17:45:49 +01:00
Christian Semmler
883f3429a7
Implement/match LegoWorld::Destroy (and destructor) (#492)
* Implement/match LegoWorld::Destroy

* Match

* Match
2024-01-27 17:48:50 +01:00
Anonymous Maarten
5f413165cc
Spinoff some sources to static libraries (#484)
* cmake: use imported targets for 3rd party libs

* Fix casing of skateboard.h include

* cmake: tglrl realtime viewmanager mxgeometry

* cmake: spin off some source in static libraries

* dx5 for everyone

* ci: bump actions/checkout to v4

* move LEGO1/realtime/realtimeview.cpp to lego1 because it exports symbols

* add misc library

* Add omni library

* Return of the .def's

* Remove COMPAT_CONST in MxVideoParam::MxVideoParam

* Run clang-format

* move LEGO1/realtime/realtimeview.cpp to realtime lib

* Add 3dmanager library

* Rename .def files

* Remove incorrect deps to Omni

* Remove DLL expor decls

* Remove unnecessary library dep from ROI

* Remove COMPAT_CONST

* Move 3dmanager lib before Omni

* Remove mxgeometry lib (`geom` is actually `lego/sources/geom`, which we don't have in our decomp yet)

* viewmanager has a dependency on realtime + fix mingw's def

* Remove Smacker::Smacker from lego1 link libraries

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-24 21:16:29 -05:00
Nathan M Gilbert
2bebc09da3
Implement misc.lib (#483)
* Implement misc.lib

* Lowercase files

* Minor changes

* Fix file cases

* Fixes

* Fix missing dtor

* Add override

* Match LegoImage::Read

* Fix delete call

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-24 18:12:57 +01:00
MS
a65eb9a4e0
Roadmap tool to compare binary structure (#479) 2024-01-22 16:15:12 +01:00
Christian Semmler
e61530d5a0
Remove unused functions from ISLE.EXE (#476) 2024-01-21 17:02:17 +01:00
MS
b5a3c5feea
Enforce vtable match (#464)
* vtable enforce

* Vtable progress

* IslePathActor subclasses

* LegoState subclasses

* LegoWorld subclasses

* Presenter progress

* Remaining presenters

* All but two that need new files

* Merge into vtable branch (#3)

* Implement MxDisplaySurface::VTable0x44 (#467)

* Update mxdisplaysurface.cpp

* add arguments to header

* Fix glitched bitmaps

* WIP fixes

* Match

* Fix

* Changes

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Implmement PoliceState::VTable0x1c (#468)

* Implmement PoliceState::VTable0x1c

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Implement Lego3DView::Render (#470)

* Implement Lego3DView::Render

* use MxDouble

* Revert "use MxDouble"

This reverts commit a006b60e20.

* Begin work on Police class (#469)

* Begin work on Police class

* Use JukeBox::e_policeStation value

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Implement MxDisplaySurface::CreateCursorSurface (#471)

* Update mxdisplaysurface.cpp

* Fixes

* Update legovideomanager.cpp

* Match to 100%

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>

---------

Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>

* Police fix

* Finish

* motocycle lower case

* Update historybook.h

* Update hospitalstate.h

* Update jetski.h

* Update legoinputmanager.h

* Update legolocomotionanimpresenter.h

* Update pizza.h

* Update act3shark.h

* Update ambulancemissionstate.h

* Update bumpbouy.h

* Update doors.h

---------

Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2024-01-20 18:04:46 -05:00
Christian Semmler
cecaced797
Implement MxFlcPresenter::LoadFrame, add flic library (#455)
* WIP

* Match

* Fix flic.lib

* Add source assembly

* Rename variable
2024-01-19 15:01:57 +01:00
Misha
e9d8fde8bc
Fix wrong class name (#438)
* push changes

* fix

* rename file
2024-01-14 23:00:03 +01:00
Misha
8b34b38ac0
implement LegoActorPresenter (#434)
* LegoActorPresenter

* Add ddtor

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-13 23:06:13 +01:00
Christian Semmler
d24f5db42f
Matrix/vector refactor (#426) 2024-01-12 19:34:38 -05:00
Christian Semmler
99ee212213
Fix inclusion of MxPresenter class in ISLE 2024-01-11 10:48:00 -05:00
Christian Semmler
516e16faf6
Further clean up Omni/LegoOmni separation (#423)
* Fix inline functions

* Whitespace

* Try this

* Fix MxEntity

* Further fixes

* Move main out

* Replace tickle code
2024-01-11 16:02:55 +01:00
Anonymous Maarten
b996fff6fa
Support building isle with modern MSVC + msys2 (#421)
* cmake: detect older MSVC and define ENABLE_DECOMP_ASSERTS to enable decomp asserts

* Add /Zc:__cplusplus to define __cplusplus with c++ version number

* Silence deprecated CRT releated warnings

* LegoCameraController overrids some methods that are not defined in its parent(s)

* Tgl::Device::GetDrawnTriangleCount does not exist (FIXME: INCORRECT FIX -> Tgl::Device should be updated instead)

* Remove copy/pasted APP_ICON from lego1 resource.h header

* Implement empty ViewLODList::Dump method

* Also enable "compat mode" for newer MSVC compilers

* Only do decomp assertions when using older MSVC compilers

* msys2 mingw compat (cannot pass reference of rvalue)

* Fix msys2 mingw warning: declaration 'class Tgl::Group' does not declare anything

* Add FIXME comment to LEgo3DView::m_previousRenderTime

* LegoView1 is 16 bytes bigger then LegoView ==> 4 32-bit pointers

* include string.h for strlen

* Fix overrides

* Fix constness of method

* Fixes

* Formatting

* Add size assert for MxFrequencyMeter

* ci: build isle with msys2 + msvc on GitHub actions

* Set vcvars for msvc

* msys2 needs the msys2 shell

* Build in default shell

* isle is not 64-bit yet (I think)

* Print bitness

* Use amd64_x64 cross tools

* Minor updates

* Add more names

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-10 23:34:32 +01:00
Misha
58085df6b0
Implement most of LegoCameraController (#419)
* Implement LegoCameraController subclasses

* Update legopovcontroller.cpp

* fixes

* Update legocameracontroller.cpp

* fix naming conventions

* Update legopointofviewcontroller.h

* Update legopointofviewcontroller.h

* Fixes

* Match LegoPointOfViewController::Create

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-09 10:43:21 +01:00
Christian Semmler
091ecd5935
Move some classes to LegoOmni (#417) 2024-01-08 12:45:07 +01:00
Christian Semmler
c47206617d
Reorganize sources and files (#414)
* Reorganize sources

* Refactor

* Remove relative paths

* Renames

* Fix gitignore

* Remove stuff

* Try fixing format script

* Fix format

* Fix format

* Fix naming script

* Test format

* Fix format
2024-01-08 10:58:49 +01:00
Anonymous Maarten
78ee66336a
cmake: fix default ninja + add clang-format target (#75)
* Add job pools with 1 job to disable parallel builds of lego1 and isle

* cmake: add clang-format target
2024-01-07 17:31:31 -05:00
Christian Semmler
bb7e4df11b
Move MxDirectDraw and MxDirect3D to mxdirectx (#413) 2024-01-07 18:07:22 +01:00
Christian Semmler
8db36722d8
Implement/match Lego3DView and parent classes (#412)
* Implement/match TglSurface

* Implement/match LegoView/1

* Lego3DView

* Fixes

* Lego3DManager

* Remove garbage

* Remove garbage

* Use shorthand calls
2024-01-07 03:29:32 +01:00
Anonymous Maarten
dc3500f631
Fixes for building isle with mingw on Linux (#410)
* Add LEGO1.DLL resources

* Rename smack files to lowercase

This fixes casing issues with mingw on Linux
Also use double quotes for #error

* cmake: dxguid must come after dinput

* cmake: create LEGO1.DLL instead of libLEGO1.DLL, when using mingw

* act3actor.h  was not including mxcore.h, and using incorrect override

* g_mcoreCount seem to be signed integers

* LegoCameraController: return references to static data in stub functions

* Include string.h, stdlib.h and stdio.h for use of libc functions

* Override MxAtomId::operator!=

* Fix use of STL's std::map + std::vector

* Fix template functions for mingw

* iterator object is used after the for loop

* IDirectDrawSurface::BltFast's first 2 arguments are x/y coordinates, not pointers

* Add stub ViewLODListManager::Lookup

* Fixes

* Format

* Remove unnecessary COMPAT_CONST use

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-01-06 18:56:15 +01:00
Christian Semmler
935ebe6910
Implement LegoVideoManager::Create and related (#393)
* WIP

* Match

* Changes

* Fix format

* Style fixes

* Update naming.yml

* Match to ~85%
2024-01-02 01:17:38 +01:00
Christian Semmler
d82d062e92
Implement/match MxRegionCursor class (#385)
* Implement/match MxRegionCursor class

* Rename function
2023-12-29 05:37:21 +01:00
MS
9a6d555508
Cvdump parser and comparing library functions (#383)
* Cvdump wrapper and parser. Matching library functions

* Remove 'Self' type int (3.11+)

* Add temp reference for entrypoints

* ISLE using multithreaded libc

* 🙄
2023-12-28 22:10:57 +01:00
Misha
a06a360dc6
Implement Lego3DManager (#380)
* Implement Lego3DManager

* Update lego3dview.cpp

* fix

* fixes

* fix wrong vtable address

* Fixes/matches

* Fix Lego3DView

* Use undefined

* More fixes

* Rename

* Rename pad

* Add blank line

* Delete stuff

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-12-28 18:38:37 +01:00
Misha
6d0d308c37
Add unknown render class stub (#347)
* Add mxrender manager class stub

* fix format

* rename the class

* Update MxUnknown100dbdbc.cpp

* rename class

* fix clang format

* Remove accidently committed code

* Update LEGO1/legoomni.cpp

Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>

* fix

* fix 2

---------

Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2023-12-21 19:21:56 +01:00
Christian Semmler
afadca953b
Refactor MxPtrList to use p_ownership (#344)
* Refactor MxPtrList to use p_ownership

* Remove class names
2023-12-21 02:09:05 +01:00
Christian Semmler
db60467ba3
Bootstrap MxSmack (#343)
* Bootstrap MxSmack

* Add comment about incorrect structure

* Fix naming

* Fix name

* Add a comment about SDK

* Add names from Smacker SDK

* Use SMACK.LIB and interface

* Use RAD.H defined types

* Use different commets

* Fix member offset

* Update mxsmack.cpp
2023-12-21 02:07:48 +01:00
Misha
20daddde32
implement MxDSBuffer object creation (#340)
* push changes

* Update mxstreamcontroller.cpp

* fix build

* MxStreamChunk

* fix format

* Match functions

* Add a comment

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-12-17 18:24:39 +01:00
Misha
d72c767685
Implement a few legoomni/mxomni functions (#339)
* LegoOmni functions

* fix build

* Update mxstreamcontroller.cpp

* fixes + improve match

* Update mxomni.cpp

* Update mxdsobject.h

* improve match

* Update mxactionnotificationparam.h

* MxOmni::HandleActionEnd

* fixes

* Update LEGO1/mxstreamer.cpp

Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>

* A bunch of fixes

---------

Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-12-16 19:14:01 +01:00
Christian Semmler
a7194266b3
Refactor utility/decomp headers (#318) 2023-12-11 16:33:46 -05:00
Christian Semmler
2a16a508a5
(Proposal) Use alternative C4786 warning suppression (#312)
* Use alternative warning suppression

* Remove newline

* Fix script

* Patch C2.EXE to disable C4786 warning

* Delete compile.cmd

* py-fixes

* Update tools/patch_c2.py

* Update tools/patch_c2.py

---------

Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2023-12-08 06:37:44 -05:00
MS
ce686705f2
Refactor MxList cursors (#313)
* LegoWorldList

* Refactor list cursors

* Add decomp markers for list cursors

* Fix decomp markers

* MxRegionListCursor edit to prevent accuracy drop

* Better fix for MxRegionListCursor
2023-12-07 14:14:49 -05:00
Mark Langen
260772e374
Bootstrap decomp of Tgl rendering library (#293)
* Bootstrap decomp of D3DRM rendering code

* This PR kicks off work on decompiling the D3D Retained Mode (D3DRM)
  rendering part of the codebase.

* High level overview:

* There is a base IMxDirect3DRMObject class which all of the D3DRM
  rendering objects inherit from. Its only virtual method is one to get
  the underlying object handle.

* A hierarchy of abstract classes inherits from this base class, which
  I've called "IMxDirect3DRM<class>". These classes only have pure
  virtual methods on them and don't contain any data.

* Each one of the abstract classes has exactly one concrete
  implementation, which I've called "MxDirect3DRM<class>". These classes
  have exactly one piece of data, which is a pointer to the underlying
  D3D Retained Mode object.

* If the classes need to store additional data, they store it in a
  userdata blob which is attached to the D3DRM object rather than the
  additional data being stored in the class itself.

* I've worked out about twice this many classes related to D3DRM
  rendering so far but the PR was getting large enough as is, so I'm
  cutting it here for now.

* I decomped sufficiently many methods of these classe to convince
  myself that the above observations are correct. About 60% of the
  decomped methods here are perfect matches, including at least one
  non-trivial method per class.

* Formatting

* Restructure changes using Tgl naming / details

* Restructure the changes to use the naming that we know from Tgl.

* Fill in some parts of the implementation I couldn't initially figure
  out using the details from Tgl (got more 100% matches).

* Move d3drm link requirement

* Fixups FloatMatrix -> FloatMatrix4

* Fix order

* Full fix for ordering problems

* Put back accidentally removed include.

* Fix call which should have been Release

* Use new and delete for DeepClone

* Missing Tgl:: on CreateRenderer

* Revert change to bool return value.

* Rename Something -> Unk

* Return paramter naming convention to what Tgl used

* Add scalar ddtor to verify inline destructor

* Fix order

* Change malloc/free -> new/delete in Tgl

* Remove duplicate destructor.

* Check all inline destructors

* Fix dtor comments

* Third time's the charm

* Alphabetical sort

* Decomp adjustments

* Add d3drm files to clang-format

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-12-07 13:10:42 +01:00
Joshua Peisach
f7dcdf9894
MxFlcPresenter vtable70, m_unk64 (#304)
* MxFlcPresenter: vtable70

* begin work on MxFlcPresenter's m_unk64

* Add another function that makes use of the FLIC header

* Remove space

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-11-29 13:35:32 +01:00
MS
3d48cdede1
STL lists for stream classes (#307) 2023-11-28 14:26:39 +01:00
Nathan M Gilbert
7fc1f8019f
Implement ViewROI and base classes (#287)
* Implement ViewROI and base classes

* Clean up Orientable header

* Move tgl to tgl subdirectory, and use target_include_directories

* Move classes to submodules

* Fix some missed references

* Fix/match UpdateWorldData

* Renaming / removing MxTypes / refactoring

* Consistent naming for Matrix

* Adjust format action

* Add Vector3/Vector4 to Data vector

* Add TGL comment

* Add a comment about Matrix4Impl

* Add ROI comment

---------

Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-11-19 15:38:07 +01:00
MS
0bb3ea6a03
MxList refactor (#290)
* MxList refactor

* Reorder LegoPathControllerList::Destroy

* MxPtrList custom destructor and more offsets

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Fix member offset comments in collection classes

* Fix template annotations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-11-19 13:23:30 +01:00
Christian Semmler
04b503c79f
Bootstrap MxMediaPresenter (#274)
* Bootstrap MxMediaPresenter

* Add override
2023-11-12 13:47:01 +01:00
Christian Semmler
9ac9fe2761
MxRegion: initial implementation (#218)
* MxRegion structures

* MxRegion structures

* Remove junk

* Refactor

* WIP

* Use MxRect32 ctor

* Refactor

* Add MxSize32, match MxRegion ctor

* Add two template annotations

* Fix missing instructions

* Fix another bug

* Refactor

* Add GetPoint

* Implement/match MxRegionTopBottom::MxRegionTopBottom

* Implement/match more functions

* More implementation

* Don't expose internal match

* Fix indent

* Add template annotations

* Implement remaining functions

* Fix comment

* Match loops

* Simplify function

* Merge

* Remove junk

* Format

* Format

* match MxRegion::vtable1c

* revert vtable1c match-hack

This reverts commit 7b88625988.

---------

Co-authored-by: Ramen2X <64166386+Ramen2X@users.noreply.github.com>
2023-10-31 11:30:13 -04:00
Ramen2X
153f4a872e
implement/match several mxsmkpresenter functions (#251)
* implement/match several mxsmkpresenter functions

* formatting

* formatting (sequel)

* Match remaining functions

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-27 19:00:20 +02:00
Nathan M Gilbert
7d8c57fc9c
Rename some functions and members (#246)
* Rename some functions and members

* Match LegoWorld::Notify to 100%

* Match MxOmni::Destroy to 100%

* Fix parameter prefix

* Fix another parameter

* Fix CR at EOF

* Fix CR at EOF

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-25 16:51:59 -04:00