Commit graph

58 commits

Author SHA1 Message Date
Christian Semmler
02aaf1533f
Increased ISLE accuracy (#319)
* Improve WndProc accuracy

* Another accuracy fix for `WndProc`
2023-12-09 18:49:13 +01:00
Christian Semmler
494a556f8e
(Proposal) Adjustments to "decomp" language (#308)
* Adjustments to "decomp" language

* Fix a comment

* Fix accidental clang-formatting

* Fix order

* Fix order

* Remove junk

* Fix OFFSET

* Adjustments based on new suggestions

* Annotate globals

* Globals in ISLE

* More globals

* Merge from parser2 branch

* Allow prepending space for exact marker match

* To eliminate noise, require the 0x prefix on offset for marker match

* fix test from previous

* Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise

* FUNCTION to SYNTHETIC where needed

* Missed marker conversion on SetAtomId

* pylint cleanup, remove unused code

* Fix unexpected function end, add more unit tests

* Be more strict about synthetic name syntax

* Revert "Missed marker conversion on SetAtomId"

This reverts commit d87d665127.

* Revert "FUNCTION to SYNTHETIC where needed"

This reverts commit 8c815418d2.

* Implicit lookup by name for functions

* Fix VTABLE SYNTHETIC and other decomp markers

* Get vtable class name

* Vtable marker should identify struct

* No colon for SIZE comment

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Update README.md

* Update CONTRIBUTING.md

* Fix destructor/annotation

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

---------

Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 13:10:45 +01:00
MS
1ae3b07dc2
Checkorder tool to keep functions in original binary order (#228)
* First commit of order tool

* More flexible match on module name. Bugfix on blank_or_comment

* Report inexact offset comments in verbose mode. Bugfix for exact regex

* Refactor checkorder into reusable isledecomp module

* Find bad comments in one pass, add awareness of TEMPLATE

* Refactor of state machine to prepare for reccmp integration

* Use isledecomp lib in reccmp

* Build isledecomp in GH actions, fix mypy complaint

* Ensure unit test cpp files will be ignored by reccmp

* Allow multiple offset markers, pep8 cleanup

* Remove unused variable

* Code style, remove unneeded module and TODO

* Final renaming and type hints

* Fix checkorder issues, add GH action and enforce (#2)

* Fix checkorder issues

* Add GH action

* Test error case

* Works

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-11-21 09:44:45 +01:00
MS
7834f18999
MxQueue and parts of LegoInputManager (#268)
* MxQueue and parts of LegoInputManager

* Missed clang-format on mxqueue.h

* Fix declarations

* MxParamType -> NotificationId

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-11-07 09:30:26 +01:00
Christian Semmler
b449da1fa3
Introduce clang-format (#240) 2023-10-25 01:38:27 +02:00
Misha
625ee52fe0
implement a few mxomni/legoomni functions (#193) 2023-10-09 12:31:36 +02:00
Misha
d82649c6f0
MxStream provider and controller vtables (#191)
* MxStreamProvider and MxRamStreamProvider vtable

* Update mxramstreamprovider.h

* Match IsA

* Fixes, improvements

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-08 22:41:34 +02:00
ChrisMiuchiz
aa516af434
Remove goto from isleapp.cpp (#188)
* Remove goto from isleapp.cpp

* Simplify if statement and make indent consistent
2023-10-08 16:10:16 +02:00
Misha
8281e195f7
Implement MxOmni Start/stop timer (#181)
* Implement start/stop timer

* Mark StartDirectSound as stub

* remove accidently committed files
2023-10-07 19:12:59 +02:00
Christian Semmler
5164ef1a54
Refactor MxOmni/LegoOmni headers to use forward declarations (#148)
* Refactor MxOmni/LegoOmni headers to use forward declarations

* Fixes

* Fix build

* Fix deps
2023-10-07 17:30:04 +02:00
MattKC
3f6e3af8ca
Fix LegoOmni vtable (#140) 2023-09-25 13:28:25 -07:00
Christian Semmler
bd9dca0d3f
Implement most of MxDSAction (#103)
* Implement most of MxDSAction

* Update mxdsaction.h

* Update mxdsobject.cpp
2023-08-08 19:38:07 -07:00
Christian Semmler
d41b7f2ca4
Add GetDeviceModeFinder to WndProc (#102) 2023-08-06 13:26:14 -07:00
pewpew
0f92e345b3
MxTickleManager mostly done (#94)
* Checkpoint to show MxTickleManager::SetClientTickleInterval match.

* Match MxTickleManager::~MxTickleManager, obliterate MxTickleManager::SetClientTickleInterval.

* Make conditional more realistic, move MxTime to mxtypes.h, add TODO for MxTickleManager::Tickle.
2023-08-03 11:19:05 -07:00
MattKC
e16249b672
Define MxLong/MxULong (#71)
* define MxLong/MxULong

The "long" type has different sizes on different platforms, and this may cause issues.

* use DWORD to match RegQueryValueExA arg
2023-07-02 01:05:49 -07:00
itsmattkc
4c9e138cbf implement all DLL exports (as TODOs)
Now we can use our own compiled LEGO1.LIB rather than one generated from the original. Also implements a script that tests them to help ensure future commits don't break them.
2023-06-30 11:34:39 -07:00
MattKC
8476bf06b2
Yet another CMake implementation (#61)
* initial cmake implementation

* ci: i guess older cmake doesn't support this

* cmake: add max version to suppress warning

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2023-06-29 16:39:02 -07:00
Cydra
07912eb05a
Class layout for LEGO1 classes (#43)
* Stubbed a bunch of classes and annotated them for later use. Heavily wip and more of pseudocode right now.

* Converted pseudocode into real code!

* Created a bunch more classes and added more information to exisiting ones
Did not error check, this was pushed just for reference

* More classes and implementation details. Still not checked for any errors

* Fixed code and decided on a way to handle virtual table stubs

* Some additional fixes

* More smaller fixes

* Added classes to project and made it compile

* Fixed function adresses that caused the python script to fail

* More classes and virtual function resolves. Builds and compares fine.

* Again more classes and virtual function resolves. Builds and compares fine.

* No clue, I guess forced update for line endings

* Finished up some work, compiles fine. All functions are STUB annotated to not pollute reccmp.py output.

* line ending change

* rename GetClassName/IsClass

Mirroring recent changes from master

* further conform to current master

* update project

* cleanup

* project only updates when you close msdev

---------

Co-authored-by: Cydra <cydra95@gmail.com>
Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
2023-06-29 01:10:08 -07:00
itsmattkc
e7b5ea53df rename GetClassName/IsClass, declare mxtypes
Was intended as a simple code improvement, however it also seems to make WinMain, MxString::operator=, MxDSFile::Open 100% (all of which just needed registers to be switched around)
2023-06-27 19:04:07 -07:00
itsmattkc
066b7311ad rename Isle to IsleApp 2023-06-27 17:10:11 -07:00
Christian Semmler
24ec7023bd
isle: match WndProc and re-arrange functions in ISLE.EXE (#45)
* match WinProc

* minor accuracy improvement

* WndProc at 50%

* fix WM_DISPLAYCHANGE branching

* fix type

* fix x/y comparison

* WndProc 82%

* 84%

* 97%

* rearrange functions to get close to the original

* remove newline

* inline no longer necessary

* merge
2023-06-27 13:07:29 -07:00
Christian Semmler
579ee84049
isle: Improving WinMain and SetupWindow accuracy (#38)
* fix second Tick call, change loop

* add missing parameter to SetupWindow

* add missing include

* reorganize CreateWindowEx

* reorder cursor assignments

* declare SetupWindow as inline

* fix indent

* WinMain 99%

* minor improvement
2023-06-23 11:45:25 -07:00
MS
4f4863af6f
Use bitfield for MxVideoParamFlags (#40)
* Use bitfield for MxVideoParamFlags

Using a bitfield for MxVideoParamFlags results in the same xor/and logic that was partially inlined in the header file. This approach is a lot cleaner and there's a good chance this is what the devs would have landed on.

The code generation is really finicky -- other inlines in the header influence the code just by being there -- so I decided to stub out all of them. This got the match to 100%.

While I was in isle.cpp::SetupVideoFlags, I changed the signature so that the `m_using16bit` parameter is just `using16bit`.

* fix: cast Set16Bit inline arg to byte
2023-06-22 23:00:51 -07:00
itsmattkc
66a010a19f move inlined MxDSObject::SetAtomId to main header
We've confirmed that, despite a function being declared inline, msvc will still make a conventional call in some circumstances. As such, I feel like this is warranted because it's most likely what a developer would have actually written.
2023-06-22 00:45:56 -07:00
Christian Semmler
30ef923bf4
hotfix: messed up structure due to windows.h (#37) 2023-06-21 23:13:15 -07:00
Christian Semmler
fa8e4523bd
isle: match Isle::Tick and FindExistingInstance (#32)
* match Isle::Tick and FindExistingInstance

* add offset comments

* inline Isle::Tick

* move inline MxDSObject, remove mx.cpp
2023-06-21 15:18:37 -07:00
Christian Semmler
bfa035ca79
isle: Match Isle::SetupCursor (#28)
* match Isle::SetupCursor

* case
2023-06-21 00:30:59 -07:00
Christian Semmler
124a5ddaa3
isle: Accuracy improvements (#27)
* Isle::Isle 100% accuracy

* Isle::~Isle 100%

* improve accuracy of ReadReg functions

* refactor

* fix Isle::ReadRegBool

* fix Isle::ReadRegInt

* empty commit to reset GH action

* fix Isle::SetupLegoOmni
2023-06-21 00:30:46 -07:00
Christian Semmler
0ab8fc52d2
lego1/isle: Add MxDSObject, implement SetObjectName, adjust MxDSAction (#20)
* add MxDSObject, implement SetObjectName, adjust MxDSAction

* add a TODO

* update project files

* add WIP MxDSObject stuff

* merge

* update project file

* add addresses and SetAtomId

* switch addresses

* remove comment since it's fixed now (?)

* refactor

* update project file

* refactor into separate unit

* refactor into separate unit

* rename unit to avoid NMAKE issue

* rename param

* add last missing piece to Isle::Close

* fix spelling

* merge

* use union hack
2023-06-19 17:18:53 -07:00
itsmattkc
f9f8440a3a main: elaborate new info about LoadAccelerators call [skip ci] 2023-06-19 01:22:01 -07:00
itsmattkc
2c6aeb8b82 oops forgot the calls too 2023-06-19 01:12:12 -07:00
itsmattkc
3d9a96995a isle: convert last two functions to PascalCase 2023-06-18 23:22:32 -07:00
ecumber
526c6af1f6
Implement a few Mx* functions / add data types (#25)
* Implement a few Mx* functions / add data types

* added more information, fixed formatting issues

* further cleanup

---------

Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
2023-06-18 22:36:07 -07:00
itsmattkc
1152feab8d use different naming scheme in ISLE
We now know that ISLE used PascalCase for its function names, so we're using those here now.
2023-06-18 21:51:50 -07:00
itsmattkc
4a41d3fd36 use sizeof in more places where appropriate 2023-06-18 21:51:26 -07:00
Anonymous Maarten
6e18d1b41f
ISLE and mingw32 fixes (#18)
* ci: no need to do a final cd

* MxDSAction has a setAtomId method

* Implement the MxOmniCreateParamBase destructor inline

Because of this, ISLE should no longer have to compile mxomnicreateparambase.obj.
I didn't modify isle.mak, because I don't have the MSVC 4.20 GUI set-up.

* Replace 256 with sizeof(...)

* Format DefWndProc calls in WndProc

* Replace magic mask in WNDPROC with macro's

* Replace magic numbers in main.cpp with macro's

* MOUSEMOVE notification id is 10 instead of 0x10

* Lowercase all windows includes such that mingw32 on Linux can find these

* Convert ISLE/res/isle.rc to utf-8, and add a comma needed by mingw32

* mingw32 cannot use a enum without previous declaration

* minor adjustments

---------

Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
2023-06-18 21:45:25 -07:00
itsmattkc
319b52f248 added more definitions
Also clarify .exe on script because Wine cares about that
2023-06-18 20:50:32 -07:00
MattKC
5aa7921e90
Add CI script to compare recompiled assembly with original code (#24)
* add test to compare assembly between functions

* ci: use abs path of wget

* ci: fix shell disambiguity

* ci: ensure capstone is installed

* ci: ensure correct filenames

* use better source for lego island files

* give me an idea of what the dir structure looks like

* make wine path function

* improved script and project

* fixed script on windows

* print debug info because now it literally only doesn't work on fucking github actions

* better source path resolving

For some reason, nmake compiles produce different symbols. I wonder if this affects the accuracy of the decomp.
2023-06-18 20:28:18 -07:00
Christian Semmler
30989aec9c
add Lego3DManager and related, fix a function signature 2023-06-18 13:45:39 +02:00
itsmattkc
6843216dfa isle: commit header that i forgot in the previous commit 2023-06-13 21:28:39 -07:00
itsmattkc
1c95cbe40e isle: named last global var 2023-06-13 20:25:42 -07:00
Thomas May
f91779b47a isle: replace other instances of ®️ with \xAE 2023-06-13 16:59:03 +01:00
itsmattkc
06c09a25bc use escape sequence in title string to prevent further unicode issues 2023-06-12 18:42:53 -07:00
itsmattkc
12a90b8730 fixed reg reading bug/inaccuracy 2023-06-12 13:06:10 -07:00
itsmattkc
7a5dc664ac improved accuracy of isle constructor 2023-06-12 13:05:55 -07:00
itsmattkc
87c61f8cd0 fixed symbol character regression
MSVC420 doesn't support UTF-8, so the (R) symbol must be in Windows-1252 encoding instead. A PR seems to have reverted this back to UTF-8 (a code editor probably did this without even mentioning it)
2023-06-12 11:51:13 -07:00
itsmattkc
dcf37c5244 isle: fix decomp inaccuracy 2023-06-11 18:04:09 -07:00
MattKC
363ebd2077
Merge pull request #4 from mosswg/match-to-original
Match some functions and values to the original binary
2023-06-11 11:17:13 -07:00
Christian Semmler
01845a94ab Use WM_SYSCOMMAND type constants 2023-06-11 16:12:41 +02:00
Moss Gallagher
1244a7a57b isle: Match readReg to Original 2023-06-11 03:29:13 -07:00