Merge branch 'master' into master

This commit is contained in:
stonedDiscord 2023-07-01 16:17:49 +02:00 committed by GitHub
commit 891babb7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 1029 additions and 360 deletions

7
.editorconfig Normal file
View File

@ -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

View File

@ -114,6 +114,11 @@ jobs:
diff -u ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true diff -u ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true
diff -u LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.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 - name: Upload Artifact
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
@ -146,6 +151,7 @@ jobs:
- name: Upload Continuous Release - name: Upload Continuous Release
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }}
run: | run: |
# Convert SVGs to PNG # Convert SVGs to PNG
rsvg-convert -w 400 -h 300 ISLEPROGRESS.SVG -o ISLEPROGRESS.PNG rsvg-convert -w 400 -h 300 ISLEPROGRESS.SVG -o ISLEPROGRESS.PNG
@ -156,3 +162,6 @@ jobs:
build/LEGO1.DLL \ build/LEGO1.DLL \
ISLEPROGRESS.* \ ISLEPROGRESS.* \
LEGO1PROGRESS.* 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/

View File

@ -3,7 +3,179 @@ cmake_minimum_required(VERSION 2.8...3.5 FATAL_ERROR)
project(isle CXX) project(isle CXX)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
option(ISLE_BUILD_LIB "Build LEGO1.DLL library" 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/mxloopingsmkpresenter.cpp
LEGO1/mxmediapresenter.cpp
LEGO1/mxmusicpresenter.cpp
LEGO1/mxnotificationmanager.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/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) if (ISLE_BUILD_APP)
add_executable(isle WIN32 add_executable(isle WIN32
@ -15,175 +187,14 @@ if (ISLE_BUILD_APP)
# Include LEGO1 headers in ISLE # Include LEGO1 headers in ISLE
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1") target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
# Link DSOUND, WINMM, and our fake LEGO1 lib (TODO: replace with real once all exports are implemented) # Link DSOUND, WINMM, and LEGO1
target_link_libraries(isle PRIVATE dsound winmm "${CMAKE_SOURCE_DIR}/ISLE/ext/lego1.lib") target_link_libraries(isle PRIVATE dsound winmm lego1)
# Make sure filenames are ALL CAPS # Make sure filenames are ALL CAPS
set_property(TARGET isle PROPERTY OUTPUT_NAME ISLE) set_property(TARGET isle PROPERTY OUTPUT_NAME ISLE)
set_property(TARGET isle PROPERTY SUFFIX ".EXE") set_property(TARGET isle PROPERTY SUFFIX ".EXE")
endif() endif()
if (ISLE_BUILD_LIB)
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/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/legohideanimpresenter.cpp
LEGO1/legoinputmanager.cpp
LEGO1/legojetski.cpp
LEGO1/legoloadcachesoundpresenter.cpp
LEGO1/legolocomotionanimpresenter.cpp
LEGO1/legonavcontroller.cpp
LEGO1/legoomni.cpp
LEGO1/legopalettepresenter.cpp
LEGO1/legopathactor.cpp
LEGO1/legopathcontroller.cpp
LEGO1/legopathpresenter.cpp
LEGO1/legophonemepresenter.cpp
LEGO1/legoplantmanager.cpp
LEGO1/legorace.cpp
LEGO1/legosoundmanager.cpp
LEGO1/legostate.cpp
LEGO1/legotexturepresenter.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/mxcompositemediapresenter.cpp
LEGO1/mxcompositepresenter.cpp
LEGO1/mxcontrolpresenter.cpp
LEGO1/mxcore.cpp
LEGO1/mxcriticalsection.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/mxloopingsmkpresenter.cpp
LEGO1/mxmediapresenter.cpp
LEGO1/mxmusicpresenter.cpp
LEGO1/mxnotificationmanager.cpp
LEGO1/mxomni.cpp
LEGO1/mxomnicreateflags.cpp
LEGO1/mxomnicreateparam.cpp
LEGO1/mxomnicreateparambase.cpp
LEGO1/mxpalette.cpp
LEGO1/mxpresenter.cpp
LEGO1/mxsmkpresenter.cpp
LEGO1/mxsoundmanager.cpp
LEGO1/mxsoundpresenter.cpp
LEGO1/mxstillpresenter.cpp
LEGO1/mxstreamer.cpp
LEGO1/mxstring.cpp
LEGO1/mxtimer.cpp
LEGO1/mxtransitionmanager.cpp
LEGO1/mxunknown100dc6b0.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/registrationbook.cpp
LEGO1/score.cpp
LEGO1/scorestate.cpp
LEGO1/skateboard.cpp
LEGO1/towtrack.cpp
LEGO1/towtrackmissionstate.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")
endif()
if (MSVC) if (MSVC)
# These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the # 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. # game was originally built with) and tweaked slightly to produce more debugging info for reccmp.

View File

@ -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

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
#include <windows.h> #include <windows.h>
// OFFSET: LEGO1 0x10091ee0 // 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; return TRUE;
} }

View File

@ -1,5 +1,8 @@
#include "legoanimationmanager.h" #include "legoanimationmanager.h"
// 0x100f74f8
int g_legoAnimationManagerConfig = 1;
// OFFSET: LEGO1 0x1005eb60 STUB // OFFSET: LEGO1 0x1005eb60 STUB
LegoAnimationManager::LegoAnimationManager() LegoAnimationManager::LegoAnimationManager()
{ {
@ -32,3 +35,9 @@ void LegoAnimationManager::Init()
{ {
// TODO // TODO
} }
// OFFSET: LEGO1 0x1005eb50
void LegoAnimationManager::configureLegoAnimationManager(int param_1)
{
g_legoAnimationManagerConfig = param_1;
}

View File

@ -0,0 +1,56 @@
#include "legobackgroundcolor.h"
#include "legoomni.h"
#include "legoutil.h"
#include "legovideomanager.h"
const char *Delimiter = "\t";
const char *set = "set";
const char *reset = "reset";
// OFFSET: LEGO1 0x1003bfb0
LegoBackgroundColor::LegoBackgroundColor(const char *name, const char *colorString)
{
m_name = name;
m_name.ToUpperCase();
SetColorString(colorString);
}
// OFFSET: LEGO1 0x1003c070
void LegoBackgroundColor::SetColorString(const char *colorString)
{
m_name = colorString;
m_string.ToLowerCase();
float converted_r;
float converted_b;
float converted_g;
LegoVideoManager *videomanager = VideoManager();
if (videomanager && colorString)
{
int length = strlen(colorString) + 1;
char *colorStringCopy = new char[length];
strcpy(colorStringCopy, colorString);
char *colorStringSplit = strtok(colorStringCopy, Delimiter);
if (!strcmp(colorStringSplit, set))
{
char *hue = strtok(0, Delimiter);
if (hue)
h = atoi(hue) * 0.01;
char *sat = strtok(0, Delimiter);
if (sat)
s = atoi(sat) * 0.01;
char *val = strtok(0, Delimiter);
if (val)
v = atoi(val) * 0.01;
}
else if (!strcmp(colorStringSplit, reset))
{
// reset it
ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b);
videomanager->SetSkyColor(converted_r, converted_g, converted_b);
}
delete[] colorStringCopy;
}
}

View File

@ -1,10 +1,17 @@
#ifndef LEGOBACKGROUNDCOLOR_H #ifndef LEGOBACKGROUNDCOLOR_H
#define LEGOBACKGROUNDCOLOR_H #define LEGOBACKGROUNDCOLOR_H
#include "mxstring.h"
class LegoBackgroundColor #include "mxcore.h"
#include "MxStringVariable.h"
class LegoBackgroundColor : public MxStringVariable
{ {
public: public:
__declspec(dllexport) LegoBackgroundColor(const char *, const char *); __declspec(dllexport) LegoBackgroundColor(const char *, const char *);
void SetColorString(const char *colorString);
protected:
float h;
float s;
float v;
}; };
#endif // LEGOBACKGROUNDCOLOR_H #endif // LEGOBACKGROUNDCOLOR_H

View File

@ -1,13 +1,18 @@
#include "legobuildingmanager.h" #include "legobuildingmanager.h"
// 0x100f37cc
int g_buildingManagerConfig = 1;
// OFFSET: LEGO1 0x1002f8c0 STUB // OFFSET: LEGO1 0x1002f8c0 STUB
LegoBuildingManager::LegoBuildingManager() LegoBuildingManager::LegoBuildingManager()
{ {
// TODO
} }
// OFFSET: LEGO1 0x1002f960 STUB // OFFSET: LEGO1 0x1002f960 STUB
LegoBuildingManager::~LegoBuildingManager() LegoBuildingManager::~LegoBuildingManager()
{ {
// TODO
} }
// OFFSET: LEGO1 0x1002f9d0 STUB // OFFSET: LEGO1 0x1002f9d0 STUB
@ -15,3 +20,9 @@ void LegoBuildingManager::Init()
{ {
// TODO // TODO
} }
// OFFSET: LEGO1 0x1002f8b0
void LegoBuildingManager::configureLegoBuildingManager(int param_1)
{
g_buildingManagerConfig = param_1;
}

45
LEGO1/legogamestate.cpp Normal file
View File

@ -0,0 +1,45 @@
#include "legogamestate.h"
// OFFSET: LEGO1 0x10039550
LegoGameState::LegoGameState()
{
// TODO
}
// OFFSET: LEGO1 0x10039720
LegoGameState::~LegoGameState()
{
// TODO
}
// OFFSET: LEGO1 0x10039c60
long LegoGameState::Load(unsigned long)
{
// TODO
return 0;
}
// OFFSET: LEGO1 0x10039980
long LegoGameState::Save(unsigned long p)
{
// TODO
return 0;
}
// OFFSET: LEGO1 0x1003a2e0
void LegoGameState::SerializePlayersInfo(short p)
{
// TODO
}
// OFFSET: LEGO1 0x1003cdd0
void LegoGameState::SerializeScoreHistory(short p)
{
// TODO
}
// OFFSET: LEGO1 0x10039f00
void LegoGameState::SetSavePath(char *p)
{
// TODO
}

View File

@ -12,6 +12,24 @@ LegoInputManager::~LegoInputManager()
// TODO // TODO
} }
// OFFSET: LEGO1 0x1005c740 STUB
void LegoInputManager::QueueEvent(NotificationId id, unsigned char p2, long p3, long 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 // OFFSET: LEGO1 0x1005b8b0 STUB
long LegoInputManager::Tickle() long LegoInputManager::Tickle()
{ {

View File

@ -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;
}

View File

@ -106,8 +106,7 @@ void LegoNavController::SetControlMax(int p_hMax, int p_vMax)
this->m_hMax = p_hMax; this->m_hMax = p_hMax;
this->m_vMax = p_vMax; this->m_vMax = p_vMax;
if (VideoManager()->GetVideoParam().flags().GetFullScreen()) if (VideoManager()->GetVideoParam().flags().GetFullScreen()) {
{
this->m_hMax = 640; this->m_hMax = 640;
this->m_vMax = 480; this->m_vMax = 480;
} }
@ -134,19 +133,15 @@ void LegoNavController::ResetToDefault()
void LegoNavController::SetTargets(int p_hPos, int p_vPos, MxBool p_accel) void LegoNavController::SetTargets(int p_hPos, int p_vPos, MxBool p_accel)
{ {
if (this->m_trackDefault != FALSE) if (this->m_trackDefault != FALSE)
{
ResetToDefault(); ResetToDefault();
}
if (p_accel != FALSE) if (p_accel != FALSE) {
{
this->m_targetTurnSpeed = CalculateNewTargetSpeed(p_hPos, this->m_hMax / 2, this->m_turnMaxSpeed); 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_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_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); 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_targetTurnSpeed = 0.0f;
this->m_targetMovementSpeed = 0.0f; this->m_targetMovementSpeed = 0.0f;
this->m_movementAccel = this->m_movementDecel; 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; result = Abs(diff) * p_maxAccel / p_center;
if (result < p_minAccel) if (result < p_minAccel)
{ result = (float) p_minAccel;
result = (float)p_minAccel;
}
return result; 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;
}

View File

@ -40,6 +40,7 @@ class LegoNavController : public MxCore
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel); void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
float CalculateNewTargetSpeed(int p_pos, int p_center, float p_maxSpeed); 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 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: private:
int m_hMax; int m_hMax;

View File

@ -1,5 +1,11 @@
#include "legoomni.h" #include "legoomni.h"
// 0x100f4588
char *g_nocdSourceName = NULL;
// 0x101020e8
void (*g_omniUserMessage)(const char *,int);
// OFFSET: LEGO1 0x10058a00 // OFFSET: LEGO1 0x10058a00
LegoOmni::LegoOmni() LegoOmni::LegoOmni()
{ {
@ -12,6 +18,44 @@ LegoOmni::~LegoOmni()
Destroy(); Destroy();
} }
// OFFSET: LEGO1 0x1005b560 STUB
void LegoOmni::CreateBackgroundAudio()
{
// TODO
}
// OFFSET: LEGO1 0x1005af10 STUB
void LegoOmni::RemoveWorld(const MxAtomId &p1, long 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
long Start(MxDSAction *)
{
// TODO
return 0;
}
// OFFSET: LEGO1 0x1005ad10 // OFFSET: LEGO1 0x1005ad10
LegoOmni *LegoOmni::GetInstance() LegoOmni *LegoOmni::GetInstance()
{ {
@ -67,6 +111,13 @@ MxBackgroundAudioManager *BackgroundAudioManager()
return LegoOmni::GetInstance()->GetBackgroundAudioManager(); return LegoOmni::GetInstance()->GetBackgroundAudioManager();
} }
// OFFSET: LEGO1 0x100c0280 STUB
MxDSObject *CreateStreamObject(MxDSFile *,short)
{
// TODO
return NULL;
}
// OFFSET: LEGO1 0x10015740 // OFFSET: LEGO1 0x10015740
LegoInputManager *InputManager() LegoInputManager *InputManager()
{ {
@ -91,6 +142,11 @@ MxTransitionManager *TransitionManager()
return LegoOmni::GetInstance()->GetTransitionManager(); return LegoOmni::GetInstance()->GetTransitionManager();
} }
// OFFSET: LEGO1 0x10053430
const char *GetNoCD_SourceName()
{
return g_nocdSourceName;
}
// OFFSET: LEGO1 0x1005b5f0 // OFFSET: LEGO1 0x1005b5f0
long LegoOmni::Notify(MxParam &p) long LegoOmni::Notify(MxParam &p)
@ -99,6 +155,20 @@ long LegoOmni::Notify(MxParam &p)
return 0; return 0;
} }
// OFFSET: LEGO1 0x1003dd70 STUB
LegoROI *PickROI(long,long)
{
// TODO
return NULL;
}
// OFFSET: LEGO1 0x1003ddc0 STUB
LegoEntity *PickEntity(long,long)
{
// TODO
return NULL;
}
// OFFSET: LEGO1 0x10058bd0 // OFFSET: LEGO1 0x10058bd0
void LegoOmni::Init() void LegoOmni::Init()
{ {

View File

@ -5,6 +5,7 @@
#include "legoinputmanager.h" #include "legoinputmanager.h"
#include "legogamestate.h" #include "legogamestate.h"
#include "legonavcontroller.h" #include "legonavcontroller.h"
#include "legopathboundary.h"
#include "legoroi.h" #include "legoroi.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "mxatomid.h" #include "mxatomid.h"
@ -27,7 +28,7 @@ class LegoOmni : public MxOmni
public: public:
__declspec(dllexport) void CreateBackgroundAudio(); __declspec(dllexport) void CreateBackgroundAudio();
__declspec(dllexport) void RemoveWorld(const MxAtomId &p1, long p2); __declspec(dllexport) void RemoveWorld(const MxAtomId &p1, long p2);
__declspec(dllexport) static int GetCurrPathInfo(class LegoPathBoundary * *,int &); __declspec(dllexport) static int GetCurrPathInfo(LegoPathBoundary **,int &);
__declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static void CreateInstance();
__declspec(dllexport) static LegoOmni *GetInstance(); __declspec(dllexport) static LegoOmni *GetInstance();
@ -99,7 +100,6 @@ __declspec(dllexport) const char * GetNoCD_SourceName();
__declspec(dllexport) LegoInputManager * InputManager(); __declspec(dllexport) LegoInputManager * InputManager();
__declspec(dllexport) LegoOmni * Lego(); __declspec(dllexport) LegoOmni * Lego();
__declspec(dllexport) void MakeSourceName(char *, const char *); __declspec(dllexport) void MakeSourceName(char *, const char *);
__declspec(dllexport) MxNotificationManager * NotificationManager();
__declspec(dllexport) LegoEntity * PickEntity(long,long); __declspec(dllexport) LegoEntity * PickEntity(long,long);
__declspec(dllexport) LegoROI * PickROI(long,long); __declspec(dllexport) LegoROI * PickROI(long,long);
__declspec(dllexport) void SetOmniUserMessage(void (*)(const char *,int)); __declspec(dllexport) void SetOmniUserMessage(void (*)(const char *,int));

View File

@ -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;
}

View File

@ -1,6 +1,8 @@
#ifndef LEGOPARTPRESENTER_H #ifndef LEGOPARTPRESENTER_H
#define LEGOPARTPRESENTER_H #define LEGOPARTPRESENTER_H
#include "mxmediapresenter.h"
// VTABLE 0x100d4df0 // VTABLE 0x100d4df0
// SIZE 0x54 (from inlined construction at 0x10009fac) // SIZE 0x54 (from inlined construction at 0x10009fac)
class LegoPartPresenter : public MxMediaPresenter class LegoPartPresenter : public MxMediaPresenter

9
LEGO1/legopathboundary.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef LEGOPATHBOUNDARH_H
#define LEGOPATHBOUNDARH_H
class LegoPathBoundary
{
};
#endif // LEGOPATHBOUNDARH_H

17
LEGO1/legoroi.cpp Normal file
View File

@ -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;
}

View File

@ -4,8 +4,8 @@
class LegoROI class LegoROI
{ {
public: public:
__declspec(dllexport) void SetDisplayBB(int); __declspec(dllexport) void SetDisplayBB(int p_displayBB);
__declspec(dllexport) static void configureLegoROI(int param_1); __declspec(dllexport) static void configureLegoROI(int p_roi);
}; };
#endif // LEGOROI_H #endif // LEGOROI_H

68
LEGO1/legoutil.cpp Normal file
View File

@ -0,0 +1,68 @@
#include "legoutil.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;
long hue_index;
double v9;
double v12;
double v13;
if (s > 0.5f)
calc = (1.0f - v) * s + v;
else
calc = (v + 1.0) * s;
if (calc <= 0.0)
{
*g_out = 0.0f;
*b_out = 0.0f;
*r_out = 0.0f;
return;
}
p = s * 2.0 - 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;
}
}

View File

@ -7,4 +7,18 @@ inline T Abs(T p_t)
return p_t < 0 ? -p_t : p_t; return p_t < 0 ? -p_t : p_t;
} }
template <class T>
inline T Min(T p_t1, T p_t2)
{
return p_t1 < p_t2 ? p_t1 : p_t2;
}
template <class T>
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 #endif // LEGOUTIL_H

View File

@ -1,4 +1,5 @@
#include "legovideomanager.h" #include "legovideomanager.h"
#include <ddraw.h>
// OFFSET: LEGO1 0x1007aa20 STUB // OFFSET: LEGO1 0x1007aa20 STUB
LegoVideoManager::LegoVideoManager() LegoVideoManager::LegoVideoManager()
@ -37,3 +38,15 @@ void LegoVideoManager::MoveCursor(int x, int y)
{ {
// TODO // 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
}

View File

@ -18,6 +18,7 @@ class LegoVideoManager : public MxVideoManager
__declspec(dllexport) void MoveCursor(int x, int y); __declspec(dllexport) void MoveCursor(int x, int y);
inline Lego3DManager *Get3DManager() { return this->m_3dManager; } inline Lego3DManager *Get3DManager() { return this->m_3dManager; }
void SetSkyColor(float r, float g, float b);
int m_unk64; int m_unk64;
Lego3DManager *m_3dManager; Lego3DManager *m_3dManager;

74
LEGO1/mxbitmap.cpp Normal file
View File

@ -0,0 +1,74 @@
#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 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 0x100bcd10
long MxBitmap::Read(const char *filename)
{
HANDLE handle;
int unk1;
MxResult ret = FAILURE;
handle = CreateFileA(filename,GENERIC_READ,FILE_SHARE_READ,(LPSECURITY_ATTRIBUTES)NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,(HANDLE)NULL);
if(handle != (HANDLE)INVALID_HANDLE_VALUE) { // INVALID_HANDLE_VALUE = -1, or 0xffffffff
// FIXME: line 16. iVar gets changed in this line
if(unk1 == 0) {
ret = SUCCESS;
}
}
if(handle != (HANDLE)NULL) {
CloseHandle(handle);
}
return ret;
}

View File

@ -1,13 +1,26 @@
#ifndef MXBITMAP_H #ifndef MXBITMAP_H
#define MXBITMAP_H #define MXBITMAP_H
class MxBitmap #include <stdlib.h>
#include "mxcore.h"
#include "mxpalette.h"
#include "mxtypes.h"
class MxBitmap : public MxCore
{ {
public: public:
__declspec(dllexport) MxBitmap(); __declspec(dllexport) MxBitmap();
__declspec(dllexport) virtual ~MxBitmap(); __declspec(dllexport) virtual ~MxBitmap();
__declspec(dllexport) virtual MxPalette *CreatePalette(); __declspec(dllexport) virtual MxPalette *CreatePalette();
__declspec(dllexport) virtual long Read(const char *); __declspec(dllexport) virtual long Read(const char *);
private:
BITMAPINFO *m_info;
BITMAPINFOHEADER *m_bmiHeader;
RGBQUAD *m_paletteData;
LPVOID *m_data;
MxBool m_unk18;
MxPalette *m_palette;
}; };
#endif // MXBITMAP_H #endif // MXBITMAP_H

22
LEGO1/mxdirectdraw.cpp Normal file
View File

@ -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;
}

View File

@ -45,16 +45,16 @@ MxDSObject &MxDSObject::operator=(MxDSObject &p_dsObject)
} }
// OFFSET: LEGO1 0x100bf8e0 // OFFSET: LEGO1 0x100bf8e0
void MxDSObject::SetObjectName(const char *p_name) void MxDSObject::SetObjectName(const char *p_objectName)
{ {
if (p_name != this->m_objectName) { if (p_objectName != this->m_objectName) {
delete[] this->m_objectName; delete[] this->m_objectName;
if (p_name) { if (p_objectName) {
this->m_objectName = new char[strlen(p_name) + 1]; this->m_objectName = new char[strlen(p_objectName) + 1];
if (this->m_objectName) { if (this->m_objectName) {
strcpy(this->m_objectName, p_name); strcpy(this->m_objectName, p_objectName);
} }
} }
else { else {

View File

@ -1,5 +1,14 @@
#include "mxomni.h" #include "mxomni.h"
// 0x101015b8
char g_hdPath[1024];
// 0x101019b8
char g_cdPath[1024];
// 0x10101db8
MxBool g_use3dSound;
// 0x101015b0 // 0x101015b0
MxOmni *MxOmni::g_instance = NULL; MxOmni *MxOmni::g_instance = NULL;
@ -43,6 +52,43 @@ void MxOmni::DestroyInstance()
} }
} }
// 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 // OFFSET: LEGO1 0x100b0680
MxOmni *MxOmni::GetInstance() MxOmni *MxOmni::GetInstance()
{ {
@ -141,4 +187,4 @@ MxMusicManager* MusicManager()
MxEventManager* EventManager() MxEventManager* EventManager()
{ {
return MxOmni::GetInstance()->GetEventManager(); return MxOmni::GetInstance()->GetEventManager();
} }

View File

@ -24,10 +24,10 @@ class MxOmni : public MxCore
__declspec(dllexport) static const char *GetCD(); __declspec(dllexport) static const char *GetCD();
__declspec(dllexport) static const char *GetHD(); __declspec(dllexport) static const char *GetHD();
__declspec(dllexport) static MxOmni *GetInstance(); __declspec(dllexport) static MxOmni *GetInstance();
__declspec(dllexport) static unsigned char IsSound3D(); __declspec(dllexport) static MxBool IsSound3D();
__declspec(dllexport) static void SetCD(const char *s); __declspec(dllexport) static void SetCD(const char *p_cd);
__declspec(dllexport) static void SetHD(const char *s); __declspec(dllexport) static void SetHD(const char *p_hd);
__declspec(dllexport) static void SetSound3D(unsigned char); __declspec(dllexport) static void SetSound3D(MxBool p_3dsound);
virtual ~MxOmni(); virtual ~MxOmni();
@ -75,5 +75,6 @@ __declspec(dllexport) MxSoundManager * MSoundManager();
__declspec(dllexport) MxVariableTable * VariableTable(); __declspec(dllexport) MxVariableTable * VariableTable();
__declspec(dllexport) MxMusicManager * MusicManager(); __declspec(dllexport) MxMusicManager * MusicManager();
__declspec(dllexport) MxEventManager * EventManager(); __declspec(dllexport) MxEventManager * EventManager();
__declspec(dllexport) MxNotificationManager * NotificationManager();
#endif // MXOMNI_H #endif // MXOMNI_H

View File

@ -5,4 +5,17 @@ MxResult MxPalette::GetEntries(LPPALETTEENTRY p_entries)
{ {
memcpy(p_entries, this->m_entries, sizeof(this->m_entries)); memcpy(p_entries, this->m_entries, sizeof(this->m_entries));
return SUCCESS; return SUCCESS;
} }
// OFFSET: LEGO1 0x100bf340
MxBool MxPalette::operator==(MxPalette &)
{
// TODO
return FALSE;
}
// OFFSET: LEGO1 0x100bf330
void MxPalette::Detach()
{
// TODO
}

View File

@ -11,7 +11,7 @@
class MxPalette : public MxCore class MxPalette : public MxCore
{ {
public: public:
__declspec(dllexport) unsigned char operator==(MxPalette &); __declspec(dllexport) MxBool operator==(MxPalette &);
__declspec(dllexport) void Detach(); __declspec(dllexport) void Detach();
MxResult GetEntries(LPPALETTEENTRY p_entries); MxResult GetEntries(LPPALETTEENTRY p_entries);

15
LEGO1/mxscheduler.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "mxscheduler.h"
// OFFSET: LEGO1 0x100bf4f0
MxScheduler *MxScheduler::GetInstance()
{
// Intentionally empty
return 0;
}
// OFFSET: LEGO1 0x100bf500
void MxScheduler::StartMultiTasking(unsigned long)
{
// Intentionally empty
}

View File

@ -6,6 +6,20 @@ MxStreamer::~MxStreamer()
// TODO // TODO
} }
// OFFSET: LEGO1 0x100b92c0 STUB
MxStreamController *MxStreamer::Open(const char *name, unsigned short p)
{
// TODO
return NULL;
}
// OFFSET: LEGO1 0x100b9570 STUB
long MxStreamer::Close(const char *p)
{
// TODO
return 0;
}
// OFFSET: LEGO1 0x100b9b60 STUB // OFFSET: LEGO1 0x100b9b60 STUB
long MxStreamer::Notify(MxParam &p) long MxStreamer::Notify(MxParam &p)
{ {

View File

@ -0,0 +1,23 @@
#include "MxStringVariable.h"
#include "mxstring.h"
//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
MxStringVariable::~MxStringVariable()
{
delete &m_string;
delete &m_name;
}
// OFFSET: LEGO1 0x1003bea0
MxString *MxStringVariable::GetString()
{
return &m_string;
}
// OFFSET: LEGO1 0x1003beb0
void MxStringVariable::SetString(const char *colorString)
{
m_string = colorString;
}

20
LEGO1/mxstringvariable.h Normal file
View File

@ -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 ~MxStringVariable();
protected:
MxString m_name;
MxString m_string;
};
#endif // MXSTRINGVARIABLE_H

View File

@ -19,3 +19,9 @@ long MxTransitionManager::Tickle()
return 0; return 0;
} }
// OFFSET: LEGO1 0x1004c470 STUB
void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *videoPresenter)
{
// TODO
}

20
LEGO1/mxvariabletable.cpp Normal file
View File

@ -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;
}

View File

@ -32,6 +32,12 @@ int MxVideoManager::Init()
return 0; return 0;
} }
// OFFSET: LEGO1 0x100bea60 STUB
void MxVideoManager::InvalidateRect(MxRect32 &p_rect)
{
// TODO
}
// OFFSET: LEGO1 0x100bebe0 // OFFSET: LEGO1 0x100bebe0
long MxVideoManager::RealizePalette(MxPalette *p_palette) long MxVideoManager::RealizePalette(MxPalette *p_palette)
{ {

32
LEGO1/realtimeview.cpp Normal file
View File

@ -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;
}

7
LEGO1/viewmanager.cpp Normal file
View File

@ -0,0 +1,7 @@
#include "viewmanager.h"
// OFFSET: LEGO1 0x100a64d0 STUB
void ViewManager::RemoveAll(ViewROI *)
{
// TODO
}

View File

@ -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) [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 ## Status
<img src="https://github.com/isledecomp/isle/releases/download/continuous/ISLEPROGRESS.PNG" width="50%"><img src="https://github.com/isledecomp/isle/releases/download/continuous/LEGO1PROGRESS.PNG" width="50%"> <img src="https://legoisland.org/progress/ISLEPROGRESS.SVG" width="50%"><img src="https://legoisland.org/progress/LEGO1PROGRESS.SVG" width="50%">
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 ## 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. #### Prerequisites
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.
### 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. #### Compiling From Command Line
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). 1. Open a Command Prompt (`cmd`).
4. `cd` to the folder you cloned this repository to. 1. From Visual C++ 4.2, run `BIN/VCVARS32.BAT x86` to populate the path and other environment variables for compiling with MSVC.
5. `mkdir Release` if the folder doesn't already exist. Some versions of NMAKE may make this folder by itself, but some don't. 1. Make a folder for compiled objects to go, such as a `build` folder inside the source repository (the folder you cloned/downloaded to).
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. 1. In your Command Prompt, `cd` to the build folder.
1. Configure the project with CMake by running:
```
cmake <path-to-source> -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo
```
- Replace `<path-to-source>` 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 <build-folder>`
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 ## 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. 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 ## 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. If you're interested in helping/contributing to this project, check out the [CONTRIBUTING](https://github.com/isledecomp/isle/blob/master/CONTRIBUTING.md) page.

View File

@ -55,12 +55,12 @@
x="58.13345" x="58.13345"
y="51.967873" /><text y="51.967873" /><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.7px;font-family:mono;-inkscape-font-specification:mono;text-align:center;text-anchor:middle;fill:#ffffff;stroke:#000000;stroke-width:1.25161812;stroke-opacity:1;stroke-dasharray:none;paint-order:stroke fill markers" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.7px;font-family:monospace;-inkscape-font-specification:mono;text-align:center;text-anchor:middle;fill:#ffffff;stroke:#000000;stroke-width:1.25161812;stroke-opacity:1;stroke-dasharray:none;paint-order:stroke fill markers"
x="84.666656" x="84.666656"
y="118.35877" y="118.35877"
id="text740"><tspan id="text740"><tspan
id="tspan738" id="tspan738"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:mono;-inkscape-font-specification:mono;text-align:center;text-anchor:middle;stroke:#000000;stroke-width:1.25161812;stroke-opacity:1;stroke-dasharray:none;paint-order:stroke fill markers" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:monospace;-inkscape-font-specification:mono;text-align:center;text-anchor:middle;stroke:#000000;stroke-width:1.25161812;stroke-opacity:1;stroke-dasharray:none;paint-order:stroke fill markers"
x="84.666656" x="84.666656"
y="118.35877">{name}</tspan></text><g y="118.35877">{name}</tspan></text><g
id="g1250" id="g1250"
@ -78,7 +78,7 @@
x="21.118132" x="21.118132"
y="134.05507" /><text y="134.05507" /><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:monospace;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
x="76.884926" x="76.884926"
y="139.89182" y="139.89182"
id="text2152"><tspan id="text2152"><tspan
@ -94,7 +94,7 @@
y="134.05507" y="134.05507"
clip-path="url(#progBarCutoff)" /><text clip-path="url(#progBarCutoff)" /><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:monospace;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
x="76.884926" x="76.884926"
y="139.89182" y="139.89182"
id="text18" id="text18"
@ -105,7 +105,7 @@
y="139.89182" y="139.89182"
id="tspan16">{percent}</tspan></text></g><text id="tspan16">{percent}</tspan></text></g><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.83441208;stroke-dasharray:none;stroke-opacity:1;opacity:1;stroke-linejoin:miter;stroke-linecap:butt;paint-order:stroke fill markers" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:monospace;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.83441208;stroke-dasharray:none;stroke-opacity:1;opacity:1;stroke-linejoin:miter;stroke-linecap:butt;paint-order:stroke fill markers"
x="46.947659" x="46.947659"
y="129.67447" y="129.67447"
id="text1260"><tspan id="text1260"><tspan

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
tools/verexp/DUMPBIN.EXE Executable file

Binary file not shown.

BIN
tools/verexp/LINK.EXE Executable file

Binary file not shown.

BIN
tools/verexp/MSPDB41.DLL Normal file

Binary file not shown.

82
tools/verexp/verexp.py Executable file
View File

@ -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)