diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..937b347f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true +[*.{cpp,h,py,txt,editorconfig}] + +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18ad2d7a..3bbc6d50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,6 @@ name: Build -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] +on: [push, pull_request] jobs: build: @@ -26,7 +22,7 @@ jobs: key: dx5sdk - name: Download DX5 SDK - if: steps.cache-dx5.outputs.cache-hit != 'true' + if: ${{ !steps.cache-dx5.outputs.cache-hit }} run: | cd dx5sdk curl -fLOSs https://archive.org/download/idx5sdk/idx5sdk.exe @@ -34,8 +30,7 @@ jobs: 7z x .\DX5SDK.EXE - name: Cache DX5 SDK - if: steps.cache-dx5.outputs.cache-hit != 'true' - id: save-dx5 + if: ${{ !steps.cache-dx5.outputs.cache-hit }} uses: actions/cache/save@v3 with: path: dx5sdk @@ -47,22 +42,68 @@ jobs: cd cdrom .\SETUP.EXE /s + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + # Use 2.8 for maximum backwards compatibility + cmake-version: '2.8.x' + - name: Build shell: cmd run: | call .\msvc420\bin\VCVARS32.BAT x86 - mkdir Release - .\msvc420\bin\NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release" + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" + cmake --build . + + - name: Upload Artifact + uses: actions/upload-artifact@master + with: + name: Win32 + path: | + build/ISLE.EXE + build/ISLE.PDB + build/LEGO1.DLL + build/LEGO1.PDB + + compare: + needs: build + runs-on: windows-latest + steps: + - uses: actions/checkout@master + + - uses: actions/download-artifact@master + with: + name: Win32 + path: build + + - name: Restore cached original binaries + id: cache-original-binaries + uses: actions/cache/restore@v3 + with: + path: legobin + key: legobin + + - name: Download original island binares + if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} + run: | + C:\msys64\usr\bin\wget.exe https://legoisland.org/download/ISLE.EXE --directory-prefix=legobin + C:\msys64\usr\bin\wget.exe https://legoisland.org/download/LEGO1.DLL --directory-prefix=legobin + + - name: Cache original binaries + if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} + uses: actions/cache/save@v3 + with: + path: legobin + key: legobin - name: Summarize Accuracy shell: bash run: | - curl -fLOSs https://legoisland.org/download/ISLE.EXE - curl -fLOSs https://legoisland.org/download/LEGO1.DLL - pip install capstone - pip install colorama - python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB . | tee ISLEPROGRESS.TXT - python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB . | tee LEGO1PROGRESS.TXT + pip install -r tools/reccmp/requirements.txt + python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT + python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT - name: Compare Accuracy With Current Master shell: bash @@ -71,41 +112,50 @@ jobs: curl -fLSs -o ISLEPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/ISLEPROGRESS.TXT curl -fLSs -o LEGO1PROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/LEGO1PROGRESS.TXT - diff -u ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT - diff -u LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.TXT + diff -u ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true + diff -u LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.TXT || true + + - name: Test Exports + shell: bash + run: | + python3 tools/verexp/verexp.py legobin/LEGO1.DLL build/LEGO1.DLL - name: Upload Artifact uses: actions/upload-artifact@master with: - name: Win32 + name: Accuracy Report path: | - Release - ISLEPROGRESS.HTML - LEGO1PROGRESS.HTML - ISLEPROGRESS.SVG - LEGO1PROGRESS.SVG - + ISLEPROGRESS.* + LEGO1PROGRESS.* + + upload: + needs: [build, compare] + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + steps: + - uses: actions/checkout@v3 + with: + repository: 'probonopd/uploadtool' + + - uses: actions/download-artifact@master + with: + name: Win32 + path: build + + - uses: actions/download-artifact@master + with: + name: Accuracy Report + - name: Upload Continuous Release - shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} run: | - # Convert SVGs to PNG - INKSCAPE_DIR=inkscape-1.2.2_2022-12-09_732a01da63-x64 - curl -fLOSs https://inkscape.org/gallery/item/37364/$INKSCAPE_DIR.7z - 7z x $INKSCAPE_DIR.7z - $INKSCAPE_DIR/bin/inkscape -w 1024 ISLEPROGRESS.SVG -o ISLEPROGRESS.PNG - $INKSCAPE_DIR/bin/inkscape -w 1024 LEGO1PROGRESS.SVG -o LEGO1PROGRESS.PNG - - curl -fLOSs https://raw.githubusercontent.com/probonopd/uploadtool/master/upload.sh ./upload.sh \ - Release/ISLE.EXE \ - Release/LEGO1.DLL \ - ISLEPROGRESS.HTML \ - ISLEPROGRESS.TXT \ - ISLEPROGRESS.SVG \ - ISLEPROGRESS.PNG \ - LEGO1PROGRESS.HTML \ - LEGO1PROGRESS.TXT \ - LEGO1PROGRESS.PNG \ - LEGO1PROGRESS.SVG + build/ISLE.EXE \ + build/LEGO1.DLL \ + ISLEPROGRESS.* \ + LEGO1PROGRESS.* + + curl -X POST -F key=$UPLOAD_KEY -F 'file=@ISLEPROGRESS.SVG' https://legoisland.org/progress/ + curl -X POST -F key=$UPLOAD_KEY -F 'file=@LEGO1PROGRESS.SVG' https://legoisland.org/progress/ diff --git a/.gitignore b/.gitignore index ef562599..14ad2717 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Release/ *.ncb ISLE.EXE LEGO1.DLL +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..cdfebd05 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,227 @@ +cmake_minimum_required(VERSION 2.8...3.5 FATAL_ERROR) + +project(isle CXX) + +option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) + +add_library(lego1 SHARED + LEGO1/act1state.cpp + LEGO1/act2brick.cpp + LEGO1/act2policestation.cpp + LEGO1/act3.cpp + LEGO1/act3shark.cpp + LEGO1/act3state.cpp + LEGO1/ambulance.cpp + LEGO1/ambulancemissionstate.cpp + LEGO1/animstate.cpp + LEGO1/beachhouseentity.cpp + LEGO1/bike.cpp + LEGO1/buildingentity.cpp + LEGO1/bumpbouy.cpp + LEGO1/carrace.cpp + LEGO1/dllmain.cpp + LEGO1/dunebuggy.cpp + LEGO1/elevatorbottom.cpp + LEGO1/gasstation.cpp + LEGO1/gasstationentity.cpp + LEGO1/gasstationstate.cpp + LEGO1/helicopter.cpp + LEGO1/helicopterstate.cpp + LEGO1/historybook.cpp + LEGO1/hospital.cpp + LEGO1/hospitalentity.cpp + LEGO1/hospitalstate.cpp + LEGO1/infocenter.cpp + LEGO1/infocenterdoor.cpp + LEGO1/infocenterentity.cpp + LEGO1/infocenterstate.cpp + LEGO1/isle.cpp + LEGO1/isleactor.cpp + LEGO1/islepathactor.cpp + LEGO1/jetski.cpp + LEGO1/jetskirace.cpp + LEGO1/jukebox.cpp + LEGO1/jukeboxentity.cpp + LEGO1/jukeboxstate.cpp + LEGO1/legoact2state.cpp + LEGO1/legoactioncontrolpresenter.cpp + LEGO1/legoanimactor.cpp + LEGO1/legoanimationmanager.cpp + LEGO1/legoanimmmpresenter.cpp + LEGO1/legoanimpresenter.cpp + LEGO1/legobackgroundcolor.cpp + LEGO1/legobackgroundcolor.cpp + LEGO1/legobuildingmanager.cpp + LEGO1/legocachesound.cpp + LEGO1/legocameracontroller.cpp + LEGO1/legocarbuild.cpp + LEGO1/legocarbuildanimpresenter.cpp + LEGO1/legocontrolmanager.cpp + LEGO1/legoentity.cpp + LEGO1/legoentitypresenter.cpp + LEGO1/legoflctexturepresenter.cpp + LEGO1/legogamestate.cpp + LEGO1/legohideanimpresenter.cpp + LEGO1/legoinputmanager.cpp + LEGO1/legojetski.cpp + LEGO1/legoloadcachesoundpresenter.cpp + LEGO1/legolocomotionanimpresenter.cpp + LEGO1/legomodelpresenter.cpp + LEGO1/legonavcontroller.cpp + LEGO1/legoomni.cpp + LEGO1/legopalettepresenter.cpp + LEGO1/legopartpresenter.cpp + LEGO1/legopathactor.cpp + LEGO1/legopathcontroller.cpp + LEGO1/legopathpresenter.cpp + LEGO1/legophonemepresenter.cpp + LEGO1/legoplantmanager.cpp + LEGO1/legorace.cpp + LEGO1/legoroi.cpp + LEGO1/legosoundmanager.cpp + LEGO1/legostate.cpp + LEGO1/legotexturepresenter.cpp + LEGO1/legoutil.cpp + LEGO1/legovideomanager.cpp + LEGO1/legoworld.cpp + LEGO1/legoworldpresenter.cpp + LEGO1/motorcycle.cpp + LEGO1/mxatomid.cpp + LEGO1/mxaudiopresenter.cpp + LEGO1/mxautolocker.cpp + LEGO1/mxbackgroundaudiomanager.cpp + LEGO1/mxbitmap.cpp + LEGO1/mxcompositemediapresenter.cpp + LEGO1/mxcompositepresenter.cpp + LEGO1/mxcontrolpresenter.cpp + LEGO1/mxcore.cpp + LEGO1/mxcriticalsection.cpp + LEGO1/mxdirectdraw.cpp + LEGO1/mxdiskstreamcontroller.cpp + LEGO1/mxdiskstreamprovider.cpp + LEGO1/mxdsaction.cpp + LEGO1/mxdsanim.cpp + LEGO1/mxdschunk.cpp + LEGO1/mxdsevent.cpp + LEGO1/mxdsfile.cpp + LEGO1/mxdsmediaaction.cpp + LEGO1/mxdsmultiaction.cpp + LEGO1/mxdsobject.cpp + LEGO1/mxdsobjectaction.cpp + LEGO1/mxdsparallelaction.cpp + LEGO1/mxdsselectaction.cpp + LEGO1/mxdsserialaction.cpp + LEGO1/mxdssound.cpp + LEGO1/mxdssource.cpp + LEGO1/mxdsstill.cpp + LEGO1/mxdssubscriber.cpp + LEGO1/mxentity.cpp + LEGO1/mxeventmanager.cpp + LEGO1/mxeventpresenter.cpp + LEGO1/mxflcpresenter.cpp + LEGO1/mxioinfo.cpp + LEGO1/mxloopingflcpresenter.cpp + LEGO1/mxloopingmidipresenter.cpp + LEGO1/mxloopingsmkpresenter.cpp + LEGO1/mxmediapresenter.cpp + LEGO1/mxmidipresenter.cpp + LEGO1/mxmusicpresenter.cpp + LEGO1/mxnotificationmanager.cpp + LEGO1/mxobjectfactory.cpp + LEGO1/mxomni.cpp + LEGO1/mxomnicreateflags.cpp + LEGO1/mxomnicreateparam.cpp + LEGO1/mxomnicreateparambase.cpp + LEGO1/mxpalette.cpp + LEGO1/mxpresenter.cpp + LEGO1/mxscheduler.cpp + LEGO1/mxsmkpresenter.cpp + LEGO1/mxsoundmanager.cpp + LEGO1/mxsoundpresenter.cpp + LEGO1/mxstillpresenter.cpp + LEGO1/mxstreamer.cpp + LEGO1/mxstring.cpp + LEGO1/mxstringvariable.cpp + LEGO1/mxtimer.cpp + LEGO1/mxtransitionmanager.cpp + LEGO1/mxunknown100dc6b0.cpp + LEGO1/mxunknown100dc6e0.cpp + LEGO1/mxvariabletable.cpp + LEGO1/mxvideomanager.cpp + LEGO1/mxvideoparam.cpp + LEGO1/mxvideoparamflags.cpp + LEGO1/mxvideopresenter.cpp + LEGO1/mxwavepresenter.cpp + LEGO1/pizza.cpp + LEGO1/pizzamissionstate.cpp + LEGO1/pizzeria.cpp + LEGO1/pizzeriastate.cpp + LEGO1/police.cpp + LEGO1/policeentity.cpp + LEGO1/policestate.cpp + LEGO1/racecar.cpp + LEGO1/racestandsentity.cpp + LEGO1/racestate.cpp + LEGO1/radio.cpp + LEGO1/radiostate.cpp + LEGO1/realtimeview.cpp + LEGO1/registrationbook.cpp + LEGO1/score.cpp + LEGO1/scorestate.cpp + LEGO1/skateboard.cpp + LEGO1/towtrack.cpp + LEGO1/towtrackmissionstate.cpp + LEGO1/viewmanager.cpp +) + +# Link libraries +target_link_libraries(lego1 PRIVATE ddraw dsound winmm) + +# Make sure filenames are ALL CAPS +set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1) +set_property(TARGET lego1 PROPERTY SUFFIX ".DLL") + +if (ISLE_BUILD_APP) + add_executable(isle WIN32 + ISLE/res/isle.rc + ISLE/isleapp.cpp + ISLE/define.cpp + ) + + # Include LEGO1 headers in ISLE + target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1") + + # Link DSOUND, WINMM, and LEGO1 + target_link_libraries(isle PRIVATE dsound winmm lego1) + + # Make sure filenames are ALL CAPS + set_property(TARGET isle PROPERTY OUTPUT_NAME ISLE) + set_property(TARGET isle PROPERTY SUFFIX ".EXE") +endif() + +if (MSVC) + # These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the + # game was originally built with) and tweaked slightly to produce more debugging info for reccmp. + # They ensure a recompilation that can be byte/instruction accurate to the original binaries. + + target_compile_options(isle PRIVATE "/ML$<$:d>") + target_compile_options(lego1 PRIVATE "/MT$<$:d>") + + set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"") + set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"") + set(CMAKE_CXX_FLAGS_RELEASE "/O2 /D \"NDEBUG\"") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /D \"NDEBUG\"") + set(CMAKE_CXX_FLAGS_MINSIZEREL "/Os /D \"NDEBUG\"") + + set(CMAKE_EXE_LINKER_FLAGS "/machine:I386") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/incremental:yes /debug") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/incremental:no") + set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug") + set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/incremental:no") + + set(CMAKE_SHARED_LINKER_FLAGS "/machine:I386") + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/incremental:yes /debug") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/incremental:no") + set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug") + set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "/incremental:no") +endif() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c6519ce..c9d3364a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,13 +6,21 @@ Generally, decompilation is a fairly advanced skill. If you aren't already famil ## Ghidra Server -For documenting the original binaries and generating pseudocode that we decompile with, we primarily use [Ghidra](https://ghidra-sre.org/) (it's free and open source). To help with collaboration, we have a shared Ghidra repository with all of our current work. You are free to check it out and mess around with it locally, however to prevent sabotage, you will need to request permission before you can push back to the server (ask in the Matrix room). +For documenting the original binaries and generating pseudocode that we decompile with, we primarily use [Ghidra](https://ghidra-sre.org/) (it's free and open source). To help with collaboration, we have a shared Ghidra repository with all of our current work. You are free to check it out and mess around with it locally, however to prevent sabotage, you will need to request permission before you can push your changes back to the server (ask in the Matrix room). To access the Ghidra repository, use the following details: - Address: `server.mattkc.com` - Port: `13100` +## General Guidelines + +If you have contributions, feel free to create a pull request! Someone will review and merge it (or provide feedback) as soon as possible. + +Please keep your pull requests small and understandable; you may be able to shoot ahead and make a lot of progress in a short amount of time, but this is a collaborative project, so you must allow others to catch up and follow along. Large pull requests become significantly more unwieldy to review, and as such make it exponentially more likely for a mistake or error to go undetected. They also make it harder to merge other pull requests because the more files you modify, the more likely it is for a merge conflict to occur. A general guideline is to keep submissions limited to one class at a time. Sometimes two or more classes may be too interlinked for this to be feasible, so this is not a hard rule, however if your PR is starting to modify more than 10 or so files, it's probably getting too big. + +This repository currently has only one goal: accuracy to the original executables. We are byte/instruction matching as much as possible, which means the priority is making the original compiler (MSVC 4.20) produce code that matches the original game. As such, modernizations and bug fixes will probably be rejected for the time being. + ## Code Style In general, we're not exhaustively strict about coding style, but there are some preferable guidelines to follow that have been adopted from what we know about the original codebase: @@ -22,10 +30,7 @@ In general, we're not exhaustively strict about coding style, but there are some - `m_camelCase` for member variables. - `g_camelCase` for global variables. - `p_camelCase` for function parameters. - -## Kinds of Contributions - -This repository has only one goal: accuracy to the original executables. As such, we are not likely to accept pull requests that attempt to modernize the code, or improve compatibility in a newer compiler that ends up reducing compatibility in MSVC 4.20. Essentially, accuracy is king, everything else is secondary. For modernizations and enhancements, it's recommended to create a fork downstream from this one instead. +- Instead of C++ primitives (e.g. `int`, `long`, etc.), use types in `mxtypes.h` instead. This will help us ensure that variables will be the correct size regardless of the underlying compiler/platform/architecture. ## Questions? diff --git a/ISLE/define.cpp b/ISLE/define.cpp index f236ea29..61de399e 100644 --- a/ISLE/define.cpp +++ b/ISLE/define.cpp @@ -37,4 +37,4 @@ int g_reqEnableRMDevice = 0; int g_startupDelay = 200; // 0x4101c0 -long g_lastFrameTime = 0; +MxLong g_lastFrameTime = 0; diff --git a/ISLE/define.h b/ISLE/define.h index ffc74654..ff2a4c2f 100644 --- a/ISLE/define.h +++ b/ISLE/define.h @@ -1,6 +1,7 @@ #ifndef DEFINE_H #define DEFINE_H +#include #include class IsleApp; @@ -21,6 +22,6 @@ extern int g_targetHeight; extern int g_targetDepth; extern int g_reqEnableRMDevice; extern int g_startupDelay; -extern long g_lastFrameTime; +extern MxLong g_lastFrameTime; #endif // DEFINE_H diff --git a/ISLE/ext/lego1.def b/ISLE/ext/lego1.def deleted file mode 100644 index eb8c8fb3..00000000 --- a/ISLE/ext/lego1.def +++ /dev/null @@ -1,137 +0,0 @@ -; -; Definition file of Lego1.dll -; Automatic generated by gendef -; written by Kai Tietz 2008 -; -LIBRARY "Lego1.dll" -EXPORTS -??0LegoBackgroundColor@@QAE@PBD0@Z ; has WINAPI (@8) -??0LegoGameState@@QAE@XZ -??0LegoWorld@@QAE@XZ -??0MxAtomId@@QAE@PBDW4LookupMode@@@Z ; has WINAPI (@8) -??0MxBitmap@@QAE@XZ -??0MxCore@@QAE@XZ -??0MxCriticalSection@@QAE@XZ -??0MxDSAction@@QAE@XZ -??0MxDSFile@@QAE@PBDK@Z ; has WINAPI (@8) -??0MxOmniCreateFlags@@QAE@XZ -??0MxOmniCreateParam@@QAE@PBDPAUHWND__@@AAVMxVideoParam@@VMxOmniCreateFlags@@@Z ; has WINAPI (@16) -??0MxString@@QAE@ABV0@@Z ; has WINAPI (@4) -??0MxVideoParam@@QAE@AAV0@@Z ; has WINAPI (@4) -??0MxVideoParam@@QAE@AAVMxRect32@@PAVMxPalette@@KAAVMxVideoParamFlags@@@Z ; has WINAPI (@16) -??0MxVideoParam@@QAE@XZ -??0MxVideoParamFlags@@QAE@XZ -??1LegoEntity@@UAE@XZ -??1LegoGameState@@QAE@XZ -??1LegoWorld@@UAE@XZ -??1MXIOINFO@@QAE@XZ -??1MxAtomId@@QAE@XZ -??1MxBitmap@@UAE@XZ -??1MxCore@@UAE@XZ -??1MxCriticalSection@@QAE@XZ -??1MxDSAction@@UAE@XZ -??1MxDSFile@@UAE@XZ -??1MxPresenter@@UAE@XZ -??1MxString@@UAE@XZ -??1MxVideoParam@@QAE@XZ -??4MxAtomId@@QAEAAV0@ABV0@@Z ; has WINAPI (@4) -??4MxString@@QAEABV0@PBD@Z ; has WINAPI (@4) -??4MxVideoParam@@QAEAAV0@ABV0@@Z ; has WINAPI (@4) -??8MxPalette@@QAEEAAV0@@Z ; has WINAPI (@4) -?BackgroundAudioManager@@YAPAVMxBackgroundAudioManager@@XZ -?Close@MxDSFile@@UAEJXZ -?Close@MxStreamer@@QAEJPBD@Z ; has WINAPI (@4) -?CreateBackgroundAudio@LegoOmni@@QAEXXZ -?CreateInstance@LegoOmni@@SAXXZ -?CreatePalette@MxBitmap@@UAEPAVMxPalette@@XZ -?CreateStreamObject@@YAPAVMxDSObject@@PAVMxDSFile@@F@Z -?DestroyInstance@MxOmni@@SAXXZ -?Detach@MxPalette@@QAEXXZ -?DisableRMDevice@LegoVideoManager@@QAEHXZ -?DoneTickle@MxPresenter@@MAEXXZ -?Enable@MxBackgroundAudioManager@@QAEXE@Z ; has WINAPI (@4) -?Enable@MxPresenter@@UAEXE@Z ; has WINAPI (@4) -?EnableFullScreenMovie@LegoVideoManager@@QAEXEE@Z ; has WINAPI (@8) -?EnableRMDevice@LegoVideoManager@@QAEHXZ -?EndAction@MxPresenter@@UAEXXZ -?EventManager@@YAPAVMxEventManager@@XZ -?FlipToGDISurface@MxDirectDraw@@QAEHXZ -?GameState@@YAPAVLegoGameState@@XZ -?GetBufferSize@MxDSFile@@UAEKXZ -?GetCD@MxOmni@@SAPBDXZ -?GetCurrPathInfo@LegoOmni@@SAHPAPAVLegoPathBoundary@@AAH@Z -?GetDefaults@LegoNavController@@SAXPAHPAM11111111PAE@Z -?GetHD@MxOmni@@SAPBDXZ -?GetInstance@LegoOmni@@SAPAV1@XZ -?GetInstance@MxOmni@@SAPAV1@XZ -?GetInstance@MxScheduler@@SAPAV1@XZ -?GetNoCD_SourceName@@YAPBDXZ -?GetPartsThreshold@RealtimeView@@SAMXZ -?GetPrimaryBitDepth@MxDirectDraw@@SAHXZ -?GetRealTime@MxTimer@@QAEJXZ -?GetStreamBuffersNum@MxDSFile@@UAEKXZ -?GetUserMaxLOD@RealtimeView@@SAMXZ -?GetVariable@MxVariableTable@@QAEPBDPBD@Z ; has WINAPI (@4) -?Init@MxPresenter@@IAEXXZ -?InputManager@@YAPAVLegoInputManager@@XZ -?InvalidateRect@MxVideoManager@@QAEXAAVMxRect32@@@Z ; has WINAPI (@4) -?IsSound3D@MxOmni@@SAEXZ -?Lego@@YAPAVLegoOmni@@XZ -?Load@LegoGameState@@QAEJK@Z ; has WINAPI (@4) -?MSoundManager@@YAPAVMxSoundManager@@XZ -?MakeSourceName@@YAXPADPBD@Z -?MoveCursor@LegoVideoManager@@QAEXHH@Z ; has WINAPI (@8) -?MusicManager@@YAPAVMxMusicManager@@XZ -?NotificationManager@@YAPAVMxNotificationManager@@XZ -?Notify@MxCore@@UAEJAAVMxParam@@@Z ; has WINAPI (@4) -?Open@MxDSFile@@UAEJK@Z ; has WINAPI (@4) -?Open@MxStreamer@@QAEPAVMxStreamController@@PBDG@Z ; has WINAPI (@8) -?ParseExtra@MxPresenter@@MAEXXZ -?Pause@MxDirectDraw@@QAEHH@Z ; has WINAPI (@4) -?PickEntity@@YAPAVLegoEntity@@JJ@Z -?PickROI@@YAPAVLegoROI@@JJ@Z -?QueueEvent@LegoInputManager@@QAEXW4NotificationId@@EJJE@Z ; has WINAPI (@20) -?Read@MxBitmap@@UAEJPBD@Z ; has WINAPI (@4) -?Read@MxDSFile@@UAEJPAEK@Z ; has WINAPI (@8) -?RealizePalette@MxVideoManager@@UAEJPAVMxPalette@@@Z ; has WINAPI (@4) -?Register@LegoInputManager@@QAEXPAVMxCore@@@Z ; has WINAPI (@4) -?RemoveAll@ViewManager@@QAEXPAVViewROI@@@Z ; has WINAPI (@4) -?RemoveWorld@LegoOmni@@QAEXABVMxAtomId@@J@Z ; has WINAPI (@8) -?Save@LegoGameState@@QAEJK@Z ; has WINAPI (@4) -?Seek@MxDSFile@@UAEJJH@Z ; has WINAPI (@8) -?SerializePlayersInfo@LegoGameState@@QAEXF@Z ; has WINAPI (@4) -?SerializeScoreHistory@LegoGameState@@QAEXF@Z ; has WINAPI (@4) -?SetCD@MxOmni@@SAXPBD@Z -?SetDefaults@LegoNavController@@SAXHMMMMMMMMME@Z -?SetDeviceName@MxVideoParam@@QAEXPAD@Z ; has WINAPI (@4) -?SetDisplayBB@LegoROI@@QAEXH@Z ; has WINAPI (@4) -?SetDoMutex@MxCriticalSection@@SAXXZ -?SetHD@MxOmni@@SAXPBD@Z -?SetObjectName@MxDSObject@@QAEXPBD@Z ; has WINAPI (@4) -?SetOmniUserMessage@@YAXP6AXPBDH@Z@Z -?SetPartsThreshold@RealtimeView@@SAXM@Z -?SetSavePath@LegoGameState@@QAEXPAD@Z ; has WINAPI (@4) -?SetSound3D@MxOmni@@SAXE@Z -?SetUserMaxLOD@RealtimeView@@SAXM@Z -?SetVariable@MxVariableTable@@QAEXPAVMxVariable@@@Z ; has WINAPI (@4) -?SetVariable@MxVariableTable@@QAEXPBD0@Z ; has WINAPI (@8) -?SetWaitIndicator@MxTransitionManager@@QAEXPAVMxVideoPresenter@@@Z ; has WINAPI (@4) -?SoundManager@@YAPAVLegoSoundManager@@XZ -?Start@@YAJPAVMxDSAction@@@Z -?StartAction@MxPresenter@@UAEJPAVMxStreamController@@PAVMxDSAction@@@Z ; has WINAPI (@8) -?StartMultiTasking@MxScheduler@@QAEXK@Z ; has WINAPI (@4) -?Streamer@@YAPAVMxStreamer@@XZ -?Tickle@MxPresenter@@UAEJXZ -?TickleManager@@YAPAVMxTickleManager@@XZ -?Timer@@YAPAVMxTimer@@XZ -?TransitionManager@@YAPAVMxTransitionManager@@XZ -?UnRegister@LegoInputManager@@QAEXPAVMxCore@@@Z ; has WINAPI (@4) -?VariableTable@@YAPAVMxVariableTable@@XZ -?VideoManager@@YAPAVLegoVideoManager@@XZ -?configureLegoAnimationManager@LegoAnimationManager@@SAXH@Z -?configureLegoBuildingManager@LegoBuildingManager@@SAXH@Z -?configureLegoModelPresenter@LegoModelPresenter@@SAXH@Z -?configureLegoPartPresenter@LegoPartPresenter@@SAXHH@Z -?configureLegoROI@LegoROI@@SAXH@Z -?configureLegoWorldPresenter@LegoWorldPresenter@@SAXH@Z -_DllMain@12@12 diff --git a/ISLE/ext/lego1.exp b/ISLE/ext/lego1.exp deleted file mode 100644 index 300d78fd..00000000 Binary files a/ISLE/ext/lego1.exp and /dev/null differ diff --git a/ISLE/ext/lego1.lib b/ISLE/ext/lego1.lib deleted file mode 100644 index 684a82b7..00000000 Binary files a/ISLE/ext/lego1.lib and /dev/null differ diff --git a/ISLE/isle.cpp b/ISLE/isleapp.cpp similarity index 99% rename from ISLE/isle.cpp rename to ISLE/isleapp.cpp index 938de251..a1836e8c 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isleapp.cpp @@ -1,4 +1,4 @@ -#include "isle.h" +#include "isleapp.h" #include "define.h" #include @@ -95,7 +95,7 @@ void IsleApp::Close() TransitionManager()->SetWaitIndicator(NULL); Lego()->vtable3c(); - long lVar8; + MxLong lVar8; do { lVar8 = Streamer()->Close(NULL); } while (lVar8 == 0); @@ -571,7 +571,7 @@ BOOL IsleApp::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize) DWORD valueType; BOOL out = FALSE; - unsigned long size = outSize; + DWORD size = outSize; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) { if (RegCloseKey(hKey) == ERROR_SUCCESS) { @@ -695,7 +695,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame) if (!TickleManager()) return; if (!Timer()) return; - long currentTime = Timer()->GetRealTime(); + MxLong currentTime = Timer()->GetRealTime(); if (currentTime < g_lastFrameTime) { g_lastFrameTime = -this->m_frameDelta; } diff --git a/ISLE/isle.h b/ISLE/isleapp.h similarity index 93% rename from ISLE/isle.h rename to ISLE/isleapp.h index 7f01cf7d..a622697a 100644 --- a/ISLE/isle.h +++ b/ISLE/isleapp.h @@ -1,9 +1,9 @@ -#ifndef ISLE_H -#define ISLE_H +#ifndef ISLEAPP_H +#define ISLEAPP_H #include -#include "mxresult.h" +#include "mxtypes.h" #include "mxvideoparam.h" class IsleApp @@ -56,7 +56,7 @@ class IsleApp // 40 int m_islandTexture; int m_gameStarted; - long m_frameDelta; + MxLong m_frameDelta; // 4c MxVideoParam m_videoParam; @@ -73,4 +73,4 @@ class IsleApp HCURSOR m_cursorCurrent; }; -#endif // ISLE_H +#endif // ISLEAPP_H diff --git a/ISLE/res/isle.rc b/ISLE/res/isle.rc index 4534ea64..95432e06 100644 --- a/ISLE/res/isle.rc +++ b/ISLE/res/isle.rc @@ -1,9 +1,9 @@ #include "resource.h" -ISLE_ARROW CURSOR "ISLE/res/arrow.cur" -ISLE_NO CURSOR "ISLE/res/no.cur" -ISLE_BUSY CURSOR "ISLE/res/busy.cur" -APP_ICON ICON "ISLE/res/isle.ico" +ISLE_ARROW CURSOR "arrow.cur" +ISLE_NO CURSOR "no.cur" +ISLE_BUSY CURSOR "busy.cur" +APP_ICON ICON "isle.ico" 1 VERSIONINFO FILEVERSION 1,1,0,0 diff --git a/LEGO1/act1state.cpp b/LEGO1/act1state.cpp new file mode 100644 index 00000000..556e6dbc --- /dev/null +++ b/LEGO1/act1state.cpp @@ -0,0 +1,8 @@ +#include "act1state.h" + +// OFFSET: LEGO1 0x100334b0 STUB +Act1State::Act1State() +{ + // TODO +} + diff --git a/LEGO1/act1state.h b/LEGO1/act1state.h new file mode 100644 index 00000000..edcb9e9d --- /dev/null +++ b/LEGO1/act1state.h @@ -0,0 +1,27 @@ +#ifndef ACT1STATE_H +#define ACT1STATE_H + +#include "legostate.h" + +// VTABLE 0x100d7028 +// SIZE 0x26c +class Act1State : public LegoState +{ +public: + Act1State(); + + // OFFSET: LEGO1 0x100338a0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0154 + return "Act1State"; + }; + + // OFFSET: LEGO1 0x100338b0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Act1State::ClassName()) || LegoState::IsA(name); + }; +}; + +#endif // ACT1STATE_H diff --git a/LEGO1/act2brick.cpp b/LEGO1/act2brick.cpp new file mode 100644 index 00000000..84c8bbb3 --- /dev/null +++ b/LEGO1/act2brick.cpp @@ -0,0 +1,29 @@ +#include "act2brick.h" + +// OFFSET: LEGO1 0x1007a2b0 STUB +Act2Brick::Act2Brick() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007a470 STUB +Act2Brick::~Act2Brick() +{ + // TODO +} + +// STUB OFFSET: LEGO1 0x1007a8c0 STUB +MxLong Act2Brick::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x1007a7f0 STUB +MxLong Act2Brick::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/act2brick.h b/LEGO1/act2brick.h new file mode 100644 index 00000000..bf909198 --- /dev/null +++ b/LEGO1/act2brick.h @@ -0,0 +1,32 @@ +#ifndef ACT2BRICK_H +#define ACT2BRICK_H + +#include "legopathactor.h" + +// VTABLE 0x100d9b60 +// SIZE 0x194 +class Act2Brick : public LegoPathActor +{ +public: + Act2Brick(); + virtual ~Act2Brick() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxLong Tickle() override; // vtable+0x08 + + // OFFSET: LEGO1 0x1007a360 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0438 + return "Act2Brick"; + } + + // OFFSET: LEGO1 0x1007a370 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(Act2Brick::ClassName(), name) || LegoEntity::IsA(name); + } + +}; + +#endif // ACT2BRICK_H diff --git a/LEGO1/act2policestation.cpp b/LEGO1/act2policestation.cpp new file mode 100644 index 00000000..32c15e3e --- /dev/null +++ b/LEGO1/act2policestation.cpp @@ -0,0 +1,9 @@ +#include "act2policestation.h" + +// OFFSET: LEGO1 0x1004e0e0 STUB +MxLong Act2PoliceStation::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/act2policestation.h b/LEGO1/act2policestation.h new file mode 100644 index 00000000..7b0ea9c5 --- /dev/null +++ b/LEGO1/act2policestation.h @@ -0,0 +1,27 @@ +#ifndef ACT2POLICESTATION_H +#define ACT2POLICESTATION_H + +#include "legoentity.h" + +// VTABLE 0x100d53a8 +// SIZE 0x68 +class Act2PoliceStation : public LegoEntity +{ +public: + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x1000e200 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03fc + return "Act2PoliceStation"; + } + + // OFFSET: LEGO1 0x1000e210 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Act2PoliceStation::ClassName()) || LegoEntity::IsA(name); + } +}; + +#endif // ACT2POLICESTATION_H diff --git a/LEGO1/act3.cpp b/LEGO1/act3.cpp new file mode 100644 index 00000000..eca84fbf --- /dev/null +++ b/LEGO1/act3.cpp @@ -0,0 +1,13 @@ +#include "act3.h" + +// OFFSET: LEGO1 0x10072270 STUB +Act3::Act3() +{ + // TODO +} + +// OFFSET: LEGO1 0x100726a0 STUB +Act3::~Act3() +{ + // TODO +} diff --git a/LEGO1/act3.h b/LEGO1/act3.h new file mode 100644 index 00000000..d0cad28a --- /dev/null +++ b/LEGO1/act3.h @@ -0,0 +1,31 @@ +#ifndef ACT3_H +#define ACT3_H + +#include "legoworld.h" + +// VTABLE 0x100d9628 +// SIZE 0x4274 +class Act3 : public LegoWorld +{ +public: + Act3(); + + virtual ~Act3() override; // vtable+00 + + // OFFSET: LEGO1 0x10072510 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f013c + return "Act3"; + } + + // OFFSET: LEGO1 0x10072520 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Act3::ClassName()) || LegoWorld::IsA(name); + } + +}; + + +#endif // ACT3_H diff --git a/LEGO1/act3actor.h b/LEGO1/act3actor.h new file mode 100644 index 00000000..a88884a1 --- /dev/null +++ b/LEGO1/act3actor.h @@ -0,0 +1,18 @@ +#ifndef ACT3ACTOR_H +#define ACT3ACTOR_H + +// FIXME: Uncertain location. There are three vtables which eventually call this +// class' ClassName() function, but none of them call it directly. +class Act3Actor +{ +public: + // OFFSET: LEGO1 0x100431b0 + inline virtual const char *ClassName() override + { + // 0x100f03ac + return "Act3Actor"; + } + +}; + +#endif // ACT3ACTOR_H diff --git a/LEGO1/act3shark.cpp b/LEGO1/act3shark.cpp new file mode 100644 index 00000000..95e5a0e0 --- /dev/null +++ b/LEGO1/act3shark.cpp @@ -0,0 +1 @@ +#include "act3shark.h" diff --git a/LEGO1/act3shark.h b/LEGO1/act3shark.h new file mode 100644 index 00000000..6cbdbc09 --- /dev/null +++ b/LEGO1/act3shark.h @@ -0,0 +1,18 @@ +#ifndef ACT3SHARK_H +#define ACT3SHARK_H + +#include "legoanimactor.h" + +// VTABLE 0x100d7920 +class Act3Shark : public LegoAnimActor +{ +public: + // OFFSET: LEGO1 0x100430c0 + inline virtual const char *ClassName() const override + { + // 0x100f03a0 + return "Act3Shark"; + } +}; + +#endif // ACT3SHARK_H diff --git a/LEGO1/act3state.cpp b/LEGO1/act3state.cpp new file mode 100644 index 00000000..5e56a31b --- /dev/null +++ b/LEGO1/act3state.cpp @@ -0,0 +1,7 @@ +#include "act3state.h" + +// OFFSET: LEGO1 0x1000e2f0 +MxBool Act3State::VTable0x14() +{ + return FALSE; +} diff --git a/LEGO1/act3state.h b/LEGO1/act3state.h new file mode 100644 index 00000000..17c19ca6 --- /dev/null +++ b/LEGO1/act3state.h @@ -0,0 +1,37 @@ +#ifndef ACT3STATE_H +#define ACT3STATE_H + +#include "legostate.h" + +// VTABLE 0x100d4fc8 +// SIZE 0xc +class Act3State : public LegoState +{ +public: + inline Act3State() + { + m_unk08 = 0; + } + + // OFFSET: LEGO1 0x1000e300 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03f0 + return "Act3State"; + } + + // OFFSET: LEGO1 0x1000e310 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Act3State::ClassName()) || LegoState::IsA(name); + } + + virtual MxBool VTable0x14() override; + +private: + // FIXME: May be part of LegoState? Uncertain... + MxU32 m_unk08; + +}; + +#endif // ACT3STATE_H diff --git a/LEGO1/ambulance.cpp b/LEGO1/ambulance.cpp new file mode 100644 index 00000000..6b5e76ad --- /dev/null +++ b/LEGO1/ambulance.cpp @@ -0,0 +1,7 @@ +#include "ambulance.h" + +// OFFSET: LEGO1 0x10035ee0 STUB +Ambulance::Ambulance() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/ambulance.h b/LEGO1/ambulance.h new file mode 100644 index 00000000..dd89af3c --- /dev/null +++ b/LEGO1/ambulance.h @@ -0,0 +1,28 @@ +#ifndef AMBULANCE_H +#define AMBULANCE_H + +#include "islepathactor.h" + +// VTABLE 0x100d71a8 +// SIZE 0x184 +class Ambulance : public IslePathActor +{ +public: + Ambulance(); + + // OFFSET: LEGO1 0x10035fa0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03c4 + return "Ambulance"; + } + + // OFFSET: LEGO1 0x10035fb0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Ambulance::ClassName()) || IslePathActor::IsA(name); + } + +}; + +#endif // AMBULANCE_H diff --git a/LEGO1/ambulancemissionstate.cpp b/LEGO1/ambulancemissionstate.cpp new file mode 100644 index 00000000..6b20ce3a --- /dev/null +++ b/LEGO1/ambulancemissionstate.cpp @@ -0,0 +1,7 @@ +#include "ambulancemissionstate.h" + +// OFFSET: LEGO1 0x100373a0 STUB +AmbulanceMissionState::AmbulanceMissionState() +{ + // TODO +} diff --git a/LEGO1/ambulancemissionstate.h b/LEGO1/ambulancemissionstate.h new file mode 100644 index 00000000..572bba9a --- /dev/null +++ b/LEGO1/ambulancemissionstate.h @@ -0,0 +1,29 @@ +#ifndef AMBULANCEMISSIONSTATE_H +#define AMBULANCEMISSIONSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d72a0 +// SIZE 0x24 +class AmbulanceMissionState : public LegoState +{ +public: + AmbulanceMissionState(); + + // OFFSET: LEGO1 0x10037600 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f00e8 + return "AmbulanceMissionState"; + } + + // OFFSET: LEGO1 0x10037610 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, AmbulanceMissionState::ClassName()) || LegoState::IsA(name); + } + +}; + + +#endif // AMBULANCEMISSIONSTATE_H diff --git a/LEGO1/animstate.cpp b/LEGO1/animstate.cpp new file mode 100644 index 00000000..887328bb --- /dev/null +++ b/LEGO1/animstate.cpp @@ -0,0 +1,13 @@ +#include "animstate.h" + +// OFFSET: LEGO1 0x10064ff0 STUB +AnimState::AnimState() +{ + // TODO +} + +// OFFSET: LEGO1 0x10065150 STUB +AnimState::~AnimState() +{ + // TODO +} diff --git a/LEGO1/animstate.h b/LEGO1/animstate.h new file mode 100644 index 00000000..2095c1cb --- /dev/null +++ b/LEGO1/animstate.h @@ -0,0 +1,29 @@ +#ifndef ANIMSTATE_H +#define ANIMSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d8d80 +// SIZE 0x1c +class AnimState : public LegoState +{ +public: + AnimState(); + virtual ~AnimState() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10065070 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0460 + return "AnimState"; + } + + // OFFSET: LEGO1 0x10065080 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, AnimState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // ANIMSTATE_H diff --git a/LEGO1/beachhouseentity.cpp b/LEGO1/beachhouseentity.cpp new file mode 100644 index 00000000..4ccf5777 --- /dev/null +++ b/LEGO1/beachhouseentity.cpp @@ -0,0 +1,9 @@ +#include "beachhouseentity.h" + +// OFFSET: LEGO1 0x100150a0 STUB +MxLong BeachHouseEntity::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/beachhouseentity.h b/LEGO1/beachhouseentity.h new file mode 100644 index 00000000..77555a81 --- /dev/null +++ b/LEGO1/beachhouseentity.h @@ -0,0 +1,27 @@ +#ifndef BEACHHOUSEENTITY_H +#define BEACHHOUSEENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d4a18 +// SIZE 0x68 +class BeachHouseEntity : public BuildingEntity +{ +public: + virtual MxLong Notify(MxParam &p) override; // vtable+04 + + // OFFSET: LEGO1 0x1000ee80 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0314 + return "BeachHouseEntity"; + } + + // OFFSET: LEGO1 0x1000ee90 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, BeachHouseEntity::ClassName()) || BuildingEntity::IsA(name); + } +}; + +#endif // BEACHHOUSEENTITY_H diff --git a/LEGO1/bike.cpp b/LEGO1/bike.cpp new file mode 100644 index 00000000..ac741a44 --- /dev/null +++ b/LEGO1/bike.cpp @@ -0,0 +1,8 @@ +#include "bike.h" + +// OFFSET: LEGO1 0x10076670 STUB +Bike::Bike() +{ + // TODO +} + diff --git a/LEGO1/bike.h b/LEGO1/bike.h new file mode 100644 index 00000000..8d2de0f1 --- /dev/null +++ b/LEGO1/bike.h @@ -0,0 +1,29 @@ +#ifndef BIKE_H +#define BIKE_H + +#include "islepathactor.h" + +// VTABLE 0x100d9808 +// SIZE 0x164 +class Bike : public IslePathActor +{ +public: + Bike(); + + // OFFSET: LEGO1 0x100766f0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03d0 + return "Bike"; + } + + // OFFSET: LEGO1 0x10076700 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Bike::ClassName()) || IslePathActor::IsA(name); + } + +}; + + +#endif // BIKE_H diff --git a/LEGO1/buildingentity.cpp b/LEGO1/buildingentity.cpp new file mode 100644 index 00000000..b4611955 --- /dev/null +++ b/LEGO1/buildingentity.cpp @@ -0,0 +1,13 @@ +#include "buildingentity.h" + +// OFFSET: LEGO1 0x10014e20 STUB +BuildingEntity::BuildingEntity() +{ + // TODO +} + +// OFFSET: LEGO1 0x10015030 STUB +BuildingEntity::~BuildingEntity() +{ + // TODO +} diff --git a/LEGO1/buildingentity.h b/LEGO1/buildingentity.h new file mode 100644 index 00000000..0f515cb0 --- /dev/null +++ b/LEGO1/buildingentity.h @@ -0,0 +1,28 @@ +#ifndef BUILDINGENTITY_H +#define BUILDINGENTITY_H + +#include "legoentity.h" + +// VTABLE 0x100d5c88 +// SIZE <= 0x68, hard to tell because it's always constructed as a derivative +class BuildingEntity : public LegoEntity +{ +public: + BuildingEntity(); + virtual ~BuildingEntity() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10014f20 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f07e8 + return "BuildingEntity"; + } + + // OFFSET: LEGO1 0x10014f30 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, BuildingEntity::ClassName()) || LegoEntity::IsA(name); + } +}; + +#endif // BUILDINGENTITY_H diff --git a/LEGO1/bumpbouy.cpp b/LEGO1/bumpbouy.cpp new file mode 100644 index 00000000..c4c8069d --- /dev/null +++ b/LEGO1/bumpbouy.cpp @@ -0,0 +1 @@ +#include "bumpbouy.h" diff --git a/LEGO1/bumpbouy.h b/LEGO1/bumpbouy.h new file mode 100644 index 00000000..58553153 --- /dev/null +++ b/LEGO1/bumpbouy.h @@ -0,0 +1,25 @@ +#ifndef BUMPBOUY_H +#define BUMPBOUY_H + +#include "legoanimactor.h" +#include "mxtypes.h" + +// VTABLE 0x100d6790 +class BumpBouy : public LegoAnimActor +{ +public: + // OFFSET: LEGO1 0x100274e0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0394 + return "BumpBouy"; + } + + // OFFSET: LEGO1 0x10027500 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, BumpBouy::ClassName()) || LegoAnimActor::IsA(name); + } +}; + +#endif // BUMPBOUY_H diff --git a/LEGO1/carrace.cpp b/LEGO1/carrace.cpp new file mode 100644 index 00000000..7c5c522c --- /dev/null +++ b/LEGO1/carrace.cpp @@ -0,0 +1,7 @@ +#include "carrace.h" + +// OFFSET: LEGO1 0x10016a90 STUB +CarRace::CarRace() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/carrace.h b/LEGO1/carrace.h new file mode 100644 index 00000000..23230da0 --- /dev/null +++ b/LEGO1/carrace.h @@ -0,0 +1,27 @@ +#ifndef CARRACE_H +#define CARRACE_H + +#include "legorace.h" + +// VTABLE 0x100d5e50 +// SIZE 0x154 +class CarRace : public LegoRace +{ +public: + CarRace(); + + // OFFSET: LEGO1 0x10016b20 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0528 + return "CarRace"; + } + + // OFFSET: LEGO1 0x10016b30 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, CarRace::ClassName()) || LegoRace::IsA(name); + } +}; + +#endif // CARRACE_H diff --git a/LEGO1/carracestate.h b/LEGO1/carracestate.h new file mode 100644 index 00000000..49e77b5d --- /dev/null +++ b/LEGO1/carracestate.h @@ -0,0 +1,25 @@ +#ifndef CARRACESTATE_H +#define CARRACESTATE_H + +#include "racestate.h" + +// VTABLE 0x100d4b70 +// SIZE 0x2c +class CarRaceState : public RaceState +{ +public: + // OFFSET: LEGO1 0x1000dd30 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f009c + return "CarRaceState"; + } + + // OFFSET: LEGO1 0x1000dd40 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, CarRaceState::ClassName()) || RaceState::IsA(name); + } +}; + +#endif // CARRACESTATE_H diff --git a/LEGO1/compat.h b/LEGO1/compat.h new file mode 100644 index 00000000..496fa4db --- /dev/null +++ b/LEGO1/compat.h @@ -0,0 +1,14 @@ +#ifndef ISLECOMPAT_H +#define ISLECOMPAT_H + +// Various macros to enable compiling with other/newer compilers. + +// Use `COMPAT_CONST` where something ought to be 'const', and a newer compiler would complain if it +// wasn't, but we know it isn't 'const' in the original code. +#ifdef __MINGW32__ +#define COMPAT_CONST const +#else +#define COMPAT_CONST +#endif + +#endif // ISLECOMPAT_H \ No newline at end of file diff --git a/LEGO1/decomp.h b/LEGO1/decomp.h new file mode 100644 index 00000000..5466e6d8 --- /dev/null +++ b/LEGO1/decomp.h @@ -0,0 +1,11 @@ +#ifndef DECOMP_H +#define DECOMP_H + +#define DECOMP_STATIC_ASSERT(V) namespace { typedef int foo[(V)?1:-1]; } +#define DECOMP_SIZE_ASSERT(T, S) DECOMP_STATIC_ASSERT(sizeof(T) == S) + +typedef unsigned char undefined; +typedef unsigned short undefined2; +typedef unsigned int undefined4; + +#endif // DECOMP_H diff --git a/LEGO1/dllmain.cpp b/LEGO1/dllmain.cpp index 58d0149f..d4b7168b 100644 --- a/LEGO1/dllmain.cpp +++ b/LEGO1/dllmain.cpp @@ -1,7 +1,7 @@ #include // OFFSET: LEGO1 0x10091ee0 -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { return TRUE; } diff --git a/LEGO1/doors.h b/LEGO1/doors.h new file mode 100644 index 00000000..702a47ce --- /dev/null +++ b/LEGO1/doors.h @@ -0,0 +1,26 @@ +#ifndef DOORS_H +#define DOORS_H + +#include "legopathactor.h" + +// VTABLE 0x100d4788 +// SIZE 0x1f8 +class Doors : public LegoPathActor +{ +public: + // OFFSET: LEGO1 0x1000e430 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03e8 + return "Doors"; + } + + // OFFSET: LEGO1 0x1000e440 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Doors::ClassName()) || LegoPathActor::IsA(name); + } +}; + + +#endif // DOORS_H diff --git a/LEGO1/dunebuggy.cpp b/LEGO1/dunebuggy.cpp new file mode 100644 index 00000000..babf21cb --- /dev/null +++ b/LEGO1/dunebuggy.cpp @@ -0,0 +1,7 @@ +#include "dunebuggy.h" + +// OFFSET: LEGO1 0x10067bb0 STUB +DuneBuggy::DuneBuggy() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/dunebuggy.h b/LEGO1/dunebuggy.h new file mode 100644 index 00000000..1f89784e --- /dev/null +++ b/LEGO1/dunebuggy.h @@ -0,0 +1,28 @@ +#ifndef DUNEBUGGY_H +#define DUNEBUGGY_H + +#include "islepathactor.h" + +// VTABLE 0x100d8f98 +// SIZE 0x16c +class DuneBuggy : public IslePathActor +{ +public: + DuneBuggy(); + + // OFFSET: LEGO1 0x10067c30 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0410 + return "DuneBuggy"; + } + + // OFFSET: LEGO1 0x10067c40 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, DuneBuggy::ClassName()) || IslePathActor::IsA(name); + } + +}; + +#endif // DUNEBUGGY_H diff --git a/LEGO1/elevatorbottom.cpp b/LEGO1/elevatorbottom.cpp new file mode 100644 index 00000000..048ecbba --- /dev/null +++ b/LEGO1/elevatorbottom.cpp @@ -0,0 +1,21 @@ +#include "elevatorbottom.h" + +// OFFSET: LEGO1 0x10017e90 STUB +ElevatorBottom::ElevatorBottom() +{ + // TODO +} + +// OFFSET: LEGO1 0x10018060 STUB +ElevatorBottom::~ElevatorBottom() +{ + // TODO +} + +// OFFSET: LEGO1 0x10018150 STUB +MxLong ElevatorBottom::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/elevatorbottom.h b/LEGO1/elevatorbottom.h new file mode 100644 index 00000000..e6a56836 --- /dev/null +++ b/LEGO1/elevatorbottom.h @@ -0,0 +1,30 @@ +#ifndef ELEVATORBOTTOM_H +#define ELEVATORBOTTOM_H + +#include "legoworld.h" + +// VTABLE 0x100d5f20 +class ElevatorBottom : public LegoWorld +{ +public: + ElevatorBottom(); + virtual ~ElevatorBottom() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x10017f20 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f04ac + return "ElevatorBottom"; + } + + // OFFSET: LEGO1 0x10017f30 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ElevatorBottom::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // ELEVATORBOTTOM_H diff --git a/LEGO1/gasstation.cpp b/LEGO1/gasstation.cpp new file mode 100644 index 00000000..33590dc9 --- /dev/null +++ b/LEGO1/gasstation.cpp @@ -0,0 +1,29 @@ +#include "gasstation.h" + +// OFFSET: LEGO1 0x100046a0 STUB +GasStation::GasStation() +{ + // TODO +} + +// OFFSET: LEGO1 0x100048c0 STUB +GasStation::~GasStation() +{ + // TODO +} + +// OFFSET: LEGO1 0x10004a60 STUB +MxLong GasStation::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x10005c90 STUB +MxLong GasStation::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/gasstation.h b/LEGO1/gasstation.h new file mode 100644 index 00000000..7f2263d0 --- /dev/null +++ b/LEGO1/gasstation.h @@ -0,0 +1,33 @@ +#ifndef GASSTATION_H +#define GASSTATION_H + +#include "legoworld.h" + +// VTABLE 0x100d4650 +// SIZE 0x128 +// Radio variable at 0x46, in constructor +class GasStation : public LegoWorld +{ +public: + GasStation(); + virtual ~GasStation() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x10004780 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0168 + return "GasStation"; + } + + // OFFSET: LEGO1 0x10004790 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, GasStation::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // GASSTATION_H diff --git a/LEGO1/gasstationentity.cpp b/LEGO1/gasstationentity.cpp new file mode 100644 index 00000000..ebe58c46 --- /dev/null +++ b/LEGO1/gasstationentity.cpp @@ -0,0 +1 @@ +#include "gasstationentity.h" diff --git a/LEGO1/gasstationentity.h b/LEGO1/gasstationentity.h new file mode 100644 index 00000000..27eb60f3 --- /dev/null +++ b/LEGO1/gasstationentity.h @@ -0,0 +1,25 @@ +#ifndef GASSTATIONENTITY_H +#define GASSTATIONENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d5258 +// SIZE 0x68 +class GasStationEntity : public BuildingEntity +{ +public: + // OFFSET: LEGO1 0x1000eb20 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0348 + return "GasStationEntity"; + } + + // OFFSET: LEGO1 0x1000eb30 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, GasStationEntity::ClassName()) || BuildingEntity::IsA(name); + } +}; + +#endif // GASSTATIONENTITY_H diff --git a/LEGO1/gasstationstate.cpp b/LEGO1/gasstationstate.cpp new file mode 100644 index 00000000..d9fa2c29 --- /dev/null +++ b/LEGO1/gasstationstate.cpp @@ -0,0 +1,7 @@ +#include "gasstationstate.h" + +// OFFSET: LEGO1 0x10005eb0 STUB +GasStationState::GasStationState() +{ + // TODO +} diff --git a/LEGO1/gasstationstate.h b/LEGO1/gasstationstate.h new file mode 100644 index 00000000..a7696bed --- /dev/null +++ b/LEGO1/gasstationstate.h @@ -0,0 +1,28 @@ +#ifndef GASSTATIONSTATE_H +#define GASSTATIONSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d46e0 +// SIZE 0x24 +class GasStationState : public LegoState +{ +public: + GasStationState(); + + // OFFSET: LEGO1 0x100061d0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0174 + return "GasStationState"; + } + + // OFFSET: LEGO1 0x100061e0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, GasStationState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // GASSTATIONSTATE_H diff --git a/LEGO1/helicopter.cpp b/LEGO1/helicopter.cpp new file mode 100644 index 00000000..318f3dab --- /dev/null +++ b/LEGO1/helicopter.cpp @@ -0,0 +1,13 @@ +#include "helicopter.h" + +// OFFSET: LEGO1 0x10001e60 STUB +Helicopter::Helicopter() +{ + // TODO +} + +// OFFSET: LEGO1 0x10003230 STUB +Helicopter::~Helicopter() +{ + // TODO +} diff --git a/LEGO1/helicopter.h b/LEGO1/helicopter.h new file mode 100644 index 00000000..15134f32 --- /dev/null +++ b/LEGO1/helicopter.h @@ -0,0 +1,29 @@ +#ifndef HELICOPTER_H +#define HELICOPTER_H + +#include "islepathactor.h" + +// VTABLE 0x100d40f8 +// SIZE 0x230 +class Helicopter : public IslePathActor +{ +public: + Helicopter(); + virtual ~Helicopter(); // vtable+0x0 + + // OFFSET: LEGO1 0x10003070 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0130 + return "Helicopter"; + } + + // OFFSET: LEGO1 0x10003080 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Helicopter::ClassName()) || IslePathActor::IsA(name); + } + +}; + +#endif // HELICOPTER_H diff --git a/LEGO1/helicopterstate.cpp b/LEGO1/helicopterstate.cpp new file mode 100644 index 00000000..70d71a0c --- /dev/null +++ b/LEGO1/helicopterstate.cpp @@ -0,0 +1 @@ +#include "helicopterstate.h" diff --git a/LEGO1/helicopterstate.h b/LEGO1/helicopterstate.h new file mode 100644 index 00000000..161624dd --- /dev/null +++ b/LEGO1/helicopterstate.h @@ -0,0 +1,25 @@ +#ifndef HELICOPTERSTATE_H +#define HELICOPTERSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d5418 +// SIZE 0xc +class HelicopterState : public LegoState +{ +public: + // OFFSET: LEGO1 0x1000e0d0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0144 + return "HelicopterState"; + } + + // OFFSET: LEGO1 0x1000e0e0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, HelicopterState::ClassName()) || LegoState::IsA(name); + } +}; + +#endif // HELICOPTERSTATE_H diff --git a/LEGO1/historybook.cpp b/LEGO1/historybook.cpp new file mode 100644 index 00000000..1666cc9d --- /dev/null +++ b/LEGO1/historybook.cpp @@ -0,0 +1,21 @@ +#include "historybook.h" + +// OFFSET: LEGO1 0x100822f0 STUB +HistoryBook::HistoryBook() +{ + // TODO +} + +// OFFSET: LEGO1 0x100824d0 STUB +HistoryBook::~HistoryBook() +{ + // TODO +} + +// OFFSET: LEGO1 0x10082680 STUB +MxLong HistoryBook::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/historybook.h b/LEGO1/historybook.h new file mode 100644 index 00000000..2fdcee78 --- /dev/null +++ b/LEGO1/historybook.h @@ -0,0 +1,30 @@ +#ifndef HISTORYBOOK_H +#define HISTORYBOOK_H + +#include "legoworld.h" + +// VTABLE 0x100da328 +// SIZE 0x3e4 +class HistoryBook : public LegoWorld +{ +public: + HistoryBook(); + virtual ~HistoryBook() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x10082390 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f04bc + return "HistoryBook"; + } + + // OFFSET: LEGO1 0x100823a0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, HistoryBook::ClassName()) || LegoWorld::IsA(name); + } +}; + +#endif // HISTORYBOOK_H diff --git a/LEGO1/hospital.cpp b/LEGO1/hospital.cpp new file mode 100644 index 00000000..9f84d7ce --- /dev/null +++ b/LEGO1/hospital.cpp @@ -0,0 +1,21 @@ +#include "hospital.h" + +// OFFSET: LEGO1 0x100745e0 STUB +Hospital::Hospital() +{ + // TODO +} + +// OFFSET: LEGO1 0x100747f0 STUB +Hospital::~Hospital() +{ + // TODO +} + +// OFFSET: LEGO1 0x10074990 STUB +MxLong Hospital::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/hospital.h b/LEGO1/hospital.h new file mode 100644 index 00000000..bcce9823 --- /dev/null +++ b/LEGO1/hospital.h @@ -0,0 +1,31 @@ +#ifndef HOSPITAL_H +#define HOSPITAL_H + +#include "legoworld.h" + +// VTABLE 0x100d9730 +// SIZE 0x12c +class Hospital : public LegoWorld +{ +public: + Hospital(); + virtual ~Hospital() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x04 + + // OFFSET: LEGO1 0x100746b0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0490 + return "Hospital"; + } + + // OFFSET: LEGO1 0x100746c0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Hospital::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // HOSPITAL_H diff --git a/LEGO1/hospitalentity.cpp b/LEGO1/hospitalentity.cpp new file mode 100644 index 00000000..8da86464 --- /dev/null +++ b/LEGO1/hospitalentity.cpp @@ -0,0 +1 @@ +#include "hospitalentity.h" diff --git a/LEGO1/hospitalentity.h b/LEGO1/hospitalentity.h new file mode 100644 index 00000000..537bff12 --- /dev/null +++ b/LEGO1/hospitalentity.h @@ -0,0 +1,26 @@ +#ifndef HOSPITALENTITY_H +#define HOSPITALENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d5068 +// SIZE 0x68 +class HospitalEntity : public BuildingEntity +{ +public: + // OFFSET: LEGO1 0x1000ec40 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0338 + return "HospitalEntity"; + } + + // OFFSET: LEGO1 0x1000ec50 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, HospitalEntity::ClassName()) || BuildingEntity::IsA(name); + } + +}; + +#endif // HOSPITALENTITY_H diff --git a/LEGO1/hospitalstate.cpp b/LEGO1/hospitalstate.cpp new file mode 100644 index 00000000..066dceec --- /dev/null +++ b/LEGO1/hospitalstate.cpp @@ -0,0 +1,7 @@ +#include "hospitalstate.h" + +// OFFSET: LEGO1 0x10076370 STUB +HospitalState::HospitalState() +{ + // TODO +} diff --git a/LEGO1/hospitalstate.h b/LEGO1/hospitalstate.h new file mode 100644 index 00000000..ccecf07b --- /dev/null +++ b/LEGO1/hospitalstate.h @@ -0,0 +1,28 @@ +#ifndef HOSPITALSTATE_H +#define HOSPITALSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d97a0 +// SIZE 0x18 +class HospitalState : public LegoState +{ +public: + HospitalState(); + + // OFFSET: LEGO1 0x10076400 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0480 + return "HospitalState"; + } + + // OFFSET: LEGO1 0x10076410 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, HospitalState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // HOSPITALSTATE_H diff --git a/LEGO1/infocenter.cpp b/LEGO1/infocenter.cpp new file mode 100644 index 00000000..b9ea67c6 --- /dev/null +++ b/LEGO1/infocenter.cpp @@ -0,0 +1,29 @@ +#include "infocenter.h" + +// OFFSET: LEGO1 0x1006ea20 STUB +Infocenter::Infocenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x1006ec90 STUB +Infocenter::~Infocenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x1006ef10 STUB +MxLong Infocenter::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x10070af0 STUB +MxLong Infocenter::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/infocenter.h b/LEGO1/infocenter.h new file mode 100644 index 00000000..a6e06f0f --- /dev/null +++ b/LEGO1/infocenter.h @@ -0,0 +1,32 @@ +#ifndef INFOCENTER_H +#define INFOCENTER_H + +#include "legoworld.h" + +// VTABLE 0x100d9338 +// SIZE 0x1d8 +class Infocenter : public LegoWorld +{ +public: + Infocenter(); + virtual ~Infocenter() override; + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x1006eb40 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f04ec + return "Infocenter"; + } + + // OFFSET: LEGO1 0x1006eb50 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Infocenter::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // INFOCENTER_H diff --git a/LEGO1/infocenterdoor.cpp b/LEGO1/infocenterdoor.cpp new file mode 100644 index 00000000..20e01771 --- /dev/null +++ b/LEGO1/infocenterdoor.cpp @@ -0,0 +1,21 @@ +#include "infocenterdoor.h" + +// OFFSET: LEGO1 0x10037730 STUB +InfocenterDoor::InfocenterDoor() +{ + // TODO +} + +// OFFSET: LEGO1 0x100378f0 STUB +InfocenterDoor::~InfocenterDoor() +{ + // TODO +} + +// OFFSET: LEGO1 0x100379e0 STUB +MxLong InfocenterDoor::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/infocenterdoor.h b/LEGO1/infocenterdoor.h new file mode 100644 index 00000000..0692fbca --- /dev/null +++ b/LEGO1/infocenterdoor.h @@ -0,0 +1,31 @@ +#ifndef INFOCENTERDOOR_H +#define INFOCENTERDOOR_H + +#include "legoworld.h" + +// VTABLE 0x100d72d8 +// SIZE 0xfc +class InfocenterDoor : public LegoWorld +{ +public: + InfocenterDoor(); + virtual ~InfocenterDoor(); // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x100377b0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f049c + return "InfocenterDoor"; + } + + // OFFSET: LEGO1 0x100377c0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, InfocenterDoor::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // INFOCENTERDOOR_H diff --git a/LEGO1/infocenterentity.cpp b/LEGO1/infocenterentity.cpp new file mode 100644 index 00000000..211cf0b8 --- /dev/null +++ b/LEGO1/infocenterentity.cpp @@ -0,0 +1 @@ +#include "infocenterentity.h" diff --git a/LEGO1/infocenterentity.h b/LEGO1/infocenterentity.h new file mode 100644 index 00000000..3980e68a --- /dev/null +++ b/LEGO1/infocenterentity.h @@ -0,0 +1,26 @@ +#ifndef INFOCENTERENTITY_H +#define INFOCENTERENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d4b90 +// SIZE 0x68 +class InfoCenterEntity : public BuildingEntity +{ +public: + // OFFSET: LEGO1 0x1000ea00 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f035c + return "InfoCenterEntity"; + } + + // OFFSET: LEGO1 0x1000ea10 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(name); + } + +}; + +#endif // INFOCENTERENTITY_H diff --git a/LEGO1/infocenterstate.cpp b/LEGO1/infocenterstate.cpp new file mode 100644 index 00000000..d680eb43 --- /dev/null +++ b/LEGO1/infocenterstate.cpp @@ -0,0 +1,14 @@ +#include "infocenterstate.h" + +// OFFSET: LEGO1 0x10071600 STUB +InfocenterState::InfocenterState() +{ + // TODO +} + +// OFFSET: LEGO1 0x10071920 STUB +InfocenterState::~InfocenterState() +{ + // TODO +} + diff --git a/LEGO1/infocenterstate.h b/LEGO1/infocenterstate.h new file mode 100644 index 00000000..4f09d496 --- /dev/null +++ b/LEGO1/infocenterstate.h @@ -0,0 +1,28 @@ +#ifndef INFOCENTERSTATE_H +#define INFOCENTERSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d93a8 +// SIZE 0x94 +class InfocenterState : public LegoState +{ +public: + InfocenterState(); + virtual ~InfocenterState(); + + // OFFSET: LEGO1 0x10071840 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f04dc + return "InfocenterState"; + } + + // OFFSET: LEGO1 0x10071850 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, InfocenterState::ClassName()) || LegoState::IsA(name); + } +}; + +#endif // INFOCENTERSTATE_H diff --git a/LEGO1/isle.cpp b/LEGO1/isle.cpp new file mode 100644 index 00000000..fa5d806b --- /dev/null +++ b/LEGO1/isle.cpp @@ -0,0 +1,7 @@ +#include "isle.h" + +// OFFSET: LEGO1 0x10030820 STUB +Isle::Isle() +{ + // TODO +} diff --git a/LEGO1/isle.h b/LEGO1/isle.h new file mode 100644 index 00000000..4aedbbcf --- /dev/null +++ b/LEGO1/isle.h @@ -0,0 +1,28 @@ +#ifndef ISLE_H +#define ISLE_H + +#include "legoworld.h" + +// VTABLE 0x100d6fb8 +// SIZE 0x140 +// Radio at 0x12c +class Isle : public LegoWorld +{ +public: + Isle(); + + // OFFSET: LEGO1 0x10030910 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0458 + return "Isle"; + } + + // OFFSET: LEGO1 0x10030920 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Isle::ClassName()) || LegoWorld::IsA(name); + } +}; + +#endif // ISLE_H diff --git a/LEGO1/isleactor.cpp b/LEGO1/isleactor.cpp new file mode 100644 index 00000000..ca286e37 --- /dev/null +++ b/LEGO1/isleactor.cpp @@ -0,0 +1 @@ +#include "isleactor.h" diff --git a/LEGO1/isleactor.h b/LEGO1/isleactor.h new file mode 100644 index 00000000..3b7660f5 --- /dev/null +++ b/LEGO1/isleactor.h @@ -0,0 +1,24 @@ +#ifndef ISLEACTOR_H +#define ISLEACTOR_H + +#include "legoactor.h" + +// VTABLE 0x100d5178 +class IsleActor : public LegoActor +{ +public: + // OFFSET: LEGO1 0x1000e660 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f07dc + return "IsleActor"; + } + + // OFFSET: LEGO1 0x1000e670 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, IsleActor::ClassName()) || LegoActor::IsA(name); + } +}; + +#endif // ISLEACTOR_H diff --git a/LEGO1/islepathactor.cpp b/LEGO1/islepathactor.cpp new file mode 100644 index 00000000..72ed76d8 --- /dev/null +++ b/LEGO1/islepathactor.cpp @@ -0,0 +1 @@ +#include "islepathactor.h" diff --git a/LEGO1/islepathactor.h b/LEGO1/islepathactor.h new file mode 100644 index 00000000..fce450ac --- /dev/null +++ b/LEGO1/islepathactor.h @@ -0,0 +1,25 @@ +#ifndef ISLEPATHACTOR_H +#define ISLEPATHACTOR_H + +#include "legopathactor.h" + +// VTABLE 0x100d4398 +// SIZE >= 0x230 +class IslePathActor : public LegoPathActor +{ +public: + // OFFSET: LEGO1 0x10002ea0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0104 + return "IslePathActor"; + } + + // OFFSET: LEGO1 0x10002eb0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, IslePathActor::ClassName()) || LegoPathActor::IsA(name); + } +}; + +#endif // ISLEPATHACTOR_H diff --git a/LEGO1/jetski.cpp b/LEGO1/jetski.cpp new file mode 100644 index 00000000..50676253 --- /dev/null +++ b/LEGO1/jetski.cpp @@ -0,0 +1,7 @@ +#include "jetski.h" + +// OFFSET: LEGO1 0x1007e3b0 STUB +Jetski::Jetski() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/jetski.h b/LEGO1/jetski.h new file mode 100644 index 00000000..7cabea4d --- /dev/null +++ b/LEGO1/jetski.h @@ -0,0 +1,29 @@ +#ifndef JETSKI_H +#define JETSKI_H + +#include "islepathactor.h" + +// VTABLE 0x100d9ec8 +// SIZE 0x164 +class Jetski : public IslePathActor +{ +public: + Jetski(); + + // OFFSET: LEGO1 0x1007e430 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03d8 + return "Jetski"; + } + + // OFFSET: LEGO1 0x1007e440 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Jetski::ClassName()) || IslePathActor::IsA(name); + } + +}; + + +#endif // JETSKI_H diff --git a/LEGO1/jetskirace.cpp b/LEGO1/jetskirace.cpp new file mode 100644 index 00000000..cc119878 --- /dev/null +++ b/LEGO1/jetskirace.cpp @@ -0,0 +1 @@ +#include "jetskirace.h" diff --git a/LEGO1/jetskirace.h b/LEGO1/jetskirace.h new file mode 100644 index 00000000..bea59903 --- /dev/null +++ b/LEGO1/jetskirace.h @@ -0,0 +1,26 @@ +#ifndef JETSKIRACE_H +#define JETSKIRACE_H + +#include "legorace.h" + +// VTABLE 0x100d4fe8 +// SIZE 0x144 +class JetskiRace : public LegoRace +{ +public: + + // OFFSET: LEGO1 0x1000daf0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0530 + return "JetskiRace"; + } + + // OFFSET: LEGO1 0x1000db00 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, JetskiRace::ClassName()) || LegoRace::IsA(name); + } +}; + +#endif // JETSKIRACE_H diff --git a/LEGO1/jetskiracestate.h b/LEGO1/jetskiracestate.h new file mode 100644 index 00000000..bdcfc0cd --- /dev/null +++ b/LEGO1/jetskiracestate.h @@ -0,0 +1,26 @@ +#ifndef JETSKIRACESTATE_H +#define JETSKIRACESTATE_H + +#include "racestate.h" + +// VTABLE 0x100d4fa8 +// SIZE 0x2c +class JetskiRaceState : public RaceState +{ +public: + // OFFSET: LEGO1 0x1000dc40 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f00ac + return "JetskiRaceState"; + } + + // OFFSET: LEGO1 0x1000dc50 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, JetskiRaceState::ClassName()) || RaceState::IsA(name); + } + +}; + +#endif // JETSKIRACESTATE_H diff --git a/LEGO1/jukebox.cpp b/LEGO1/jukebox.cpp new file mode 100644 index 00000000..f169a278 --- /dev/null +++ b/LEGO1/jukebox.cpp @@ -0,0 +1,7 @@ +#include "jukebox.h" + +// OFFSET: LEGO1 0x1005d660 STUB +JukeBox::JukeBox() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/jukebox.h b/LEGO1/jukebox.h new file mode 100644 index 00000000..3083f901 --- /dev/null +++ b/LEGO1/jukebox.h @@ -0,0 +1,28 @@ +#ifndef JUKEBOX_H +#define JUKEBOX_H + +#include "legoworld.h" + +// VTABLE 0x100d8958 +// SIZE 0x104 +class JukeBox : public LegoWorld +{ +public: + JukeBox(); + + // OFFSET: LEGO1 0x1005d6f0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f02cc + return "JukeBox"; + } + + // OFFSET: LEGO1 0x1005d700 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, JukeBox::ClassName()) || LegoWorld::IsA(name); + } + +}; + +#endif // JUKEBOX_H diff --git a/LEGO1/jukeboxentity.cpp b/LEGO1/jukeboxentity.cpp new file mode 100644 index 00000000..8c1a971b --- /dev/null +++ b/LEGO1/jukeboxentity.cpp @@ -0,0 +1,13 @@ +#include "jukeboxentity.h" + +// OFFSET: LEGO1 0x10085bc0 STUB +JukeBoxEntity::JukeBoxEntity() +{ + // TODO +} + +// OFFSET: LEGO1 0x10085dd0 STUB +JukeBoxEntity::~JukeBoxEntity() +{ + // TODO +} diff --git a/LEGO1/jukeboxentity.h b/LEGO1/jukeboxentity.h new file mode 100644 index 00000000..8571f203 --- /dev/null +++ b/LEGO1/jukeboxentity.h @@ -0,0 +1,29 @@ +#ifndef JUKEBOXENTITY_H +#define JUKEBOXENTITY_H + +#include "legoentity.h" + +// VTABLE 0x100da8a0 +// SIZE 0x6c +class JukeBoxEntity : public LegoEntity +{ +public: + JukeBoxEntity(); + virtual ~JukeBoxEntity() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10085cc0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f02f0 + return "JukeBoxEntity"; + } + + // OFFSET: LEGO1 0x10085cd0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, JukeBoxEntity::ClassName()) || LegoEntity::IsA(name); + } + +}; + +#endif // JUKEBOXENTITY_H diff --git a/LEGO1/jukeboxstate.cpp b/LEGO1/jukeboxstate.cpp new file mode 100644 index 00000000..25b6dc90 --- /dev/null +++ b/LEGO1/jukeboxstate.cpp @@ -0,0 +1 @@ +#include "jukeboxstate.h" diff --git a/LEGO1/jukeboxstate.h b/LEGO1/jukeboxstate.h new file mode 100644 index 00000000..75640fe3 --- /dev/null +++ b/LEGO1/jukeboxstate.h @@ -0,0 +1,26 @@ +#ifndef JUKEBOXSTATE_H +#define JUKEBOXSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d4a90 +// SIZE 0x10 +class JukeBoxState : public LegoState +{ +public: + // OFFSET: LEGO1 0x1000f310 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f02bc + return "JukeBoxState"; + } + + // OFFSET: LEGO1 0x1000f320 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, JukeBoxState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // JUKEBOXSTATE_H diff --git a/LEGO1/lego3dwavepresenter.h b/LEGO1/lego3dwavepresenter.h new file mode 100644 index 00000000..b9a2b7f5 --- /dev/null +++ b/LEGO1/lego3dwavepresenter.h @@ -0,0 +1,25 @@ +#ifndef LEGO3DWAVEPRESENTER_H +#define LEGO3DWAVEPRESENTER_H + +#include "legowavepresenter.h" + +// VTABLE 0x100d52b0 +// SIZE 0xa0 +class Lego3DWavePresenter : public LegoWavePresenter +{ +public: + // OFFSET: LEGO1 0x1000d890 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f058c + return "Lego3DWavePresenter"; + } + + // OFFSET: LEGO1 0x1000d8a0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Lego3DWavePresenter::ClassName()) || MxWavePresenter::IsA(name); + } +}; + +#endif // LEGO3DWAVEPRESENTER_H diff --git a/LEGO1/legoact2state.cpp b/LEGO1/legoact2state.cpp new file mode 100644 index 00000000..1ca6a144 --- /dev/null +++ b/LEGO1/legoact2state.cpp @@ -0,0 +1 @@ +#include "legoact2state.h" diff --git a/LEGO1/legoact2state.h b/LEGO1/legoact2state.h new file mode 100644 index 00000000..321138ba --- /dev/null +++ b/LEGO1/legoact2state.h @@ -0,0 +1,26 @@ +#ifndef LEGOACT2STATE_H +#define LEGOACT2STATE_H + +#include "legostate.h" + +// VTABLE 0x100d4a70 +// SIZE 0x10 +class LegoAct2State : public LegoState +{ +public: + // OFFSET: LEGO1 0x1000df80 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0428 + return "LegoAct2State"; + } + + // OFFSET: LEGO1 0x1000df90 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoAct2State::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // LEGOACT2STATE_H diff --git a/LEGO1/legoactioncontrolpresenter.cpp b/LEGO1/legoactioncontrolpresenter.cpp new file mode 100644 index 00000000..598c0958 --- /dev/null +++ b/LEGO1/legoactioncontrolpresenter.cpp @@ -0,0 +1 @@ +#include "legoactioncontrolpresenter.h" diff --git a/LEGO1/legoactioncontrolpresenter.h b/LEGO1/legoactioncontrolpresenter.h new file mode 100644 index 00000000..7e051805 --- /dev/null +++ b/LEGO1/legoactioncontrolpresenter.h @@ -0,0 +1,25 @@ +#ifndef LEGOACTIONCONTROLPRESENTER_H +#define LEGOACTIONCONTROLPRESENTER_H + +#include "mxmediapresenter.h" + +// VTABLE 0x100d5118 +// SIZE 0x68 +class LegoActionControlPresenter : public MxMediaPresenter +{ +public: + // OFFSET: LEGO1 0x1000d0e0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f05bc + return "LegoActionControlPresenter"; + } + + // OFFSET: LEGO1 0x1000d0f0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoActionControlPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } +}; + +#endif // LEGOACTIONCONTROLPRESENTER_H diff --git a/LEGO1/legoactor.h b/LEGO1/legoactor.h new file mode 100644 index 00000000..9b23e943 --- /dev/null +++ b/LEGO1/legoactor.h @@ -0,0 +1,25 @@ +#ifndef LEGOACTOR_H +#define LEGOACTOR_H + +#include "legoentity.h" + +// VTABLE 0x100d6d68 +// SIZE 0x78 +class LegoActor : public LegoEntity +{ +public: + // OFFSET: LEGO1 0x1002d210 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0124 + return "LegoActor"; + } + + // OFFSET: LEGO1 0x1002d220 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name); + } +}; + +#endif // LEGOACTOR_H diff --git a/LEGO1/legoactorpresenter.h b/LEGO1/legoactorpresenter.h new file mode 100644 index 00000000..fd3ae4e7 --- /dev/null +++ b/LEGO1/legoactorpresenter.h @@ -0,0 +1,25 @@ +#ifndef LEGOACTORPRESENTER_H +#define LEGOACTORPRESENTER_H + +#include "legoentitypresenter.h" + +// VTABLE 0x100d5320 +// SIZE 0x50 +class LegoActorPresenter : public LegoEntityPresenter +{ +public: + // OFFSET: LEGO1 0x1000cb10 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f06a4 + return "LegoActorPresenter"; + } + + // OFFSET: LEGO1 0x1000cb20 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoActorPresenter::ClassName()) || LegoEntityPresenter::IsA(name); + } +}; + +#endif // LEGOACTORPRESENTER_H diff --git a/LEGO1/legoanimactor.cpp b/LEGO1/legoanimactor.cpp new file mode 100644 index 00000000..d3515937 --- /dev/null +++ b/LEGO1/legoanimactor.cpp @@ -0,0 +1 @@ +#include "legoanimactor.h" diff --git a/LEGO1/legoanimactor.h b/LEGO1/legoanimactor.h new file mode 100644 index 00000000..f535028c --- /dev/null +++ b/LEGO1/legoanimactor.h @@ -0,0 +1,11 @@ +#ifndef LEGOANIMACTOR_H +#define LEGOANIMACTOR_H + +#include "legopathactor.h" + +class LegoAnimActor : public LegoPathActor +{ +public: +}; + +#endif // LEGOANIMACTOR_H diff --git a/LEGO1/legoanimationmanager.cpp b/LEGO1/legoanimationmanager.cpp new file mode 100644 index 00000000..d396d431 --- /dev/null +++ b/LEGO1/legoanimationmanager.cpp @@ -0,0 +1,43 @@ +#include "legoanimationmanager.h" + +// 0x100f74f8 +int g_legoAnimationManagerConfig = 1; + +// OFFSET: LEGO1 0x1005eb60 STUB +LegoAnimationManager::LegoAnimationManager() +{ +} + +// OFFSET: LEGO1 0x1005ed30 STUB +LegoAnimationManager::~LegoAnimationManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x100619f0 STUB +MxLong LegoAnimationManager::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x10061cc0 STUB +MxLong LegoAnimationManager::Tickle() +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x1005f130 STUB +void LegoAnimationManager::Init() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005eb50 +void LegoAnimationManager::configureLegoAnimationManager(int param_1) +{ + g_legoAnimationManagerConfig = param_1; +} diff --git a/LEGO1/legoanimationmanager.h b/LEGO1/legoanimationmanager.h index 8e243dd3..49b95f94 100644 --- a/LEGO1/legoanimationmanager.h +++ b/LEGO1/legoanimationmanager.h @@ -1,10 +1,37 @@ #ifndef LEGOANIMATIONMANAGER_H #define LEGOANIMATIONMANAGER_H -class LegoAnimationManager +#include "mxcore.h" + +// VTABLE 0x100d8c18 +// SIZE 0x500 +class LegoAnimationManager : public MxCore { public: + LegoAnimationManager(); + virtual ~LegoAnimationManager() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x1005ec80 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f7508 + return "LegoAnimationManager"; + } + + // OFFSET: LEGO1 0x1005ec90 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || MxCore::IsA(name); + } + __declspec(dllexport) static void configureLegoAnimationManager(int param_1); + +private: + void Init(); + }; #endif // LEGOANIMATIONMANAGER_H diff --git a/LEGO1/legoanimmmpresenter.cpp b/LEGO1/legoanimmmpresenter.cpp new file mode 100644 index 00000000..1c98b7c1 --- /dev/null +++ b/LEGO1/legoanimmmpresenter.cpp @@ -0,0 +1,7 @@ +#include "legoanimmmpresenter.h" + +// OFFSET: LEGO1 0x1004a8d0 STUB +LegoAnimMMPresenter::LegoAnimMMPresenter() +{ + // TODO +} diff --git a/LEGO1/legoanimmmpresenter.h b/LEGO1/legoanimmmpresenter.h new file mode 100644 index 00000000..8cb61be0 --- /dev/null +++ b/LEGO1/legoanimmmpresenter.h @@ -0,0 +1,28 @@ +#ifndef LEGOANIMMMPRESENTER_H +#define LEGOANIMMMPRESENTER_H + +#include "mxcompositepresenter.h" + +// VTABLE 0x100d7de8 +// SIZE 0x74 +class LegoAnimMMPresenter : public MxCompositePresenter +{ +public: + LegoAnimMMPresenter(); + + // OFFSET: LEGO1 0x1004a950 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f046c + return "LegoAnimMMPresenter"; + } + + // OFFSET: LEGO1 0x1004a960 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoAnimMMPresenter::ClassName()) || MxCompositePresenter::IsA(name); + } + +}; + +#endif // LEGOANIMMMPRESENTER_H diff --git a/LEGO1/legoanimpresenter.cpp b/LEGO1/legoanimpresenter.cpp new file mode 100644 index 00000000..a968afe0 --- /dev/null +++ b/LEGO1/legoanimpresenter.cpp @@ -0,0 +1,13 @@ +#include "legoanimpresenter.h" + +// OFFSET: LEGO1 0x10068420 STUB +LegoAnimPresenter::LegoAnimPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100686f0 STUB +void LegoAnimPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/legoanimpresenter.h b/LEGO1/legoanimpresenter.h new file mode 100644 index 00000000..56fcc989 --- /dev/null +++ b/LEGO1/legoanimpresenter.h @@ -0,0 +1,30 @@ +#ifndef LEGOANIMPRESENTER_H +#define LEGOANIMPRESENTER_H + +#include "mxvideopresenter.h" + +// VTABLE 0x100d90c8 +class LegoAnimPresenter : public MxVideoPresenter +{ +public: + LegoAnimPresenter(); + + // OFFSET: LEGO1 0x10068530 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f071c + return "LegoAnimPresenter"; + } + + // OFFSET: LEGO1 0x10068540 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(name); + } + +private: + void Init(); + +}; + +#endif // LEGOANIMPRESENTER_H diff --git a/LEGO1/legobackgroundcolor.cpp b/LEGO1/legobackgroundcolor.cpp new file mode 100644 index 00000000..2d8c5348 --- /dev/null +++ b/LEGO1/legobackgroundcolor.cpp @@ -0,0 +1,53 @@ +#include "legobackgroundcolor.h" + +#include "legoomni.h" +#include "legoutil.h" +#include "legovideomanager.h" + +const char *g_delimiter = "\t"; +const char *g_set = "set"; +const char *g_reset = "reset"; + +// OFFSET: LEGO1 0x1003bfb0 +LegoBackgroundColor::LegoBackgroundColor(const char *p_name, const char *p_colorString) +{ + m_name = p_name; + m_name.ToUpperCase(); + SetColorString(p_colorString); +} + +// OFFSET: LEGO1 0x1003c070 +void LegoBackgroundColor::SetColorString(const char *p_colorString) +{ + m_string = p_colorString; + m_string.ToLowerCase(); + + LegoVideoManager *videomanager = VideoManager(); + if (!videomanager || !p_colorString) + return; + + float converted_r, converted_g, converted_b; + char *colorStringCopy = strcpy(new char[strlen(p_colorString) + 1], p_colorString); + char *colorStringSplit = strtok(colorStringCopy, g_delimiter); + + if (!strcmp(colorStringSplit, g_set)) { + colorStringSplit = strtok(0, g_delimiter); + if (colorStringSplit) + h = (float) (atoi(colorStringSplit) * 0.01); + colorStringSplit = strtok(0, g_delimiter); + if (colorStringSplit) + s = (float) (atoi(colorStringSplit) * 0.01); + colorStringSplit = strtok(0, g_delimiter); + if (colorStringSplit) + v = (float) (atoi(colorStringSplit) * 0.01); + + ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b); + videomanager->SetSkyColor(converted_r, converted_g, converted_b); + } + else if (!strcmp(colorStringSplit, g_reset)) { + ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b); + videomanager->SetSkyColor(converted_r, converted_g, converted_b); + } + + delete[] colorStringCopy; +} diff --git a/LEGO1/legobackgroundcolor.h b/LEGO1/legobackgroundcolor.h index c660c0bf..9345c394 100644 --- a/LEGO1/legobackgroundcolor.h +++ b/LEGO1/legobackgroundcolor.h @@ -1,10 +1,18 @@ #ifndef LEGOBACKGROUNDCOLOR_H #define LEGOBACKGROUNDCOLOR_H -class LegoBackgroundColor +#include "mxstringvariable.h" + +class LegoBackgroundColor : public MxStringVariable { public: - __declspec(dllexport) LegoBackgroundColor(const char *, const char *); + __declspec(dllexport) LegoBackgroundColor(const char *p_name, const char *p_colorString); + void SetColorString(const char *p_colorString); + +private: + float h; + float s; + float v; }; #endif // LEGOBACKGROUNDCOLOR_H diff --git a/LEGO1/legobuildingmanager.cpp b/LEGO1/legobuildingmanager.cpp new file mode 100644 index 00000000..f6706c78 --- /dev/null +++ b/LEGO1/legobuildingmanager.cpp @@ -0,0 +1,28 @@ +#include "legobuildingmanager.h" + +// 0x100f37cc +int g_buildingManagerConfig = 1; + +// OFFSET: LEGO1 0x1002f8c0 STUB +LegoBuildingManager::LegoBuildingManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1002f960 STUB +LegoBuildingManager::~LegoBuildingManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1002f9d0 STUB +void LegoBuildingManager::Init() +{ + // TODO +} + +// OFFSET: LEGO1 0x1002f8b0 +void LegoBuildingManager::configureLegoBuildingManager(int param_1) +{ + g_buildingManagerConfig = param_1; +} diff --git a/LEGO1/legobuildingmanager.h b/LEGO1/legobuildingmanager.h index a1173d3d..17701617 100644 --- a/LEGO1/legobuildingmanager.h +++ b/LEGO1/legobuildingmanager.h @@ -1,10 +1,28 @@ #ifndef LEGOBUILDINGMANAGER_H #define LEGOBUILDINGMANAGER_H -class LegoBuildingManager +#include "mxcore.h" + +// VTABLE 0x100d6f50 +// SIZE 0x30 +class LegoBuildingManager : public MxCore { public: + LegoBuildingManager(); + virtual ~LegoBuildingManager() override; + + // OFFSET: LEGO1 0x1002f930 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f37d0 + return "LegoBuildingManager"; + } + __declspec(dllexport) static void configureLegoBuildingManager(int param_1); + +private: + void Init(); + }; #endif // LEGOBUILDINGMANAGER_H diff --git a/LEGO1/legocachesound.cpp b/LEGO1/legocachesound.cpp new file mode 100644 index 00000000..37495920 --- /dev/null +++ b/LEGO1/legocachesound.cpp @@ -0,0 +1,19 @@ +#include "legocachesound.h" + +// OFFSET: LEGO1 0x100064d0 +LegoCacheSound::LegoCacheSound() +{ + Init(); +} + +// OFFSET: LEGO1 0x10006630 STUB +LegoCacheSound::~LegoCacheSound() +{ + // TODO +} + +// OFFSET: LEGO1 0x100066d0 STUB +void LegoCacheSound::Init() +{ + // TODO +} diff --git a/LEGO1/legocachesound.h b/LEGO1/legocachesound.h new file mode 100644 index 00000000..3506aa95 --- /dev/null +++ b/LEGO1/legocachesound.h @@ -0,0 +1,31 @@ +#ifndef LEGOCACHESOUND_H +#define LEGOCACHESOUND_H + +#include "mxcore.h" + +// VTABLE 0x100d4718 +// SIZE 0x88 +class LegoCacheSound : public MxCore +{ +public: + LegoCacheSound(); + virtual ~LegoCacheSound() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10006580 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f01c4 + return "LegoCacheSound"; + } + + // OFFSET: LEGO1 0x10006590 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoCacheSound::ClassName()) || MxCore::IsA(name); + } + +private: + void Init(); +}; + +#endif // LEGOCACHESOUND_H diff --git a/LEGO1/legocameracontroller.cpp b/LEGO1/legocameracontroller.cpp new file mode 100644 index 00000000..da023851 --- /dev/null +++ b/LEGO1/legocameracontroller.cpp @@ -0,0 +1,13 @@ +#include "legocameracontroller.h" + +// OFFSET: LEGO1 0x10011d50 STUB +LegoCameraController::LegoCameraController() +{ + // TODO +} + +// OFFSET: LEGO1 0x10011f70 STUB +LegoCameraController::~LegoCameraController() +{ + // TODO +} diff --git a/LEGO1/legocameracontroller.h b/LEGO1/legocameracontroller.h new file mode 100644 index 00000000..15afff7f --- /dev/null +++ b/LEGO1/legocameracontroller.h @@ -0,0 +1,29 @@ +#ifndef LEGOCAMERACONTROLLER_H +#define LEGOCAMERACONTROLLER_H + +#include "mxcore.h" + +// VTABLE 0x100d57b0 +// SIZE 0xc8 +class LegoCameraController : public MxCore +{ +public: + LegoCameraController(); + virtual ~LegoCameraController() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10011ec0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0850 + return "LegoCameraController"; + } + + // OFFSET: LEGO1 0x10011ed0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || MxCore::IsA(name); + } + +}; + +#endif // LEGOCAMERACONTROLLER_H diff --git a/LEGO1/legocarbuild.cpp b/LEGO1/legocarbuild.cpp new file mode 100644 index 00000000..c9254c37 --- /dev/null +++ b/LEGO1/legocarbuild.cpp @@ -0,0 +1,29 @@ +#include "legocarbuild.h" + +// OFFSET: LEGO1 0x100226d0 STUB +LegoCarBuild::LegoCarBuild() +{ + // TODO +} + +// OFFSET: LEGO1 0x10022a80 STUB +LegoCarBuild::~LegoCarBuild() +{ + // TODO +} + +// OFFSET: LEGO1 0x10024050 STUB +MxLong LegoCarBuild::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x100238b0 STUB +MxLong LegoCarBuild::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/legocarbuild.h b/LEGO1/legocarbuild.h new file mode 100644 index 00000000..d320cd6e --- /dev/null +++ b/LEGO1/legocarbuild.h @@ -0,0 +1,31 @@ +#ifndef LEGOCARBUILD_H +#define LEGOCARBUILD_H + +#include "legoworld.h" + +// VTABLE 0x100d6658 +// SIZE 0x34c +class LegoCarBuild : public LegoWorld +{ +public: + LegoCarBuild(); + virtual ~LegoCarBuild() override; + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x10022940 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0504 + return "LegoCarBuild"; + } + + // OFFSET: LEGO1 0x10022950 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoCarBuild::ClassName()) || LegoWorld::IsA(name); + } +}; + +#endif // LEGOCARBUILD_H diff --git a/LEGO1/legocarbuildanimpresenter.cpp b/LEGO1/legocarbuildanimpresenter.cpp new file mode 100644 index 00000000..0b5ee0a5 --- /dev/null +++ b/LEGO1/legocarbuildanimpresenter.cpp @@ -0,0 +1,13 @@ +#include "legocarbuildanimpresenter.h" + +// OFFSET: LEGO1 0x10078400 STUB +LegoCarBuildAnimPresenter::LegoCarBuildAnimPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x10078680 STUB +LegoCarBuildAnimPresenter::~LegoCarBuildAnimPresenter() +{ + // TODO +} diff --git a/LEGO1/legocarbuildanimpresenter.h b/LEGO1/legocarbuildanimpresenter.h new file mode 100644 index 00000000..b270243e --- /dev/null +++ b/LEGO1/legocarbuildanimpresenter.h @@ -0,0 +1,28 @@ +#ifndef LEGOCARBUILDANIMPRESENTER_H +#define LEGOCARBUILDANIMPRESENTER_H + +#include "legoanimpresenter.h" + +// VTABLE 0x100d99e0 +// SIZE 0x150 +class LegoCarBuildAnimPresenter : public LegoAnimPresenter +{ +public: + LegoCarBuildAnimPresenter(); + virtual ~LegoCarBuildAnimPresenter() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10078510 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f05ec + return "LegoCarBuildAnimPresenter"; + } + + // OFFSET: LEGO1 0x10078520 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoCarBuildAnimPresenter::ClassName()) || LegoAnimPresenter::IsA(name); + } +}; + +#endif // LEGOCARBUILDANIMPRESENTER_H diff --git a/LEGO1/legocarraceactor.h b/LEGO1/legocarraceactor.h new file mode 100644 index 00000000..36ba3ab1 --- /dev/null +++ b/LEGO1/legocarraceactor.h @@ -0,0 +1,24 @@ +#ifndef LEGOCARRACEACTOR_H +#define LEGOCARRACEACTOR_H + +#include "legoraceactor.h" + +// VTABLE 0x100da0d8 +class LegoCarRaceActor : public LegoRaceActor +{ +public: + // OFFSET: LEGO1 0x10081650 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0568 + return "LegoCarRaceActor"; + } + + // OFFSET: LEGO1 0x10081670 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoCarRaceActor::ClassName()) || LegoRaceActor::IsA(name); + } +}; + +#endif // LEGOCARRACEACTOR_H diff --git a/LEGO1/legocontrolmanager.cpp b/LEGO1/legocontrolmanager.cpp new file mode 100644 index 00000000..16733e13 --- /dev/null +++ b/LEGO1/legocontrolmanager.cpp @@ -0,0 +1,21 @@ +#include "legocontrolmanager.h" + +// OFFSET: LEGO1 0x10028520 STUB +LegoControlManager::LegoControlManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x10028d60 STUB +LegoControlManager::~LegoControlManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x10029600 STUB +MxLong LegoControlManager::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/legocontrolmanager.h b/LEGO1/legocontrolmanager.h new file mode 100644 index 00000000..c4563776 --- /dev/null +++ b/LEGO1/legocontrolmanager.h @@ -0,0 +1,30 @@ +#ifndef LEGOCONTROLMANAGER_H +#define LEGOCONTROLMANAGER_H + +#include "mxcore.h" + +// VTABLE 0x100d6a80 +class LegoControlManager : public MxCore +{ +public: + LegoControlManager(); + virtual ~LegoControlManager() override; // vtable+0x0 + + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x10028cb0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f31b8 + return "LegoControlManager"; + } + + // OFFSET: LEGO1 0x10028cc0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoControlManager::ClassName()) || MxCore::IsA(name); + } + +}; + +#endif // LEGOCONTROLMANAGER_H diff --git a/LEGO1/legoentity.cpp b/LEGO1/legoentity.cpp new file mode 100644 index 00000000..b79bc587 --- /dev/null +++ b/LEGO1/legoentity.cpp @@ -0,0 +1,21 @@ +#include "legoentity.h" + +// OFFSET: LEGO1 0x1000c290 +LegoEntity::~LegoEntity() +{ + Destroy(); +} + +// OFFSET: LEGO1 0x100114f0 STUB +MxLong LegoEntity::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x10010810 STUB +void LegoEntity::Destroy() +{ + // TODO +} diff --git a/LEGO1/legoentity.h b/LEGO1/legoentity.h index b64f55a2..46aea940 100644 --- a/LEGO1/legoentity.h +++ b/LEGO1/legoentity.h @@ -1,10 +1,37 @@ #ifndef LEGOENTITY_H #define LEGOENTITY_H -class LegoEntity +#include "mxentity.h" + +// VTABLE 0x100d4858 +class LegoEntity : public MxEntity { public: - __declspec(dllexport) virtual ~LegoEntity(); + // Inlined at 0x100853f7 + inline LegoEntity() + { + // TODO + } + + __declspec(dllexport) virtual ~LegoEntity() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x1000c2f0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0064 + return "LegoEntity"; + } + + // OFFSET: LEGO1 0x1000c300 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name); + } + + virtual void Destroy() override; // vtable+0x1c + }; #endif // LEGOENTITY_H diff --git a/LEGO1/legoentitypresenter.cpp b/LEGO1/legoentitypresenter.cpp new file mode 100644 index 00000000..e763b771 --- /dev/null +++ b/LEGO1/legoentitypresenter.cpp @@ -0,0 +1,19 @@ +#include "legoentitypresenter.h" + +// OFFSET: LEGO1 0x10053440 +LegoEntityPresenter::LegoEntityPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x100535d0 STUB +LegoEntityPresenter::~LegoEntityPresenter() +{ + // TODO +} + +// OFFSET: LEG01 0x100535c0 STUB +void LegoEntityPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/legoentitypresenter.h b/LEGO1/legoentitypresenter.h new file mode 100644 index 00000000..e2e82abc --- /dev/null +++ b/LEGO1/legoentitypresenter.h @@ -0,0 +1,32 @@ +#ifndef LEGOENTITYPRESENTER_H +#define LEGOENTITYPRESENTER_H + +#include "mxcompositepresenter.h" + +// VTABLE 0x100d8398 +class LegoEntityPresenter : public MxCompositePresenter +{ +public: + LegoEntityPresenter(); + virtual ~LegoEntityPresenter() override; // vtable+0x0 + + // OFFSET: LEGO1 0x100534b0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f06b8 + return "LegoEntityPresenter"; + } + + // OFFSET: LEGO1 0x100534c0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoEntityPresenter::ClassName()) || MxCompositePresenter::IsA(name); + } + +private: + void Init(); + +}; + + +#endif // LEGOENTITYPRESENTER_H diff --git a/LEGO1/legoextraactor.h b/LEGO1/legoextraactor.h new file mode 100644 index 00000000..5b7f216f --- /dev/null +++ b/LEGO1/legoextraactor.h @@ -0,0 +1,24 @@ +#ifndef LEGOEXTRAACTOR_H +#define LEGOEXTRAACTOR_H + +#include "legoanimactor.h" + +// VTABLE 0x100d6c10 +class LegoExtraActor : public LegoAnimActor +{ +public: + // OFFSET: LEGO1 0x1002b7a0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f3204 + return "LegoExtraActor"; + } + + // OFFSET: LEGO1 0x1002b7c0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(name); + } +}; + +#endif // LEGOEXTRAACTOR_H diff --git a/LEGO1/legoflctexturepresenter.cpp b/LEGO1/legoflctexturepresenter.cpp new file mode 100644 index 00000000..d7a97d21 --- /dev/null +++ b/LEGO1/legoflctexturepresenter.cpp @@ -0,0 +1,7 @@ +#include "legoflctexturepresenter.h" + +// OFFSET: LEGO1 0x1005de80 STUB +LegoFlcTexturePresenter::LegoFlcTexturePresenter() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/legoflctexturepresenter.h b/LEGO1/legoflctexturepresenter.h new file mode 100644 index 00000000..e525b3ce --- /dev/null +++ b/LEGO1/legoflctexturepresenter.h @@ -0,0 +1,22 @@ +#ifndef LEGOFLCTEXTUREPRESENTER_H +#define LEGOFLCTEXTUREPRESENTER_H + +#include "mxflcpresenter.h" + +// VTABLE 0x100d89e0 +// SIZE 0x70 +class LegoFlcTexturePresenter : public MxFlcPresenter +{ +public: + LegoFlcTexturePresenter(); + + // OFFSET: LEGO1 0x1005def0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0634 + return "LegoFlcTexturePresenter"; + } + +}; + +#endif // LEGOFLCTEXTUREPRESENTER_H diff --git a/LEGO1/legogamestate.cpp b/LEGO1/legogamestate.cpp new file mode 100644 index 00000000..c12a5e06 --- /dev/null +++ b/LEGO1/legogamestate.cpp @@ -0,0 +1,45 @@ +#include "legogamestate.h" + +// OFFSET: LEGO1 0x10039550 +LegoGameState::LegoGameState() +{ + // TODO +} + +// OFFSET: LEGO1 0x10039720 +LegoGameState::~LegoGameState() +{ + // TODO +} + +// OFFSET: LEGO1 0x10039c60 +MxResult LegoGameState::Load(MxULong) +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x10039980 +MxResult LegoGameState::Save(MxULong p) +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x1003a2e0 +void LegoGameState::SerializePlayersInfo(MxS16 p) +{ + // TODO +} + +// OFFSET: LEGO1 0x1003cdd0 +void LegoGameState::SerializeScoreHistory(MxS16 p) +{ + // TODO +} + +// OFFSET: LEGO1 0x10039f00 +void LegoGameState::SetSavePath(char *p) +{ + // TODO +} diff --git a/LEGO1/legogamestate.h b/LEGO1/legogamestate.h index 239719eb..80437051 100644 --- a/LEGO1/legogamestate.h +++ b/LEGO1/legogamestate.h @@ -1,15 +1,17 @@ #ifndef LEGOGAMESTATE_H #define LEGOGAMESTATE_H +#include "mxtypes.h" + class LegoGameState { public: __declspec(dllexport) LegoGameState(); __declspec(dllexport) ~LegoGameState(); - __declspec(dllexport) long Load(unsigned long); - __declspec(dllexport) long Save(unsigned long p); - __declspec(dllexport) void SerializePlayersInfo(short p); - __declspec(dllexport) void SerializeScoreHistory(short p); + __declspec(dllexport) MxResult Load(MxULong); + __declspec(dllexport) MxResult Save(MxULong p); + __declspec(dllexport) void SerializePlayersInfo(MxS16 p); + __declspec(dllexport) void SerializeScoreHistory(MxS16 p); __declspec(dllexport) void SetSavePath(char *p); }; diff --git a/LEGO1/legohideanimpresenter.cpp b/LEGO1/legohideanimpresenter.cpp new file mode 100644 index 00000000..8a9e7c9b --- /dev/null +++ b/LEGO1/legohideanimpresenter.cpp @@ -0,0 +1,12 @@ +#include "legohideanimpresenter.h" + +// OFFSET: LEGO1 0x1006d7e0 +LegoHideAnimPresenter::LegoHideAnimPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x1006da50 STUB +void LegoHideAnimPresenter::Init() +{ +} diff --git a/LEGO1/legohideanimpresenter.h b/LEGO1/legohideanimpresenter.h new file mode 100644 index 00000000..abc63d78 --- /dev/null +++ b/LEGO1/legohideanimpresenter.h @@ -0,0 +1,31 @@ +#ifndef LEGOHIDEANIMPRESENTER_H +#define LEGOHIDEANIMPRESENTER_H + +#include "legoloopinganimpresenter.h" + +// VTABLE 0x100d9278 +// SIZE 0xc4 +class LegoHideAnimPresenter : public LegoLoopingAnimPresenter +{ +public: + LegoHideAnimPresenter(); + + // OFFSET: LEGO1 0x1006d880 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f06cc + return "LegoHideAnimPresenter"; + } + + // OFFSET: LEGO1 0x1006d890 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || LegoAnimPresenter::IsA(name); + } + +private: + void Init(); + +}; + +#endif // LEGOHIDEANIMPRESENTER_H diff --git a/LEGO1/legoinputmanager.cpp b/LEGO1/legoinputmanager.cpp new file mode 100644 index 00000000..90be0c2c --- /dev/null +++ b/LEGO1/legoinputmanager.cpp @@ -0,0 +1,44 @@ +#include "legoinputmanager.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(LegoInputManager, 0x338); // 0x10059085 + +// OFFSET: LEGO1 0x1005b790 STUB +LegoInputManager::LegoInputManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005b8f0 STUB +LegoInputManager::~LegoInputManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005c740 STUB +void LegoInputManager::QueueEvent(NotificationId id, unsigned char p2, MxLong p3, MxLong p4, unsigned char p5) +{ + // TODO +} + +// OFFSET: LEGO1 0x1005c470 STUB +void LegoInputManager::Register(MxCore *) +{ + // TODO +} + +// OFFSET: LEGO1 0x1005c5c0 STUB +void LegoInputManager::UnRegister(MxCore *) +{ + // TODO +} + +// OFFSET: LEGO1 0x1005b8b0 STUB +MxLong LegoInputManager::Tickle() +{ + // TODO + + return 0; +} + diff --git a/LEGO1/legoinputmanager.h b/LEGO1/legoinputmanager.h index bc5cc4d3..7ae2dd62 100644 --- a/LEGO1/legoinputmanager.h +++ b/LEGO1/legoinputmanager.h @@ -1,9 +1,10 @@ #ifndef LEGOINPUTMANAGER_H #define LEGOINPUTMANAGER_H -#include "mxcore.h" +#include "decomp.h" +#include "mxpresenter.h" -__declspec(dllexport) enum NotificationId +enum NotificationId { NONE = 0, KEYDOWN = 7, @@ -13,16 +14,23 @@ __declspec(dllexport) enum NotificationId TIMER = 15 }; -class LegoInputManager +// VTABLE 0x100d8760 +// SIZE 0x338 +class LegoInputManager : public MxPresenter { public: - __declspec(dllexport) void QueueEvent(NotificationId id, unsigned char p2, long p3, long p4, unsigned char p5); + LegoInputManager(); + virtual ~LegoInputManager() override; + + __declspec(dllexport) void QueueEvent(NotificationId id, unsigned char p2, MxLong p3, MxLong p4, unsigned char p5); __declspec(dllexport) void Register(MxCore *); __declspec(dllexport) void UnRegister(MxCore *); - char m_pad00[0x19C]; + virtual MxLong Tickle() override; // vtable+0x8 + + undefined m_pad40[0x15c]; int m_joystickIndex; - char m_pad200[0x194]; + undefined m_pad200[0x194]; MxBool m_useJoystick; }; diff --git a/LEGO1/legojetski.cpp b/LEGO1/legojetski.cpp new file mode 100644 index 00000000..d0fffd85 --- /dev/null +++ b/LEGO1/legojetski.cpp @@ -0,0 +1 @@ +#include "legojetski.h" diff --git a/LEGO1/legojetski.h b/LEGO1/legojetski.h new file mode 100644 index 00000000..759e83ac --- /dev/null +++ b/LEGO1/legojetski.h @@ -0,0 +1,26 @@ +#ifndef LEGOJETSKI_H +#define LEGOJETSKI_H + +#include "legojetskiraceactor.h" + +// VTABLE 0x100d5a40 +class LegoJetski : public LegoJetskiRaceActor +{ +public: + // OFFSET: LEGO1 0x10013e80 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f053c + return "LegoJetski"; + } + + // OFFSET: LEGO1 0x10013ea0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoJetski::ClassName()) || LegoJetskiRaceActor::IsA(name); + } + +}; + + +#endif // LEGOJETSKI_H diff --git a/LEGO1/legojetskiraceactor.h b/LEGO1/legojetskiraceactor.h new file mode 100644 index 00000000..7c31f3b2 --- /dev/null +++ b/LEGO1/legojetskiraceactor.h @@ -0,0 +1,24 @@ +#ifndef LEGOJETSKIRACEACTOR_H +#define LEGOJETSKIRACEACTOR_H + +#include "legocarraceactor.h" + +// VTABLE 0x100da240 +class LegoJetskiRaceActor : public LegoCarRaceActor +{ +public: + // OFFSET: LEGO1 0x10081d80 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0554 + return "LegoJetskiRaceActor"; + } + + // OFFSET: LEGO1 0x10081da0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoJetskiRaceActor::ClassName()) || LegoCarRaceActor::IsA(name); + } +}; + +#endif // LEGOJETSKIRACEACTOR_H diff --git a/LEGO1/legoloadcachesoundpresenter.cpp b/LEGO1/legoloadcachesoundpresenter.cpp new file mode 100644 index 00000000..0830d7d7 --- /dev/null +++ b/LEGO1/legoloadcachesoundpresenter.cpp @@ -0,0 +1,19 @@ +#include "legoloadcachesoundpresenter.h" + +// OFFSET: LEGO1 0x10018340 +LegoLoadCacheSoundPresenter::LegoLoadCacheSoundPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x10018480 STUB +LegoLoadCacheSoundPresenter::~LegoLoadCacheSoundPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100184e0 STUB +void LegoLoadCacheSoundPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/legoloadcachesoundpresenter.h b/LEGO1/legoloadcachesoundpresenter.h new file mode 100644 index 00000000..0673568e --- /dev/null +++ b/LEGO1/legoloadcachesoundpresenter.h @@ -0,0 +1,26 @@ +#ifndef LEGOLOADCACHESOUNDPRESENTER_H +#define LEGOLOADCACHESOUNDPRESENTER_H + +#include "mxwavepresenter.h" + +// VTABLE 0x100d5fa8 +// SIZE 0x90 +class LegoLoadCacheSoundPresenter : public MxWavePresenter +{ +public: + LegoLoadCacheSoundPresenter(); + virtual ~LegoLoadCacheSoundPresenter() override; + + // OFFSET: LEGO1 0x10018450 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f05a0 + return "LegoLoadCacheSoundPresenter"; + } + +private: + void Init(); + +}; + +#endif // LEGOLOADCACHESOUNDPRESENTER_H diff --git a/LEGO1/legolocomotionanimpresenter.cpp b/LEGO1/legolocomotionanimpresenter.cpp new file mode 100644 index 00000000..f7da593f --- /dev/null +++ b/LEGO1/legolocomotionanimpresenter.cpp @@ -0,0 +1,13 @@ +#include "legolocomotionanimpresenter.h" + +// OFFSET: LEGO1 0x1006cdd0 +LegoLocomotionAnimPresenter::LegoLocomotionAnimPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x1006d0b0 STUB +void LegoLocomotionAnimPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/legolocomotionanimpresenter.h b/LEGO1/legolocomotionanimpresenter.h new file mode 100644 index 00000000..89a3039c --- /dev/null +++ b/LEGO1/legolocomotionanimpresenter.h @@ -0,0 +1,30 @@ +#ifndef LEGOLOCOMOTIONANIMPRESENTER_H +#define LEGOLOCOMOTIONANIMPRESENTER_H + +#include "legoloopinganimpresenter.h" + +// VTABLE 0x100d9170 +class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter +{ +public: + LegoLocomotionAnimPresenter(); + + // OFFSET: LEGO1 0x1006ce50 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f06e4 + return "LegoLocomotionAnimPresenter"; + } + + // OFFSET: LEGO1 0x1006ce60 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || LegoLoopingAnimPresenter::IsA(name); + } + +private: + void Init(); + +}; + +#endif // LEGOLOCOMOTIONANIMPRESENTER_H diff --git a/LEGO1/legoloopinganimpresenter.h b/LEGO1/legoloopinganimpresenter.h new file mode 100644 index 00000000..672ff260 --- /dev/null +++ b/LEGO1/legoloopinganimpresenter.h @@ -0,0 +1,25 @@ +#ifndef LEGOLOOPINGANIMPRESENTER_H +#define LEGOLOOPINGANIMPRESENTER_H + +#include "legoanimpresenter.h" + +// VTABLE 0x100d4900 +// SIZE 0xc0 (discovered through inlined constructor at 0x10009ecd) +class LegoLoopingAnimPresenter : public LegoAnimPresenter +{ +public: + // OFFSET: LEGO1 0x1000c9a0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0700 + return "LegoLoopingAnimPresenter"; + } + + // OFFSET: LEGO1 0x1000c9b0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || LegoAnimPresenter::IsA(name); + } +}; + +#endif // LEGOLOOPINGANIMPRESENTER_H diff --git a/LEGO1/legomodelpresenter.cpp b/LEGO1/legomodelpresenter.cpp new file mode 100644 index 00000000..b038287c --- /dev/null +++ b/LEGO1/legomodelpresenter.cpp @@ -0,0 +1,10 @@ +#include "legomodelpresenter.h" + +// 0x100f7ae0 +int g_modelPresenterConfig = 1; + +// OFFSET: LEGO1 0x1007f660 +void LegoModelPresenter::configureLegoModelPresenter(int param_1) +{ + g_modelPresenterConfig = param_1; +} diff --git a/LEGO1/legomodelpresenter.h b/LEGO1/legomodelpresenter.h index a5c6306c..e5f0d136 100644 --- a/LEGO1/legomodelpresenter.h +++ b/LEGO1/legomodelpresenter.h @@ -1,10 +1,27 @@ #ifndef LEGOMODELPRESENTER_H #define LEGOMODELPRESENTER_H -class LegoModelPresenter +#include "mxvideopresenter.h" + +// VTABLE 0x100d4e50 +// SIZE 0x6c (discovered through inline constructor at 0x10009ae6) +class LegoModelPresenter : public MxVideoPresenter { public: __declspec(dllexport) static void configureLegoModelPresenter(int param_1); + + // OFFSET: LEGO1 0x1000ccb0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f067c + return "LegoModelPresenter"; + } + + // OFFSET: LEGO1 0x1000ccc0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoModelPresenter::ClassName()) || MxVideoPresenter::IsA(name); + } }; #endif // LEGOMODELPRESENTER_H diff --git a/LEGO1/legonavcontroller.cpp b/LEGO1/legonavcontroller.cpp index af618de9..90c0a485 100644 --- a/LEGO1/legonavcontroller.cpp +++ b/LEGO1/legonavcontroller.cpp @@ -106,8 +106,7 @@ void LegoNavController::SetControlMax(int p_hMax, int p_vMax) this->m_hMax = p_hMax; this->m_vMax = p_vMax; - if (VideoManager()->GetVideoParam().flags().GetFullScreen()) - { + if (VideoManager()->GetVideoParam().flags().GetFullScreen()) { this->m_hMax = 640; this->m_vMax = 480; } @@ -134,19 +133,15 @@ void LegoNavController::ResetToDefault() void LegoNavController::SetTargets(int p_hPos, int p_vPos, MxBool p_accel) { if (this->m_trackDefault != FALSE) - { ResetToDefault(); - } - if (p_accel != FALSE) - { + if (p_accel != FALSE) { this->m_targetTurnSpeed = CalculateNewTargetSpeed(p_hPos, this->m_hMax / 2, this->m_turnMaxSpeed); this->m_targetMovementSpeed = CalculateNewTargetSpeed(this->m_vMax - p_vPos, this->m_vMax / 2, this->m_movementMaxSpeed); this->m_turnAccel = CalculateNewAccel(p_hPos, this->m_hMax / 2, this->m_turnMaxAccel, (int)this->m_turnMinAccel); this->m_movementAccel = CalculateNewAccel(this->m_vMax - p_vPos, this->m_vMax / 2, this->m_movementMaxAccel, (int)this->m_movementMinAccel); } - else - { + else { this->m_targetTurnSpeed = 0.0f; this->m_targetMovementSpeed = 0.0f; this->m_movementAccel = this->m_movementDecel; @@ -179,9 +174,28 @@ float LegoNavController::CalculateNewAccel(int p_pos, int p_center, float p_maxA result = Abs(diff) * p_maxAccel / p_center; if (result < p_minAccel) - { - result = (float)p_minAccel; - } + result = (float) p_minAccel; return result; } + +// OFFSET: LEGO1 0x10054fe0 +float LegoNavController::CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time) +{ + float newVel = p_currentVel; + + float velDiff = p_targetVel - p_currentVel; + int vSign = velDiff > 0 ? 1 : -1; + + if (Abs(velDiff) > this->m_zeroThreshold) { + float deltaVel = p_accel * p_time; + newVel = p_currentVel + (deltaVel * vSign); + + if (vSign > 0) + newVel = Min(newVel, p_targetVel); + else + newVel = Max(newVel, p_targetVel); + } + + return newVel; +} \ No newline at end of file diff --git a/LEGO1/legonavcontroller.h b/LEGO1/legonavcontroller.h index 35bcf4d3..89af9f12 100644 --- a/LEGO1/legonavcontroller.h +++ b/LEGO1/legonavcontroller.h @@ -5,6 +5,8 @@ #include "mxtimer.h" #include "mxtypes.h" +// VTABLE 0x100d85b8 +// SIZE 0x70 class LegoNavController : public MxCore { public: @@ -18,13 +20,27 @@ class LegoNavController : public MxCore float p_rotationSensitivity, MxBool p_turnUseVelocity); LegoNavController(); - // virtual ~LegoNavController(); + // virtual ~LegoNavController(); // vtable+0x0 + + // OFFSET: LEGO1 0x10054b80 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f66d8 + return "LegoNavController"; + } + + // OFFSET: LEGO1 0x10054b90 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || MxCore::IsA(name); + } void SetControlMax(int p_hMax, int p_vMax); void ResetToDefault(); void SetTargets(int p_hPos, int p_vPos, MxBool p_accel); float CalculateNewTargetSpeed(int p_pos, int p_center, float p_maxSpeed); float CalculateNewAccel(int p_pos, int p_center, float p_maxAccel, int p_minAccel); + float CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time); private: int m_hMax; diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 3d8be0d7..b5cbca8e 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -1,5 +1,11 @@ #include "legoomni.h" +// 0x100f4588 +char *g_nocdSourceName = NULL; + +// 0x101020e8 +void (*g_omniUserMessage)(const char *,int); + // OFFSET: LEGO1 0x10058a00 LegoOmni::LegoOmni() { @@ -12,16 +18,61 @@ LegoOmni::~LegoOmni() Destroy(); } +// OFFSET: LEGO1 0x1005b560 STUB +void LegoOmni::CreateBackgroundAudio() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005af10 STUB +void LegoOmni::RemoveWorld(const MxAtomId &p1, MxLong p2) +{ + // TODO +} + +// OFFSET: LEGO1 0x1005b400 STUB +int LegoOmni::GetCurrPathInfo(LegoPathBoundary **,int &) +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x100b6ff0 STUB +void MakeSourceName(char *, const char *) +{ + // TODO +} + +// OFFSET: LEGO1 0x100b7210 +void SetOmniUserMessage(void (*p_userMsg)(const char *,int)) +{ + g_omniUserMessage = p_userMsg; +} + +// OFFSET: LEGO1 0x100acf50 STUB +MxLong Start(MxDSAction *) +{ + // TODO + return 0; +} + // OFFSET: LEGO1 0x1005ad10 LegoOmni *LegoOmni::GetInstance() { - return (LegoOmni *) m_instance; + return (LegoOmni *)MxOmni::GetInstance(); +} + +// OFFSET: LEGO1 0x1005ac90 +void LegoOmni::CreateInstance() +{ + MxOmni::DestroyInstance(); + MxOmni::SetInstance(new LegoOmni()); } // OFFSET: LEGO1 0x10015700 LegoOmni *Lego() { - return (LegoOmni *) MxOmni::GetInstance(); + return (LegoOmni *)MxOmni::GetInstance(); } // OFFSET: LEGO1 0x10015710 @@ -30,19 +81,43 @@ LegoSoundManager *SoundManager() return LegoOmni::GetInstance()->GetSoundManager(); } - // OFFSET: LEGO1 0x10015720 LegoVideoManager *VideoManager() { return LegoOmni::GetInstance()->GetVideoManager(); } +// OFFSET: LEGO1 0x100157f0 +LegoBuildingManager *BuildingManager() +{ + return LegoOmni::GetInstance()->GetLegoBuildingManager(); +} + +// OFFSET: LEGO1 0x10015790 +Isle *GetIsle() +{ + return LegoOmni::GetInstance()->GetIsle(); +} + +// OFFSET: LEGO1 0x100157e0 +LegoPlantManager *PlantManager() +{ + return LegoOmni::GetInstance()->GetLegoPlantManager(); +} + // OFFSET: LEGO1 0x10015730 MxBackgroundAudioManager *BackgroundAudioManager() { return LegoOmni::GetInstance()->GetBackgroundAudioManager(); } +// OFFSET: LEGO1 0x100c0280 STUB +MxDSObject *CreateStreamObject(MxDSFile *,MxS16) +{ + // TODO + return NULL; +} + // OFFSET: LEGO1 0x10015740 LegoInputManager *InputManager() { @@ -61,13 +136,39 @@ LegoNavController *NavController() return LegoOmni::GetInstance()->GetNavController(); } +// OFFSET: LEGO1 0x10015900 +MxTransitionManager *TransitionManager() +{ + return LegoOmni::GetInstance()->GetTransitionManager(); +} + +// OFFSET: LEGO1 0x10053430 +const char *GetNoCD_SourceName() +{ + return g_nocdSourceName; +} + // OFFSET: LEGO1 0x1005b5f0 -long LegoOmni::Notify(MxParam &p) +MxLong LegoOmni::Notify(MxParam &p) { // FIXME: Stub return 0; } +// OFFSET: LEGO1 0x1003dd70 STUB +LegoROI *PickROI(MxLong,MxLong) +{ + // TODO + return NULL; +} + +// OFFSET: LEGO1 0x1003ddc0 STUB +LegoEntity *PickEntity(MxLong,MxLong) +{ + // TODO + return NULL; +} + // OFFSET: LEGO1 0x10058bd0 void LegoOmni::Init() { @@ -75,7 +176,7 @@ void LegoOmni::Init() } // OFFSET: LEGO1 0x10058e70 -MxResult LegoOmni::Create(MxOmniCreateParam &p) +MxResult LegoOmni::Create(COMPAT_CONST MxOmniCreateParam &p) { // FIXME: Stub return SUCCESS; diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index 852c5b07..0ba27cf2 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -1,10 +1,12 @@ #ifndef LEGOOMNI_H #define LEGOOMNI_H +#include "compat.h" #include "legoentity.h" #include "legoinputmanager.h" #include "legogamestate.h" #include "legonavcontroller.h" +#include "legopathboundary.h" #include "legoroi.h" #include "legovideomanager.h" #include "mxatomid.h" @@ -14,31 +16,43 @@ #include "mxdsobject.h" #include "mxomni.h" #include "mxtransitionmanager.h" +#include "isle.h" +#include "legobuildingmanager.h" +#include "legoplantmanager.h" class LegoSoundManager; +// VTABLE 0x100d8638 +// SIZE: 0x140 class LegoOmni : public MxOmni { public: __declspec(dllexport) void CreateBackgroundAudio(); - __declspec(dllexport) void RemoveWorld(const MxAtomId &p1, long p2); - __declspec(dllexport) static int GetCurrPathInfo(class LegoPathBoundary * *,int &); + __declspec(dllexport) void RemoveWorld(const MxAtomId &p1, MxLong p2); + __declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary **,int &); __declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static LegoOmni *GetInstance(); LegoOmni(); virtual ~LegoOmni(); // vtable+00 - virtual long Notify(MxParam &p); // vtable+04 + virtual MxLong Notify(MxParam &p); // vtable+04 // OFFSET: LEGO1 0x10058aa0 - inline virtual const char *ClassName() const { return "LegoOmni"; }; // vtable+0c + inline virtual const char *ClassName() const // vtable+0c + { + // 0x100f671c + return "LegoOmni"; + } // OFFSET: LEGO1 0x10058ab0 - inline virtual MxBool IsA(const char *name) const { return !strcmp(name, LegoOmni::ClassName()) || MxOmni::IsA(name); }; // vtable+10; + inline virtual MxBool IsA(const char *name) const // vtable+10 + { + return !strcmp(name, LegoOmni::ClassName()) || MxOmni::IsA(name); + } virtual void Init(); // vtable+14 - virtual MxResult Create(MxOmniCreateParam &p); // vtable+18 + virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p); // vtable+18 virtual void Destroy(); // vtable+1c virtual void vtable20(); virtual void vtable24(MxDSAction &ds); @@ -54,8 +68,12 @@ class LegoOmni : public MxOmni LegoSoundManager *GetSoundManager() { return (LegoSoundManager *)m_soundManager;} MxBackgroundAudioManager *GetBackgroundAudioManager() { return m_bkgAudioManager; } LegoInputManager *GetInputManager() { return m_inputMgr; } + Isle *GetIsle() { return m_isle; } + LegoBuildingManager *GetLegoBuildingManager() { return m_buildingManager; } + LegoPlantManager *GetLegoPlantManager() { return m_plantManager; } LegoGameState *GetGameState() { return m_gameState; } LegoNavController *GetNavController() { return m_navController; } + MxTransitionManager *GetTransitionManager() { return m_transitionManager; } private: int m_unk68; @@ -63,36 +81,37 @@ class LegoOmni : public MxOmni LegoInputManager *m_inputMgr; // 0x70 char m_unk74[0x10]; LegoNavController *m_navController; // 0x84 - char m_unk88[0x14]; + Isle* m_isle; // 0x88 + char m_unk8c[0x4]; + LegoPlantManager* m_plantManager; // 0x90 + char m_unk94[0x4]; + LegoBuildingManager* m_buildingManager; // 0x98 LegoGameState *m_gameState; // 0x9c - char m_unka0[0x94]; + MxDSAction m_action; MxBackgroundAudioManager *m_bkgAudioManager; // 0x134 MxTransitionManager *m_transitionManager; // 0x138 + int m_unk13c; }; __declspec(dllexport) MxBackgroundAudioManager * BackgroundAudioManager(); -__declspec(dllexport) MxDSObject * CreateStreamObject(MxDSFile *,short); -__declspec(dllexport) MxEventManager * EventManager(); +__declspec(dllexport) MxDSObject * CreateStreamObject(MxDSFile *,MxS16); __declspec(dllexport) LegoGameState * GameState(); __declspec(dllexport) const char * GetNoCD_SourceName(); __declspec(dllexport) LegoInputManager * InputManager(); __declspec(dllexport) LegoOmni * Lego(); -__declspec(dllexport) MxSoundManager * MSoundManager(); __declspec(dllexport) void MakeSourceName(char *, const char *); -__declspec(dllexport) MxMusicManager * MusicManager(); -__declspec(dllexport) MxNotificationManager * NotificationManager(); -__declspec(dllexport) LegoEntity * PickEntity(long,long); -__declspec(dllexport) LegoROI * PickROI(long,long); +__declspec(dllexport) LegoEntity * PickEntity(MxLong,MxLong); +__declspec(dllexport) LegoROI * PickROI(MxLong,MxLong); __declspec(dllexport) void SetOmniUserMessage(void (*)(const char *,int)); __declspec(dllexport) LegoSoundManager * SoundManager(); -__declspec(dllexport) long Start(MxDSAction *); -__declspec(dllexport) MxStreamer * Streamer(); -__declspec(dllexport) MxTickleManager * TickleManager(); +__declspec(dllexport) MxLong Start(MxDSAction *); __declspec(dllexport) MxTransitionManager * TransitionManager(); -__declspec(dllexport) MxVariableTable * VariableTable(); __declspec(dllexport) LegoVideoManager * VideoManager(); +__declspec(dllexport) MxLong Start(MxDSAction *a); -__declspec(dllexport) long Start(MxDSAction *a); +LegoBuildingManager* BuildingManager(); +Isle* GetIsle(); +LegoPlantManager* PlantManager(); #endif // LEGOOMNI_H diff --git a/LEGO1/legopalettepresenter.cpp b/LEGO1/legopalettepresenter.cpp new file mode 100644 index 00000000..07b9cb99 --- /dev/null +++ b/LEGO1/legopalettepresenter.cpp @@ -0,0 +1,19 @@ +#include "legopalettepresenter.h" + +// OFFSET: LEGO1 0x10079e50 +LegoPalettePresenter::LegoPalettePresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x1007a070 STUB +LegoPalettePresenter::~LegoPalettePresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007a0d0 STUB +void LegoPalettePresenter::Init() +{ + // TODO +} diff --git a/LEGO1/legopalettepresenter.h b/LEGO1/legopalettepresenter.h new file mode 100644 index 00000000..d5fbefba --- /dev/null +++ b/LEGO1/legopalettepresenter.h @@ -0,0 +1,33 @@ +#ifndef LEGOPALETTEPRESENTER_H +#define LEGOPALETTEPRESENTER_H + +#include "mxvideopresenter.h" + +// VTABLE 0x100d9aa0 +// SIZE 0x68 +class LegoPalettePresenter : public MxVideoPresenter +{ +public: + LegoPalettePresenter(); + virtual ~LegoPalettePresenter(); // vtable+0x0 + + // OFFSET: LEGO1 0x10079f30 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f061c + return "LegoPalettePresenter"; + } + + // OFFSET: LEGO1 0x10079f40 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ClassName()) || MxVideoPresenter::IsA(name); + } + +private: + void Init(); + +}; + + +#endif // LEGOPALETTEPRESENTER_H diff --git a/LEGO1/legopartpresenter.cpp b/LEGO1/legopartpresenter.cpp new file mode 100644 index 00000000..376073f0 --- /dev/null +++ b/LEGO1/legopartpresenter.cpp @@ -0,0 +1,14 @@ +#include "legopartpresenter.h" + +// 0x100f7aa0 +int g_partPresenterConfig1 = 1; + +// 0x100f7aa4 +int g_partPresenterConfig2 = 100; + +// OFFSET: LEGO1 0x1007c990 +void LegoPartPresenter::configureLegoPartPresenter(int param_1, int param_2) +{ + g_partPresenterConfig1 = param_1; + g_partPresenterConfig2 = param_2; +} diff --git a/LEGO1/legopartpresenter.h b/LEGO1/legopartpresenter.h index 05e0df7e..73be1709 100644 --- a/LEGO1/legopartpresenter.h +++ b/LEGO1/legopartpresenter.h @@ -1,9 +1,26 @@ #ifndef LEGOPARTPRESENTER_H #define LEGOPARTPRESENTER_H -class LegoPartPresenter +#include "mxmediapresenter.h" + +// VTABLE 0x100d4df0 +// SIZE 0x54 (from inlined construction at 0x10009fac) +class LegoPartPresenter : public MxMediaPresenter { public: + // OFFSET: LEGO1 0x1000cf70 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f05d8 + return "LegoPartPresenter"; + } + + // OFFSET: LEGO1 0x1000cf80 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoPartPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + __declspec(dllexport) static void configureLegoPartPresenter(int param_1, int param_2); }; diff --git a/LEGO1/legopathactor.cpp b/LEGO1/legopathactor.cpp new file mode 100644 index 00000000..336cdc13 --- /dev/null +++ b/LEGO1/legopathactor.cpp @@ -0,0 +1,13 @@ +#include "legopathactor.h" + +// OFFSET: LEGO1 0x1002d700 STUB +LegoPathActor::LegoPathActor() +{ + // TODO +} + +// OFFSET: LEGO1 0x1002d820 STUB +LegoPathActor::~LegoPathActor() +{ + // TODO +} diff --git a/LEGO1/legopathactor.h b/LEGO1/legopathactor.h new file mode 100644 index 00000000..e6f643c2 --- /dev/null +++ b/LEGO1/legopathactor.h @@ -0,0 +1,30 @@ +#ifndef LEGOPATHACTOR_H +#define LEGOPATHACTOR_H + +#include "legoactor.h" + +// VTABLE 0x100d6e28 +// SIZE 0x154 (from inlined construction at 0x1000a346) +class LegoPathActor : public LegoActor +{ +public: + LegoPathActor(); + + virtual ~LegoPathActor() override; + + // OFFSET: LEGO1 0x1000c430 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0114 + return "LegoPathActor"; + } + + // OFFSET: LEGO1 0x1000c440 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoPathActor::ClassName()) || LegoActor::IsA(name); + } + +}; + +#endif // LEGOPATHACTOR_H diff --git a/LEGO1/legopathboundary.h b/LEGO1/legopathboundary.h new file mode 100644 index 00000000..c1f9d6ff --- /dev/null +++ b/LEGO1/legopathboundary.h @@ -0,0 +1,9 @@ +#ifndef LEGOPATHBOUNDARH_H +#define LEGOPATHBOUNDARH_H + +class LegoPathBoundary +{ + +}; + +#endif // LEGOPATHBOUNDARH_H diff --git a/LEGO1/legopathcontroller.cpp b/LEGO1/legopathcontroller.cpp new file mode 100644 index 00000000..0cebbc0f --- /dev/null +++ b/LEGO1/legopathcontroller.cpp @@ -0,0 +1,20 @@ +#include "legopathcontroller.h" + +// OFFSET: LEGO1 0x10044f40 STUB +LegoPathController::LegoPathController() +{ + // TODO +} + +// OFFSET: LEGO1 0x10045740 STUB +LegoPathController::~LegoPathController() +{ + // TODO +} + +// OFFSET: LEGO1 0x10045c10 STUB +MxLong LegoPathController::Tickle() +{ + // TODO + return 0; +} diff --git a/LEGO1/legopathcontroller.h b/LEGO1/legopathcontroller.h new file mode 100644 index 00000000..ba415076 --- /dev/null +++ b/LEGO1/legopathcontroller.h @@ -0,0 +1,31 @@ +#ifndef LEGOPATHCONTROLLER_H +#define LEGOPATHCONTROLLER_H + +#include "mxcore.h" + +// VTABLE 0x100d7d60 +// SIZE 0x40 +class LegoPathController : public MxCore +{ +public: + LegoPathController(); + virtual ~LegoPathController() override; + + virtual MxLong Tickle() override; // vtable+08 + + // OFFSET: LEGO1 0x10045110 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f11b8 + return "LegoPathController"; + } + + // OFFSET: LEGO1 0x10045120 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoPathController::ClassName()) || MxCore::IsA(name); + } + +}; + +#endif // LEGOPATHCONTROLLER_H diff --git a/LEGO1/legopathpresenter.cpp b/LEGO1/legopathpresenter.cpp new file mode 100644 index 00000000..43b05e26 --- /dev/null +++ b/LEGO1/legopathpresenter.cpp @@ -0,0 +1,7 @@ +#include "legopathpresenter.h" + +// OFFSET: LEGO1 0x100448d0 STUB +LegoPathPresenter::LegoPathPresenter() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/legopathpresenter.h b/LEGO1/legopathpresenter.h new file mode 100644 index 00000000..225f4256 --- /dev/null +++ b/LEGO1/legopathpresenter.h @@ -0,0 +1,29 @@ +#ifndef LEGOPATHPRESENTER_H +#define LEGOPATHPRESENTER_H + +#include "mxmediapresenter.h" + +// VTABLE 0x100d7c10 +// SIZE 0x54 +class LegoPathPresenter : public MxMediaPresenter +{ +public: + LegoPathPresenter(); + + // OFFSET: LEGO1 0x100449a0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0690 + return "LegoPathPresenter"; + } + + // OFFSET: LEGO1 0x100449b0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + +}; + + +#endif // LEGOPATHPRESENTER_H diff --git a/LEGO1/legophonemepresenter.cpp b/LEGO1/legophonemepresenter.cpp new file mode 100644 index 00000000..43948fc7 --- /dev/null +++ b/LEGO1/legophonemepresenter.cpp @@ -0,0 +1,19 @@ +#include "legophonemepresenter.h" + +// OFFSET: LEGO1 0x1004e180 +LegoPhonemePresenter::LegoPhonemePresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x1004e3b0 STUB +void LegoPhonemePresenter::Init() +{ + // TODO +} + +// OFFSET: LEGO1 0x1004e340 STUB +LegoPhonemePresenter::~LegoPhonemePresenter() +{ + // TODO +} diff --git a/LEGO1/legophonemepresenter.h b/LEGO1/legophonemepresenter.h new file mode 100644 index 00000000..c2616448 --- /dev/null +++ b/LEGO1/legophonemepresenter.h @@ -0,0 +1,26 @@ +#ifndef LEGOPHONEMEPRESENTER_H +#define LEGOPHONEMEPRESENTER_H + +#include "mxflcpresenter.h" + +// VTABLE 0x100d8040 +// SIZE 0x88 +class LegoPhonemePresenter : public MxFlcPresenter +{ +public: + LegoPhonemePresenter(); + virtual ~LegoPhonemePresenter() override; // vtable+0x0 + + // OFFSET: LEGO1 0x1004e310 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f064c + return "LegoPhonemePresenter"; + } + +private: + void Init(); + +}; + +#endif // LEGOPHONEMEPRESENTER_H diff --git a/LEGO1/legoplantmanager.cpp b/LEGO1/legoplantmanager.cpp new file mode 100644 index 00000000..eee83726 --- /dev/null +++ b/LEGO1/legoplantmanager.cpp @@ -0,0 +1,27 @@ +#include "legoplantmanager.h" + +// OFFSET: LEGO1 0x10026220 +LegoPlantManager::LegoPlantManager() +{ + Init(); +} + +// OFFSET: LEGO1 0x100262c0 STUB +LegoPlantManager::~LegoPlantManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x10026e00 STUB +MxLong LegoPlantManager::Tickle() +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x10026330 STUB +void LegoPlantManager::Init() +{ + // TODO +} diff --git a/LEGO1/legoplantmanager.h b/LEGO1/legoplantmanager.h new file mode 100644 index 00000000..3e8bfefe --- /dev/null +++ b/LEGO1/legoplantmanager.h @@ -0,0 +1,28 @@ +#ifndef LEGOPLANTMANAGER_H +#define LEGOPLANTMANAGER_H + +#include "mxcore.h" + +// VTABLE 0x100d6758 +// SIZE 0x2c +class LegoPlantManager : public MxCore +{ +public: + LegoPlantManager(); + virtual ~LegoPlantManager() override; // vtable+0x0 + + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x10026290 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f318c + return "LegoPlantManager"; + } + +private: + void Init(); + +}; + +#endif // LEGOPLANTMANAGER_H diff --git a/LEGO1/legorace.cpp b/LEGO1/legorace.cpp new file mode 100644 index 00000000..2b2e3390 --- /dev/null +++ b/LEGO1/legorace.cpp @@ -0,0 +1,21 @@ +#include "legorace.h" + +// OFFSET: LEGO1 0x10015aa0 STUB +LegoRace::LegoRace() +{ + // TODO +} + +// OFFSET: LEGO1 0x10015d40 STUB +LegoRace::~LegoRace() +{ + // TODO +} + +// OFFSET: LEGO1 0x10015e00 STUB +MxLong LegoRace::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/legorace.h b/LEGO1/legorace.h new file mode 100644 index 00000000..26c88b9b --- /dev/null +++ b/LEGO1/legorace.h @@ -0,0 +1,29 @@ +#ifndef LEGORACE_H +#define LEGORACE_H + +#include "legoworld.h" + +// VTABLE 0x100d5db0 +class LegoRace : public LegoWorld +{ +public: + LegoRace(); + virtual ~LegoRace() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + + // OFFSET: LEGO1 0x10015ba0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f07c4 + return "LegoRace"; + } + + // OFFSET: LEGO1 0x10015bb0 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoRace::ClassName()) || LegoWorld::IsA(name); + } +}; + +#endif // LEGORACE_H diff --git a/LEGO1/legoraceactor.h b/LEGO1/legoraceactor.h new file mode 100644 index 00000000..d7908063 --- /dev/null +++ b/LEGO1/legoraceactor.h @@ -0,0 +1,25 @@ +#ifndef LEGORACEACTOR_H +#define LEGORACEACTOR_H + +#include "legoanimactor.h" + +// VTABLE 0x100d5b88 +class LegoRaceActor : public LegoAnimActor +{ +public: + // OFFSET: LEGO1 0x10014af0 + inline const char *ClassName() const override // vtable+0xc + { + // 0x100f0bf4 + return "LegoRaceActor"; + } + + // OFFSET: LEGO1 0x10014b10 + inline MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoRaceActor::ClassName()) || LegoAnimActor::IsA(name); + } +}; + + +#endif // LEGORACEACTOR_H diff --git a/LEGO1/legoroi.cpp b/LEGO1/legoroi.cpp new file mode 100644 index 00000000..97ac06f8 --- /dev/null +++ b/LEGO1/legoroi.cpp @@ -0,0 +1,17 @@ +#include "legoroi.h" + +// 0x10101368 +int g_roiConfig = 100; + +// OFFSET: LEGO1 0x100a9e10 +void LegoROI::SetDisplayBB(int p_displayBB) +{ + // Intentionally empty function +} + +// OFFSET: LEGO1 0x100a81c0 +void LegoROI::configureLegoROI(int p_roi) +{ + g_roiConfig = p_roi; +} + diff --git a/LEGO1/legoroi.h b/LEGO1/legoroi.h index 8bfc0faa..3baa31fa 100644 --- a/LEGO1/legoroi.h +++ b/LEGO1/legoroi.h @@ -4,8 +4,8 @@ class LegoROI { public: - __declspec(dllexport) void SetDisplayBB(int); - __declspec(dllexport) static void configureLegoROI(int param_1); + __declspec(dllexport) void SetDisplayBB(int p_displayBB); + __declspec(dllexport) static void configureLegoROI(int p_roi); }; #endif // LEGOROI_H diff --git a/LEGO1/legosoundmanager.cpp b/LEGO1/legosoundmanager.cpp new file mode 100644 index 00000000..e56747f6 --- /dev/null +++ b/LEGO1/legosoundmanager.cpp @@ -0,0 +1,20 @@ +#include "legosoundmanager.h" + +// OFFSET: LEGO1 0x100298a0 STUB +LegoSoundManager::LegoSoundManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x10029940 STUB +LegoSoundManager::~LegoSoundManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1002a3a0 STUB +MxLong LegoSoundManager::Tickle() +{ + // TODO + return 0; +} diff --git a/LEGO1/legosoundmanager.h b/LEGO1/legosoundmanager.h new file mode 100644 index 00000000..1d191e03 --- /dev/null +++ b/LEGO1/legosoundmanager.h @@ -0,0 +1,20 @@ +#ifndef LEGOSOUNDMANAGER_H +#define LEGOSOUNDMANAGER_H + +#include "mxsoundmanager.h" + +// VTABLE 0x100d6b10 +// SIZE 0x44 +class LegoSoundManager : public MxSoundManager +{ +public: + LegoSoundManager(); + virtual ~LegoSoundManager() override; + virtual MxLong Tickle() override; // vtable+08 + +private: + void Init(); + +}; + +#endif // LEGOSOUNDMANAGER_H diff --git a/LEGO1/legostate.cpp b/LEGO1/legostate.cpp new file mode 100644 index 00000000..55637dc4 --- /dev/null +++ b/LEGO1/legostate.cpp @@ -0,0 +1,11 @@ +#include "legostate.h" + +// OFFSET: LEGO1 0x10005f40 +LegoState::~LegoState() +{ +} + +// OFFSET: LEGO1 0x10005f90 +MxBool LegoState::VTable0x14() { + return TRUE; +} diff --git a/LEGO1/legostate.h b/LEGO1/legostate.h new file mode 100644 index 00000000..904ad323 --- /dev/null +++ b/LEGO1/legostate.h @@ -0,0 +1,29 @@ +#ifndef LEGOSTATE_H +#define LEGOSTATE_H + +#include "mxcore.h" + +// VTABLE 0x100d46c0 +class LegoState : public MxCore +{ +public: + virtual ~LegoState() override; // vtable+0x00 + + // OFFSET: LEGO1 0x100060d0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f01b8 + return "LegoState"; + } + + // OFFSET: LEGO1 0x100060e0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoState::ClassName()) || MxCore::IsA(name); + } + + virtual MxBool VTable0x14(); + +}; + +#endif // LEGOSTATE_H diff --git a/LEGO1/legotexturepresenter.cpp b/LEGO1/legotexturepresenter.cpp new file mode 100644 index 00000000..2336a724 --- /dev/null +++ b/LEGO1/legotexturepresenter.cpp @@ -0,0 +1,7 @@ +#include "legotexturepresenter.h" + +// OFFSET: LEGO1 0x1004eb40 STUB +LegoTexturePresenter::~LegoTexturePresenter() +{ + // TODO +} diff --git a/LEGO1/legotexturepresenter.h b/LEGO1/legotexturepresenter.h new file mode 100644 index 00000000..eabd4895 --- /dev/null +++ b/LEGO1/legotexturepresenter.h @@ -0,0 +1,28 @@ +#ifndef LEGOTEXTUREPRESENTER_H +#define LEGOTEXTUREPRESENTER_H + +#include "mxmediapresenter.h" + +// VTABLE 0x100d4d90 +// SIZE 0x54 (from inlined construction at 0x10009bb5) +class LegoTexturePresenter : public MxMediaPresenter +{ +public: + virtual ~LegoTexturePresenter() override; + + // OFFSET: LEGO1 0x1000ce50 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0664 + return "LegoTexturePresenter"; + } + + // OFFSET: LEGO1 0x1000ce60 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoTexturePresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + +}; + +#endif // LEGOTEXTUREPRESENTER_H diff --git a/LEGO1/legoutil.cpp b/LEGO1/legoutil.cpp new file mode 100644 index 00000000..bac8f284 --- /dev/null +++ b/LEGO1/legoutil.cpp @@ -0,0 +1,73 @@ +#include "legoutil.h" + +#include "mxtypes.h" + +// OFFSET: LEGO1 0x1003eae0 +void ConvertHSVToRGB(float h, float s, float v, float *r_out, float *b_out, float *g_out) +{ + double calc; + double p; + MxLong hue_index; + double v9; + double v12; + double v13; + + double s_dbl = s; + + if (s > 0.5f) + calc = (1.0f - v) * s + v; + else + calc = (v + 1.0) * s_dbl; + if (calc <= 0.0) + { + *g_out = 0.0f; + *b_out = 0.0f; + *r_out = 0.0f; + return; + } + p = s * 2.0f - calc; + hue_index = h * 6.0; + v9 = (h * 6.0 - (float)hue_index) * ((calc - p) / calc) * calc; + v12 = p + v9; + v13 = calc - v9; + switch (hue_index) + { + case 0: + *r_out = calc; + *b_out = v12; + *g_out = p; + break; + case 1: + *r_out = v13; + *b_out = calc; + *g_out = p; + break; + case 2: + *r_out = p; + *b_out = calc; + *g_out = v12; + break; + case 3: + *r_out = p; + *b_out = v13; + *g_out = calc; + break; + case 4: + *r_out = v12; + *b_out = p; + *g_out = calc; + break; + case 5: + *r_out = calc; + *b_out = p; + *g_out = v13; + break; + case 6: + *r_out = calc; + *b_out = p; + *g_out = v13; + break; + default: + return; + } +} diff --git a/LEGO1/legoutil.h b/LEGO1/legoutil.h index 440b01d0..6a0113e8 100644 --- a/LEGO1/legoutil.h +++ b/LEGO1/legoutil.h @@ -4,7 +4,21 @@ template inline T Abs(T p_t) { - return p_t < 0 ? -p_t : p_t; + return p_t < 0 ? -p_t : p_t; } -#endif // LEGOUTIL_H \ No newline at end of file +template +inline T Min(T p_t1, T p_t2) +{ + return p_t1 < p_t2 ? p_t1 : p_t2; +} + +template +inline T Max(T p_t1, T p_t2) +{ + return p_t1 > p_t2 ? p_t1 : p_t2; +} + +void ConvertHSVToRGB(float r, float g, float b, float* out_r, float* out_g, float* out_b); + +#endif // LEGOUTIL_H diff --git a/LEGO1/legovideomanager.cpp b/LEGO1/legovideomanager.cpp new file mode 100644 index 00000000..9c1044e2 --- /dev/null +++ b/LEGO1/legovideomanager.cpp @@ -0,0 +1,52 @@ +#include "legovideomanager.h" +#include + +// OFFSET: LEGO1 0x1007aa20 STUB +LegoVideoManager::LegoVideoManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007ab40 STUB +LegoVideoManager::~LegoVideoManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007c560 STUB +int LegoVideoManager::EnableRMDevice() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x1007c740 STUB +int LegoVideoManager::DisableRMDevice() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x1007c310 STUB +void LegoVideoManager::EnableFullScreenMovie(unsigned char a, unsigned char b) +{ + // TODO +} + +// OFFSET: LEGO1 0x1007b6a0 STUB +void LegoVideoManager::MoveCursor(int x, int y) +{ + // TODO +} + +// OFFSET: LEGO1 0x1007c440 +void LegoVideoManager::SetSkyColor(float red, float green, float blue) +{ + PALETTEENTRY colorStrucure; // [esp+0h] [ebp-4h] BYREF + + colorStrucure.peRed = (red* 255.0); + colorStrucure.peGreen = (green * 255.0); + colorStrucure.peBlue = (blue * 255.0); + colorStrucure.peFlags = -124; + // TODO +} diff --git a/LEGO1/legovideomanager.h b/LEGO1/legovideomanager.h index d96fac87..379ec468 100644 --- a/LEGO1/legovideomanager.h +++ b/LEGO1/legovideomanager.h @@ -4,15 +4,21 @@ #include "mxvideomanager.h" #include "lego3dmanager.h" +// VTABLE 0x100d9c88 +// SIZE 0x590 class LegoVideoManager : public MxVideoManager { public: + LegoVideoManager(); + virtual ~LegoVideoManager() override; + __declspec(dllexport) int EnableRMDevice(); __declspec(dllexport) int DisableRMDevice(); __declspec(dllexport) void EnableFullScreenMovie(unsigned char a, unsigned char b); __declspec(dllexport) void MoveCursor(int x, int y); inline Lego3DManager *Get3DManager() { return this->m_3dManager; } + void SetSkyColor(float r, float g, float b); int m_unk64; Lego3DManager *m_3dManager; diff --git a/LEGO1/legoworld.cpp b/LEGO1/legoworld.cpp new file mode 100644 index 00000000..68009d43 --- /dev/null +++ b/LEGO1/legoworld.cpp @@ -0,0 +1,13 @@ +#include "legoworld.h" + +// OFFSET: LEGO1 0x1001ca40 STUB +LegoWorld::LegoWorld() +{ + // TODO +} + +// OFFSET: LEGO1 0x1001dfa0 STUB +LegoWorld::~LegoWorld() +{ + // TODO +} diff --git a/LEGO1/legoworld.h b/LEGO1/legoworld.h index b11f7095..d6170bfc 100644 --- a/LEGO1/legoworld.h +++ b/LEGO1/legoworld.h @@ -1,11 +1,28 @@ #ifndef LEGOWORLD_H #define LEGOWORLD_H -class LegoWorld +#include "legoentity.h" + +// VTABLE 0x100d6280 +// SIZE 0xf8 +class LegoWorld : public LegoEntity { public: __declspec(dllexport) LegoWorld(); - __declspec(dllexport) virtual ~LegoWorld(); + __declspec(dllexport) virtual ~LegoWorld(); // vtable+0x0 + + // OFFSET: LEGO1 0x1001d690 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0058 + return "LegoWorld"; + } + + // OFFSET: LEGO1 0x1001d6a0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoWorld::ClassName()) || LegoEntity::IsA(name); + } }; #endif // LEGOWORLD_H diff --git a/LEGO1/legoworldpresenter.cpp b/LEGO1/legoworldpresenter.cpp new file mode 100644 index 00000000..280d7a24 --- /dev/null +++ b/LEGO1/legoworldpresenter.cpp @@ -0,0 +1,19 @@ +#include "legoworldpresenter.h" + +// OFFSET: LEGO1 0x100665c0 STUB +LegoWorldPresenter::LegoWorldPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x10066770 STUB +LegoWorldPresenter::~LegoWorldPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100665b0 STUB +void LegoWorldPresenter::configureLegoWorldPresenter(int param_1) +{ + // TODO +} diff --git a/LEGO1/legoworldpresenter.h b/LEGO1/legoworldpresenter.h index 006b4cf8..b7f39ddb 100644 --- a/LEGO1/legoworldpresenter.h +++ b/LEGO1/legoworldpresenter.h @@ -1,10 +1,31 @@ #ifndef LEGOWORLDPRESENTER_H #define LEGOWORLDPRESENTER_H -class LegoWorldPresenter +#include "legoentitypresenter.h" + +// VTABLE 0x100d8ee0 +// SIZE 0x54 +class LegoWorldPresenter : public LegoEntityPresenter { public: + LegoWorldPresenter(); + virtual ~LegoWorldPresenter() override; // vtable+0x0 + __declspec(dllexport) static void configureLegoWorldPresenter(int param_1); + + // OFFSET: LEGO1 0x10066630 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0608 + return "LegoWorldPresenter"; + } + + // OFFSET: LEGO1 0x10066640 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, LegoWorldPresenter::ClassName()) || LegoEntityPresenter::IsA(name); + } + }; #endif // LEGOWORLDPRESENTER_H diff --git a/LEGO1/motorcycle.cpp b/LEGO1/motorcycle.cpp new file mode 100644 index 00000000..9b0e0e40 --- /dev/null +++ b/LEGO1/motorcycle.cpp @@ -0,0 +1,7 @@ +#include "motorcycle.h" + +// OFFSET: LEGO1 0x100357b0 STUB +Motorcycle::Motorcycle() +{ + // TODO +} diff --git a/LEGO1/motorcycle.h b/LEGO1/motorcycle.h new file mode 100644 index 00000000..5ba746a8 --- /dev/null +++ b/LEGO1/motorcycle.h @@ -0,0 +1,28 @@ +#ifndef MOTORCYCLE_H +#define MOTORCYCLE_H + +#include "islepathactor.h" + +// VTABLE 0x100d7090 +// SIZE 0x16c +class Motorcycle : public IslePathActor +{ +public: + Motorcycle(); + + // OFFSET: LEGO1 0x10035840 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10035840 + return "Motorcycle"; + } + + // OFFSET: LEGO1 0x10035850 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, Motorcycle::ClassName()) || IslePathActor::IsA(name); + } + +}; + +#endif // MOTORCYCLE_H diff --git a/LEGO1/mxatomid.cpp b/LEGO1/mxatomid.cpp index f2171360..007e2de3 100644 --- a/LEGO1/mxatomid.cpp +++ b/LEGO1/mxatomid.cpp @@ -1,5 +1,11 @@ #include "mxatomid.h" +// OFFSET: LEGO1 0x100acf90 +MxAtomId::MxAtomId(const char *, LookupMode) +{ + // TODO +} + // OFFSET: LEGO1 0x100acfd0 MxAtomId::~MxAtomId() { @@ -11,4 +17,4 @@ MxAtomId &MxAtomId::operator=(const MxAtomId &id) { // TODO return *this; -} \ No newline at end of file +} diff --git a/LEGO1/mxatomid.h b/LEGO1/mxatomid.h index b28704c0..6b7dddbb 100644 --- a/LEGO1/mxatomid.h +++ b/LEGO1/mxatomid.h @@ -1,8 +1,14 @@ #ifndef MXATOMID_H #define MXATOMID_H +#include "mxtypes.h" + enum LookupMode { + LookupMode_Exact = 0, + LookupMode_LowerCase = 1, + LookupMode_UpperCase = 2, + LookupMode_LowerCase2 = 3 }; class MxAtomId @@ -15,7 +21,12 @@ class MxAtomId MxAtomId() { this->m_internal = 0; - }; + } + + inline MxBool operator ==(const MxAtomId &other) const + { + return this->m_internal == other.m_internal; + } private: char *m_internal; diff --git a/LEGO1/mxaudiopresenter.cpp b/LEGO1/mxaudiopresenter.cpp new file mode 100644 index 00000000..ac634362 --- /dev/null +++ b/LEGO1/mxaudiopresenter.cpp @@ -0,0 +1,5 @@ +#include "mxaudiopresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxAudioPresenter, 0x54); diff --git a/LEGO1/mxaudiopresenter.h b/LEGO1/mxaudiopresenter.h new file mode 100644 index 00000000..c1001a13 --- /dev/null +++ b/LEGO1/mxaudiopresenter.h @@ -0,0 +1,30 @@ +#ifndef MXAUDIOPRESENTER_H +#define MXAUDIOPRESENTER_H + +#include "mxmediapresenter.h" + +// VTABLE 0x100d4c70 +class MxAudioPresenter : public MxMediaPresenter +{ +public: + MxAudioPresenter() { + m_unk50 = 100; + } + + // OFFSET: LEGO1 0x1000d280 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f078c + return "MxAudioPresenter"; + } + + // OFFSET: LEGO1 0x1000d290 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxAudioPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + + int m_unk50; +}; + +#endif // MXAUDIOPRESENTER_H diff --git a/LEGO1/mxautolocker.h b/LEGO1/mxautolocker.h index a2ce6caa..35e32ff3 100644 --- a/LEGO1/mxautolocker.h +++ b/LEGO1/mxautolocker.h @@ -5,11 +5,11 @@ class MxAutoLocker { - public: - MxAutoLocker(MxCriticalSection* cs); - ~MxAutoLocker(); - private: - MxCriticalSection* m_criticalSection; +public: + MxAutoLocker(MxCriticalSection* cs); + ~MxAutoLocker(); +private: + MxCriticalSection* m_criticalSection; }; #endif // MXAUTOLOCKER_H diff --git a/LEGO1/mxbackgroundaudiomanager.cpp b/LEGO1/mxbackgroundaudiomanager.cpp new file mode 100644 index 00000000..6f001303 --- /dev/null +++ b/LEGO1/mxbackgroundaudiomanager.cpp @@ -0,0 +1,19 @@ +#include "mxbackgroundaudiomanager.h" + +// OFFSET: LEGO1 0x1007ea90 +MxBackgroundAudioManager::MxBackgroundAudioManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007ec20 +MxBackgroundAudioManager::~MxBackgroundAudioManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1007f5f0 +void MxBackgroundAudioManager::Enable(MxBool p) +{ + // TODO +} diff --git a/LEGO1/mxbackgroundaudiomanager.h b/LEGO1/mxbackgroundaudiomanager.h index 765fc9c3..9a23a671 100644 --- a/LEGO1/mxbackgroundaudiomanager.h +++ b/LEGO1/mxbackgroundaudiomanager.h @@ -1,9 +1,29 @@ #ifndef MXBACKGROUNDAUDIOMANAGER_H #define MXBACKGROUNDAUDIOMANAGER_H -class MxBackgroundAudioManager +#include "mxcore.h" + +// VTABLE 0x100d9fe8 +// SIZE 0x150 +class MxBackgroundAudioManager : public MxCore { public: + MxBackgroundAudioManager(); + virtual ~MxBackgroundAudioManager() override; + + // OFFSET: LEGO1 0x1007eb70 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f7ac4 + return "MxBackgroundAudioManager"; + } + + // OFFSET: LEGO1 0x1007eb80 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxBackgroundAudioManager::ClassName()) || MxCore::IsA(name); + } + __declspec(dllexport) void Enable(unsigned char p); }; diff --git a/LEGO1/mxbitmap.cpp b/LEGO1/mxbitmap.cpp new file mode 100644 index 00000000..6ad26f94 --- /dev/null +++ b/LEGO1/mxbitmap.cpp @@ -0,0 +1,129 @@ +#include "mxbitmap.h" + +// OFFSET: LEGO1 0x100bc980 +MxBitmap::MxBitmap() +{ + this->m_info = NULL; + this->m_bmiHeader = NULL; + this->m_paletteData = NULL; + this->m_data = NULL; + this->m_unk18 = FALSE; + this->m_palette = NULL; +} + +// OFFSET: LEGO1 0x100bca10 +MxBitmap::~MxBitmap() +{ + if (this->m_info != NULL) + delete m_info; + if (this->m_data != NULL) + delete m_data; + if (this->m_palette != NULL) + delete m_palette; +} + +// OFFSET: LEGO1 0x100bcc40 STUB +int MxBitmap::vtable14(int) +{ + return 0; +} + +// OFFSET: LEGO1 0x100bcba0 STUB +int MxBitmap::vtable18(BITMAPINFOHEADER *p_bmiHeader) +{ + return 0; +} + +// OFFSET: LEGO1 0x100bcaa0 STUB +int MxBitmap::vtable1c(int p_width, int p_height, MxPalette *p_palette, int) +{ + return 0; +} + +// OFFSET: LEGO1 0x100bcd60 STUB +MxResult MxBitmap::LoadFile(HANDLE p_handle) +{ + return SUCCESS; +} + +// OFFSET: LEGO1 0x100bcd10 +MxLong MxBitmap::Read(const char *p_filename) +{ + MxResult result = FAILURE; + HANDLE handle = CreateFileA( + p_filename, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + if (handle != INVALID_HANDLE_VALUE && !LoadFile(handle)) + result = SUCCESS; + + if (handle) + CloseHandle(handle); + + return result; +} + +// OFFSET: LEGO1 0x1004e0d0 +int MxBitmap::vtable28(int) +{ + return -1; +} + +// OFFSET: LEGO1 0x100ce70 STUB +void MxBitmap::vtable2c(int, int, int, int, int, int, int) +{ +} + +// OFFSET: LEGO1 0x100d020 STUB +void MxBitmap::vtable30(int, int, int, int, int, int, int) +{ +} + +// OFFSET: LEGO1 0x100bd1c0 +MxPalette *MxBitmap::CreatePalette() +{ + // FIXME: This function needs MxPalette to be completed. Also INFERRING usage of MxBool + MxPalette *pal = NULL; + MxPalette *ppal; + MxBool success = FALSE; + + if(this->m_unk18 == FALSE) { + // ppal = MxPalette::FromBitmapPalette(this->m_paletteData); + } else { + if(this->m_unk18 != TRUE) { + if(!success && pal != NULL) { + delete pal; + pal = NULL; + } + } + //.pal = MxPalette::Clone(this->m_palette); + } + if(pal != NULL) { + success = TRUE; + } + + return pal; +} + +// OFFSET: LEGO1 0x100bd280 STUB +void MxBitmap::vtable38(void*) +{ +} + +// OFFSET: LEGO1 0x100bd2d0 STUB +int MxBitmap::vtable3c(MxBool) +{ + return 0; +} + +// OFFSET: LEGO1 0x100bd3e0 STUB +int MxBitmap::vtable40(HDC p_hdc, int p_xSrc, int p_ySrc, int p_xDest, int p_yDest, int p_destWidth, int p_destHeight) +{ + return 0; +} \ No newline at end of file diff --git a/LEGO1/mxbitmap.h b/LEGO1/mxbitmap.h index 1613c47e..66550f7e 100644 --- a/LEGO1/mxbitmap.h +++ b/LEGO1/mxbitmap.h @@ -1,13 +1,38 @@ #ifndef MXBITMAP_H #define MXBITMAP_H -class MxBitmap +#include + +#include "mxcore.h" +#include "mxpalette.h" +#include "mxtypes.h" + +class MxBitmap : public MxCore { public: __declspec(dllexport) MxBitmap(); - __declspec(dllexport) virtual ~MxBitmap(); - __declspec(dllexport) virtual MxPalette *CreatePalette(); - __declspec(dllexport) virtual long Read(const char *); + __declspec(dllexport) virtual ~MxBitmap(); // vtable+00 + + virtual int vtable14(int); + virtual int vtable18(BITMAPINFOHEADER *p_bmiHeader); + virtual int vtable1c(int p_width, int p_height, MxPalette *p_palette, int); + virtual MxResult LoadFile(HANDLE p_handle); + __declspec(dllexport) virtual MxLong Read(const char *p_filename); // vtable+24 + virtual int vtable28(int); + virtual void vtable2c(int, int, int, int, int, int, int); + virtual void vtable30(int, int, int, int, int, int, int); + __declspec(dllexport) virtual MxPalette *CreatePalette(); // vtable+34 + virtual void vtable38(void*); + virtual int vtable3c(MxBool); + virtual int vtable40(HDC p_hdc, int p_xSrc, int p_ySrc, int p_xDest, int p_yDest, int p_destWidth, int p_destHeight); + +private: + BITMAPINFO *m_info; + BITMAPINFOHEADER *m_bmiHeader; + RGBQUAD *m_paletteData; + LPVOID *m_data; + MxBool m_unk18; + MxPalette *m_palette; }; #endif // MXBITMAP_H diff --git a/LEGO1/mxcompositemediapresenter.cpp b/LEGO1/mxcompositemediapresenter.cpp new file mode 100644 index 00000000..581df06a --- /dev/null +++ b/LEGO1/mxcompositemediapresenter.cpp @@ -0,0 +1,7 @@ +#include "mxcompositemediapresenter.h" + +// OFFSET: LEGO1 0x10073ea0 STUB +MxCompositeMediaPresenter::MxCompositeMediaPresenter() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/mxcompositemediapresenter.h b/LEGO1/mxcompositemediapresenter.h new file mode 100644 index 00000000..1f464f4d --- /dev/null +++ b/LEGO1/mxcompositemediapresenter.h @@ -0,0 +1,28 @@ +#ifndef MXCOMPOSITEMEDIAPRESENTER_H +#define MXCOMPOSITEMEDIAPRESENTER_H + +#include "mxcompositepresenter.h" + +// VTABLE 0x100dc618 +// SIZE 0x50 +class MxCompositeMediaPresenter : public MxCompositePresenter +{ +public: + MxCompositeMediaPresenter(); + + // OFFSET: LEGO1 0x10073f10 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f02d4 + return "MxCompositeMediaPresenter"; + } + + // OFFSET: LEGO1 0x10073f20 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxCompositeMediaPresenter::ClassName()) || MxCompositePresenter::IsA(name); + } + +}; + +#endif // MXCOMPOSITEMEDIAPRESENTER_H diff --git a/LEGO1/mxcompositepresenter.cpp b/LEGO1/mxcompositepresenter.cpp new file mode 100644 index 00000000..342f3d96 --- /dev/null +++ b/LEGO1/mxcompositepresenter.cpp @@ -0,0 +1,17 @@ +#include "mxcompositepresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxCompositePresenter, 0x4c); + +// OFFSET: LEGO1 0x100b60b0 STUB +MxCompositePresenter::MxCompositePresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b6390 STUB +MxCompositePresenter::~MxCompositePresenter() +{ + // TODO +} diff --git a/LEGO1/mxcompositepresenter.h b/LEGO1/mxcompositepresenter.h new file mode 100644 index 00000000..9f517652 --- /dev/null +++ b/LEGO1/mxcompositepresenter.h @@ -0,0 +1,32 @@ +#ifndef MXCOMPOSITEPRESENTER_H +#define MXCOMPOSITEPRESENTER_H + +#include "mxpresenter.h" + +// VTABLE 0x100dc618 +// SIZE 0x4c +class MxCompositePresenter : public MxPresenter +{ +public: + MxCompositePresenter(); + virtual ~MxCompositePresenter() override; // vtable+0x0 + + // OFFSET: LEGO1 0x100b6210 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0774 + return "MxCompositePresenter"; + } + + // OFFSET: LEGO1 0x100b6220 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxCompositePresenter::ClassName()) || MxPresenter::IsA(name); + } + + undefined m_unk40; + undefined4 *m_unk44; + undefined4 m_unk48; +}; + +#endif // MXCOMPOSITEPRESENTER_H diff --git a/LEGO1/mxcontrolpresenter.cpp b/LEGO1/mxcontrolpresenter.cpp new file mode 100644 index 00000000..e9e10ef8 --- /dev/null +++ b/LEGO1/mxcontrolpresenter.cpp @@ -0,0 +1,7 @@ +#include "mxcontrolpresenter.h" + +// OFFSET: LEGO1 0x10043f50 STUB +MxControlPresenter::MxControlPresenter() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/mxcontrolpresenter.h b/LEGO1/mxcontrolpresenter.h new file mode 100644 index 00000000..909a3502 --- /dev/null +++ b/LEGO1/mxcontrolpresenter.h @@ -0,0 +1,29 @@ +#ifndef MXCONTROLPRESENTER_H +#define MXCONTROLPRESENTER_H + +#include "mxcompositepresenter.h" + +// VTABLE 0x100d7b88 +// SIZE 0x5c +class MxControlPresenter : public MxCompositePresenter +{ +public: + MxControlPresenter(); + + // OFFSET: LEGO1 0x10044000 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0514 + return "MxControlPresenter"; + } + + // OFFSET: LEGO1 0x10044010 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(name); + } + +}; + + +#endif // MXCONTROLPRESENTER_H diff --git a/LEGO1/mxcore.cpp b/LEGO1/mxcore.cpp index aec24c00..78441d8d 100644 --- a/LEGO1/mxcore.cpp +++ b/LEGO1/mxcore.cpp @@ -16,13 +16,13 @@ MxCore::~MxCore() } // OFFSET: LEGO1 0x100ae1f0 -long MxCore::Notify(MxParam &p) +MxLong MxCore::Notify(MxParam &p) { return 0; } // OFFSET: LEGO1 0x10001f70 -long MxCore::Tickle() +MxLong MxCore::Tickle() { return 0; } \ No newline at end of file diff --git a/LEGO1/mxcore.h b/LEGO1/mxcore.h index d870b3b3..5e6586ba 100644 --- a/LEGO1/mxcore.h +++ b/LEGO1/mxcore.h @@ -7,19 +7,28 @@ class MxParam; +// VTABLE 0x100dc0f8 +// SIZE 0x8 class MxCore { public: __declspec(dllexport) MxCore(); __declspec(dllexport) virtual ~MxCore(); // vtable+00 - __declspec(dllexport) virtual long Notify(MxParam &p); // vtable+04 - virtual long Tickle(); // vtable+08 + __declspec(dllexport) virtual MxLong Notify(MxParam &p); // vtable+04 + virtual MxLong Tickle(); // vtable+08 // OFFSET: LEGO1 0x100144c0 - inline virtual const char *ClassName() const { return "MxCore"; }; // vtable+0c + inline virtual const char *ClassName() const // vtable+0c + { + // 0x100f007c + return "MxCore"; + } // OFFSET: LEGO1 0x100140d0 - inline virtual MxBool IsA(const char *name) const { return !strcmp(name, MxCore::ClassName()); }; // vtable+10 + inline virtual MxBool IsA(const char *name) const // vtable+10 + { + return !strcmp(name, MxCore::ClassName()); + } private: unsigned int m_id; diff --git a/LEGO1/mxdirectdraw.cpp b/LEGO1/mxdirectdraw.cpp new file mode 100644 index 00000000..dde59ba0 --- /dev/null +++ b/LEGO1/mxdirectdraw.cpp @@ -0,0 +1,22 @@ +#include "mxdirectdraw.h" + +// OFFSET: LEGO1 0x1009e7f0 +int MxDirectDraw::FlipToGDISurface() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x1009d570 +int MxDirectDraw::GetPrimaryBitDepth() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x1009e6a0 +int MxDirectDraw::Pause(int) +{ + // TODO + return 0; +} diff --git a/LEGO1/mxdiskstreamcontroller.cpp b/LEGO1/mxdiskstreamcontroller.cpp new file mode 100644 index 00000000..61243410 --- /dev/null +++ b/LEGO1/mxdiskstreamcontroller.cpp @@ -0,0 +1,21 @@ +#include "mxdiskstreamcontroller.h" + +// OFFSET: LEGO1 0x100c7120 STUB +MxDiskStreamController::MxDiskStreamController() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c7530 STUB +MxDiskStreamController::~MxDiskStreamController() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c8640 STUB +MxLong MxDiskStreamController::Tickle() +{ + // TODO + + return 0; +} diff --git a/LEGO1/mxdiskstreamcontroller.h b/LEGO1/mxdiskstreamcontroller.h new file mode 100644 index 00000000..c0142663 --- /dev/null +++ b/LEGO1/mxdiskstreamcontroller.h @@ -0,0 +1,34 @@ +#ifndef MXDISKSTREAMCONTROLLER_H +#define MXDISKSTREAMCONTROLLER_H + +#include + +#include "mxstreamcontroller.h" +#include "mxtypes.h" + +// VTABLE 0x100dccb8 +// SIZE 0xc8 +class MxDiskStreamController : public MxStreamController +{ +public: + MxDiskStreamController(); + virtual ~MxDiskStreamController() override; + + virtual MxLong Tickle() override; // vtable+0x8 + + // OFFSET: LEGO1 0x100c7360 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10102144 + return "MxDiskStreamController"; + } + + // OFFSET: LEGO1 0x100c7370 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDiskStreamController::ClassName()) || MxStreamController::IsA(name); + } + +}; + +#endif // MXDISKSTREAMCONTROLLER_H diff --git a/LEGO1/mxdiskstreamprovider.cpp b/LEGO1/mxdiskstreamprovider.cpp new file mode 100644 index 00000000..5e59efee --- /dev/null +++ b/LEGO1/mxdiskstreamprovider.cpp @@ -0,0 +1,13 @@ +#include "mxdiskstreamprovider.h" + +// OFFSET: LEGO1 0x100d0f70 +MxDiskStreamProvider::MxDiskStreamProvider() +{ + // TODO +} + +// OFFSET: LEGO1 0x100d1240 +MxDiskStreamProvider::~MxDiskStreamProvider() +{ + // TODO +} diff --git a/LEGO1/mxdiskstreamprovider.h b/LEGO1/mxdiskstreamprovider.h new file mode 100644 index 00000000..198b6062 --- /dev/null +++ b/LEGO1/mxdiskstreamprovider.h @@ -0,0 +1,28 @@ +#ifndef MXDISKSTREAMPROVIDER_H +#define MXDISKSTREAMPROVIDER_H + +#include "mxstreamprovider.h" + +// VTABLE 0x100dd138 +class MxDiskStreamProvider : public MxStreamProvider +{ +public: + MxDiskStreamProvider(); + + virtual ~MxDiskStreamProvider() override; + + // OFFSET: LEGO1 0x100d1160 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x1010287c + return "MxDiskStreamProvider"; + } + + // OFFSET: LEGO1 0x100d1170 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDiskStreamProvider::ClassName()) || MxStreamProvider::IsA(name); + } +}; + +#endif // MXDISKSTREAMPROVIDER_H diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp new file mode 100644 index 00000000..a193ab21 --- /dev/null +++ b/LEGO1/mxdsaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsaction.h" + +// OFFSET: LEGO1 0x100ad810 +MxDSAction::MxDSAction() +{ + // TODO +} + +// OFFSET: LEGO1 0x100ada80 +MxDSAction::~MxDSAction() +{ + // TODO +} diff --git a/LEGO1/mxdsaction.h b/LEGO1/mxdsaction.h index 558cd035..e26d28a6 100644 --- a/LEGO1/mxdsaction.h +++ b/LEGO1/mxdsaction.h @@ -3,12 +3,27 @@ #include "mxdsobject.h" +// VTABLE 0x100dc098 +// SIZE 0x94 class MxDSAction : public MxDSObject { public: __declspec(dllexport) MxDSAction(); __declspec(dllexport) virtual ~MxDSAction(); + // OFFSET: LEGO1 0x100ad980 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101013f4 + return "MxDSAction"; + } + + // OFFSET: LEGO1 0x100ad990 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSAction::ClassName()) || MxDSObject::IsA(name); + } + int m_unk2c; int m_unk30; int m_unk34; diff --git a/LEGO1/mxdsanim.cpp b/LEGO1/mxdsanim.cpp new file mode 100644 index 00000000..9a56d359 --- /dev/null +++ b/LEGO1/mxdsanim.cpp @@ -0,0 +1,13 @@ +#include "mxdsanim.h" + +// OFFSET: LEGO1 0x100c8ff0 +MxDSAnim::MxDSAnim() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c91a0 +MxDSAnim::~MxDSAnim() +{ + // TODO +} diff --git a/LEGO1/mxdsanim.h b/LEGO1/mxdsanim.h new file mode 100644 index 00000000..fdef0859 --- /dev/null +++ b/LEGO1/mxdsanim.h @@ -0,0 +1,29 @@ +#ifndef MXDSANIM_H +#define MXDSANIM_H + +#include "mxdsmediaaction.h" + +// VTABLE 0x100dcd88 +// SIZE 0xb8 +class MxDSAnim : public MxDSMediaAction +{ +public: + MxDSAnim(); + + virtual ~MxDSAnim() override; + + // OFFSET: LEGO1 0x100c9060 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101025d8 + return "MxDSAnim"; + } + + // OFFSET: LEGO1 0x100c9070 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSAnim::ClassName()) || MxDSMediaAction::IsA(name); + } +}; + +#endif // MXDSANIM_H diff --git a/LEGO1/mxdschunk.cpp b/LEGO1/mxdschunk.cpp new file mode 100644 index 00000000..7ec8531c --- /dev/null +++ b/LEGO1/mxdschunk.cpp @@ -0,0 +1,13 @@ +#include "mxdschunk.h" + +// OFFSET: LEGO1 0x100be050 STUB +MxDSChunk::MxDSChunk() +{ + // TODO +} + +// OFFSET: LEGO1 0x100be170 STUB +MxDSChunk::~MxDSChunk() +{ + // TODO +} diff --git a/LEGO1/mxdschunk.h b/LEGO1/mxdschunk.h new file mode 100644 index 00000000..8758ffa3 --- /dev/null +++ b/LEGO1/mxdschunk.h @@ -0,0 +1,26 @@ +#ifndef MXDSCHUNK_H +#define MXDSCHUNK_H + +#include "mxcore.h" + +class MxDSChunk : public MxCore +{ +public: + MxDSChunk(); + virtual ~MxDSChunk() override; + + // OFFSET: LEGO1 0x100be0c0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10101e6c + return "MxDSChunk"; + } + + // OFFSET: LEGO1 0x100be0d0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSChunk::ClassName()) || MxCore::IsA(name); + } +}; + +#endif // MXDSCHUNK_H diff --git a/LEGO1/mxdsevent.cpp b/LEGO1/mxdsevent.cpp new file mode 100644 index 00000000..a45ec93a --- /dev/null +++ b/LEGO1/mxdsevent.cpp @@ -0,0 +1,13 @@ +#include "mxdsevent.h" + +// OFFSET: LEGO1 0x100c95f0 STUB +MxDSEvent::MxDSEvent() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c97a0 STUB +MxDSEvent::~MxDSEvent() +{ + // TODO +} diff --git a/LEGO1/mxdsevent.h b/LEGO1/mxdsevent.h new file mode 100644 index 00000000..59a00bb5 --- /dev/null +++ b/LEGO1/mxdsevent.h @@ -0,0 +1,26 @@ +#ifndef MXDSEVENT_H +#define MXDSEVENT_H + +#include "mxdsmediaaction.h" + +class MxDSEvent : public MxDSMediaAction +{ +public: + MxDSEvent(); + virtual ~MxDSEvent() override; + + // OFFSET: LEGO1 0x100c9660 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101025f0 + return "MxDSEvent"; + } + + // OFFSET: LEGO1 0x100c9670 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSEvent::ClassName()) || MxDSMediaAction::IsA(name); + } +}; + +#endif // MXDSEVENT_H diff --git a/LEGO1/mxdsfile.cpp b/LEGO1/mxdsfile.cpp index 327fab46..60f8533e 100644 --- a/LEGO1/mxdsfile.cpp +++ b/LEGO1/mxdsfile.cpp @@ -8,7 +8,7 @@ #define FOURCC(a, b, c, d) (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24)) // OFFSET: LEGO1 0x100cc4b0 -MxDSFile::MxDSFile(const char *filename, unsigned long skipReadingChunks) +MxDSFile::MxDSFile(const char *filename, MxULong skipReadingChunks) { m_filename = filename; m_skipReadingChunks = skipReadingChunks; @@ -21,18 +21,17 @@ MxDSFile::~MxDSFile() } // OFFSET: LEGO1 0x100cc590 -long MxDSFile::Open(unsigned long uStyle) +MxLong MxDSFile::Open(MxULong uStyle) { - // No idea what's stopping this one matching, but I'm pretty - // confident it has the correct behavior. - long longResult = 1; - memset(&m_io, 0, sizeof(MXIOINFO)); + MXIOINFO& io = m_io; + MxLong longResult = 1; + memset(&io, 0, sizeof(MXIOINFO)); - if (m_io.Open(m_filename.GetData(), uStyle) != 0) { + if (io.Open(m_filename.GetData(), uStyle) != 0) { return -1; } - m_io.SetBuffer(NULL, 0, 0); + io.SetBuffer(NULL, 0, 0); m_position = 0; if (m_skipReadingChunks == 0) { @@ -50,7 +49,7 @@ long MxDSFile::Open(unsigned long uStyle) } // OFFSET: LEGO1 0x100cc780 -long MxDSFile::Read(unsigned char *pch, unsigned long cch) +MxLong MxDSFile::Read(unsigned char *pch, MxULong cch) { if (m_io.Read((char*)pch, cch) != cch) return -1; @@ -60,7 +59,7 @@ long MxDSFile::Read(unsigned char *pch, unsigned long cch) } // OFFSET: LEGO1 0x100cc620 -long MxDSFile::ReadChunks() +MxLong MxDSFile::ReadChunks() { _MMCKINFO topChunk; _MMCKINFO childChunk; @@ -82,7 +81,7 @@ long MxDSFile::ReadChunks() if (m_io.Descend(&childChunk, &topChunk, 0) != 0) { return -1; } - unsigned long* pLengthInDWords = &m_lengthInDWords; + MxULong* pLengthInDWords = &m_lengthInDWords; m_io.Read((char *)pLengthInDWords, 4); m_pBuffer = malloc(*pLengthInDWords * 4); m_io.Read((char*)m_pBuffer, *pLengthInDWords * 4); @@ -97,25 +96,25 @@ long MxDSFile::ReadChunks() } // OFFSET: LEGO1 0x100cc7b0 -long MxDSFile::Seek(long lOffset, int iOrigin) +MxLong MxDSFile::Seek(MxLong lOffset, int iOrigin) { return (m_position = m_io.Seek(lOffset, iOrigin)) == -1 ? -1 : 0; } // OFFSET: LEGO1 0x100cc7e0 -unsigned long MxDSFile::GetBufferSize() +MxULong MxDSFile::GetBufferSize() { return m_header.bufferSize; } // OFFSET: LEGO1 0x100cc7f0 -unsigned long MxDSFile::GetStreamBuffersNum() +MxULong MxDSFile::GetStreamBuffersNum() { return m_header.streamBuffersNum; } // OFFSET: LEGO1 0x100cc740 -long MxDSFile::Close() +MxLong MxDSFile::Close() { m_io.Close(0); m_position = -1; diff --git a/LEGO1/mxdsfile.h b/LEGO1/mxdsfile.h index ee577e78..ac812df7 100644 --- a/LEGO1/mxdsfile.h +++ b/LEGO1/mxdsfile.h @@ -1,25 +1,38 @@ #ifndef MXDSFILE_H #define MXDSFILE_H -#include "mxcore.h" -#include "mxstring.h" -#include "mxioinfo.h" #include "mxdssource.h" +#include "mxioinfo.h" +#include "mxstring.h" +// VTABLE 0x100dc890 class MxDSFile : public MxDSSource { public: - __declspec(dllexport) MxDSFile(const char *filename, unsigned long skipReadingChunks); - __declspec(dllexport) virtual ~MxDSFile(); - __declspec(dllexport) virtual long Open(unsigned long); - __declspec(dllexport) virtual long Close(); - __declspec(dllexport) virtual long Read(unsigned char *,unsigned long); - __declspec(dllexport) virtual long Seek(long,int); - __declspec(dllexport) virtual unsigned long GetBufferSize(); - __declspec(dllexport) virtual unsigned long GetStreamBuffersNum(); + __declspec(dllexport) MxDSFile(const char *filename, MxULong skipReadingChunks); + __declspec(dllexport) virtual ~MxDSFile(); // vtable+0x0 + // OFFSET: LEGO1 0x100c0120 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10102594 + return "MxDSFile"; + } + + // OFFSET: LEGO1 0x100c0130 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSFile::ClassName()) || MxDSSource::IsA(name); + } + + __declspec(dllexport) virtual MxLong Open(MxULong); // vtable+0x14 + __declspec(dllexport) virtual MxLong Close(); // vtable+0x18 + __declspec(dllexport) virtual MxLong Read(unsigned char *,MxULong); // vtable+0x20 + __declspec(dllexport) virtual MxLong Seek(MxLong,int); // vtable+0x24 + __declspec(dllexport) virtual MxULong GetBufferSize(); // vtable+0x28 + __declspec(dllexport) virtual MxULong GetStreamBuffersNum(); // vtable+0x2c private: - long ReadChunks(); + MxLong ReadChunks(); struct ChunkHeader { ChunkHeader() : majorVersion(0) @@ -28,11 +41,11 @@ class MxDSFile : public MxDSSource , streamBuffersNum(0) {} - unsigned short majorVersion; - unsigned short minorVersion; - unsigned long bufferSize; - short streamBuffersNum; - short reserved; + MxU16 majorVersion; + MxU16 minorVersion; + MxULong bufferSize; + MxS16 streamBuffersNum; + MxS16 reserved; }; MxString m_filename; @@ -41,7 +54,7 @@ class MxDSFile : public MxDSSource // If false, read chunks immediately on open, otherwise // skip reading chunks until ReadChunks is explicitly called. - unsigned long m_skipReadingChunks; + MxULong m_skipReadingChunks; }; #endif // MXDSFILE_H diff --git a/LEGO1/mxdsmediaaction.cpp b/LEGO1/mxdsmediaaction.cpp new file mode 100644 index 00000000..9587b152 --- /dev/null +++ b/LEGO1/mxdsmediaaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsmediaaction.h" + +// OFFSET: LEGO1 0x100c8b40 +MxDSMediaAction::MxDSMediaAction() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c8cf0 +MxDSMediaAction::~MxDSMediaAction() +{ + // TODO +} diff --git a/LEGO1/mxdsmediaaction.h b/LEGO1/mxdsmediaaction.h new file mode 100644 index 00000000..5beb12f5 --- /dev/null +++ b/LEGO1/mxdsmediaaction.h @@ -0,0 +1,29 @@ +#ifndef MXDSMEDIAACTION_H +#define MXDSMEDIAACTION_H + +#include "mxdsaction.h" + +// VTABLE 0x100dcd40 +// SIZE 0xb8 +class MxDSMediaAction : public MxDSAction +{ +public: + MxDSMediaAction(); + virtual ~MxDSMediaAction() override; + + // OFFSET: LEGO1 0x100c8be0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f7624 + return "MxDSMediaAction"; + } + + // OFFSET: LEGO1 0x100c8bf0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSMediaAction::ClassName()) || MxDSAction::IsA(name); + } + +}; + +#endif // MXDSMEDIAACTION_H diff --git a/LEGO1/mxdsmultiaction.cpp b/LEGO1/mxdsmultiaction.cpp new file mode 100644 index 00000000..4b36f2ec --- /dev/null +++ b/LEGO1/mxdsmultiaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsmultiaction.h" + +// OFFSET: LEGO1 0x100c9b90 +MxDSMultiAction::MxDSMultiAction() +{ + +} + +// OFFSET: LEGO1 0x100ca060 +MxDSMultiAction::~MxDSMultiAction() +{ + +} diff --git a/LEGO1/mxdsmultiaction.h b/LEGO1/mxdsmultiaction.h new file mode 100644 index 00000000..af3d69df --- /dev/null +++ b/LEGO1/mxdsmultiaction.h @@ -0,0 +1,28 @@ +#ifndef MXDSMULTIACTION_H +#define MXDSMULTIACTION_H + +#include "mxdsaction.h" + +// VTABLE 0x100dcef0 +// SIZE 0x9c +class MxDSMultiAction : public MxDSAction +{ +public: + MxDSMultiAction(); + virtual ~MxDSMultiAction() override; + + // OFFSET: LEGO1 0x100c9f50 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10101dbc + return "MxDSMultiAction"; + } + + // OFFSET: LEGO1 0x100c9f60 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSMultiAction::ClassName()) || MxDSAction::IsA(name); + } +}; + +#endif // MXDSMULTIACTION_H diff --git a/LEGO1/mxdsobject.cpp b/LEGO1/mxdsobject.cpp index 7323f446..abe8902f 100644 --- a/LEGO1/mxdsobject.cpp +++ b/LEGO1/mxdsobject.cpp @@ -7,30 +7,121 @@ MxDSObject::MxDSObject() { this->m_unk0c = 0; - this->m_unk10 = 0; + this->m_sourceName = NULL; this->m_unk14 = 0; - this->m_name = NULL; + this->m_objectName = NULL; this->m_unk24 = -1; this->m_unk1c = -1; this->m_unk28 = 0; } -// OFFSET: LEGO1 0x100bf8e0 -void MxDSObject::SetObjectName(const char *p_name) +// OFFSET: LEGO1 0x100bf7e0 +MxDSObject::~MxDSObject() { - if (p_name != this->m_name) - { - free(this->m_name); + delete[] m_objectName; + delete[] m_sourceName; +} - if (p_name) { - this->m_name = (char *)malloc(strlen(p_name) + 1); +// OFFSET: LEGO1 0x100bf870 +void MxDSObject::CopyFrom(MxDSObject &p_dsObject) +{ + this->SetSourceName(p_dsObject.m_sourceName); + this->m_unk14 = p_dsObject.m_unk14; + this->SetObjectName(p_dsObject.m_objectName); + this->m_unk1c = p_dsObject.m_unk1c; + this->m_unk24 = p_dsObject.m_unk24; + this->m_atomId = p_dsObject.m_atomId; + this->m_unk28 = p_dsObject.m_unk28; +} - if (this->m_name) { - strcpy(this->m_name, p_name); +// OFFSET: LEGO1 0x100bf8c0 +MxDSObject &MxDSObject::operator=(MxDSObject &p_dsObject) +{ + if (this == &p_dsObject) + return *this; + + this->CopyFrom(p_dsObject); + return *this; +} + +// OFFSET: LEGO1 0x100bf8e0 +void MxDSObject::SetObjectName(const char *p_objectName) +{ + if (p_objectName != this->m_objectName) { + delete[] this->m_objectName; + + if (p_objectName) { + this->m_objectName = new char[strlen(p_objectName) + 1]; + + if (this->m_objectName) { + strcpy(this->m_objectName, p_objectName); } } else { - this->m_name = NULL; + this->m_objectName = NULL; } } } + +// OFFSET: LEGO1 0x100bf950 +void MxDSObject::SetSourceName(const char *p_sourceName) +{ + if (p_sourceName != this->m_sourceName) { + delete[] this->m_sourceName; + + if (p_sourceName) { + this->m_sourceName = new char[strlen(p_sourceName) + 1]; + + if (this->m_sourceName) { + strcpy(this->m_sourceName, p_sourceName); + } + } + else { + this->m_sourceName = NULL; + } + } +} + +// OFFSET: LEGO1 0x100bf9c0 +int MxDSObject::unk14() +{ + return 10; +} + +// OFFSET: LEGO1 0x100bf9d0 +unsigned int MxDSObject::CalculateUnk08() +{ + unsigned int unk08; + + if (this->m_sourceName) + unk08 = strlen(this->m_sourceName) + 3; + else + unk08 = 3; + + unk08 += 4; + + if (this->m_objectName) + unk08 += strlen(this->m_objectName) + 1; + else + unk08++; + + unk08 += 4; + this->m_unk08 = unk08; + return unk08; +} + +// OFFSET: LEGO1 0x100bfa20 +void MxDSObject::Parse(char **p_source, MxU16 p_unk24) +{ + this->SetSourceName(*p_source); + *p_source += strlen(this->m_sourceName) + 1; + this->m_unk14 = *(int*) *p_source; + *p_source += 4; + + this->SetObjectName(*p_source); + *p_source += strlen(this->m_objectName) + 1; + this->m_unk1c = *(int*) *p_source; + *p_source += 4; + + this->m_unk24 = p_unk24; +} diff --git a/LEGO1/mxdsobject.h b/LEGO1/mxdsobject.h index 468076f7..ff7d4a02 100644 --- a/LEGO1/mxdsobject.h +++ b/LEGO1/mxdsobject.h @@ -4,33 +4,51 @@ #include "mxcore.h" #include "mxatomid.h" +// VTABLE 0x100dc868 +// SIZE 0x2c class MxDSObject : public MxCore { public: - __declspec(dllexport) void SetObjectName(const char *); + __declspec(dllexport) void SetObjectName(const char *p_objectName); MxDSObject(); + virtual ~MxDSObject() override; + + MxDSObject &operator=(MxDSObject &p_dsObject); + void CopyFrom(MxDSObject &p_dsObject); + + // OFFSET: LEGO1 0x100bf730 + inline virtual const char *ClassName() const override { return "MxDSObject"; }; // vtable+0c + + // OFFSET: LEGO1 0x100bf740 + inline virtual MxBool IsA(const char *name) const override { return !strcmp(name, MxDSObject::ClassName()) || MxCore::IsA(name); }; // vtable+10; + + virtual int unk14(); // vtable+14; + virtual unsigned int CalculateUnk08(); // vtable+18; + virtual void Parse(char **p_source, MxU16 p_unk24); // vtable+1c; + + void SetSourceName(const char *p_sourceName); inline const MxAtomId& GetAtomId() { return this->m_atomId; } inline int GetUnknown1c() { return this->m_unk1c; } inline void SetUnknown1c(int p_unk1c) { this->m_unk1c = p_unk1c; } - inline void SetUnknown24(short p_unk24) { this->m_unk24 = p_unk24; } + inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; } // OFFSET: ISLE 0x401c40 // OFFSET: LEGO1 0x10005530 inline void SetAtomId(MxAtomId p_atomId) { this->m_atomId = p_atomId; } private: - int m_unk08; - short m_unk0c; - char* m_unk10; + unsigned int m_unk08; + MxS16 m_unk0c; + char* m_sourceName; int m_unk14; - char *m_name; + char *m_objectName; int m_unk1c; MxAtomId m_atomId; - short m_unk24; - unsigned short m_unk26; + MxS16 m_unk24; + MxU16 m_unk26; int m_unk28; }; diff --git a/LEGO1/mxdsobjectaction.cpp b/LEGO1/mxdsobjectaction.cpp new file mode 100644 index 00000000..990168da --- /dev/null +++ b/LEGO1/mxdsobjectaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsobjectaction.h" + +// OFFSET: LEGO1 0x100c8870 +MxDSObjectAction::MxDSObjectAction() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c8a20 +MxDSObjectAction::~MxDSObjectAction() +{ + // TODO +} diff --git a/LEGO1/mxdsobjectaction.h b/LEGO1/mxdsobjectaction.h new file mode 100644 index 00000000..12e147fc --- /dev/null +++ b/LEGO1/mxdsobjectaction.h @@ -0,0 +1,28 @@ +#ifndef MXDSOBJECTACTION_H +#define MXDSOBJECTACTION_H + +#include "mxdsmediaaction.h" + +// VTABLE 0x100dccf8 +// SIZE 0xb8 +class MxDSObjectAction : public MxDSMediaAction +{ +public: + MxDSObjectAction(); + virtual ~MxDSObjectAction() override; + + // OFFSET: LEGO1 0x100c88e0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101025c4 + return "MxDSObjectAction"; + } + + // OFFSET: LEGO1 0x100c88f0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSObjectAction::ClassName()) || MxDSMediaAction::IsA(name); + } +}; + +#endif // MXDSOBJECTACTION_H diff --git a/LEGO1/mxdsparallelaction.cpp b/LEGO1/mxdsparallelaction.cpp new file mode 100644 index 00000000..78b9623a --- /dev/null +++ b/LEGO1/mxdsparallelaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsparallelaction.h" + +// OFFSET: LEGO1 0x100cae80 +MxDSParallelAction::MxDSParallelAction() +{ + +} + +// OFFSET: LEGO1 0x100cb040 +MxDSParallelAction::~MxDSParallelAction() +{ + +} diff --git a/LEGO1/mxdsparallelaction.h b/LEGO1/mxdsparallelaction.h new file mode 100644 index 00000000..067dc82c --- /dev/null +++ b/LEGO1/mxdsparallelaction.h @@ -0,0 +1,29 @@ +#ifndef MXDSPARALLELACTION_H +#define MXDSPARALLELACTION_H + +#include "mxdsmultiaction.h" + +// VTABLE 0x100dcf80 +// SIZE 0x9c +class MxDSParallelAction : public MxDSMultiAction +{ +public: + MxDSParallelAction(); + virtual ~MxDSParallelAction() override; + + // OFFSET: LEGO1 0x100caf00 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10102608 + return "MxDSParallelAction"; + } + + // OFFSET: LEGO1 0x100caf10 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSParallelAction::ClassName()) || MxDSMultiAction::IsA(name); + } + +}; + +#endif // MXDSPARALLELACTION_H diff --git a/LEGO1/mxdsselectaction.cpp b/LEGO1/mxdsselectaction.cpp new file mode 100644 index 00000000..575aba29 --- /dev/null +++ b/LEGO1/mxdsselectaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsselectaction.h" + +// OFFSET: LEGO1 0x100cb2b0 +MxDSSelectAction::MxDSSelectAction() +{ + +} + +// OFFSET: LEGO1 0x100cb8d0 +MxDSSelectAction::~MxDSSelectAction() +{ + +} diff --git a/LEGO1/mxdsselectaction.h b/LEGO1/mxdsselectaction.h new file mode 100644 index 00000000..cb5374e1 --- /dev/null +++ b/LEGO1/mxdsselectaction.h @@ -0,0 +1,29 @@ +#ifndef MXDSSELECTACTION_H +#define MXDSSELECTACTION_H + +#include "mxdsparallelaction.h" + +// VTABLE 0x100dcfc8 +// SIZE 0xb0 +class MxDSSelectAction : public MxDSParallelAction +{ +public: + MxDSSelectAction(); + virtual ~MxDSSelectAction() override; + + // OFFSET: LEGO1 0x100cb6f0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x1010261c + return "MxDSSelectAction"; + } + + // OFFSET: LEGO1 0x100cb700 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSSelectAction::ClassName()) || MxDSParallelAction::IsA(name); + } + +}; + +#endif // MXDSSELECTACTION_H diff --git a/LEGO1/mxdsserialaction.cpp b/LEGO1/mxdsserialaction.cpp new file mode 100644 index 00000000..a5e8f623 --- /dev/null +++ b/LEGO1/mxdsserialaction.cpp @@ -0,0 +1,13 @@ +#include "mxdsserialaction.h" + +// OFFSET: LEGO1 0x100ca9d0 +MxDSSerialAction::MxDSSerialAction() +{ + +} + +// OFFSET: LEGO1 0x100cac10 +MxDSSerialAction::~MxDSSerialAction() +{ + +} diff --git a/LEGO1/mxdsserialaction.h b/LEGO1/mxdsserialaction.h new file mode 100644 index 00000000..2b260556 --- /dev/null +++ b/LEGO1/mxdsserialaction.h @@ -0,0 +1,28 @@ +#ifndef MXDSSERIALACTION_H +#define MXDSSERIALACTION_H + +#include "mxdsmultiaction.h" + +// VTABLE 0x100dcf38 +// SIZE 0xa8 +class MxDSSerialAction : public MxDSMultiAction +{ +public: + MxDSSerialAction(); + virtual ~MxDSSerialAction() override; + + // OFFSET: LEGO1 0x100caad0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f75dc + return "MxDSSerialAction"; + } + + // OFFSET: LEGO1 0x100caae0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSSerialAction::ClassName()) || MxDSMultiAction::IsA(name); + } +}; + +#endif // MXDSSERIALACTION_H diff --git a/LEGO1/mxdssound.cpp b/LEGO1/mxdssound.cpp new file mode 100644 index 00000000..4f2b0d61 --- /dev/null +++ b/LEGO1/mxdssound.cpp @@ -0,0 +1,13 @@ +#include "mxdssound.h" + +// OFFSET: LEGO1 0x100c92c0 +MxDSSound::MxDSSound() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c9470 +MxDSSound::~MxDSSound() +{ + // TODO +} diff --git a/LEGO1/mxdssound.h b/LEGO1/mxdssound.h new file mode 100644 index 00000000..45a61d63 --- /dev/null +++ b/LEGO1/mxdssound.h @@ -0,0 +1,29 @@ +#ifndef MXDSSOUND_H +#define MXDSSOUND_H + +#include "mxdsmediaaction.h" + +// VTABLE 0x100dcdd0 +// SIZE 0xc0 +class MxDSSound : public MxDSMediaAction +{ +public: + MxDSSound(); + virtual ~MxDSSound() override; + + // OFFSET: LEGO1 0x100c9330 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101025e4 + return "MxDSSound"; + } + + // OFFSET: LEGO1 0x100c9340 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSSound::ClassName()) || MxDSMediaAction::IsA(name); + } +}; + + +#endif // MXDSSOUND_H diff --git a/LEGO1/mxdssource.cpp b/LEGO1/mxdssource.cpp index 8612c5c4..9a94f110 100644 --- a/LEGO1/mxdssource.cpp +++ b/LEGO1/mxdssource.cpp @@ -8,7 +8,7 @@ void MxDSSource::SomethingWhichCallsRead(void* pUnknownObject) } // OFFSET: LEGO1 0x100bfff0 -long MxDSSource::GetLengthInDWords() +MxLong MxDSSource::GetLengthInDWords() { return m_lengthInDWords; } \ No newline at end of file diff --git a/LEGO1/mxdssource.h b/LEGO1/mxdssource.h index 7ee01490..5ff4c33c 100644 --- a/LEGO1/mxdssource.h +++ b/LEGO1/mxdssource.h @@ -3,6 +3,7 @@ #include "mxcore.h" +// VTABLE 0x100dc8c8 class MxDSSource : public MxCore { public: @@ -12,19 +13,32 @@ class MxDSSource : public MxCore , m_position(-1) {} - virtual long Open(unsigned long) = 0; - virtual long Close() = 0; + // OFFSET: LEGO1 0x100c0010 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x10102588 + return "MxDSSource"; + } + + // OFFSET: LEGO1 0x100c0020 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSSource::ClassName()) || MxCore::IsA(name); + } + + virtual MxLong Open(MxULong) = 0; + virtual MxLong Close() = 0; virtual void SomethingWhichCallsRead(void* pUnknownObject); - virtual long Read(unsigned char *, unsigned long) = 0; - virtual long Seek(long, int) = 0; - virtual unsigned long GetBufferSize() = 0; - virtual unsigned long GetStreamBuffersNum() = 0; - virtual long GetLengthInDWords(); + virtual MxLong Read(unsigned char *, MxULong) = 0; + virtual MxLong Seek(MxLong, int) = 0; + virtual MxULong GetBufferSize() = 0; + virtual MxULong GetStreamBuffersNum() = 0; + virtual MxLong GetLengthInDWords(); protected: - unsigned long m_lengthInDWords; + MxULong m_lengthInDWords; void* m_pBuffer; - long m_position; + MxLong m_position; }; -#endif // MXDSSOURCE_H \ No newline at end of file +#endif // MXDSSOURCE_H diff --git a/LEGO1/mxdsstill.cpp b/LEGO1/mxdsstill.cpp new file mode 100644 index 00000000..0a5434f1 --- /dev/null +++ b/LEGO1/mxdsstill.cpp @@ -0,0 +1,13 @@ +#include "mxdsstill.h" + +// OFFSET: LEGO1 0x100c98c0 +MxDSStill::MxDSStill() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c9a70 +MxDSStill::~MxDSStill() +{ + // TODO +} diff --git a/LEGO1/mxdsstill.h b/LEGO1/mxdsstill.h new file mode 100644 index 00000000..920f890a --- /dev/null +++ b/LEGO1/mxdsstill.h @@ -0,0 +1,28 @@ +#ifndef MXDSSTILL_H +#define MXDSSTILL_H + +#include "mxdsmediaaction.h" + +// VTABLE 0x100dce60 +// SIZE 0xb8 +class MxDSStill : public MxDSMediaAction +{ +public: + MxDSStill(); + virtual ~MxDSStill() override; + + // OFFSET: LEGO1 0x100c9930 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101025fc + return "MxDSStill"; + } + + // OFFSET: LEGO1 0x100c9940 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSStill::ClassName()) || MxDSMediaAction::IsA(name); + } +}; + +#endif // MXDSSTILL_H diff --git a/LEGO1/mxdssubscriber.cpp b/LEGO1/mxdssubscriber.cpp new file mode 100644 index 00000000..8a011fed --- /dev/null +++ b/LEGO1/mxdssubscriber.cpp @@ -0,0 +1,13 @@ +#include "mxdssubscriber.h" + +// OFFSET: LEGO1 0x100b7bb0 +MxDSSubscriber::MxDSSubscriber() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b7e00 +MxDSSubscriber::~MxDSSubscriber() +{ + // TODO +} diff --git a/LEGO1/mxdssubscriber.h b/LEGO1/mxdssubscriber.h new file mode 100644 index 00000000..fb3b0d04 --- /dev/null +++ b/LEGO1/mxdssubscriber.h @@ -0,0 +1,28 @@ +#ifndef MXDSSUBSCRIBER_H +#define MXDSSUBSCRIBER_H + +#include "mxcore.h" + +// VTABLE 0x100dc698 +// SIZE 0x4c +class MxDSSubscriber : public MxCore +{ +public: + MxDSSubscriber(); + virtual ~MxDSSubscriber() override; + + // OFFSET: LEGO1 0x100b7d50 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x101020f8 + return "MxDSSubscriber"; + } + + // OFFSET: LEGO1 0x100b7d60 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxDSSubscriber::ClassName()) || MxCore::IsA(name); + } +}; + +#endif // MXDSSUBSCRIBER_H diff --git a/LEGO1/mxentity.cpp b/LEGO1/mxentity.cpp new file mode 100644 index 00000000..7459dd24 --- /dev/null +++ b/LEGO1/mxentity.cpp @@ -0,0 +1,19 @@ +#include "mxentity.h" + +// OFFSET: LEGO1 0x1001d190 STUB +MxEntity::MxEntity() +{ + // TODO +} + +// OFFSET: LEGO1 0x1000c110 STUB +MxEntity::~MxEntity() +{ + // TODO +} + +// OFFSET: LEGO1 0x10001070 STUB +void MxEntity::Destroy() +{ + // TODO +} diff --git a/LEGO1/mxentity.h b/LEGO1/mxentity.h new file mode 100644 index 00000000..7123abbf --- /dev/null +++ b/LEGO1/mxentity.h @@ -0,0 +1,32 @@ +#ifndef MXENTITY_H +#define MXENTITY_H + +#include "mxcore.h" + +// VTABLE 0x100d5390 +class MxEntity : public MxCore +{ +public: + MxEntity(); + virtual ~MxEntity() override; + + // OFFSET: LEGO1 0x1000c180 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x100f0070 + return "MxEntity"; + } + + // OFFSET: LEGO1 0x1000c190 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxEntity::ClassName()) || MxCore::IsA(name); + } + + virtual void Destroy(); // vtable+0x1c + + // 0x8: MxResult + // 0xc MxAtomId +}; + +#endif // MXENTITY_H diff --git a/LEGO1/mxeventmanager.cpp b/LEGO1/mxeventmanager.cpp new file mode 100644 index 00000000..786420bc --- /dev/null +++ b/LEGO1/mxeventmanager.cpp @@ -0,0 +1,13 @@ +#include "mxeventmanager.h" + +// OFFSET: LEGO1 0x100c0360 STUB +MxEventManager::MxEventManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c03f0 STUB +MxEventManager::~MxEventManager() +{ + // TODO +} diff --git a/LEGO1/mxeventmanager.h b/LEGO1/mxeventmanager.h index 5d187256..be5a796c 100644 --- a/LEGO1/mxeventmanager.h +++ b/LEGO1/mxeventmanager.h @@ -1,9 +1,16 @@ #ifndef MXEVENTMANAGER_H #define MXEVENTMANAGER_H -class MxEventManager +#include "mxunknown100dc6b0.h" + +// VTABLE 0x100dc900 +// SIZE 0x2c +class MxEventManager : public MxUnknown100dc6b0 { - +public: + MxEventManager(); + virtual ~MxEventManager() override; + }; #endif // MXEVENTMANAGER_H diff --git a/LEGO1/mxeventpresenter.cpp b/LEGO1/mxeventpresenter.cpp new file mode 100644 index 00000000..88c20ce3 --- /dev/null +++ b/LEGO1/mxeventpresenter.cpp @@ -0,0 +1,23 @@ +#include "mxeventpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxEventPresenter, 0x54); + +// OFFSET: LEGO1 0x100c2b70 +MxEventPresenter::MxEventPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x100c2d40 STUB +MxEventPresenter::~MxEventPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100c2da0 +void MxEventPresenter::Init() +{ + m_unk50 = 0; +} diff --git a/LEGO1/mxeventpresenter.h b/LEGO1/mxeventpresenter.h new file mode 100644 index 00000000..256d0c7f --- /dev/null +++ b/LEGO1/mxeventpresenter.h @@ -0,0 +1,35 @@ +#ifndef MXEVENTPRESENTER_H +#define MXEVENTPRESENTER_H + +#include "mxmediapresenter.h" + +#include "decomp.h" + +// VTABLE 0x100dca88 +// SIZE 0x54 +class MxEventPresenter : public MxMediaPresenter +{ +public: + MxEventPresenter(); + virtual ~MxEventPresenter() override; + + // OFFSET: LEGO1 0x100c2c30 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101dcc + return "MxEventPresenter"; + } + + // OFFSET: LEGO1 0x100c2c40 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxEventPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + +private: + void Init(); + undefined4 m_unk50; + +}; + +#endif // MXEVENTPRESENTER_H diff --git a/LEGO1/mxflcpresenter.cpp b/LEGO1/mxflcpresenter.cpp new file mode 100644 index 00000000..8bd23d22 --- /dev/null +++ b/LEGO1/mxflcpresenter.cpp @@ -0,0 +1,17 @@ +#include "mxflcpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxFlcPresenter, 0x68); + +// OFFSET: LEGO1 0x100b3310 STUB +MxFlcPresenter::MxFlcPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b3420 STUB +MxFlcPresenter::~MxFlcPresenter() +{ + // TODO +} diff --git a/LEGO1/mxflcpresenter.h b/LEGO1/mxflcpresenter.h new file mode 100644 index 00000000..bc34ff12 --- /dev/null +++ b/LEGO1/mxflcpresenter.h @@ -0,0 +1,32 @@ +#ifndef MXFLCPRESENTER_H +#define MXFLCPRESENTER_H + +#include "mxvideopresenter.h" + +#include "decomp.h" + +// VTABLE 0x100dc2c0 +// SIZE 0x68 +class MxFlcPresenter : public MxVideoPresenter +{ +public: + MxFlcPresenter(); + virtual ~MxFlcPresenter() override; + + // OFFSET: LEGO1 0x100b33f0 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x100f43c8 + return "MxFlcPresenter"; + } + + // OFFSET: LEGO1 0x1004e200 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxFlcPresenter::ClassName()) || MxVideoPresenter::IsA(name); + } + + undefined4 m_unk64; +}; + +#endif // MXFLCPRESENTER_H diff --git a/LEGO1/mxioinfo.cpp b/LEGO1/mxioinfo.cpp index 4a3fdf25..11022b44 100644 --- a/LEGO1/mxioinfo.cpp +++ b/LEGO1/mxioinfo.cpp @@ -15,10 +15,10 @@ MXIOINFO::~MXIOINFO() } // OFFSET: LEGO1 0x100cc830 -unsigned short MXIOINFO::Open(const char *filename, DWORD fdwOpen) +MxU16 MXIOINFO::Open(const char *filename, DWORD fdwOpen) { OFSTRUCT _unused; - unsigned short result = 0; + MxU16 result = 0; m_lBufOffset = 0; m_lDiskOffset = 0; @@ -57,9 +57,9 @@ unsigned short MXIOINFO::Open(const char *filename, DWORD fdwOpen) } // OFFSET: LEGO1 0x100cc8e0 -unsigned short MXIOINFO::Close(long arg) +MxU16 MXIOINFO::Close(MxLong arg) { - unsigned short result = 0; + MxU16 result = 0; if (m_hmmio) { result = Flush(0); @@ -79,9 +79,9 @@ unsigned short MXIOINFO::Close(long arg) } // OFFSET: LEGO1 0x100cc930 -unsigned long MXIOINFO::Read(HPSTR pch, LONG cch) +MxLong MXIOINFO::Read(HPSTR pch, LONG cch) { - unsigned long bytes_read = 0; + MxLong bytes_read = 0; if (m_pchBuffer) { @@ -121,9 +121,9 @@ unsigned long MXIOINFO::Read(HPSTR pch, LONG cch) } // OFFSET: LEGO1 0x100cca00 -LONG MXIOINFO::Seek(LONG lOffset, int iOrigin) +MxLong MXIOINFO::Seek(LONG lOffset, int iOrigin) { - LONG result = -1; + MxLong result = -1; // If buffered I/O if (m_pchBuffer) { @@ -222,9 +222,9 @@ LONG MXIOINFO::Seek(LONG lOffset, int iOrigin) } // OFFSET: LEGO1 0x100ccbc0 -unsigned short MXIOINFO::SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk) +MxU16 MXIOINFO::SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk) { - unsigned short result = Flush(0); + MxU16 result = Flush(0); if (m_dwFlags & MMIO_ALLOCBUF) { m_dwFlags &= ~MMIO_ALLOCBUF; @@ -240,9 +240,9 @@ unsigned short MXIOINFO::SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk) } // OFFSET: LEGO1 0x100ccc10 -unsigned short MXIOINFO::Flush(UINT fuFlush) +MxU16 MXIOINFO::Flush(UINT fuFlush) { - unsigned short result = 0; + MxU16 result = 0; // if buffer is dirty if (m_dwFlags & MMIO_DIRTY) { @@ -286,9 +286,9 @@ unsigned short MXIOINFO::Flush(UINT fuFlush) } // OFFSET: LEGO1 0x100ccd00 -unsigned short MXIOINFO::Advance(UINT fuAdvance) +MxU16 MXIOINFO::Advance(UINT fuAdvance) { - unsigned short result = 0; + MxU16 result = 0; DWORD rwmode = m_dwFlags & MMIO_RWMODE; if (m_pchBuffer) { @@ -356,7 +356,7 @@ unsigned short MXIOINFO::Advance(UINT fuAdvance) } // OFFSET: LEGO1 0x100cce60 -unsigned short MXIOINFO::Descend(MMCKINFO *pmmcki, const MMCKINFO *pmmckiParent, unsigned short fuDescend) +MxU16 MXIOINFO::Descend(MMCKINFO *pmmcki, const MMCKINFO *pmmckiParent, unsigned short fuDescend) { unsigned short result = 0; @@ -439,4 +439,4 @@ unsigned short MXIOINFO::Descend(MMCKINFO *pmmcki, const MMCKINFO *pmmckiParent, } return result; -} \ No newline at end of file +} diff --git a/LEGO1/mxioinfo.h b/LEGO1/mxioinfo.h index d69d2bf0..419e84af 100644 --- a/LEGO1/mxioinfo.h +++ b/LEGO1/mxioinfo.h @@ -2,8 +2,9 @@ #define MXIOINFO_H #include +#include -#include "mmsystem.h" +#include "mxtypes.h" class MXIOINFO { @@ -11,14 +12,14 @@ class MXIOINFO MXIOINFO(); __declspec(dllexport) ~MXIOINFO(); - unsigned short Open(const char *filename, DWORD fdwOpen); - unsigned short Close(long arg); - LONG Seek(LONG lOffset, int iOrigin); - unsigned long Read(HPSTR pch, LONG cch); - unsigned short SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk); - unsigned short Flush(UINT); - unsigned short Advance(UINT); - unsigned short Descend(MMCKINFO *pmmcki, const MMCKINFO *pmmckiParent, unsigned short fuDescend); + MxU16 Open(const char *filename, DWORD fdwOpen); + MxU16 Close(MxLong arg); + MxLong Seek(LONG lOffset, int iOrigin); + MxLong Read(HPSTR pch, LONG cch); + MxU16 SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk); + MxU16 Flush(UINT); + MxU16 Advance(UINT); + MxU16 Descend(MMCKINFO *pmmcki, const MMCKINFO *pmmckiParent, MxU16 fuDescend); // The following is the MMIOINFO struct but with h_mmio set to type HFILE. diff --git a/LEGO1/mxloopingflcpresenter.cpp b/LEGO1/mxloopingflcpresenter.cpp new file mode 100644 index 00000000..041ae6a5 --- /dev/null +++ b/LEGO1/mxloopingflcpresenter.cpp @@ -0,0 +1,23 @@ +#include "mxloopingflcpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxLoopingFlcPresenter, 0x6c); + +// OFFSET: LEGO1 0x100b4310 STUB +MxLoopingFlcPresenter::MxLoopingFlcPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b43b0 STUB +MxLoopingFlcPresenter::~MxLoopingFlcPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b4410 STUB +void MxLoopingFlcPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/mxloopingflcpresenter.h b/LEGO1/mxloopingflcpresenter.h new file mode 100644 index 00000000..1973c28e --- /dev/null +++ b/LEGO1/mxloopingflcpresenter.h @@ -0,0 +1,28 @@ +#ifndef MXLOOPINGFLCPRESENTER_H +#define MXLOOPINGFLCPRESENTER_H + +#include "mxflcpresenter.h" + +#include "decomp.h" + +// VTABLE 0x100dc480 +// SIZE 0x6c +class MxLoopingFlcPresenter : public MxFlcPresenter +{ +public: + MxLoopingFlcPresenter(); + virtual ~MxLoopingFlcPresenter() override; + + // OFFSET: LEGO1 0x100b4380 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101e20 + return "MxLoopingFlcPresenter"; + } + +private: + void Init(); + undefined4 m_unk68; +}; + +#endif // MXLOOPINGFLCPRESENTER_H diff --git a/LEGO1/mxloopingmidipresenter.cpp b/LEGO1/mxloopingmidipresenter.cpp new file mode 100644 index 00000000..ebeed4b4 --- /dev/null +++ b/LEGO1/mxloopingmidipresenter.cpp @@ -0,0 +1,5 @@ +#include "mxloopingmidipresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxLoopingMIDIPresenter, 0x58); diff --git a/LEGO1/mxloopingmidipresenter.h b/LEGO1/mxloopingmidipresenter.h new file mode 100644 index 00000000..e41be651 --- /dev/null +++ b/LEGO1/mxloopingmidipresenter.h @@ -0,0 +1,25 @@ +#ifndef MXLOOPINGMIDIPRESENTER_H +#define MXLOOPINGMIDIPRESENTER_H + +#include "mxmidipresenter.h" + +// VTABLE 0x100dc240 +// SIZE 0x58 +class MxLoopingMIDIPresenter : public MxMIDIPresenter +{ +public: + // OFFSET: LEGO1 0x100b1830 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101de0 + return "MxLoopingMIDIPresenter"; + } + + // OFFSET: LEGO1 0x100b1840 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxLoopingMIDIPresenter::ClassName()) || MxMIDIPresenter::IsA(name); + } +}; + +#endif // MXLOOPINGMIDIPRESENTER_H diff --git a/LEGO1/mxloopingsmkpresenter.cpp b/LEGO1/mxloopingsmkpresenter.cpp new file mode 100644 index 00000000..da9223df --- /dev/null +++ b/LEGO1/mxloopingsmkpresenter.cpp @@ -0,0 +1,23 @@ +#include "mxloopingsmkpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxLoopingSmkPresenter, 0x724); + +// OFFSET: LEGO1 0x100b48b0 +MxLoopingSmkPresenter::MxLoopingSmkPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x100b4950 STUB +MxLoopingSmkPresenter::~MxLoopingSmkPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b49b0 STUB +void MxLoopingSmkPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/mxloopingsmkpresenter.h b/LEGO1/mxloopingsmkpresenter.h new file mode 100644 index 00000000..8ca18d20 --- /dev/null +++ b/LEGO1/mxloopingsmkpresenter.h @@ -0,0 +1,28 @@ +#ifndef MXLOOPINGSMKPRESENTER_H +#define MXLOOPINGSMKPRESENTER_H + +#include "mxsmkpresenter.h" + +#include "decomp.h" + +// VTABLE 0x100dc540 +// SIZE 0x724 +class MxLoopingSmkPresenter : public MxSmkPresenter +{ +public: + MxLoopingSmkPresenter(); + virtual ~MxLoopingSmkPresenter() override; // vtable+0x0 + + // OFFSET: LEGO1 0x100b4920 + inline virtual const char* ClassName() const override // vtable+0xc + { + // 0x10101e08 + return "MxLoopingSmkPresenter"; + } + +private: + void Init(); + undefined4 m_unk720; +}; + +#endif // MXLOOPINGSMKPRESENTER_H diff --git a/LEGO1/mxmediapresenter.cpp b/LEGO1/mxmediapresenter.cpp new file mode 100644 index 00000000..58c068ac --- /dev/null +++ b/LEGO1/mxmediapresenter.cpp @@ -0,0 +1,16 @@ +#include "mxmediapresenter.h" + +DECOMP_SIZE_ASSERT(MxMediaPresenter, 0x50); + +// OFFSET: LEGO1 0x100b5d10 STUB +MxLong MxMediaPresenter::Tickle() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x100b54e0 STUB +void MxMediaPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/mxmediapresenter.h b/LEGO1/mxmediapresenter.h new file mode 100644 index 00000000..64de0614 --- /dev/null +++ b/LEGO1/mxmediapresenter.h @@ -0,0 +1,41 @@ +#ifndef MXMEDIAPRESENTER_H +#define MXMEDIAPRESENTER_H + +#include "mxpresenter.h" + +#include "decomp.h" + +// VTABLE 0x100d4cd8 +class MxMediaPresenter : public MxPresenter +{ +public: + inline MxMediaPresenter() + { + Init(); + } + + virtual MxLong Tickle() override; // vtable+0x8, override MxCore + + // OFFSET: LEGO1 0x1000c5c0 + inline virtual const char *ClassName() const override // vtable+0xc + { + // 0x100f074c + return "MxMediaPresenter"; + } + + // OFFSET: LEGO1 0x1000c5d0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxMediaPresenter::ClassName()) || MxPresenter::IsA(name); + } + + undefined4 m_unk40; + undefined4 m_unk44; + undefined4 m_unk48; + undefined4 m_unk4c; +private: + void Init(); + +}; + +#endif // MXMEDIAPRESENTER_H diff --git a/LEGO1/mxmidipresenter.cpp b/LEGO1/mxmidipresenter.cpp new file mode 100644 index 00000000..98868f8a --- /dev/null +++ b/LEGO1/mxmidipresenter.cpp @@ -0,0 +1,16 @@ +#include "mxmidipresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxMIDIPresenter, 0x58); + +// OFFSET: LEGO1 0x100c25e0 +MxMIDIPresenter::MxMIDIPresenter() { + Init(); +} + +// OFFSET: LEGO1 0x100c2820 +void MxMIDIPresenter::Init() +{ + m_unk54 = 0; +} diff --git a/LEGO1/mxmidipresenter.h b/LEGO1/mxmidipresenter.h new file mode 100644 index 00000000..1cd65c4a --- /dev/null +++ b/LEGO1/mxmidipresenter.h @@ -0,0 +1,16 @@ +#ifndef MXMIDIPRESENTER_H +#define MXMIDIPRESENTER_H + +#include "mxmusicpresenter.h" + +// VTABLE 0x100dca20 +class MxMIDIPresenter : public MxMusicPresenter +{ +public: + MxMIDIPresenter(); +private: + void Init(); + undefined4 m_unk54; +}; + +#endif // MXMIDIPRESENTER_H diff --git a/LEGO1/mxmusicmanager.h b/LEGO1/mxmusicmanager.h index 23134708..4288ed1e 100644 --- a/LEGO1/mxmusicmanager.h +++ b/LEGO1/mxmusicmanager.h @@ -1,9 +1,11 @@ #ifndef MXMUSICMANAGER_H #define MXMUSICMANAGER_H -class MxMusicManager +#include "mxcore.h" + +// VTABLE 0x100dc930 +class MxMusicManager : public MxCore { - }; #endif // MXMUSICMANAGER_H diff --git a/LEGO1/mxmusicpresenter.cpp b/LEGO1/mxmusicpresenter.cpp new file mode 100644 index 00000000..562f047c --- /dev/null +++ b/LEGO1/mxmusicpresenter.cpp @@ -0,0 +1,7 @@ +#include "mxmusicpresenter.h" + +// OFFSET: LEGO1 0x100c22c0 STUB +MxMusicPresenter::MxMusicPresenter() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/mxmusicpresenter.h b/LEGO1/mxmusicpresenter.h new file mode 100644 index 00000000..e244b036 --- /dev/null +++ b/LEGO1/mxmusicpresenter.h @@ -0,0 +1,13 @@ +#ifndef MXMUSICPRESENTER_H +#define MXMUSICPRESENTER_H + +#include "mxaudiopresenter.h" + +// VTABLE 0x100dc9b8 +class MxMusicPresenter : public MxAudioPresenter +{ +public: + MxMusicPresenter(); +}; + +#endif // MXMUSICPRESENTER_H diff --git a/LEGO1/mxnextactiondatastart.h b/LEGO1/mxnextactiondatastart.h new file mode 100644 index 00000000..df2a2748 --- /dev/null +++ b/LEGO1/mxnextactiondatastart.h @@ -0,0 +1,12 @@ +#ifndef MXNEXTACTIONDATASTART_H +#define MXNEXTACTIONDATASTART_H + +#include "mxcore.h" + +// VTABLE 0x100dc9a0 +class MxNextActionDataStart : public MxCore +{ + +}; + +#endif // MXNEXTACTIONDATASTART_H diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp new file mode 100644 index 00000000..472c87b5 --- /dev/null +++ b/LEGO1/mxnotificationmanager.cpp @@ -0,0 +1,15 @@ +#include "mxnotificationmanager.h" + +// OFFSET: LEGO1 0x100ac450 STUB +MxNotificationManager::~MxNotificationManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x100ac800 STUB +MxLong MxNotificationManager::Tickle() +{ + // TODO + + return 0; +} \ No newline at end of file diff --git a/LEGO1/mxnotificationmanager.h b/LEGO1/mxnotificationmanager.h index afa378e1..86cb4f00 100644 --- a/LEGO1/mxnotificationmanager.h +++ b/LEGO1/mxnotificationmanager.h @@ -1,9 +1,17 @@ #ifndef MXNOTIFICATIONMANAGER_H #define MXNOTIFICATIONMANAGER_H -class MxNotificationManager +#include "mxcore.h" + +// VTABLE 0x100dc078 +class MxNotificationManager : public MxCore { - +public: + virtual ~MxNotificationManager(); // vtable+0x0 + + virtual MxLong Tickle(); // vtable+0x8 + + // 0x10: MxCriticalSection }; #endif // MXNOTIFICATIONMANAGER_H diff --git a/LEGO1/mxobjectfactory.cpp b/LEGO1/mxobjectfactory.cpp new file mode 100644 index 00000000..d52e4dac --- /dev/null +++ b/LEGO1/mxobjectfactory.cpp @@ -0,0 +1,45 @@ +#include "mxobjectfactory.h" + +#include "mxpresenter.h" +#include "mxcompositepresenter.h" +#include "mxvideopresenter.h" +#include "mxflcpresenter.h" +#include "mxsmkpresenter.h" +#include "mxstillpresenter.h" +#include "mxwavepresenter.h" +#include "mxmidipresenter.h" +#include "mxeventpresenter.h" +#include "mxloopingflcpresenter.h" +#include "mxloopingsmkpresenter.h" +#include "mxloopingmidipresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db + +// OFFSET: LEGO1 0x100b0d80 +MxObjectFactory::MxObjectFactory() +{ +#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact); + FOR_MXOBJECTFACTORY_OBJECTS(X) +#undef X +} + +// OFFSET: LEGO1 0x100b12c0 +MxCore *MxObjectFactory::Create(const char *name) +{ + MxAtomId atom(name, LookupMode_Exact); + + if (0) { +#define X(V) } else if (this->m_id##V == atom) { return new V; + FOR_MXOBJECTFACTORY_OBJECTS(X) +#undef X + } else { + return NULL; + } +} + +// OFFSET: LEGO1 0x100b1a30 STUB +void MxObjectFactory::vtable18(void *) { + // FIXME +} diff --git a/LEGO1/mxobjectfactory.h b/LEGO1/mxobjectfactory.h index ad341edd..53aee2cb 100644 --- a/LEGO1/mxobjectfactory.h +++ b/LEGO1/mxobjectfactory.h @@ -1,9 +1,34 @@ #ifndef MXOBJECTFACTORY_H #define MXOBJECTFACTORY_H -class MxObjectFactory -{ +#include "mxcore.h" +#include "mxatomid.h" +#define FOR_MXOBJECTFACTORY_OBJECTS(X) \ + X(MxPresenter) \ + X(MxCompositePresenter) \ + X(MxVideoPresenter) \ + X(MxFlcPresenter) \ + X(MxSmkPresenter) \ + X(MxStillPresenter) \ + X(MxWavePresenter) \ + X(MxMIDIPresenter) \ + X(MxEventPresenter) \ + X(MxLoopingFlcPresenter) \ + X(MxLoopingSmkPresenter) \ + X(MxLoopingMIDIPresenter) + +// VTABLE 0x100dc220 +class MxObjectFactory : public MxCore +{ +public: + MxObjectFactory(); + virtual MxCore *Create(const char *name); // vtable 0x14 + virtual void vtable18(void *); // vtable 0x18 +private: +#define X(V) MxAtomId m_id##V; + FOR_MXOBJECTFACTORY_OBJECTS(X) +#undef X }; -#endif MXOBJECTFACTORY_H +#endif // MXOBJECTFACTORY_H diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index 9752f6ea..10e8eccb 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -1,7 +1,16 @@ #include "mxomni.h" +// 0x101015b8 +char g_hdPath[1024]; + +// 0x101019b8 +char g_cdPath[1024]; + +// 0x10101db8 +MxBool g_use3dSound; + // 0x101015b0 -MxOmni* MxOmni::m_instance = NULL; +MxOmni *MxOmni::g_instance = NULL; // OFFSET: LEGO1 0x100aef10 MxOmni::MxOmni() @@ -33,10 +42,63 @@ void MxOmni::Init() m_unk64 = NULL; } +// OFFSET: LEGO1 0x100b0690 +void MxOmni::DestroyInstance() +{ + if (g_instance != NULL) + { + delete g_instance; + g_instance = NULL; + } +} + +// OFFSET: LEGO1 0x100b0900 +const char *MxOmni::GetHD() +{ + return g_hdPath; +} + +// OFFSET: LEGO1 0x100b0940 +const char *MxOmni::GetCD() +{ + return g_cdPath; +} + +// OFFSET: LEGO1 0x100b0980 +MxBool MxOmni::IsSound3D() +{ + return g_use3dSound; +} + +// OFFSET: LEGO1 0x100b0910 +void MxOmni::SetHD(const char *p_hd) +{ + strcpy(g_hdPath, p_hd); +} + +// OFFSET: LEGO1 0x100b0950 +void MxOmni::SetCD(const char *p_cd) +{ + strcpy(g_cdPath, p_cd); +} + +// OFFSET: LEGO1 0x100b0990 +void MxOmni::SetSound3D(MxBool p_3dsound) +{ + g_use3dSound = p_3dsound; +} + + // OFFSET: LEGO1 0x100b0680 MxOmni *MxOmni::GetInstance() { - return m_instance; + return g_instance; +} + +// OFFSET: LEGO1 0x100af0b0 +void MxOmni::SetInstance(MxOmni *instance) +{ + g_instance = instance; } // OFFSET: LEGO1 0x100af0c0 @@ -61,14 +123,68 @@ void MxOmni::Destroy() } // OFFSET: LEGO1 0x100b07f0 -long MxOmni::Notify(MxParam &p) +MxLong MxOmni::Notify(MxParam &p) { // FIXME: Stub return 0; } +// OFFSET: LEGO1 0x100acea0 +MxObjectFactory *ObjectFactory() +{ + return MxOmni::GetInstance()->GetObjectFactory(); +} + +// OFFSET: LEGO1 0x100aceb0 +MxNotificationManager *NotificationManager() +{ + return MxOmni::GetInstance()->GetNotificationManager(); +} + +// OFFSET: LEGO1 0x100acec0 +MxTickleManager *TickleManager() +{ + return MxOmni::GetInstance()->GetTickleManager(); +} + // OFFSET: LEGO1 0x100aced0 MxTimer *Timer() { return MxOmni::GetInstance()->GetTimer(); } + +// OFFSET: LEGO1 0x100acef0 +MxStreamer* Streamer() +{ + return MxOmni::GetInstance()->GetStreamer(); +} + +// OFFSET: LEGO1 0x100acf00 +MxSoundManager* MSoundManager() +{ + return MxOmni::GetInstance()->GetSoundManager(); +} + +// OFFSET: LEGO1 0x100acf10 +MxVideoManager* MVideoManager() +{ + return MxOmni::GetInstance()->GetVideoManager(); +} + +// OFFSET: LEGO1 0x100acf20 +MxVariableTable* VariableTable() +{ + return MxOmni::GetInstance()->GetVariableTable(); +} + +// OFFSET: LEGO1 0x100acf30 +MxMusicManager* MusicManager() +{ + return MxOmni::GetInstance()->GetMusicManager(); +} + +// OFFSET: LEGO1 0x100acf40 +MxEventManager* EventManager() +{ + return MxOmni::GetInstance()->GetEventManager(); +} diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 4c7d29e8..f3f1ee9a 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -8,7 +8,6 @@ #include "mxobjectfactory.h" #include "mxomnicreateflags.h" #include "mxomnicreateparam.h" -#include "mxresult.h" #include "mxsoundmanager.h" #include "mxstreamer.h" #include "mxticklemanager.h" @@ -16,6 +15,8 @@ #include "mxvariabletable.h" #include "mxvideomanager.h" +// VTABLE 0x100dc168 +// SIZE 0x68 class MxOmni : public MxCore { public: @@ -23,22 +24,31 @@ class MxOmni : public MxCore __declspec(dllexport) static const char *GetCD(); __declspec(dllexport) static const char *GetHD(); __declspec(dllexport) static MxOmni *GetInstance(); - __declspec(dllexport) static unsigned char IsSound3D(); - __declspec(dllexport) static void SetCD(const char *s); - __declspec(dllexport) static void SetHD(const char *s); - __declspec(dllexport) static void SetSound3D(unsigned char); - - virtual ~MxOmni(); + __declspec(dllexport) static MxBool IsSound3D(); + __declspec(dllexport) static void SetCD(const char *p_cd); + __declspec(dllexport) static void SetHD(const char *p_hd); + __declspec(dllexport) static void SetSound3D(MxBool p_3dsound); - virtual long Notify(MxParam &p); // vtable+04 + MxOmni(); + virtual ~MxOmni() override; + + virtual MxLong Notify(MxParam &p); // vtable+04 virtual void Init(); // vtable+14 virtual MxResult Create(MxOmniCreateParam &p); // vtable+18 virtual void Destroy(); // vtable+1c - + static void SetInstance(MxOmni* instance); + MxObjectFactory* GetObjectFactory() const { return this->m_objectFactory; } + MxNotificationManager* GetNotificationManager() const { return this->m_notificationManager; } + MxTickleManager* GetTickleManager() const { return this->m_tickleManager; } MxTimer* GetTimer() const { return this->m_timer; } - + MxStreamer* GetStreamer() const { return this->m_streamer; } + MxSoundManager* GetSoundManager() const { return this->m_soundManager; } + MxVideoManager* GetVideoManager() const { return this->m_videoManager; } + MxVariableTable* GetVariableTable() const { return this->m_variableTable; } + MxMusicManager* GetMusicManager() const { return this->m_musicManager; } + MxEventManager* GetEventManager() const { return this->m_eventManager; } protected: - static MxOmni* m_instance; + static MxOmni* g_instance; MxString m_mediaPath; // 0x8 HWND *m_windowHandle; // 0x18; @@ -59,7 +69,13 @@ class MxOmni : public MxCore unsigned char m_unk64; // 0x64 }; - +__declspec(dllexport) MxTickleManager * TickleManager(); __declspec(dllexport) MxTimer * Timer(); +__declspec(dllexport) MxStreamer * Streamer(); +__declspec(dllexport) MxSoundManager * MSoundManager(); +__declspec(dllexport) MxVariableTable * VariableTable(); +__declspec(dllexport) MxMusicManager * MusicManager(); +__declspec(dllexport) MxEventManager * EventManager(); +__declspec(dllexport) MxNotificationManager * NotificationManager(); #endif // MXOMNI_H diff --git a/LEGO1/mxpalette.cpp b/LEGO1/mxpalette.cpp index dd245538..546dddf9 100644 --- a/LEGO1/mxpalette.cpp +++ b/LEGO1/mxpalette.cpp @@ -5,4 +5,17 @@ MxResult MxPalette::GetEntries(LPPALETTEENTRY p_entries) { memcpy(p_entries, this->m_entries, sizeof(this->m_entries)); return SUCCESS; -} \ No newline at end of file +} + +// OFFSET: LEGO1 0x100bf340 +MxBool MxPalette::operator==(MxPalette &) +{ + // TODO + return FALSE; +} + +// OFFSET: LEGO1 0x100bf330 +void MxPalette::Detach() +{ + // TODO +} diff --git a/LEGO1/mxpalette.h b/LEGO1/mxpalette.h index ab52b412..7f4a4299 100644 --- a/LEGO1/mxpalette.h +++ b/LEGO1/mxpalette.h @@ -4,12 +4,14 @@ #include #include "mxcore.h" -#include "mxresult.h" +#include "mxtypes.h" +// VTABLE 0x100dc848 +// SIZE 0x414 class MxPalette : public MxCore { public: - __declspec(dllexport) unsigned char operator==(MxPalette &); + __declspec(dllexport) MxBool operator==(MxPalette &); __declspec(dllexport) void Detach(); MxResult GetEntries(LPPALETTEENTRY p_entries); diff --git a/LEGO1/mxpresenter.cpp b/LEGO1/mxpresenter.cpp new file mode 100644 index 00000000..4629fdba --- /dev/null +++ b/LEGO1/mxpresenter.cpp @@ -0,0 +1,139 @@ +#include "mxpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxPresenter, 0x40); + +// OFFSET: LEGO1 0x1000bee0 STUB +void MxPresenter::DoneTickle() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b4d50 +void MxPresenter::Init() +{ + m_unk0x8 = 0; + m_action = NULL; + m_unk0x18 = 0; + m_unk0x3c = 0; + m_unk0xc = 0; + m_unk0x10 = 0; + m_unk0x14 = 0; +} + +// OFFSET: LEGO1 0x100b4fc0 STUB +void MxPresenter::ParseExtra() +{ + // TODO +} + +// OFFSET: LEGO1 0x1000bf00 +MxPresenter::~MxPresenter() +{ +} + +// OFFSET: LEGO1 0x100b5200 STUB +MxLong MxPresenter::Tickle() +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x100b4d80 STUB +MxLong MxPresenter::StartAction(MxStreamController *, MxDSAction *) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x100b4e40 STUB +void MxPresenter::EndAction() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b52d0 STUB +void MxPresenter::Enable(unsigned char) +{ + // TODO +} + +// OFFSET: LEGO1 0x1000be30 +void MxPresenter::VTable0x14() +{ +} + +// OFFSET: LEGO1 0x1000be40 +void MxPresenter::VTable0x18() +{ + ParseExtra(); + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = 2; +} + +// OFFSET: LEGO1 0x1000be60 +void MxPresenter::VTable0x1c() +{ + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = 3; +} + +// OFFSET: LEGO1 0x1000be80 +void MxPresenter::VTable0x20() +{ + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = 4; +} + +// OFFSET: LEGO1 0x1000bea0 +void MxPresenter::VTable0x24() +{ + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = 5; +} + +// OFFSET: LEGO1 0x1000bec0 +void MxPresenter::VTable0x28() +{ + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = 6; +} + +// OFFSET: LEGO1 0x1000bf70 +undefined4 MxPresenter::VTable0x34() +{ + return 0; +} + +// OFFSET: LEGO1 0x1000bf80 +void MxPresenter::InitVirtual() +{ + Init(); +} +// OFFSET: LEGO1 0x1000bf90 +void MxPresenter::VTable0x44(undefined4 param) +{ + m_unk0xc |= 1 << (unsigned char)m_unk0x8; + m_unk0x8 = param; +} + +// OFFSET: LEGO1 0x1000bfb0 +unsigned char MxPresenter::VTable0x48(unsigned char param) +{ + return m_unk0xc & (1 << param); +} + +// OFFSET: LEGO1 0x1000bfc0 +undefined4 MxPresenter::VTable0x4c() +{ + return 0; +} + +// OFFSET: LEGO1 0x1000bfd0 +undefined MxPresenter::VTable0x50(undefined4, undefined4) +{ + return 0; +} diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index c4890c1f..e01100c1 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -1,18 +1,70 @@ #ifndef MXPRESENTER_H #define MXPRESENTER_H -class MxPresenter +#include "mxcore.h" + +#include "mxcriticalsection.h" + +#include "decomp.h" + +class MxStreamController; +class MxDSAction; + +class MxPresenter : public MxCore { -protected: - __declspec(dllexport) virtual void DoneTickle(); - __declspec(dllexport) void Init(); - __declspec(dllexport) virtual void ParseExtra(); public: - __declspec(dllexport) virtual ~MxPresenter(); - __declspec(dllexport) virtual void Enable(unsigned char); - __declspec(dllexport) virtual void EndAction(); - __declspec(dllexport) virtual long StartAction(MxStreamController *, MxDSAction *); - __declspec(dllexport) virtual long Tickle(); + MxPresenter() { + Init(); + } + __declspec(dllexport) virtual ~MxPresenter(); // vtable+0x0 + + // OFFSET: LEGO1 0x1000bfe0 + inline virtual const char *ClassName() const override// vtable+0xc + { + // 0x100f0740 + return "MxPresenter"; + } + + // OFFSET: LEGO1 0x1000bff0 + inline virtual MxBool IsA(const char *name) const override// vtable+0x10 + { + return !strcmp(name, MxPresenter::ClassName()) || MxCore::IsA(name); + } + + __declspec(dllexport) virtual MxLong Tickle() override; // vtable+0x8 + virtual void VTable0x14(); // vtable+0x14 + virtual void VTable0x18(); // vtable+0x18 + virtual void VTable0x1c(); // vtable+0x1c + virtual void VTable0x20(); // vtable+0x20 + virtual void VTable0x24(); // vtable+0x24 + virtual void VTable0x28(); // vtable+0x28 +protected: + __declspec(dllexport) virtual void DoneTickle(); // vtable+0x2c + __declspec(dllexport) virtual void ParseExtra(); // vtable+0x30 +public: + virtual undefined4 VTable0x34(); // vtable+0x34 + virtual void InitVirtual(); // vtable+0x38 + __declspec(dllexport) virtual MxLong StartAction(MxStreamController *, MxDSAction *); // vtable+0x3c + __declspec(dllexport) virtual void EndAction(); // vtable+0x40 + virtual void VTable0x44(undefined4 param); // vtable+0x44 + virtual unsigned char VTable0x48(unsigned char param); // vtable+0x48 + virtual undefined4 VTable0x4c(); // vtable+0x4c + virtual undefined VTable0x50(undefined4, undefined4); // vtable+0x50 + __declspec(dllexport) virtual void Enable(unsigned char); // vtable+0x54 +protected: + __declspec(dllexport) void Init(); +public: + + undefined4 m_unk0x8; + undefined4 m_unk0xc; + undefined4 m_unk0x10; + undefined4 m_unk0x14; + undefined4 m_unk0x18; + MxDSAction* m_action; // 0 + MxCriticalSection m_criticalSection; + undefined4 m_unk0x3c; + + // VTABLE 0x100d4d38 }; #endif // MXPRESENTER_H diff --git a/LEGO1/mxramstreamcontroller.h b/LEGO1/mxramstreamcontroller.h new file mode 100644 index 00000000..09915cbf --- /dev/null +++ b/LEGO1/mxramstreamcontroller.h @@ -0,0 +1,12 @@ +#ifndef MXRAMSTREAMCONTROLLER_H +#define MXRAMSTREAMCONTROLLER_H + +#include "mxstreamcontroller.h" + +// VTABLE 0x100dc728 +class MxRAMStreamController : public MxStreamController +{ + +}; + +#endif // MXRAMSTREAMCONTROLLER_H diff --git a/LEGO1/mxramstreamprovider.h b/LEGO1/mxramstreamprovider.h new file mode 100644 index 00000000..5422d3b3 --- /dev/null +++ b/LEGO1/mxramstreamprovider.h @@ -0,0 +1,12 @@ +#ifndef MXRAMSTREAMPROVIDER_H +#define MXRAMSTREAMPROVIDER_H + +#include "mxstreamprovider.h" + +// VTABLE 0x100dd0d0 +class MxRAMStreamProvider : public MxStreamProvider +{ + +}; + +#endif // MXRAMSTREAMPROVIDER_H diff --git a/LEGO1/mxresult.h b/LEGO1/mxresult.h deleted file mode 100644 index 7a56f493..00000000 --- a/LEGO1/mxresult.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MXRESULT_H -#define MXRESULT_H - -typedef unsigned long MxResult; -const MxResult SUCCESS = 0; -const MxResult FAILURE = 0xFFFFFFFFL; - -#endif // MXRESULT_H diff --git a/LEGO1/mxscheduler.cpp b/LEGO1/mxscheduler.cpp new file mode 100644 index 00000000..08bcd04c --- /dev/null +++ b/LEGO1/mxscheduler.cpp @@ -0,0 +1,15 @@ +#include "mxscheduler.h" + +// OFFSET: LEGO1 0x100bf4f0 +MxScheduler *MxScheduler::GetInstance() +{ + // Intentionally empty + return 0; +} + +// OFFSET: LEGO1 0x100bf500 +void MxScheduler::StartMultiTasking(MxULong) +{ + // Intentionally empty +} + diff --git a/LEGO1/mxscheduler.h b/LEGO1/mxscheduler.h index 4f7ee387..fabb33dc 100644 --- a/LEGO1/mxscheduler.h +++ b/LEGO1/mxscheduler.h @@ -1,11 +1,13 @@ #ifndef MXSCHEDULER_H #define MXSCHEDULER_H +#include "mxtypes.h" + class MxScheduler { public: __declspec(dllexport) static MxScheduler *GetInstance(); - __declspec(dllexport) void StartMultiTasking(unsigned long); + __declspec(dllexport) void StartMultiTasking(MxULong); }; #endif // MXSCHEDULER_H diff --git a/LEGO1/mxsmkpresenter.cpp b/LEGO1/mxsmkpresenter.cpp new file mode 100644 index 00000000..cc7efec1 --- /dev/null +++ b/LEGO1/mxsmkpresenter.cpp @@ -0,0 +1,17 @@ +#include "mxsmkpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxSmkPresenter, 0x720); + +// OFFSET: LEGO1 0x100b3650 STUB +MxSmkPresenter::MxSmkPresenter() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b38d0 STUB +void MxSmkPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/mxsmkpresenter.h b/LEGO1/mxsmkpresenter.h new file mode 100644 index 00000000..325091bb --- /dev/null +++ b/LEGO1/mxsmkpresenter.h @@ -0,0 +1,21 @@ +#ifndef MXSMKPRESENTER_H +#define MXSMKPRESENTER_H + +#include "mxvideopresenter.h" + +#include "decomp.h" + +// VTABLE 0x100dc348 +// SIZE 0x720 +class MxSmkPresenter : public MxVideoPresenter +{ +public: + MxSmkPresenter(); + + undefined4 m_unk64[430]; + undefined4 m_unk71c; +private: + void Init(); +}; + +#endif // MXSMKPRESENTER_H diff --git a/LEGO1/mxsoundmanager.cpp b/LEGO1/mxsoundmanager.cpp new file mode 100644 index 00000000..275d0514 --- /dev/null +++ b/LEGO1/mxsoundmanager.cpp @@ -0,0 +1,21 @@ +#include "mxsoundmanager.h" + +// OFFSET: LEGO1 0x100ae740 +MxSoundManager::MxSoundManager() +{ + Init(); +} + +// OFFSET: LEGO1 0x100ae7d0 STUB +MxSoundManager::~MxSoundManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x100ae830 +void MxSoundManager::Init() +{ + m_unk30 = 0; + m_unk34 = 0; +} + diff --git a/LEGO1/mxsoundmanager.h b/LEGO1/mxsoundmanager.h index 7c0b0cf1..4d74fa95 100644 --- a/LEGO1/mxsoundmanager.h +++ b/LEGO1/mxsoundmanager.h @@ -1,9 +1,21 @@ #ifndef MXSOUNDMANAGER_H #define MXSOUNDMANAGER_H -class MxSoundManager +#include "mxunknown100dc6e0.h" + +// VTABLE 0x100dc128 +// SIZE 0x3c +// Base vtables are: MxCore -> 0x100dc6b0 -> 0x100dc6e0 -> MxSoundManager +class MxSoundManager : public MxUnknown100dc6e0 { - +public: + MxSoundManager(); + virtual ~MxSoundManager() override; // vtable+0x0 + +private: + void Init(); + int m_unk30; + int m_unk34; }; #endif // MXSOUNDMANAGER_H diff --git a/LEGO1/mxsoundpresenter.cpp b/LEGO1/mxsoundpresenter.cpp new file mode 100644 index 00000000..50e04ce4 --- /dev/null +++ b/LEGO1/mxsoundpresenter.cpp @@ -0,0 +1 @@ +#include "mxsoundpresenter.h" diff --git a/LEGO1/mxsoundpresenter.h b/LEGO1/mxsoundpresenter.h new file mode 100644 index 00000000..53d7000d --- /dev/null +++ b/LEGO1/mxsoundpresenter.h @@ -0,0 +1,25 @@ +#ifndef MXSOUNDPRESENTER_H +#define MXSOUNDPRESENTER_H + +#include "mxaudiopresenter.h" + +// VTABLE 0x100d4b08 +class MxSoundPresenter : public MxAudioPresenter +{ +public: + // OFFSET: LEGO1 0x1000d4a0 + inline virtual const char *ClassName() const // vtable+0x0c + { + // 0x100f07a0 + return "MxSoundPresenter"; + }; + + // OFFSET: LEGO1 0x1000d4b0 + inline virtual MxBool IsA(const char *name) const // vtable+0x10 + { + return !strcmp(name, MxSoundPresenter::ClassName()) || MxAudioPresenter::IsA(name); + }; + +}; + +#endif // MXSOUNDPRESENTER_H diff --git a/LEGO1/mxstillpresenter.cpp b/LEGO1/mxstillpresenter.cpp new file mode 100644 index 00000000..351971f0 --- /dev/null +++ b/LEGO1/mxstillpresenter.cpp @@ -0,0 +1,5 @@ +#include "mxstillpresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c); diff --git a/LEGO1/mxstillpresenter.h b/LEGO1/mxstillpresenter.h new file mode 100644 index 00000000..9b7c5810 --- /dev/null +++ b/LEGO1/mxstillpresenter.h @@ -0,0 +1,20 @@ +#ifndef MXSTILLPRESENTER_H +#define MXSTILLPRESENTER_H + +#include "mxvideopresenter.h" + +#include "decomp.h" + +// VTABLE 0x100d7a38 +// SIZE 0x6c +class MxStillPresenter : public MxVideoPresenter +{ +public: + MxStillPresenter() { + m_unk68 = 0; + } + undefined4 m_unk64; + undefined4 m_unk68; +}; + +#endif // MXSTILLPRESENTER_H diff --git a/LEGO1/mxstreamchunk.h b/LEGO1/mxstreamchunk.h new file mode 100644 index 00000000..51f1a34d --- /dev/null +++ b/LEGO1/mxstreamchunk.h @@ -0,0 +1,12 @@ +#ifndef MXSTREAMCHUNK_H +#define MXSTREAMCHUNK_H + +#include "mxdschunk.h" + +// VTABLE 0x100dc2a8 +class MxStreamChunk : public MxDSChunk +{ + +}; + +#endif // MXSTREAMCHUNK_H diff --git a/LEGO1/mxstreamcontroller.h b/LEGO1/mxstreamcontroller.h index dba24176..4ec95e9e 100644 --- a/LEGO1/mxstreamcontroller.h +++ b/LEGO1/mxstreamcontroller.h @@ -2,12 +2,25 @@ #define MXSTREAMCONTROLLER_H #include "mxatomid.h" +#include "mxcore.h" -class MxStreamController +// VTABLE 0x100dc968 +class MxStreamController : public MxCore { public: - int m_unk00; - int m_unk04; + // OFFSET: LEGO1 0x100c0f10 + inline virtual const char *ClassName() const override // vtable+0xc + { + // 0x10102130 + return "MxStreamController"; + } + + // OFFSET: LEGO1 0x100c0f20 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxStreamController::ClassName()) || MxCore::IsA(name); + } + int m_unk08; int m_unk0c; int m_unk10; diff --git a/LEGO1/mxstreamer.cpp b/LEGO1/mxstreamer.cpp new file mode 100644 index 00000000..12f51f99 --- /dev/null +++ b/LEGO1/mxstreamer.cpp @@ -0,0 +1,37 @@ +#include "mxstreamer.h" + +// OFFSET: LEGO1 0x100b91d0 STUB +MxStreamer::~MxStreamer() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b92c0 STUB +MxStreamController *MxStreamer::Open(const char *name, MxU16 p) +{ + // TODO + return NULL; +} + +// OFFSET: LEGO1 0x100b9570 STUB +MxLong MxStreamer::Close(const char *p) +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x100b9b60 STUB +MxLong MxStreamer::Notify(MxParam &p) +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x100b9190 STUB +MxResult MxStreamer::VTable0x14() +{ + // TODO + + return MxResult(); +} diff --git a/LEGO1/mxstreamer.h b/LEGO1/mxstreamer.h index 785c475b..f14ac66d 100644 --- a/LEGO1/mxstreamer.h +++ b/LEGO1/mxstreamer.h @@ -1,14 +1,21 @@ #ifndef MXSTREAMER_H #define MXSTREAMER_H +#include "mxcore.h" #include "mxstreamcontroller.h" +#include "mxtypes.h" -class MxStreamer +// VTABLE 0x100dc710 +class MxStreamer : public MxCore { public: - __declspec(dllexport) MxStreamController *Open(const char *name, unsigned short p); - __declspec(dllexport) long Close(const char *p); + virtual ~MxStreamer() override; + __declspec(dllexport) MxStreamController *Open(const char *name, MxU16 p); + __declspec(dllexport) MxLong Close(const char *p); + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + virtual MxResult VTable0x14(); // vtable+0x14 }; #endif // MXSTREAMER_H diff --git a/LEGO1/mxstreamprovider.h b/LEGO1/mxstreamprovider.h new file mode 100644 index 00000000..796d0ed3 --- /dev/null +++ b/LEGO1/mxstreamprovider.h @@ -0,0 +1,23 @@ +#ifndef MXSTREAMPROVIDER_H +#define MXSTREAMPROVIDER_H + +#include "mxcore.h" + +// VTABLE 0x100dd100 +class MxStreamProvider : public MxCore +{ +public: + // OFFSET: LEGO1 0x100d07e0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + return "MxStreamProvider"; + } + + // OFFSET: LEGO1 0x100d07f0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxStreamProvider::ClassName()) || MxCore::IsA(name); + } +}; + +#endif // MXSTREAMPROVIDER_H diff --git a/LEGO1/mxstring.cpp b/LEGO1/mxstring.cpp index 09130a39..e2f24cab 100644 --- a/LEGO1/mxstring.cpp +++ b/LEGO1/mxstring.cpp @@ -6,7 +6,7 @@ MxString::MxString() { // Set string to one char in length and set that char to null terminator - this->m_data = (char *)malloc(1); + this->m_data = new char[1]; this->m_data[0] = 0; this->m_length = 0; } @@ -15,7 +15,7 @@ MxString::MxString() MxString::MxString(const MxString &str) { this->m_length = str.m_length; - this->m_data = (char *)malloc(this->m_length + 1); + this->m_data = new char[this->m_length + 1]; strcpy(this->m_data, str.m_data); } @@ -24,10 +24,10 @@ MxString::MxString(const char *str) { if (str) { this->m_length = strlen(str); - this->m_data = (char *)malloc(this->m_length + 1); + this->m_data = new char[this->m_length + 1]; strcpy(this->m_data, str); } else { - this->m_data = (char *)malloc(1); + this->m_data = new char[1]; this->m_data[0] = 0; this->m_length = 0; } @@ -36,7 +36,7 @@ MxString::MxString(const char *str) // OFFSET: LEGO1 0x100ae420 MxString::~MxString() { - free(this->m_data); + delete[] this->m_data; } // OFFSET: LEGO1 0x100ae490 @@ -52,30 +52,63 @@ void MxString::ToLowerCase() } // OFFSET: LEGO1 0x100ae4b0 -const MxString &MxString::operator=(MxString *param) +MxString &MxString::operator=(MxString *param) { if (this->m_data != param->m_data) { - free(this->m_data); + delete[] this->m_data; this->m_length = param->m_length; - this->m_data = (char *)malloc(this->m_length + 1); + this->m_data = new char[this->m_length + 1]; strcpy(this->m_data, param->m_data); } return *this; } -// TODO: this *mostly* matches, again weird with the comparison // OFFSET: LEGO1 0x100ae510 const MxString &MxString::operator=(const char *param) { if (this->m_data != param) { - free(this->m_data); + delete[] this->m_data; this->m_length = strlen(param); - this->m_data = (char *)malloc(this->m_length + 1); + this->m_data = new char[this->m_length + 1]; strcpy(this->m_data, param); } return *this; } + +// Return type is intentionally just MxString, not MxString&. +// This forces MSVC to add $ReturnUdt$ to the stack for 100% match. +// OFFSET: LEGO1 0x100ae580 +MxString MxString::operator+(const char *str) +{ + // MxString constructor allocates 1 byte for m_data, so free that first + MxString tmp; + delete[] tmp.m_data; + + tmp.m_length = strlen(str) + this->m_length; + tmp.m_data = new char[tmp.m_length + 1]; + + strcpy(tmp.m_data, this->m_data); + strcpy(tmp.m_data + this->m_length, str); + + return MxString(tmp); +} + +// OFFSET: LEGO1 0x100ae690 +MxString& MxString::operator+=(const char *str) +{ + int newlen = this->m_length + strlen(str); + + char *tmp = new char[newlen + 1]; + strcpy(tmp, this->m_data); + strcpy(tmp + this->m_length, str); + + delete[] this->m_data; + this->m_length = newlen; + this->m_data = tmp; + + return *this; +} diff --git a/LEGO1/mxstring.h b/LEGO1/mxstring.h index a9a25ba1..a24a0df1 100644 --- a/LEGO1/mxstring.h +++ b/LEGO1/mxstring.h @@ -3,6 +3,7 @@ #include "mxcore.h" +// VTABLE 0x100dc110 class MxString : public MxCore { public: @@ -14,13 +15,15 @@ class MxString : public MxCore MxString(const char *); void ToUpperCase(); void ToLowerCase(); - const MxString &operator=(MxString *); + MxString& operator=(MxString *); + MxString operator+(const char *); + MxString& operator+=(const char *); inline const char *GetData() const { return m_data; } private: char *m_data; - unsigned short m_length; + MxU16 m_length; }; diff --git a/LEGO1/mxstringvariable.cpp b/LEGO1/mxstringvariable.cpp new file mode 100644 index 00000000..e63329c1 --- /dev/null +++ b/LEGO1/mxstringvariable.cpp @@ -0,0 +1,22 @@ +#include "mxstringvariable.h" +#include "mxstring.h" + + +// OFFSET: LEGO1 0x1003bea0 +MxString *MxStringVariable::GetString() +{ + return &m_string; +} + +// OFFSET: LEGO1 0x1003beb0 +void MxStringVariable::SetString(const char *colorString) +{ + m_string = colorString; +} + +//FIXME: Figure out what exactly this class is used for. It is used in LegoGameState::LegoGameState when loading the background color, and for loading the "fsmovie" variable +// OFFSET: LEGO1 0x1003bec0 +void MxStringVariable::Destroy() +{ + delete this; +} diff --git a/LEGO1/mxstringvariable.h b/LEGO1/mxstringvariable.h new file mode 100644 index 00000000..dd623dfb --- /dev/null +++ b/LEGO1/mxstringvariable.h @@ -0,0 +1,20 @@ +#ifndef MXSTRINGVARIABLE_H +#define MXSTRINGVARIABLE_H +#include "mxstring.h" +#include "mxcore.h" +//VTABLE: 0x100d74a8 +class MxStringVariable +{ +public: + __declspec(dllexport) MxStringVariable(const char *, const char *); + MxStringVariable() {} + virtual MxString *GetString(); + virtual void SetString(const char *colorString); + virtual void Destroy(); + +protected: + MxString m_name; + MxString m_string; +}; + +#endif // MXSTRINGVARIABLE_H diff --git a/LEGO1/mxticklemanager.h b/LEGO1/mxticklemanager.h index 24600dca..60f2f14d 100644 --- a/LEGO1/mxticklemanager.h +++ b/LEGO1/mxticklemanager.h @@ -3,12 +3,13 @@ #include "mxcore.h" +// VTABLE 0x100d86d8 class MxTickleManager : public MxCore { public: virtual ~MxTickleManager(); - virtual long Tickle(); + virtual MxLong Tickle(); virtual const char *ClassName() const; virtual MxBool IsA(const char *name) const; virtual void vtable14(); diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp index 47afaa03..0d5752d6 100644 --- a/LEGO1/mxtimer.cpp +++ b/LEGO1/mxtimer.cpp @@ -3,10 +3,10 @@ #include // 0x10101414 -long MxTimer::s_LastTimeCalculated = 0; +MxLong MxTimer::s_LastTimeCalculated = 0; // 0x10101418 -long MxTimer::s_LastTimeTimerStarted = 0; +MxLong MxTimer::s_LastTimeTimerStarted = 0; // OFFSET: LEGO1 0x100ae060 MxTimer::MxTimer() @@ -27,15 +27,15 @@ void MxTimer::Start() // OFFSET: LEGO1 0x100ae180 void MxTimer::Stop() { - long elapsed = this->GetRealTime(); - long startTime = elapsed - MxTimer::s_LastTimeTimerStarted; + MxLong elapsed = this->GetRealTime(); + MxLong startTime = elapsed - MxTimer::s_LastTimeTimerStarted; this->m_isRunning = FALSE; // this feels very stupid but it's what the assembly does this->m_startTime = this->m_startTime + startTime - 5; } // OFFSET: LEGO1 0x100ae140 -long MxTimer::GetRealTime() +MxLong MxTimer::GetRealTime() { MxTimer::s_LastTimeCalculated = timeGetTime(); return MxTimer::s_LastTimeCalculated - this->m_startTime; diff --git a/LEGO1/mxtimer.h b/LEGO1/mxtimer.h index 8f35d205..1714e8e1 100644 --- a/LEGO1/mxtimer.h +++ b/LEGO1/mxtimer.h @@ -3,6 +3,8 @@ #include "mxcore.h" +// VTABLE 0x100dc0e0 +// SIZE 0x10 class MxTimer : public MxCore { public: @@ -11,9 +13,9 @@ class MxTimer : public MxCore void Start(); void Stop(); - __declspec(dllexport) long GetRealTime(); + __declspec(dllexport) MxLong GetRealTime(); - long GetTime() inline + inline MxLong GetTime() { if (this->m_isRunning) return s_LastTimeCalculated; @@ -22,10 +24,10 @@ class MxTimer : public MxCore } private: - long m_startTime; + MxLong m_startTime; MxBool m_isRunning; - static long s_LastTimeCalculated; - static long s_LastTimeTimerStarted; + static MxLong s_LastTimeCalculated; + static MxLong s_LastTimeTimerStarted; }; #endif // MXTIMER_H diff --git a/LEGO1/mxtransitionmanager.cpp b/LEGO1/mxtransitionmanager.cpp new file mode 100644 index 00000000..8af3f497 --- /dev/null +++ b/LEGO1/mxtransitionmanager.cpp @@ -0,0 +1,27 @@ +#include "mxtransitionmanager.h" + +// OFFSET: LEGO1 0x1004b8d0 STUB +MxTransitionManager::MxTransitionManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1004ba00 STUB +MxTransitionManager::~MxTransitionManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x1004bac0 STUB +MxLong MxTransitionManager::Tickle() +{ + // TODO + + return 0; +} + +// OFFSET: LEGO1 0x1004c470 STUB +void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *videoPresenter) +{ + // TODO +} diff --git a/LEGO1/mxtransitionmanager.h b/LEGO1/mxtransitionmanager.h index 904070b9..c6cc28aa 100644 --- a/LEGO1/mxtransitionmanager.h +++ b/LEGO1/mxtransitionmanager.h @@ -1,12 +1,20 @@ #ifndef MXTRANSITIONMANAGER_H #define MXTRANSITIONMANAGER_H +#include "mxcore.h" + class MxVideoPresenter; -class MxTransitionManager +// 0x100d7ea0 +class MxTransitionManager : public MxCore { public: + MxTransitionManager(); + virtual ~MxTransitionManager() override; // vtable+0x0 + __declspec(dllexport) void SetWaitIndicator(MxVideoPresenter *videoPresenter); + + virtual MxLong Tickle(); // vtable+0x8 }; #endif // MXTRANSITIONMANAGER_H diff --git a/LEGO1/mxtypes.h b/LEGO1/mxtypes.h index f6e23970..8a7d5026 100644 --- a/LEGO1/mxtypes.h +++ b/LEGO1/mxtypes.h @@ -2,13 +2,34 @@ #define MXTYPE_H typedef unsigned char MxU8; -typedef char MxS8; +typedef signed char MxS8; typedef unsigned short MxU16; -typedef short MxS16; +typedef signed short MxS16; typedef unsigned int MxU32; -typedef int MxS32; +typedef signed int MxS32; +typedef unsigned __int64 MxU64; +typedef signed __int64 MxS64; +typedef float MxFloat; +typedef double MxDouble; -typedef unsigned char MxBool; +// On MSVC, a long is 32-bit, but on GCC/Clang, it's 64-bit. LEGO Island obviously +// assumes the former in all cases, which could become an issue in the future. +// The "longs" can't all be changed to "ints" (which are 32-bit on both) because +// this will break DLL export compatibility. Therefore, we define MxLong/MxULong, +// which is guaranteed to be 32-bit, and guaranteed to be a "long" on MSVC. +#if defined(_MSC_VER) +typedef long MxLong; +typedef unsigned long MxULong; +#else +typedef int MxLong; +typedef unsigned int MxULong; +#endif + +typedef MxLong MxResult; +const MxResult SUCCESS = 0; +const MxResult FAILURE = -1; + +typedef MxU8 MxBool; #ifndef TRUE #define TRUE 1 @@ -18,4 +39,8 @@ typedef unsigned char MxBool; #define FALSE 0 #endif -#endif MXTYPE_H +#if defined(_MSC_VER) && _MSC_VER <= 1200 // 1200 corresponds to VC6.0 but "override" was probably added even later +#define override +#endif + +#endif // MXTYPE_H diff --git a/LEGO1/mxunknown100dc6b0.cpp b/LEGO1/mxunknown100dc6b0.cpp index e3125cef..b896fa10 100644 --- a/LEGO1/mxunknown100dc6b0.cpp +++ b/LEGO1/mxunknown100dc6b0.cpp @@ -6,10 +6,16 @@ MxUnknown100dc6b0::MxUnknown100dc6b0() Init(); } +// OFFSET: LEGO1 0x100b8560 STUB +MxUnknown100dc6b0::~MxUnknown100dc6b0() +{ + // TODO +} + // OFFSET: LEGO1 0x100b85d0 MxResult MxUnknown100dc6b0::Init() { this->m_unk08 = 0; this->m_unk0c = 0; return SUCCESS; -} \ No newline at end of file +} diff --git a/LEGO1/mxunknown100dc6b0.h b/LEGO1/mxunknown100dc6b0.h index 87779eaf..29d42209 100644 --- a/LEGO1/mxunknown100dc6b0.h +++ b/LEGO1/mxunknown100dc6b0.h @@ -2,13 +2,15 @@ #define MXUNKNOWN100DC6B0_H #include "mxcore.h" -#include "mxresult.h" #include "mxcriticalsection.h" +#include "mxtypes.h" +// VTABLE 0x100dc6b0 class MxUnknown100dc6b0 : public MxCore { public: MxUnknown100dc6b0(); + virtual ~MxUnknown100dc6b0() override; MxResult Init(); diff --git a/LEGO1/mxunknown100dc6e0.cpp b/LEGO1/mxunknown100dc6e0.cpp new file mode 100644 index 00000000..b896e89b --- /dev/null +++ b/LEGO1/mxunknown100dc6e0.cpp @@ -0,0 +1,19 @@ +#include "mxunknown100dc6e0.h" + +// OFFSET: LEGO1 0x100b8d00 +MxUnknown100dc6e0::MxUnknown100dc6e0() +{ + Init(); +} + +// OFFSET: LEGO1 0x100b8d90 STUB +MxUnknown100dc6e0::~MxUnknown100dc6e0() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b8df0 +void MxUnknown100dc6e0::Init() +{ + this->m_unk2c = 100; +} diff --git a/LEGO1/mxunknown100dc6e0.h b/LEGO1/mxunknown100dc6e0.h new file mode 100644 index 00000000..79c63bab --- /dev/null +++ b/LEGO1/mxunknown100dc6e0.h @@ -0,0 +1,19 @@ +#ifndef MXUNKNOWN100DC6E0_H +#define MXUNKNOWN100DC6E0_H + +#include "mxunknown100dc6b0.h" + +// VTABLE 0x100dc6e0 +class MxUnknown100dc6e0 : public MxUnknown100dc6b0 +{ +public: + MxUnknown100dc6e0(); + virtual ~MxUnknown100dc6e0() override; + +protected: + void Init(); + + int m_unk2c; +}; + +#endif // MXUNKNOWN100DC6E0_H diff --git a/LEGO1/mxvariabletable.cpp b/LEGO1/mxvariabletable.cpp new file mode 100644 index 00000000..8927bc32 --- /dev/null +++ b/LEGO1/mxvariabletable.cpp @@ -0,0 +1,20 @@ +#include "mxvariabletable.h" + +// OFFSET: LEGO1 0x100b73a0 +void MxVariableTable::SetVariable(const char *key, const char *value) +{ + // TODO +} + +// OFFSET: LEGO1 0x100b7740 +void MxVariableTable::SetVariable(MxVariable *var) +{ + // TODO +} + +// OFFSET: LEGO1 0x100b78f0 +const char *MxVariableTable::GetVariable(const char *key) +{ + // TODO + return 0; +} diff --git a/LEGO1/mxvariabletable.h b/LEGO1/mxvariabletable.h index a82b25c4..13c70658 100644 --- a/LEGO1/mxvariabletable.h +++ b/LEGO1/mxvariabletable.h @@ -3,6 +3,8 @@ class MxVariable; +// VTABLE 0x100dc1c8 +// SIZE 0x28 class MxVariableTable { public: diff --git a/LEGO1/mxvideomanager.cpp b/LEGO1/mxvideomanager.cpp index 7c1625d1..543f4136 100644 --- a/LEGO1/mxvideomanager.cpp +++ b/LEGO1/mxvideomanager.cpp @@ -1,5 +1,19 @@ #include "mxvideomanager.h" +// OFFSET: LEGO1 0x100be2a0 STUB +MxVideoManager::~MxVideoManager() +{ + // TODO +} + +// OFFSET: LEGO1 0x100bea90 STUB +MxLong MxVideoManager::Tickle() +{ + // TODO + + return 0; +} + // OFFSET: LEGO1 0x100be1f0 MxVideoManager::MxVideoManager() { @@ -18,8 +32,14 @@ int MxVideoManager::Init() return 0; } +// OFFSET: LEGO1 0x100bea60 STUB +void MxVideoManager::InvalidateRect(MxRect32 &p_rect) +{ + // TODO +} + // OFFSET: LEGO1 0x100bebe0 -long MxVideoManager::RealizePalette(MxPalette *p_palette) +MxLong MxVideoManager::RealizePalette(MxPalette *p_palette) { PALETTEENTRY paletteEntries[256]; diff --git a/LEGO1/mxvideomanager.h b/LEGO1/mxvideomanager.h index eba332f3..f70bf06e 100644 --- a/LEGO1/mxvideomanager.h +++ b/LEGO1/mxvideomanager.h @@ -4,11 +4,17 @@ #include "mxunknown100dc6b0.h" #include "mxvideoparam.h" +// VTABLE 0x100dc810 +// SIZE 0x64 class MxVideoManager : public MxUnknown100dc6b0 { public: + virtual ~MxVideoManager(); + + virtual MxLong Tickle(); // vtable+0x8 + __declspec(dllexport) void InvalidateRect(MxRect32 &); - __declspec(dllexport) virtual long RealizePalette(MxPalette *); + __declspec(dllexport) virtual MxLong RealizePalette(MxPalette *); // vtable+0x30 MxVideoManager(); diff --git a/LEGO1/mxvideoparam.cpp b/LEGO1/mxvideoparam.cpp index b72107c7..6f74f7a9 100644 --- a/LEGO1/mxvideoparam.cpp +++ b/LEGO1/mxvideoparam.cpp @@ -17,7 +17,7 @@ MxVideoParam::MxVideoParam() } // OFFSET: LEGO1 0x100beca0 -MxVideoParam::MxVideoParam(MxRect32 &p_rect, MxPalette *p_pal, unsigned long p_backBuffers, MxVideoParamFlags &p_flags) +MxVideoParam::MxVideoParam(COMPAT_CONST MxRect32 &p_rect, MxPalette *p_pal, MxULong p_backBuffers, COMPAT_CONST MxVideoParamFlags &p_flags) { this->m_rect.m_left = p_rect.m_left; this->m_rect.m_top = p_rect.m_top; diff --git a/LEGO1/mxvideoparam.h b/LEGO1/mxvideoparam.h index 3e00a920..2376e5db 100644 --- a/LEGO1/mxvideoparam.h +++ b/LEGO1/mxvideoparam.h @@ -3,6 +3,7 @@ #include +#include "compat.h" #include "mxpalette.h" #include "mxrect32.h" #include "mxtypes.h" @@ -14,7 +15,7 @@ class MxVideoParam public: __declspec(dllexport) MxVideoParam(); __declspec(dllexport) MxVideoParam(MxVideoParam &); - __declspec(dllexport) MxVideoParam(MxRect32 &rect, MxPalette *pal, unsigned long p3, MxVideoParamFlags &flags); + __declspec(dllexport) MxVideoParam(COMPAT_CONST MxRect32 &rect, MxPalette *pal, MxULong p3, COMPAT_CONST MxVideoParamFlags &flags); __declspec(dllexport) MxVideoParam &operator=(const MxVideoParam &); __declspec(dllexport) ~MxVideoParam(); diff --git a/LEGO1/mxvideopresenter.cpp b/LEGO1/mxvideopresenter.cpp new file mode 100644 index 00000000..4e47e4a4 --- /dev/null +++ b/LEGO1/mxvideopresenter.cpp @@ -0,0 +1,9 @@ +#include "mxvideopresenter.h" + +DECOMP_SIZE_ASSERT(MxVideoPresenter, 0x64); + +// OFFSET: LEGO1 0x100b2760 STUB +void MxVideoPresenter::Init() +{ + // TODO +} diff --git a/LEGO1/mxvideopresenter.h b/LEGO1/mxvideopresenter.h new file mode 100644 index 00000000..19c211c3 --- /dev/null +++ b/LEGO1/mxvideopresenter.h @@ -0,0 +1,39 @@ +#ifndef MXVIDEOPRESENTER_H +#define MXVIDEOPRESENTER_H + +#include "mxmediapresenter.h" + +#include "decomp.h" + +class MxVideoPresenter : public MxMediaPresenter +{ +public: + MxVideoPresenter() + { + Init(); + } + + // OFFSET: LEGO1 0x1000c820 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0760 + return "MxVideoPresenter"; + } + + // OFFSET: LEGO1 0x1000c830 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, MxVideoPresenter::ClassName()) || MxMediaPresenter::IsA(name); + } + + void Init(); + + undefined4 m_unk50; + undefined4 m_unk54; + undefined4 m_unk58; + undefined2 m_unk5c; + unsigned char m_flags; + undefined4 m_unk60; +}; + +#endif // MXVIDEOPRESENTER_H diff --git a/LEGO1/mxwavepresenter.cpp b/LEGO1/mxwavepresenter.cpp new file mode 100644 index 00000000..cba9106e --- /dev/null +++ b/LEGO1/mxwavepresenter.cpp @@ -0,0 +1,18 @@ +#include "mxwavepresenter.h" + +#include "decomp.h" + +DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c); + +// OFFSET: LEGO1 0x100b1ad0 +void MxWavePresenter::Init() +{ + m_unk54 = 0; + m_unk58 = 0; + m_unk5c = 0; + m_unk60 = 0; + m_unk64 = 0; + m_unk65 = 0; + m_unk66 = 0; + m_unk68 = 0; +} diff --git a/LEGO1/mxwavepresenter.h b/LEGO1/mxwavepresenter.h new file mode 100644 index 00000000..a8a1de45 --- /dev/null +++ b/LEGO1/mxwavepresenter.h @@ -0,0 +1,30 @@ +#ifndef MXWAVEPRESENTER_H +#define MXWAVEPRESENTER_H + +#include "mxsoundpresenter.h" + +#include "decomp.h" + +// VTABLE 0x100d49a8 +// SIZE 0x6c +class MxWavePresenter : public MxSoundPresenter +{ +private: + void Init(); + +public: + MxWavePresenter() { + Init(); + } + undefined4 m_unk54; + undefined4 m_unk58; + undefined4 m_unk5c; + undefined4 m_unk60; + undefined m_unk64; + undefined m_unk65; + undefined m_unk66; + undefined m_unk67; + undefined m_unk68; +}; + +#endif // MXWAVEPRESENTER_H diff --git a/LEGO1/pizza.cpp b/LEGO1/pizza.cpp new file mode 100644 index 00000000..e7e9c552 --- /dev/null +++ b/LEGO1/pizza.cpp @@ -0,0 +1,13 @@ +#include "pizza.h" + +// OFFSET: LEGO1 0x10037ef0 STUB +Pizza::Pizza() +{ + // TODO +} + +// OFFSET: LEGO1 0x10038100 STUB +Pizza::~Pizza() +{ + // TODO +} diff --git a/LEGO1/pizza.h b/LEGO1/pizza.h new file mode 100644 index 00000000..c47ef40e --- /dev/null +++ b/LEGO1/pizza.h @@ -0,0 +1,16 @@ +#ifndef PIZZA_H +#define PIZZA_H + +#include "isleactor.h" + +// VTABLE 0x100d7380 +// SIZE 0x9c +class Pizza : public IsleActor +{ +public: + Pizza(); + virtual ~Pizza() override; + +}; + +#endif // PIZZA_H diff --git a/LEGO1/pizzamissionstate.cpp b/LEGO1/pizzamissionstate.cpp new file mode 100644 index 00000000..5dc85dcc --- /dev/null +++ b/LEGO1/pizzamissionstate.cpp @@ -0,0 +1 @@ +#include "pizzamissionstate.h" diff --git a/LEGO1/pizzamissionstate.h b/LEGO1/pizzamissionstate.h new file mode 100644 index 00000000..575c4972 --- /dev/null +++ b/LEGO1/pizzamissionstate.h @@ -0,0 +1,25 @@ +#ifndef PIZZAMISSIONSTATE_H +#define PIZZAMISSIONSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d7408 +class PizzaMissionState : public LegoState +{ +public: + // OFFSET: LEGO1 0x10039290 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f00d4 + return "PizzaMissionState"; + } + + // OFFSET: LEGO1 0x100392a0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, PizzaMissionState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // PIZZAMISSIONSTATE_H diff --git a/LEGO1/pizzeria.cpp b/LEGO1/pizzeria.cpp new file mode 100644 index 00000000..3b6e8d41 --- /dev/null +++ b/LEGO1/pizzeria.cpp @@ -0,0 +1 @@ +#include "pizzeria.h" diff --git a/LEGO1/pizzeria.h b/LEGO1/pizzeria.h new file mode 100644 index 00000000..54f1a200 --- /dev/null +++ b/LEGO1/pizzeria.h @@ -0,0 +1,13 @@ +#ifndef PIZZERIASTATE_H +#define PIZZERIASTATE_H + +#include "isleactor.h" + +// VTABLE 0x100d5520 +// SIZE 0x84 +class Pizzeria : public IsleActor +{ +public: +}; + +#endif // PIZZERIASTATE_H diff --git a/LEGO1/pizzeriastate.cpp b/LEGO1/pizzeriastate.cpp new file mode 100644 index 00000000..85f8aef0 --- /dev/null +++ b/LEGO1/pizzeriastate.cpp @@ -0,0 +1,7 @@ +#include "pizzeriastate.h" + +// OFFSET: LEGO1 0x10017af0 STUB +PizzeriaState::PizzeriaState() +{ + // TODO +} diff --git a/LEGO1/pizzeriastate.h b/LEGO1/pizzeriastate.h new file mode 100644 index 00000000..70b1f127 --- /dev/null +++ b/LEGO1/pizzeriastate.h @@ -0,0 +1,15 @@ +#ifndef PIZZERIASTATE_H +#define PIZZERIASTATE_H + +#include "legostate.h" + +// VTABLE 0x100d5ee8 +// SIZE 0xb4 +class PizzeriaState : public LegoState +{ +public: + PizzeriaState(); + +}; + +#endif // PIZZERIASTATE_H diff --git a/LEGO1/police.cpp b/LEGO1/police.cpp new file mode 100644 index 00000000..37f10295 --- /dev/null +++ b/LEGO1/police.cpp @@ -0,0 +1,21 @@ +#include "police.h" + +// OFFSET: LEGO1 0x1005e130 STUB +Police::Police() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005e320 STUB +Police::~Police() +{ + // TODO +} + +// OFFSET: LEGO1 0x1005e480 STUB +MxLong Police::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/police.h b/LEGO1/police.h new file mode 100644 index 00000000..8ff6dff9 --- /dev/null +++ b/LEGO1/police.h @@ -0,0 +1,19 @@ +#ifndef POLICE_H +#define POLICE_H + +#include "legoworld.h" + +// VTABLE 0x100d8a80 +// SIZE 0x110 +// Radio at 0xf8 +class Police : public LegoWorld +{ +public: + Police(); + virtual ~Police() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + +}; + +#endif // POLICE_H diff --git a/LEGO1/policeentity.cpp b/LEGO1/policeentity.cpp new file mode 100644 index 00000000..b4492be5 --- /dev/null +++ b/LEGO1/policeentity.cpp @@ -0,0 +1 @@ +#include "policeentity.h" diff --git a/LEGO1/policeentity.h b/LEGO1/policeentity.h new file mode 100644 index 00000000..a23cced4 --- /dev/null +++ b/LEGO1/policeentity.h @@ -0,0 +1,13 @@ +#ifndef POLICEENTITY_H +#define POLICEENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d4ab0 +// SIZE 0x68 +class PoliceEntity : public BuildingEntity +{ + +}; + +#endif // POLICEENTITY_H diff --git a/LEGO1/policestate.cpp b/LEGO1/policestate.cpp new file mode 100644 index 00000000..e0995f35 --- /dev/null +++ b/LEGO1/policestate.cpp @@ -0,0 +1,7 @@ +#include "policestate.h" + +// OFFSET: LEGO1 0x1005e7c0 STUB +PoliceState::PoliceState() +{ + // TODO +} diff --git a/LEGO1/policestate.h b/LEGO1/policestate.h new file mode 100644 index 00000000..e43b5c5a --- /dev/null +++ b/LEGO1/policestate.h @@ -0,0 +1,27 @@ +#ifndef POLICESTATE_H +#define POLICESTATE_H + +#include "legostate.h" + +// VTABLE 0x100d8af0 +// SIZE 0x10 +class PoliceState : public LegoState +{ +public: + PoliceState(); + + // OFFSET: LEGO1 0x1005e860 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0444 + return "PoliceState"; + } + + // OFFSET: LEGO1 0x1005e870 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, PoliceState::ClassName()) || LegoState::IsA(name); + } +}; + +#endif // POLICESTATE_H diff --git a/LEGO1/racecar.cpp b/LEGO1/racecar.cpp new file mode 100644 index 00000000..59bb5146 --- /dev/null +++ b/LEGO1/racecar.cpp @@ -0,0 +1,13 @@ +#include "racecar.h" + +// OFFSET: LEGO1 0x10028200 STUB +RaceCar::RaceCar() +{ + // TODO +} + +// OFFSET: LEGO1 0x10028420 STUB +RaceCar::~RaceCar() +{ + // TODO +} diff --git a/LEGO1/racecar.h b/LEGO1/racecar.h new file mode 100644 index 00000000..f8bd6ccf --- /dev/null +++ b/LEGO1/racecar.h @@ -0,0 +1,15 @@ +#ifndef RACECAR_H +#define RACECAR_H + +#include "islepathactor.h" + +// VTABLE 0x100d6918 +// SIZE 0x164 +class RaceCar : public IslePathActor +{ +public: + RaceCar(); + virtual ~RaceCar() override; // vtable+0x0 +}; + +#endif // RACECAR_H diff --git a/LEGO1/racestandsentity.cpp b/LEGO1/racestandsentity.cpp new file mode 100644 index 00000000..13e65bb4 --- /dev/null +++ b/LEGO1/racestandsentity.cpp @@ -0,0 +1 @@ +#include "racestandsentity.h" diff --git a/LEGO1/racestandsentity.h b/LEGO1/racestandsentity.h new file mode 100644 index 00000000..cbf0946c --- /dev/null +++ b/LEGO1/racestandsentity.h @@ -0,0 +1,12 @@ +#ifndef RACESTANDSENTITY_H +#define RACESTANDSENTITY_H + +#include "buildingentity.h" + +// VTABLE 0x100d48a8 +// SIZE 0x68 +class RaceStandsEntity : public BuildingEntity +{ +}; + +#endif // RACESTANDSENTITY_H diff --git a/LEGO1/racestate.cpp b/LEGO1/racestate.cpp new file mode 100644 index 00000000..4eeb21b7 --- /dev/null +++ b/LEGO1/racestate.cpp @@ -0,0 +1,7 @@ +#include "racestate.h" + +// OFFSET: LEGO1 0x10015f30 STUB +RaceState::RaceState() +{ + // TODO +} diff --git a/LEGO1/racestate.h b/LEGO1/racestate.h new file mode 100644 index 00000000..b9415051 --- /dev/null +++ b/LEGO1/racestate.h @@ -0,0 +1,28 @@ +#ifndef RACESTATE_H +#define RACESTATE_H + +#include "legostate.h" + +// VTABLE 0x100d5e30 +// SIZE probably 0x2c +class RaceState : public LegoState +{ +public: + RaceState(); + + // OFFSET: LEGO1 0x10016010 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f07d0 + return "RaceState"; + } + + // OFFSET: LEGO1 0x10016020 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, RaceState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // RACESTATE_H diff --git a/LEGO1/radio.cpp b/LEGO1/radio.cpp new file mode 100644 index 00000000..935fb141 --- /dev/null +++ b/LEGO1/radio.cpp @@ -0,0 +1,7 @@ +#include "radio.h" + +// OFFSET: LEGO1 0x1002c990 STUB +Radio::~Radio() +{ + // TODO +} \ No newline at end of file diff --git a/LEGO1/radio.h b/LEGO1/radio.h new file mode 100644 index 00000000..83b3a445 --- /dev/null +++ b/LEGO1/radio.h @@ -0,0 +1,14 @@ +#ifndef RADIO_H +#define RADIO_H + +#include "mxcore.h" + +// VTABLE 0x100d6d10 +class Radio : public MxCore +{ +public: + virtual ~Radio() override; + +}; + +#endif // RADIO_H diff --git a/LEGO1/radiostate.cpp b/LEGO1/radiostate.cpp new file mode 100644 index 00000000..e6ce8782 --- /dev/null +++ b/LEGO1/radiostate.cpp @@ -0,0 +1,7 @@ +#include "radiostate.h" + +// OFFSET: LEGO1 0x1002ce10 STUB +RadioState::RadioState() +{ + // TODO +} diff --git a/LEGO1/radiostate.h b/LEGO1/radiostate.h new file mode 100644 index 00000000..99c1c925 --- /dev/null +++ b/LEGO1/radiostate.h @@ -0,0 +1,28 @@ +#ifndef RADIOSTATE_H +#define RADIOSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d6d28 +// SIZE 0x30 +class RadioState : public LegoState +{ +public: + RadioState(); + + // OFFSET: LEGO1 0x1002cf60 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f04f8 + return "RadioState"; + } + + // OFFSET: LEGO1 0x1002cf70 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, RadioState::ClassName()) || LegoState::IsA(name); + } + +}; + +#endif // RADIOSTATE_H diff --git a/LEGO1/realtimeview.cpp b/LEGO1/realtimeview.cpp new file mode 100644 index 00000000..35be5b0e --- /dev/null +++ b/LEGO1/realtimeview.cpp @@ -0,0 +1,32 @@ +#include "realtimeview.h" + +// 0x10101048 +float g_userMaxLod = 3.6f; + +// 0x1010104c +float g_partsThreshold = 1000.0f; + +// OFFSET: LEGO1 0x100a5e00 +float RealtimeView::GetUserMaxLOD() +{ + // TODO + return 0; +} + +// OFFSET: LEGO1 0x100a5e10 +float RealtimeView::GetPartsThreshold() +{ + return g_partsThreshold; +} + +// OFFSET: LEGO1 0x100a5de0 +void RealtimeView::SetUserMaxLOD(float p_lod) +{ + g_userMaxLod = p_lod; +} + +// OFFSET: LEGO1 0x100a5df0 +void RealtimeView::SetPartsThreshold(float p_threshold) +{ + g_partsThreshold = p_threshold; +} diff --git a/LEGO1/registrationbook.cpp b/LEGO1/registrationbook.cpp new file mode 100644 index 00000000..dc03a327 --- /dev/null +++ b/LEGO1/registrationbook.cpp @@ -0,0 +1,21 @@ +#include "registrationbook.h" + +// OFFSET: LEGO1 0x10076d20 STUB +RegistrationBook::RegistrationBook() +{ + // TODO +} + +// OFFSET: LEGO1 0x10076f50 STUB +RegistrationBook::~RegistrationBook() +{ + // TODO +} + +// OFFSET: LEGO1 0x100770e0 STUB +MxLong RegistrationBook::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/registrationbook.h b/LEGO1/registrationbook.h new file mode 100644 index 00000000..a8219569 --- /dev/null +++ b/LEGO1/registrationbook.h @@ -0,0 +1,18 @@ +#ifndef REGISTRATIONBOOK_H +#define REGISTRATIONBOOK_H + +#include "legoworld.h" + +// VTABLE 0x100d9928 +// SIZE 0x2d0 +class RegistrationBook : public LegoWorld +{ +public: + RegistrationBook(); + virtual ~RegistrationBook() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + +}; + +#endif // REGISTRATIONBOOK_H diff --git a/LEGO1/score.cpp b/LEGO1/score.cpp new file mode 100644 index 00000000..fc4070f7 --- /dev/null +++ b/LEGO1/score.cpp @@ -0,0 +1,21 @@ +#include "score.h" + +// OFFSET: LEGO1 0x10001000 STUB +Score::Score() +{ + // TODO +} + +// OFFSET: LEGO1 0x10001200 STUB +Score::~Score() +{ + // TODO +} + +// OFFSET: LEGO1 0x10001410 STUB +MxLong Score::Notify(MxParam &p) +{ + // TODO + + return 0; +} diff --git a/LEGO1/score.h b/LEGO1/score.h new file mode 100644 index 00000000..e103b4bc --- /dev/null +++ b/LEGO1/score.h @@ -0,0 +1,18 @@ +#ifndef SCORE_H +#define SCORE_H + +#include "legoworld.h" + +// VTABLE 0x100d4018 +// SIZE 0x104 +class Score : public LegoWorld +{ +public: + Score(); + virtual ~Score() override; // vtable+0x0 + + virtual MxLong Notify(MxParam &p) override; // vtable+0x4 + +}; + +#endif // SCORE_H diff --git a/LEGO1/scorestate.cpp b/LEGO1/scorestate.cpp new file mode 100644 index 00000000..826ab482 --- /dev/null +++ b/LEGO1/scorestate.cpp @@ -0,0 +1 @@ +#include "scorestate.h" diff --git a/LEGO1/scorestate.h b/LEGO1/scorestate.h new file mode 100644 index 00000000..4f5a8dc2 --- /dev/null +++ b/LEGO1/scorestate.h @@ -0,0 +1,26 @@ +#ifndef SCORESTATE_H +#define SCORESTATE_H + +#include "legostate.h" + +// VTABLE 0x100d53f8 +// SIZE 0xc +class ScoreState : public LegoState +{ +public: + // OFFSET: LEGO1 0x1000de40 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f0084 + return "ScoreState"; + }; + + // OFFSET: LEGO1 0x1000de50 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, ScoreState::ClassName()) || LegoState::IsA(name); + }; + +}; + +#endif // SCORESTATE_H diff --git a/LEGO1/skateboard.cpp b/LEGO1/skateboard.cpp new file mode 100644 index 00000000..42466206 --- /dev/null +++ b/LEGO1/skateboard.cpp @@ -0,0 +1,7 @@ +#include "skateboard.h" + +// OFFSET: LEGO1 0x1000fd40 STUB +SkateBoard::SkateBoard() +{ + // TODO +} diff --git a/LEGO1/skateboard.h b/LEGO1/skateboard.h new file mode 100644 index 00000000..f290dc7b --- /dev/null +++ b/LEGO1/skateboard.h @@ -0,0 +1,15 @@ +#ifndef SKATEBOARD_H +#define SKATEBOARD_H + +#include "islepathactor.h" + +// VTABLE 0x100d55f0 +// SIZE 0x168 +class SkateBoard : public IslePathActor +{ +public: + SkateBoard(); + +}; + +#endif // SKATEBOARD_H diff --git a/LEGO1/towtrack.cpp b/LEGO1/towtrack.cpp new file mode 100644 index 00000000..90d3d018 --- /dev/null +++ b/LEGO1/towtrack.cpp @@ -0,0 +1,7 @@ +#include "towtrack.h" + +// OFFSET: LEGO1 0x1004c720 STUB +TowTrack::TowTrack() +{ + // TODO +} diff --git a/LEGO1/towtrack.h b/LEGO1/towtrack.h new file mode 100644 index 00000000..95e6885a --- /dev/null +++ b/LEGO1/towtrack.h @@ -0,0 +1,16 @@ +#ifndef TOWTRACK_H +#define TOWTRACK_H + +#include "islepathactor.h" + +// VTABLE 0x100d7ee0 +// SIZE 0x180 +class TowTrack : public IslePathActor +{ +public: + TowTrack(); + +}; + + +#endif // TOWTRACK_H diff --git a/LEGO1/towtrackmissionstate.cpp b/LEGO1/towtrackmissionstate.cpp new file mode 100644 index 00000000..b85c40cc --- /dev/null +++ b/LEGO1/towtrackmissionstate.cpp @@ -0,0 +1,7 @@ +#include "towtrackmissionstate.h" + +// OFFSET: LEGO1 0x1004dd30 STUB +TowTrackMissionState::TowTrackMissionState() +{ + // TODO +} diff --git a/LEGO1/towtrackmissionstate.h b/LEGO1/towtrackmissionstate.h new file mode 100644 index 00000000..a335584f --- /dev/null +++ b/LEGO1/towtrackmissionstate.h @@ -0,0 +1,28 @@ +#ifndef TOWTRACKMISSIONSTATE_H +#define TOWTRACKMISSIONSTATE_H + +#include "legostate.h" + +// VTABLE 0x100d7fd8 +// SIZE 0x28 +class TowTrackMissionState : LegoState +{ +public: + TowTrackMissionState(); + + // OFFSET: LEGO1 0x1004dfa0 + inline virtual const char *ClassName() const // vtable+0x0c + { + // 0x100f00bc + return "TowTrackMissionState"; + }; + + // OFFSET: LEGO1 0x1004dfb0 + inline virtual MxBool IsA(const char *name) const // vtable+0x10 + { + return !strcmp(name, TowTrackMissionState::ClassName()) || LegoState::IsA(name); + }; + +}; + +#endif // TOWTRACKMISSIONSTATE_H diff --git a/LEGO1/viewmanager.cpp b/LEGO1/viewmanager.cpp new file mode 100644 index 00000000..0baebd2c --- /dev/null +++ b/LEGO1/viewmanager.cpp @@ -0,0 +1,7 @@ +#include "viewmanager.h" + +// OFFSET: LEGO1 0x100a64d0 STUB +void ViewManager::RemoveAll(ViewROI *) +{ + // TODO +} diff --git a/README.md b/README.md index f89f1f15..2be5373a 100644 --- a/README.md +++ b/README.md @@ -2,47 +2,53 @@ [Development Vlog](https://www.youtube.com/playlist?list=PLbpl-gZkNl2COf_bB6cfgTapD5WduAfPz) | [Contributing](https://github.com/isledecomp/isle/blob/master/CONTRIBUTING.md) | [Matrix](https://matrix.to/#/#isledecomp:matrix.org) | [Forums](https://forum.mattkc.com/viewforum.php?f=1) | [Patreon](https://www.patreon.com/mattkc) -This is a **work-in-progress** decompilation of LEGO Island version 1.1. It aims to be relatively faithful, but not byte accurate. The goal is to provide a workable codebase that can be modified, improved, and ported to other platforms later on. +This is a **work-in-progress** decompilation of LEGO Island version 1.1. It aims to be as accurate as possible, matching the recompiled instructions to the original machine code as much as possible. The goal is to provide a workable codebase that can be modified, improved, and ported to other platforms later on. ## Status - + -Currently `ISLE.EXE` is completely decompiled, however there are some known inaccuracies. It should work if you pair it with the original game's `LEGO1.DLL` (and other files), however small things may not work correctly yet. Work on decompiling `LEGO1.DLL` has only just started and currently it is too incomplete to be usable. +Currently `ISLE.EXE` is completely decompiled and behaves identically to the original. A handful of stubborn instructions are not yet matching, however we anticipate they will as more of the overall codebase is implemented. + +`LEGO1.DLL` is still very much incomplete and cannot be used at this time. Instead, if you want to test this, it is recommended to pair the recompiled `ISLE.EXE` with the `LEGO1.DLL` from the original game. ## Building -LEGO Island was compiled with Microsoft Visual C++ 4.20, so that's what this decompilation targets. However it should compile with NMAKE on newer versions of Visual Studio too. +This projects uses the [CMake](https://cmake.org/) build system, which allows for a high degree of versatility regarding compilers and development environments. For the most accurate results, it is recommended to use Microsoft Visual C++ 4.20 (the same compiler used to build the original game). Since we're trying to match this to the original executable as closely as possible, all contributions will be graded with the output of this compiler. -### Recommended Instructions -These instructions use the development IDE from Visual C++ 4.20. By modern standards, it can be a little clunky to use, especially on newer versions of Windows, however it's still relatively straightforward. If you prefer a command line process that can fit into a modern workflow/IDE, see the instructions below. +These instructions will outline how to compile this repository into an accurate instruction-matching binary with Visual C++ 4.2. If you wish, you can try using other compilers, but this is at your own risk and won't be covered in this guide. -1. Install Microsoft Visual C++ 4.20. This can be found on many abandonware sites, but the installer can be a little iffy on modern versions of Windows. For convenience, I made a [portable version](https://github.com/itsmattkc/msvc420) that can be downloaded and used quickly instead. -2. Download and install the DirectX 5 SDK. Similarly, this can be found on many abandonware sites. -3. Open "Microsoft Developer Studio" (`BIN/MSDEV.EXE` for those using the portable). -4. `File` > `Open Workspace` -5. Select `ISLE.MDP` from this repository. -6. Select a build configuration. `ISLE - Win32 Release` is recommended because, at this point in time, you'll almost certainly be pairing it with the retail `LEGO1.DLL`, which is also a release build. -7. `Build` > `Build ISLE.EXE`. This will build `ISLE.EXE` in a folder called `Release`. It will also build `LEGO1.DLL` since it's listed as a dependency, however the `LEGO1.DLL` produced is too incomplete to be usable at this time. +#### Prerequisites -### Command Line Instructions +You will need the following software installed: -For some users, this may be preferable to using an obsolete graphical IDE. Any modern IDE should support custom command line build steps, making this potentially easier to fit into a familiar contemporary workflow. This guide assumes a general familiarity with the Windows command prompt. +- Microsoft Visual C++ 4.2. This can be found on many abandonware sites, but the installer can be a little iffy on modern versions of Windows. For convenience, I made a [portable version](https://github.com/itsmattkc/msvc420) that can be downloaded and used quickly instead. +- DirectX 5 SDK. Similarly, this can be found on many abandonware sites. +- [CMake](https://cmake.org/). A copy is often included with the "Desktop development with C++" workload in newer versions of Visual Studio, however it can also be installed as a standalone app. -1. Acquire Visual Studio/Visual C++. Any version after 4.20 should work here, but 4.20 is the only one guaranteed to work. If you wish to use 4.20, it can be found on many abandonware sites, but the installer can be a little iffy on modern versions of Windows. For convenience, I made a [portable version](https://github.com/itsmattkc/msvc420) that can be downloaded and used quickly instead. -2. Download and install the DirectX 5 SDK. Similarly, this can be found on many abandonware sites, but later versions of Visual Studio include the DirectX SDK by default, so this step may be skippable (you definitely need it for MSVC 4.20). -3. Open an x86/32-bit developer command prompt. Depending on the version of VS you're using, you may have a start menu item for it already (e.g. `x86 Native Tools Command Prompt`). Alternatively, you can start a normal command prompt (`cmd`) and run `vcvars32.bat` from the Visual Studio folder (run `BIN/VCVARS32.BAT x86` if you're using the portable 4.20). -4. `cd` to the folder you cloned this repository to. -5. `mkdir Release` if the folder doesn't already exist. Some versions of NMAKE may make this folder by itself, but some don't. -6. Run `nmake /f isle.mak CFG="ISLE - Win32 Release"`. This will build `ISLE.EXE` in the `Release` folder you just made. It will also build `LEGO1.DLL` since it's listed as a dependency, however the `LEGO1.DLL` produced is too incomplete to be usable at this time. +#### Compiling From Command Line + +1. Open a Command Prompt (`cmd`). +1. From Visual C++ 4.2, run `BIN/VCVARS32.BAT x86` to populate the path and other environment variables for compiling with MSVC. +1. Make a folder for compiled objects to go, such as a `build` folder inside the source repository (the folder you cloned/downloaded to). +1. In your Command Prompt, `cd` to the build folder. +1. Configure the project with CMake by running: +``` +cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo +``` + - Replace `` with the source repository. Can be `..` if your build folder is inside the source repository. + - `RelWithDebInfo` is recommended because it will produce debug symbols useful for further decompilation work. However, you can change this to `Release` if you don't need them. `Debug` builds are not recommended because they are unlikely to be compatible with the retail `LEGO1.DLL`, which is currently the only way to really use this decomp. + - `NMake Makefiles` is most recommended because it will be immediately compatible with Visual C++ 4.2. For faster builds, you can use `Ninja` (if you have it installed), however due to limitations in Visual C++ 4.2, you can only build `Release` builds this way (debug symbols cannot be generated with `Ninja`). +1. Build the project by running `nmake` or `cmake --build ` +1. When this is done, there should a recompiled `ISLE.EXE` and `LEGO1.DLL` in the build folder. + +If you have a CMake-compatible IDE, it should be pretty straightforward to use this repository, as long as you can use `VCVARS32.BAT` and set the generator to `NMake Makefiles`. ## Usage Simply place the compiled `ISLE.EXE` into LEGO Island's install folder (usually `C:\Program Files\LEGO Island` or `C:\Program Files (x86)\LEGO Island`). Unless you're a developer, disregard the compiled `LEGO1.DLL` for now as it is too incomplete to be usable. Alternatively, LEGO Island can run from any directory as long as `ISLE.EXE` and `LEGO1.DLL` are in the same directory, and the registry keys point to the correct location for the asset files. -Ideally, this decompilation should be paired with version 1.1. It may work on 1.0 too, however this is not guaranteed. - ## Contributing If you're interested in helping/contributing to this project, check out the [CONTRIBUTING](https://github.com/isledecomp/isle/blob/master/CONTRIBUTING.md) page. diff --git a/isle.mak b/isle.mak deleted file mode 100644 index 899c2b03..00000000 --- a/isle.mak +++ /dev/null @@ -1,1486 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -!IF "$(CFG)" == "" -CFG=LEGO1 - Win32 Release -!MESSAGE No configuration specified. Defaulting to LEGO1 - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "LEGO1 - Win32 Release" && "$(CFG)" != "LEGO1 - Win32 Debug" &&\ - "$(CFG)" != "ISLE - Win32 Release" && "$(CFG)" != "ISLE - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "isle.mak" CFG="LEGO1 - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "LEGO1 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "LEGO1 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ISLE - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "ISLE - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -# PROP Target_Last_Scanned "isle - Win32 Debug" - -!IF "$(CFG)" == "LEGO1 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LEGO1\Release" -# PROP BASE Intermediate_Dir "LEGO1\Release" -# PROP BASE Target_Dir "LEGO1" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LEGO1\Release" -# PROP Intermediate_Dir "LEGO1\Release" -# PROP Target_Dir "LEGO1" -OUTDIR=.\LEGO1\Release -INTDIR=.\LEGO1\Release - -ALL : ".\Release\LEGO1.DLL" - -CLEAN : - -@erase "$(INTDIR)\dllmain.obj" - -@erase "$(INTDIR)\legonavcontroller.obj" - -@erase "$(INTDIR)\legoomni.obj" - -@erase "$(INTDIR)\mxatomid.obj" - -@erase "$(INTDIR)\mxautolocker.obj" - -@erase "$(INTDIR)\mxcore.obj" - -@erase "$(INTDIR)\mxcriticalsection.obj" - -@erase "$(INTDIR)\mxdsfile.obj" - -@erase "$(INTDIR)\mxdsobject.obj" - -@erase "$(INTDIR)\mxdssource.obj" - -@erase "$(INTDIR)\mxioinfo.obj" - -@erase "$(INTDIR)\mxomni.obj" - -@erase "$(INTDIR)\mxomnicreateflags.obj" - -@erase "$(INTDIR)\mxomnicreateparam.obj" - -@erase "$(INTDIR)\mxomnicreateparambase.obj" - -@erase "$(INTDIR)\mxpalette.obj" - -@erase "$(INTDIR)\mxstring.obj" - -@erase "$(INTDIR)\mxtimer.obj" - -@erase "$(INTDIR)\mxunknown100dc6b0.obj" - -@erase "$(INTDIR)\mxvideomanager.obj" - -@erase "$(INTDIR)\mxvideoparam.obj" - -@erase "$(INTDIR)\mxvideoparamflags.obj" - -@erase "$(INTDIR)\vc40.pdb" - -@erase ".\Release\LEGO1.DLL" - -@erase ".\Release\LEGO1.EXP" - -@erase ".\Release\LEGO1.LIB" - -@erase ".\Release\LEGO1.PDB" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -CPP_PROJ=/nologo /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)/LEGO1.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\LEGO1\Release/ -CPP_SBRS=.\. - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -MTL=mktyplib.exe -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/LEGO1.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /pdb:"Release/LEGO1.PDB" /debug /machine:I386 /out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB" -# SUBTRACT LINK32 /pdb:none /map -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no\ - /pdb:"Release/LEGO1.PDB" /debug /machine:I386 /out:"Release/LEGO1.DLL"\ - /implib:"Release/LEGO1.LIB" -LINK32_OBJS= \ - "$(INTDIR)\dllmain.obj" \ - "$(INTDIR)\legonavcontroller.obj" \ - "$(INTDIR)\legoomni.obj" \ - "$(INTDIR)\mxatomid.obj" \ - "$(INTDIR)\mxautolocker.obj" \ - "$(INTDIR)\mxcore.obj" \ - "$(INTDIR)\mxcriticalsection.obj" \ - "$(INTDIR)\mxdsfile.obj" \ - "$(INTDIR)\mxdsobject.obj" \ - "$(INTDIR)\mxdssource.obj" \ - "$(INTDIR)\mxioinfo.obj" \ - "$(INTDIR)\mxomni.obj" \ - "$(INTDIR)\mxomnicreateflags.obj" \ - "$(INTDIR)\mxomnicreateparam.obj" \ - "$(INTDIR)\mxomnicreateparambase.obj" \ - "$(INTDIR)\mxpalette.obj" \ - "$(INTDIR)\mxstring.obj" \ - "$(INTDIR)\mxtimer.obj" \ - "$(INTDIR)\mxunknown100dc6b0.obj" \ - "$(INTDIR)\mxvideomanager.obj" \ - "$(INTDIR)\mxvideoparam.obj" \ - "$(INTDIR)\mxvideoparamflags.obj" - -".\Release\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "LEGO1 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LEGO1\Debug" -# PROP BASE Intermediate_Dir "LEGO1\Debug" -# PROP BASE Target_Dir "LEGO1" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LEGO1\Debug" -# PROP Intermediate_Dir "LEGO1\Debug" -# PROP Target_Dir "LEGO1" -OUTDIR=.\LEGO1\Debug -INTDIR=.\LEGO1\Debug - -ALL : ".\Debug\LEGO1.DLL" - -CLEAN : - -@erase "$(INTDIR)\dllmain.obj" - -@erase "$(INTDIR)\legonavcontroller.obj" - -@erase "$(INTDIR)\legoomni.obj" - -@erase "$(INTDIR)\mxatomid.obj" - -@erase "$(INTDIR)\mxautolocker.obj" - -@erase "$(INTDIR)\mxcore.obj" - -@erase "$(INTDIR)\mxcriticalsection.obj" - -@erase "$(INTDIR)\mxdsfile.obj" - -@erase "$(INTDIR)\mxdsobject.obj" - -@erase "$(INTDIR)\mxdssource.obj" - -@erase "$(INTDIR)\mxioinfo.obj" - -@erase "$(INTDIR)\mxomni.obj" - -@erase "$(INTDIR)\mxomnicreateflags.obj" - -@erase "$(INTDIR)\mxomnicreateparam.obj" - -@erase "$(INTDIR)\mxomnicreateparambase.obj" - -@erase "$(INTDIR)\mxpalette.obj" - -@erase "$(INTDIR)\mxstring.obj" - -@erase "$(INTDIR)\mxtimer.obj" - -@erase "$(INTDIR)\mxunknown100dc6b0.obj" - -@erase "$(INTDIR)\mxvideomanager.obj" - -@erase "$(INTDIR)\mxvideoparam.obj" - -@erase "$(INTDIR)\mxvideoparamflags.obj" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\LEGO1.exp" - -@erase "$(OUTDIR)\LEGO1.lib" - -@erase "$(OUTDIR)\LEGO1.pdb" - -@erase ".\Debug\LEGO1.DLL" - -@erase ".\Debug\LEGO1.ILK" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)/LEGO1.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\LEGO1\Debug/ -CPP_SBRS=.\. - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -MTL=mktyplib.exe -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /win32 -MTL_PROJ=/nologo /D "_DEBUG" /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/LEGO1.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/LEGO1.DLL" -# SUBTRACT LINK32 /pdb:none /map -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:yes\ - /pdb:"$(OUTDIR)/LEGO1.pdb" /debug /machine:I386 /out:"Debug/LEGO1.DLL"\ - /implib:"$(OUTDIR)/LEGO1.lib" -LINK32_OBJS= \ - "$(INTDIR)\dllmain.obj" \ - "$(INTDIR)\legonavcontroller.obj" \ - "$(INTDIR)\legoomni.obj" \ - "$(INTDIR)\mxatomid.obj" \ - "$(INTDIR)\mxautolocker.obj" \ - "$(INTDIR)\mxcore.obj" \ - "$(INTDIR)\mxcriticalsection.obj" \ - "$(INTDIR)\mxdsfile.obj" \ - "$(INTDIR)\mxdsobject.obj" \ - "$(INTDIR)\mxdssource.obj" \ - "$(INTDIR)\mxioinfo.obj" \ - "$(INTDIR)\mxomni.obj" \ - "$(INTDIR)\mxomnicreateflags.obj" \ - "$(INTDIR)\mxomnicreateparam.obj" \ - "$(INTDIR)\mxomnicreateparambase.obj" \ - "$(INTDIR)\mxpalette.obj" \ - "$(INTDIR)\mxstring.obj" \ - "$(INTDIR)\mxtimer.obj" \ - "$(INTDIR)\mxunknown100dc6b0.obj" \ - "$(INTDIR)\mxvideomanager.obj" \ - "$(INTDIR)\mxvideoparam.obj" \ - "$(INTDIR)\mxvideoparamflags.obj" - -".\Debug\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "ISLE - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ISLE\Release" -# PROP BASE Intermediate_Dir "ISLE\Release" -# PROP BASE Target_Dir "ISLE" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ISLE\Release" -# PROP Intermediate_Dir "ISLE\Release" -# PROP Target_Dir "ISLE" -OUTDIR=.\ISLE\Release -INTDIR=.\ISLE\Release - -ALL : "LEGO1 - Win32 Release" ".\Release\ISLE.EXE" - -CLEAN : - -@erase "$(INTDIR)\define.obj" - -@erase "$(INTDIR)\isle.obj" - -@erase "$(INTDIR)\isle.res" - -@erase "$(INTDIR)\vc40.pdb" - -@erase ".\Release\ISLE.EXE" - -@erase ".\Release\ISLE.PDB" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /W3 /GX /Zi /O2 /I "LEGO1" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -CPP_PROJ=/nologo /ML /W3 /GX /Zi /O2 /I "LEGO1" /D "WIN32" /D "NDEBUG" /D\ - "_WINDOWS" /Fp"$(INTDIR)/ISLE.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\ISLE\Release/ -CPP_SBRS=.\. - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -MTL=mktyplib.exe -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/isle.res" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/ISLE.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /pdb:"Release/ISLE.PDB" /debug /machine:I386 /out:"Release/ISLE.EXE" /LIBPATH:"ISLE/ext" -# SUBTRACT LINK32 /pdb:none -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows\ - /incremental:no /pdb:"Release/ISLE.PDB" /debug /machine:I386\ - /out:"Release/ISLE.EXE" /LIBPATH:"ISLE/ext" -LINK32_OBJS= \ - "$(INTDIR)\define.obj" \ - "$(INTDIR)\isle.obj" \ - "$(INTDIR)\isle.res" \ - ".\Release\LEGO1.LIB" - -".\Release\ISLE.EXE" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ISLE\Debug" -# PROP BASE Intermediate_Dir "ISLE\Debug" -# PROP BASE Target_Dir "ISLE" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ISLE\Debug" -# PROP Intermediate_Dir "ISLE\Debug" -# PROP Target_Dir "ISLE" -OUTDIR=.\ISLE\Debug -INTDIR=.\ISLE\Debug - -ALL : "LEGO1 - Win32 Debug" ".\Debug\ISLE.EXE" - -CLEAN : - -@erase "$(INTDIR)\define.obj" - -@erase "$(INTDIR)\isle.obj" - -@erase "$(INTDIR)\isle.res" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase ".\Debug\ISLE.EXE" - -@erase ".\Debug\ISLE.ILK" - -@erase ".\Debug\ISLE.PDB" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "LEGO1" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "LEGO1" /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /Fp"$(INTDIR)/ISLE.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c -CPP_OBJS=.\ISLE\Debug/ -CPP_SBRS=.\. - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -MTL=mktyplib.exe -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /win32 -MTL_PROJ=/nologo /D "_DEBUG" /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/isle.res" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/ISLE.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /pdb:"Debug/ISLE.PDB" /debug /machine:I386 /out:"Debug/ISLE.EXE" /LIBPATH:"ISLE/ext" -# SUBTRACT LINK32 /pdb:none -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows\ - /incremental:yes /pdb:"Debug/ISLE.PDB" /debug /machine:I386\ - /out:"Debug/ISLE.EXE" /LIBPATH:"ISLE/ext" -LINK32_OBJS= \ - "$(INTDIR)\define.obj" \ - "$(INTDIR)\isle.obj" \ - "$(INTDIR)\isle.res" \ - ".\LEGO1\Debug\LEGO1.lib" - -".\Debug\ISLE.EXE" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -################################################################################ -# Begin Target - -# Name "LEGO1 - Win32 Release" -# Name "LEGO1 - Win32 Debug" - -!IF "$(CFG)" == "LEGO1 - Win32 Release" - -!ELSEIF "$(CFG)" == "LEGO1 - Win32 Debug" - -!ENDIF - -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxcore.cpp -DEP_CPP_MXCOR=\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - - -"$(INTDIR)\mxcore.obj" : $(SOURCE) $(DEP_CPP_MXCOR) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\dllmain.cpp - -"$(INTDIR)\dllmain.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoomni.cpp -DEP_CPP_LEGOO=\ - ".\LEGO1\lego3dmanager.h"\ - ".\LEGO1\lego3dview.h"\ - ".\LEGO1\legoentity.h"\ - ".\LEGO1\legogamestate.h"\ - ".\LEGO1\legoinputmanager.h"\ - ".\LEGO1\legonavcontroller.h"\ - ".\LEGO1\legoomni.h"\ - ".\LEGO1\legoroi.h"\ - ".\LEGO1\legovideomanager.h"\ - ".\LEGO1\mxatomid.h"\ - ".\LEGO1\mxbackgroundaudiomanager.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxdsaction.h"\ - ".\LEGO1\mxdsfile.h"\ - ".\LEGO1\mxdsobject.h"\ - ".\LEGO1\mxdssource.h"\ - ".\LEGO1\mxeventmanager.h"\ - ".\LEGO1\mxioinfo.h"\ - ".\LEGO1\mxmusicmanager.h"\ - ".\LEGO1\mxnotificationmanager.h"\ - ".\LEGO1\mxobjectfactory.h"\ - ".\LEGO1\mxomni.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxsoundmanager.h"\ - ".\LEGO1\mxstreamcontroller.h"\ - ".\LEGO1\mxstreamer.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxticklemanager.h"\ - ".\LEGO1\mxtimer.h"\ - ".\LEGO1\mxtransitionmanager.h"\ - ".\LEGO1\mxtypes.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideomanager.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - ".\LEGO1\viewmanager.h"\ - - -"$(INTDIR)\legoomni.obj" : $(SOURCE) $(DEP_CPP_LEGOO) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxcriticalsection.cpp -DEP_CPP_MXCRI=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxcriticalsection.h"\ - - -"$(INTDIR)\mxcriticalsection.obj" : $(SOURCE) $(DEP_CPP_MXCRI) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxautolocker.cpp -DEP_CPP_MXAUT=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxautolocker.h"\ - ".\LEGO1\mxcriticalsection.h"\ - - -"$(INTDIR)\mxautolocker.obj" : $(SOURCE) $(DEP_CPP_MXAUT) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxtimer.cpp -DEP_CPP_MXTIM=\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxtimer.h"\ - ".\LEGO1\mxtypes.h"\ - - -"$(INTDIR)\mxtimer.obj" : $(SOURCE) $(DEP_CPP_MXTIM) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomni.cpp -DEP_CPP_MXOMN=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxatomid.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxeventmanager.h"\ - ".\LEGO1\mxmusicmanager.h"\ - ".\LEGO1\mxnotificationmanager.h"\ - ".\LEGO1\mxobjectfactory.h"\ - ".\LEGO1\mxomni.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxsoundmanager.h"\ - ".\LEGO1\mxstreamcontroller.h"\ - ".\LEGO1\mxstreamer.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxticklemanager.h"\ - ".\LEGO1\mxtimer.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideomanager.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxomni.obj" : $(SOURCE) $(DEP_CPP_MXOMN) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvideoparam.cpp -DEP_CPP_MXVID=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxvideoparam.obj" : $(SOURCE) $(DEP_CPP_MXVID) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvideoparamflags.cpp -DEP_CPP_MXVIDE=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxvideoparamflags.obj" : $(SOURCE) $(DEP_CPP_MXVIDE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomnicreateparam.cpp -DEP_CPP_MXOMNI=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxomnicreateparam.obj" : $(SOURCE) $(DEP_CPP_MXOMNI) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomnicreateparambase.cpp -DEP_CPP_MXOMNIC=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxomnicreateparambase.obj" : $(SOURCE) $(DEP_CPP_MXOMNIC)\ - "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxstring.cpp -DEP_CPP_MXSTR=\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxstring.h"\ - - -"$(INTDIR)\mxstring.obj" : $(SOURCE) $(DEP_CPP_MXSTR) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomnicreateflags.cpp -DEP_CPP_MXOMNICR=\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxtypes.h"\ - - -"$(INTDIR)\mxomnicreateflags.obj" : $(SOURCE) $(DEP_CPP_MXOMNICR) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legonavcontroller.cpp -DEP_CPP_LEGON=\ - ".\LEGO1\lego3dmanager.h"\ - ".\LEGO1\lego3dview.h"\ - ".\LEGO1\legoentity.h"\ - ".\LEGO1\legogamestate.h"\ - ".\LEGO1\legoinputmanager.h"\ - ".\LEGO1\legonavcontroller.h"\ - ".\LEGO1\legoomni.h"\ - ".\LEGO1\legoroi.h"\ - ".\LEGO1\legoutil.h"\ - ".\LEGO1\legovideomanager.h"\ - ".\LEGO1\mxatomid.h"\ - ".\LEGO1\mxbackgroundaudiomanager.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxdsaction.h"\ - ".\LEGO1\mxdsfile.h"\ - ".\LEGO1\mxdsobject.h"\ - ".\LEGO1\mxdssource.h"\ - ".\LEGO1\mxeventmanager.h"\ - ".\LEGO1\mxioinfo.h"\ - ".\LEGO1\mxmusicmanager.h"\ - ".\LEGO1\mxnotificationmanager.h"\ - ".\LEGO1\mxobjectfactory.h"\ - ".\LEGO1\mxomni.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxsoundmanager.h"\ - ".\LEGO1\mxstreamcontroller.h"\ - ".\LEGO1\mxstreamer.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxticklemanager.h"\ - ".\LEGO1\mxtimer.h"\ - ".\LEGO1\mxtransitionmanager.h"\ - ".\LEGO1\mxtypes.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideomanager.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - ".\LEGO1\viewmanager.h"\ - - -"$(INTDIR)\legonavcontroller.obj" : $(SOURCE) $(DEP_CPP_LEGON) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdsobject.cpp -DEP_CPP_MXDSO=\ - ".\LEGO1\mxatomid.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxdsobject.h"\ - - -"$(INTDIR)\mxdsobject.obj" : $(SOURCE) $(DEP_CPP_MXDSO) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxatomid.cpp -DEP_CPP_MXATO=\ - ".\LEGO1\mxatomid.h"\ - - -"$(INTDIR)\mxatomid.obj" : $(SOURCE) $(DEP_CPP_MXATO) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxunknown100dc6b0.cpp -DEP_CPP_MXUNK=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - - -"$(INTDIR)\mxunknown100dc6b0.obj" : $(SOURCE) $(DEP_CPP_MXUNK) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvideomanager.cpp -DEP_CPP_MXVIDEO=\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxtypes.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideomanager.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - - -"$(INTDIR)\mxvideomanager.obj" : $(SOURCE) $(DEP_CPP_MXVIDEO) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxpalette.cpp -DEP_CPP_MXPAL=\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxresult.h"\ - - -"$(INTDIR)\mxpalette.obj" : $(SOURCE) $(DEP_CPP_MXPAL) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxioinfo.cpp -DEP_CPP_MXIOI=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxioinfo.h"\ - - -"$(INTDIR)\mxioinfo.obj" : $(SOURCE) $(DEP_CPP_MXIOI) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdsfile.cpp -DEP_CPP_MXDSF=\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxdsfile.h"\ - ".\LEGO1\mxdssource.h"\ - ".\LEGO1\mxioinfo.h"\ - ".\LEGO1\mxstring.h"\ - - -"$(INTDIR)\mxdsfile.obj" : $(SOURCE) $(DEP_CPP_MXDSF) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdssource.cpp -DEP_CPP_MXDSS=\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxdssource.h"\ - - -"$(INTDIR)\mxdssource.obj" : $(SOURCE) $(DEP_CPP_MXDSS) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -# End Target -################################################################################ -# Begin Target - -# Name "ISLE - Win32 Release" -# Name "ISLE - Win32 Debug" - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -################################################################################ -# Begin Source File - -SOURCE=.\ISLE\isle.cpp -DEP_CPP_ISLE_=\ - ".\ISLE\define.h"\ - ".\ISLE\isle.h"\ - ".\ISLE\res\resource.h"\ - ".\LEGO1\lego3dmanager.h"\ - ".\LEGO1\lego3dview.h"\ - ".\LEGO1\legoanimationmanager.h"\ - ".\LEGO1\legobuildingmanager.h"\ - ".\LEGO1\legoentity.h"\ - ".\LEGO1\legogamestate.h"\ - ".\LEGO1\legoinc.h"\ - ".\LEGO1\legoinputmanager.h"\ - ".\LEGO1\legomodelpresenter.h"\ - ".\LEGO1\legonavcontroller.h"\ - ".\LEGO1\legoomni.h"\ - ".\LEGO1\legopartpresenter.h"\ - ".\LEGO1\legoroi.h"\ - ".\LEGO1\legovideomanager.h"\ - ".\LEGO1\legoworldpresenter.h"\ - ".\LEGO1\mxatomid.h"\ - ".\LEGO1\mxbackgroundaudiomanager.h"\ - ".\LEGO1\mxbool.h"\ - ".\LEGO1\mxcore.h"\ - ".\LEGO1\mxcriticalsection.h"\ - ".\LEGO1\mxdirectdraw.h"\ - ".\LEGO1\mxdsaction.h"\ - ".\LEGO1\mxdsfile.h"\ - ".\LEGO1\mxdsobject.h"\ - ".\LEGO1\mxdssource.h"\ - ".\LEGO1\mxeventmanager.h"\ - ".\LEGO1\mxioinfo.h"\ - ".\LEGO1\mxmusicmanager.h"\ - ".\LEGO1\mxnotificationmanager.h"\ - ".\LEGO1\mxobjectfactory.h"\ - ".\LEGO1\mxomni.h"\ - ".\LEGO1\mxomnicreateflags.h"\ - ".\LEGO1\mxomnicreateparam.h"\ - ".\LEGO1\mxomnicreateparambase.h"\ - ".\LEGO1\mxpalette.h"\ - ".\LEGO1\mxrect32.h"\ - ".\LEGO1\mxresult.h"\ - ".\LEGO1\mxsoundmanager.h"\ - ".\LEGO1\mxstreamcontroller.h"\ - ".\LEGO1\mxstreamer.h"\ - ".\LEGO1\mxstring.h"\ - ".\LEGO1\mxticklemanager.h"\ - ".\LEGO1\mxtimer.h"\ - ".\LEGO1\mxtransitionmanager.h"\ - ".\LEGO1\mxtypes.h"\ - ".\LEGO1\mxunknown100dc6b0.h"\ - ".\LEGO1\mxvariabletable.h"\ - ".\LEGO1\mxvideomanager.h"\ - ".\LEGO1\mxvideoparam.h"\ - ".\LEGO1\mxvideoparamflags.h"\ - ".\LEGO1\viewmanager.h"\ - - -"$(INTDIR)\isle.obj" : $(SOURCE) $(DEP_CPP_ISLE_) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ISLE\res\isle.rc -DEP_RSC_ISLE_R=\ - ".\ISLE\res\resource.h"\ - - -!IF "$(CFG)" == "ISLE - Win32 Release" - - -"$(INTDIR)\isle.res" : $(SOURCE) $(DEP_RSC_ISLE_R) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/isle.res" /i "ISLE\res" /d "NDEBUG" $(SOURCE) - - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - - -"$(INTDIR)\isle.res" : $(SOURCE) $(DEP_RSC_ISLE_R) "$(INTDIR)" - $(RSC) /l 0x409 /fo"$(INTDIR)/isle.res" /i "ISLE\res" /d "_DEBUG" $(SOURCE) - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoanimationmanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legobuildingmanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legogamestate.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoinputmanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legomodelpresenter.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoomni.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legopartpresenter.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoroi.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legovideomanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\legoworldpresenter.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxbackgroundaudiomanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxbitmap.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxbool.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxcore.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdirectdraw.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdsaction.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxdsfile.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomni.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomnicreateflags.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxomnicreateparam.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxpalette.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxrect32.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxresult.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxstreamcontroller.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxstreamer.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxstring.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxticklemanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxtimer.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxtransitionmanager.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvariabletable.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvideoparam.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxvideoparamflags.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Project Dependency - -# Project_Dep_Name "LEGO1" - -!IF "$(CFG)" == "ISLE - Win32 Release" - -"LEGO1 - Win32 Release" : - $(MAKE) /$(MAKEFLAGS) /F ".\isle.mak" CFG="LEGO1 - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -"LEGO1 - Win32 Debug" : - $(MAKE) /$(MAKEFLAGS) /F ".\isle.mak" CFG="LEGO1 - Win32 Debug" - -!ENDIF - -# End Project Dependency -################################################################################ -# Begin Source File - -SOURCE=.\LEGO1\mxatomid.h - -!IF "$(CFG)" == "ISLE - Win32 Release" - -!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ISLE\define.cpp -DEP_CPP_DEFIN=\ - ".\ISLE\define.h"\ - ".\LEGO1\legoinc.h"\ - - -"$(INTDIR)\define.obj" : $(SOURCE) $(DEP_CPP_DEFIN) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -# End Target -# End Project -################################################################################ diff --git a/isle.mdp b/isle.mdp deleted file mode 100644 index d86f4dbf..00000000 Binary files a/isle.mdp and /dev/null differ diff --git a/tools/reccmp/reccmp.py b/tools/reccmp/reccmp.py index a8d3cd07..226be15d 100755 --- a/tools/reccmp/reccmp.py +++ b/tools/reccmp/reccmp.py @@ -6,6 +6,7 @@ import difflib import struct import subprocess +import logging import os import sys import colorama @@ -16,15 +17,22 @@ parser.add_argument('recompiled', metavar='recompiled-binary', help='The recompiled binary') parser.add_argument('pdb', metavar='recompiled-pdb', help='The PDB of the recompiled binary') parser.add_argument('decomp_dir', metavar='decomp-dir', help='The decompiled source tree') -parser.add_argument('--total', '-T', metavar='total-func-count', help='Total number of expected functions (improves total accuracy statistic)') -parser.add_argument('--verbose', '-v', metavar='offset', help='Print assembly diff for specific function (original file\'s offset)') -parser.add_argument('--html', '-H', metavar='output-file', help='Generate searchable HTML summary of status and diffs') +parser.add_argument('--total', '-T', metavar='', help='Total number of expected functions (improves total accuracy statistic)') +parser.add_argument('--verbose', '-v', metavar='', help='Print assembly diff for specific function (original file\'s offset)') +parser.add_argument('--html', '-H', metavar='', help='Generate searchable HTML summary of status and diffs') parser.add_argument('--no-color', '-n', action='store_true', help='Do not color the output') -parser.add_argument('--svg', '-S', metavar='output-svg', help='Generate SVG graphic of progress') -parser.add_argument('--svg-icon', metavar='svg-icon', help='Icon to use in SVG (PNG)') +parser.add_argument('--svg', '-S', metavar='', help='Generate SVG graphic of progress') +parser.add_argument('--svg-icon', metavar='icon', help='Icon to use in SVG (PNG)') +parser.add_argument('--print-rec-addr', action='store_true', help='Print addresses of recompiled functions too') + +parser.set_defaults(loglevel=logging.INFO) +parser.add_argument('--debug', action='store_const', const=logging.DEBUG, dest='loglevel', help='Print script debug information') args = parser.parse_args() +logging.basicConfig(level=args.loglevel, format='[%(levelname)s] %(message)s') +logger = logging.getLogger(__name__) + colorama.init() verbose = None @@ -60,6 +68,7 @@ # to file addresses class Bin: def __init__(self, filename): + logger.debug('Parsing headers of "%s"... ', filename) self.file = open(filename, 'rb') #HACK: Strictly, we should be parsing the header, but we know where @@ -67,15 +76,16 @@ def __init__(self, filename): # Read ImageBase self.file.seek(0xB4) - self.imagebase = struct.unpack('i', self.file.read(4))[0] + self.imagebase, = struct.unpack(' str: + if unix_fn.startswith('./'): + return self.win_cmd + '\\' + unix_fn[2:].replace('/', '\\') + if unix_fn.startswith(self.unix_cwd): + return self.win_cwd + '\\' + unix_fn.removeprefix(self.unix_cwd).replace('/', '\\').lstrip('\\') + return self._call_winepath_unix2win(unix_fn) + + def get_unix_path(self, win_fn: str) -> str: + if win_fn.startswith('.\\') or win_fn.startswith('./'): + return self.unix_cwd + '/' + win_fn[2:].replace('\\', '/') + if win_fn.startswith(self.win_cwd): + return self.unix_cwd + '/' + win_fn.removeprefix(self.win_cwd).replace('\\', '/') + return self._call_winepath_win2unix(win_fn) + + @staticmethod + def _call_winepath_unix2win(fn: str) -> str: + return subprocess.check_output(['winepath', '-w', fn], text=True).strip() + + @staticmethod + def _call_winepath_win2unix(fn: str) -> str: + return subprocess.check_output(['winepath', fn], text=True).strip() def get_file_in_script_dir(fn): return os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), fn) @@ -108,22 +140,24 @@ class SymInfo: funcs = {} lines = {} - def __init__(self, pdb, file): + def __init__(self, pdb, file, wine_path_converter): call = [get_file_in_script_dir('cvdump.exe'), '-l', '-s'] - if os.name != 'nt': + if wine_path_converter: # Run cvdump through wine and convert path to Windows-friendly wine path call.insert(0, 'wine') - call.append(get_wine_path(pdb)) + call.append(wine_path_converter.get_wine_path(pdb)) else: call.append(pdb) - print('Parsing %s...' % pdb) - + logger.info('Parsing %s ...', pdb) + logger.debug('Command = %r', call) line_dump = subprocess.check_output(call).decode('utf-8').split('\r\n') current_section = None + logger.debug('Parsing output of cvdump.exe ...') + for i, line in enumerate(line_dump): if line.startswith('***'): current_section = line[4:] @@ -131,8 +165,6 @@ def __init__(self, pdb, file): if current_section == 'SYMBOLS' and 'S_GPROC32' in line: addr = int(line[26:34], 16) - - info = RecompiledInfo() info.addr = addr + recompfile.imagebase + recompfile.textvirt @@ -154,9 +186,9 @@ def __init__(self, pdb, file): elif current_section == 'LINES' and line.startswith(' ') and not line.startswith(' '): sourcepath = line.split()[0] - if os.name != 'nt': + if wine_path_converter: # Convert filename to Unix path for file compare - sourcepath = get_unix_path(sourcepath) + sourcepath = wine_path_converter.get_unix_path(sourcepath) if sourcepath not in self.lines: self.lines[sourcepath] = {} @@ -177,18 +209,23 @@ def __init__(self, pdb, file): j += 1 + logger.debug('... Parsing output of cvdump.exe finished') + def get_recompiled_address(self, filename, line): addr = None found = False - #print('Looking for ' + filename + ' line ' + str(line)) + logger.debug('Looking for %s:%d', filename, line) for fn in self.lines: # Sometimes a PDB is compiled with a relative path while we always have # an absolute path. Therefore we must - if os.path.samefile(fn, filename): - filename = fn - break + try: + if os.path.samefile(fn, filename): + filename = fn + break + except FileNotFoundError as e: + continue if filename in self.lines and line in self.lines[fn]: addr = self.lines[fn][line] @@ -196,13 +233,16 @@ def get_recompiled_address(self, filename, line): if addr in self.funcs: return self.funcs[addr] else: - print('Failed to find function symbol with address: %s' % hex(addr)) + logger.error('Failed to find function symbol with address: 0x%x', addr) else: - print('Failed to find function symbol with filename and line: %s:%s' % (filename, str(line))) + logger.error('Failed to find function symbol with filename and line: %s:%d', filename, line) +wine_path_converter = None +if os.name != 'nt': + wine_path_converter = WinePathConverter(source) origfile = Bin(original) recompfile = Bin(recomp) -syminfo = SymInfo(syms, recompfile) +syminfo = SymInfo(syms, recompfile, wine_path_converter) print() @@ -292,7 +332,7 @@ def parse_asm(file, addr, size): line = line.strip() - if line.startswith(pattern): + if line.startswith(pattern) and not line.endswith("STUB"): par = line[len(pattern):].strip().split() module = par[0] if module != basename: @@ -335,7 +375,11 @@ def parse_asm(file, addr, size): percenttext = colorama.Fore.RED + percenttext + colorama.Style.RESET_ALL if not verbose: - print(' %s (%s / %s) is %s similar to the original' % (recinfo.name, hex(addr), hex(recinfo.addr), percenttext)) + if args.print_rec_addr: + addrs = '%s / %s' % (hex(addr), hex(recinfo.addr)) + else: + addrs = hex(addr) + print(' %s (%s) is %s similar to the original' % (recinfo.name, addrs, percenttext)) function_count += 1 total_accuracy += ratio diff --git a/tools/reccmp/template.svg b/tools/reccmp/template.svg index 1cded1e3..626ed08d 100644 --- a/tools/reccmp/template.svg +++ b/tools/reccmp/template.svg @@ -25,31 +25,25 @@ inkscape:deskcolor="#505050" showgrid="false" inkscape:zoom="1.6046875" - inkscape:cx="239.29893" - inkscape:cy="219.98053" + inkscape:cx="158.90944" + inkscape:cy="220.6037" inkscape:window-width="2560" inkscape:window-height="1379" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" - inkscape:current-layer="svg5" /> - {name}{percent}{percent}Implemented: {implemented}Accuracy: {accuracy} diff --git a/tools/verexp/DUMPBIN.EXE b/tools/verexp/DUMPBIN.EXE new file mode 100755 index 00000000..c57ed02c Binary files /dev/null and b/tools/verexp/DUMPBIN.EXE differ diff --git a/tools/verexp/LINK.EXE b/tools/verexp/LINK.EXE new file mode 100755 index 00000000..9d35a899 Binary files /dev/null and b/tools/verexp/LINK.EXE differ diff --git a/tools/verexp/MSPDB41.DLL b/tools/verexp/MSPDB41.DLL new file mode 100644 index 00000000..9d2953e2 Binary files /dev/null and b/tools/verexp/MSPDB41.DLL differ diff --git a/tools/verexp/verexp.py b/tools/verexp/verexp.py new file mode 100755 index 00000000..6927622d --- /dev/null +++ b/tools/verexp/verexp.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 + +import argparse +import colorama +import difflib +import subprocess +import os +import sys + +parser = argparse.ArgumentParser(allow_abbrev=False, + description='Verify Exports: Compare the exports of two DLLs.') +parser.add_argument('original', metavar='original-binary', help='The original binary') +parser.add_argument('recompiled', metavar='recompiled-binary', help='The recompiled binary') +parser.add_argument('--no-color', '-n', action='store_true', help='Do not color the output') + +args = parser.parse_args() + +if not os.path.isfile(args.original): + parser.error('Original binary does not exist') + +if not os.path.isfile(args.recompiled): + parser.error('Recompiled binary does not exist') + +def get_file_in_script_dir(fn): + return os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), fn) + +def get_exports(file): + call = [get_file_in_script_dir('DUMPBIN.EXE'), '/EXPORTS'] + + if os.name != 'nt': + call.insert(0, 'wine') + file = subprocess.check_output(['winepath', '-w', file]).decode('utf-8').strip() + + call.append(file) + + raw = subprocess.check_output(call).decode('utf-8').split('\r\n') + exports = [] + + start = False + + for line in raw: + if not start: + if line == ' ordinal hint name': + start = True + else: + if line: + exports.append(line[27:line.rindex(' (')]) + elif exports: + break + + return exports + +og_exp = get_exports(args.original) +re_exp = get_exports(args.recompiled) + +udiff = difflib.unified_diff(og_exp, re_exp) +has_diff = False + +for line in udiff: + has_diff = True + if line.startswith("++") or line.startswith("@@") or line.startswith("--"): + # Skip unneeded parts of the diff for the brief view + pass + elif line.startswith("+"): + if args.no_color: + print(line) + else: + print(colorama.Fore.GREEN + line) + elif line.startswith("-"): + if args.no_color: + print(line) + else: + print(colorama.Fore.RED + line) + else: + print(line) + if not args.no_color: + print(colorama.Style.RESET_ALL, end='') + +if has_diff: + sys.exit(1) +else: + sys.exit(0)