From ce46866403fdcc479cf9d67e4d430409b15dadc3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 21 Aug 2002 16:07:07 +0000 Subject: Initial revision svn-id: r4785 --- .cvsignore | 6 - .indent.pro | 15 - COPYING | 341 ++ Makefile | 18 +- Makefile.common | 67 +- Makefile.irix | 21 - Makefile.mingw | 45 - Makefile.qtopia | 20 - NEWS | 28 + README | 560 ++ actor.cpp | 1418 ----- actor.h | 179 - akos.cpp | 1199 ---- akos.h | 170 - backends/dc/.cvsignore | 5 + backends/dc/Makefile | 39 + backends/dc/README | 20 + backends/dc/audio.cpp | 86 + backends/dc/dc.h | 102 + backends/dc/dcmain.cpp | 201 + backends/dc/display.cpp | 303 + backends/dc/icon.cpp | 228 + backends/dc/icon.h | 21 + backends/dc/input.cpp | 173 + backends/dc/label.cpp | 131 + backends/dc/label.h | 11 + backends/dc/portdefs.h | 9 + backends/dc/selector.cpp | 487 ++ backends/dc/vmsave.cpp | 266 + backends/mac/Carbon.r | 111 + backends/mac/CarbonPort-ReadMe.txt | 34 + backends/mac/mac.cpp | 1790 ++++++ backends/mac/macos.h | 24 + backends/mac/scummvm.icns | Bin 0 -> 38332 bytes backends/mac/scummvm.mcp | Bin 0 -> 158716 bytes backends/morphos/Makefile | 48 + backends/morphos/MorphOS.readme | 13 + backends/morphos/morphos.cpp | 1293 ++++ backends/morphos/morphos.h | 206 + backends/morphos/morphos_scaler.cpp | 823 +++ backends/morphos/morphos_scaler.h | 93 + backends/morphos/morphos_sound.cpp | 284 + backends/morphos/morphos_start.cpp | 359 ++ backends/morphos/morphos_timer.cpp | 243 + backends/morphos/morphos_timer.h | 86 + backends/sdl/fb2opengl.h | 355 ++ backends/sdl/sdl.cpp | 1409 +++++ backends/sdl/sdl_gl.cpp | 1068 ++++ backends/wince/MenuTitle.bmp | Bin 0 -> 11482 bytes backends/wince/PocketSCUMM.rc | 209 + backends/wince/PocketSCUMM.vcc | 74 + backends/wince/PocketSCUMM.vcp | 9228 +++++++++++++++++++++++++++++ backends/wince/PocketSCUMM.vcw | 29 + backends/wince/bitmaps.cpp | 10720 ++++++++++++++++++++++++++++++++++ backends/wince/findgame.cpp | 556 ++ backends/wince/gapi_keys.cpp | 341 ++ backends/wince/gapi_keys.h | 62 + backends/wince/missing/assert.h | 3 + backends/wince/missing/conio.h | 2 + backends/wince/missing/dir.h | 1 + backends/wince/missing/direct.h | 1 + backends/wince/missing/dirent.h | 52 + backends/wince/missing/errno.h | 1 + backends/wince/missing/fcntl.h | 1 + backends/wince/missing/io.h | 15 + backends/wince/missing/missing.cpp | 378 ++ backends/wince/missing/signal.h | 3 + backends/wince/missing/sys/stat.h | 23 + backends/wince/missing/sys/time.h | 10 + backends/wince/missing/sys/types.h | 5 + backends/wince/missing/time.h | 24 + backends/wince/missing/unistd.h | 1 + backends/wince/newres.h | 41 + backends/wince/pocketpc.cpp | 1490 +++++ backends/wince/pocketscumm.ico | Bin 0 -> 318 bytes backends/wince/resource.h | 58 + backends/wince/screen.cpp | 1588 +++++ backends/wince/screen.h | 58 + backends/x11/x11.cpp | 990 ++++ boxes.cpp | 1039 ---- boxes.h | 52 - bundle.cpp | 660 --- bundle.h | 71 - common/config-file.cpp | 386 ++ common/config-file.h | 57 + common/gameDetector.cpp | 632 ++ common/gameDetector.h | 79 + common/main.cpp | 150 + common/scummsys.h | 366 ++ common/stdafx.cpp | 1 + common/stdafx.h | 169 + common/system.h | 199 + common/timer.cpp | 157 + common/timer.h | 66 + common/util.cpp | 312 + common/util.h | 183 + config-file.cpp | 386 -- config-file.h | 57 - copying.txt | 341 -- costume.cpp | 1447 ----- costume.h | 112 - dc/.cvsignore | 5 - dc/Makefile | 39 - dc/README | 20 - dc/audio.cpp | 86 - dc/dc.h | 102 - dc/dcmain.cpp | 201 - dc/display.cpp | 303 - dc/icon.cpp | 228 - dc/icon.h | 21 - dc/input.cpp | 173 - dc/label.cpp | 131 - dc/label.h | 11 - dc/portdefs.h | 9 - dc/selector.cpp | 487 -- dc/vmsave.cpp | 266 - debian/.cvsignore | 6 - debian/README.Debian | 9 - debian/changelog.cvs | 8 - debian/changelog.debian | 22 - debian/changelog.debian_official | 23 - debian/control | 15 - debian/copyright | 16 - debian/prepare | 20 - debian/rules | 48 - debian/scummvm.dirs | 3 - debian/scummvm.docs | 2 - debug.cpp | 485 -- debug.h | 52 - debugrl.cpp | 87 - debugrl.h | 5 - engine.cpp | 101 - engine.h | 60 - fb2opengl.h | 355 -- gameDetector.cpp | 632 -- gameDetector.h | 79 - gapi_keys.h | 62 - gfx.cpp | 2872 --------- gfx.h | 193 - gui.cpp | 1252 ---- gui.h | 124 - gui/dialog.cpp | 22 +- gui/dialog.h | 2 + gui/gui.cpp | 1252 ++++ gui/gui.h | 124 + gui/guimaps.h | 157 + gui/newgui.cpp | 541 ++ gui/newgui.h | 151 + guimaps.h | 157 - insane.cpp | 1510 ----- mac/Carbon.r | 111 - mac/CarbonPort-ReadMe.txt | 34 - mac/ScummVM_Mac_Prefix.h | 7 - mac/mac.cpp | 1790 ------ mac/macos.h | 24 - mac/scummvm.mcp | Bin 158716 -> 0 bytes main.cpp | 150 - morphos/Makefile | 49 - morphos/MorphOS.readme | 13 - morphos/morphos.cpp | 1293 ---- morphos/morphos.h | 206 - morphos/morphos_scaler.cpp | 823 --- morphos/morphos_scaler.h | 93 - morphos/morphos_sound.cpp | 284 - morphos/morphos_start.cpp | 359 -- morphos/morphos_timer.cpp | 243 - morphos/morphos_timer.h | 86 - newgui.cpp | 541 -- newgui.h | 151 - object.cpp | 1326 ----- object.h | 122 - readme.txt | 560 -- resource.cpp | 1428 ----- resource.h | 58 - saveload.cpp | 891 --- saveload.h | 101 - scaler.cpp | 814 --- scaler.h | 40 - script.cpp | 1113 ---- script_v1.cpp | 2799 --------- script_v2.cpp | 3141 ---------- scumm.h | 1414 ----- scumm/actor.cpp | 1418 +++++ scumm/actor.h | 179 + scumm/akos.cpp | 1199 ++++ scumm/akos.h | 170 + scumm/boxes.cpp | 1039 ++++ scumm/boxes.h | 52 + scumm/bundle.cpp | 660 +++ scumm/bundle.h | 71 + scumm/costume.cpp | 1447 +++++ scumm/costume.h | 112 + scumm/debug.cpp | 485 ++ scumm/debug.h | 52 + scumm/debugrl.cpp | 87 + scumm/debugrl.h | 5 + scumm/engine.cpp | 101 + scumm/engine.h | 60 + scumm/gfx.cpp | 2872 +++++++++ scumm/gfx.h | 193 + scumm/imuse.cpp | 4580 +++++++++++++++ scumm/imuse.h | 61 + scumm/insane.cpp | 1510 +++++ scumm/object.cpp | 1326 +++++ scumm/object.h | 122 + scumm/resource.cpp | 1428 +++++ scumm/resource.h | 58 + scumm/resource_v3.cpp | 161 + scumm/resource_v4.cpp | 40 + scumm/saveload.cpp | 891 +++ scumm/saveload.h | 101 + scumm/scaler.cpp | 814 +++ scumm/scaler.h | 40 + scumm/script.cpp | 1113 ++++ scumm/script_v1.cpp | 2799 +++++++++ scumm/script_v2.cpp | 3141 ++++++++++ scumm/scumm.h | 1414 +++++ scumm/scummvm.cpp | 1677 ++++++ scumm/smush.h | 144 + scumm/sound.h | 136 + scumm/string.cpp | 1056 ++++ scumm/sys.cpp | 195 + scumm/vars.cpp | 207 + scumm/verbs.cpp | 317 + scummsys.h | 366 -- scummvm.cpp | 1677 ------ sdl.cpp | 1409 ----- sdl_gl.cpp | 1068 ---- simon/debug.cpp | 769 +++ simon/intern.h | 171 + simon/items.cpp | 1628 ++++++ simon/midi.cpp | 8 +- simon/res.cpp | 400 ++ simon/simon.cpp | 6 +- simon/simondebug.cpp | 769 --- simon/simonintern.h | 171 - simon/simonitems.cpp | 1628 ------ simon/simonres.cpp | 400 -- simon/simonsys.cpp | 71 - simon/simonverb.cpp | 449 -- simon/simonvga.cpp | 1966 ------- simon/sys.cpp | 71 + simon/verb.cpp | 449 ++ simon/vga.cpp | 1966 +++++++ smush.h | 144 - sound.cpp | 1236 ---- sound.h | 136 - sound/imuse.cpp | 4584 --------------- sound/imuse.h | 61 - sound/sound.cpp | 1236 ++++ sound/sound.h | 136 + stdafx.cpp | 1 - stdafx.h | 166 - string.cpp | 1056 ---- sys.cpp | 195 - system.h | 199 - timer.cpp | 157 - timer.h | 66 - util.cpp | 312 - util.h | 183 - v3/resource_v3.cpp | 161 - v4/resource_v4.cpp | 40 - vars.cpp | 207 - verbs.cpp | 317 - whatsnew.txt | 28 - wince/MenuTitle.bmp | Bin 11482 -> 0 bytes wince/PocketSCUMM.rc | 209 - wince/PocketSCUMM.vcc | 74 - wince/PocketSCUMM.vcp | 9228 ----------------------------- wince/PocketSCUMM.vcw | 29 - wince/bitmaps.cpp | 10720 ---------------------------------- wince/findgame.cpp | 556 -- wince/gapi_keys.cpp | 341 -- wince/missing/assert.h | 3 - wince/missing/conio.h | 2 - wince/missing/dir.h | 1 - wince/missing/direct.h | 1 - wince/missing/dirent.h | 52 - wince/missing/errno.h | 1 - wince/missing/fcntl.h | 1 - wince/missing/io.h | 15 - wince/missing/missing.cpp | 378 -- wince/missing/signal.h | 3 - wince/missing/sys/stat.h | 23 - wince/missing/sys/time.h | 10 - wince/missing/sys/types.h | 5 - wince/missing/time.h | 24 - wince/missing/unistd.h | 1 - wince/newres.h | 41 - wince/pocketpc.cpp | 1490 ----- wince/pocketscumm.ico | Bin 318 -> 0 bytes wince/resource.h | 58 - wince/screen.cpp | 1588 ----- wince/screen.h | 58 - x11.cpp | 990 ---- 295 files changed, 82633 insertions(+), 82752 deletions(-) delete mode 100644 .cvsignore delete mode 100644 .indent.pro create mode 100644 COPYING delete mode 100644 Makefile.irix delete mode 100644 Makefile.mingw delete mode 100644 Makefile.qtopia create mode 100644 NEWS create mode 100644 README delete mode 100644 actor.cpp delete mode 100644 actor.h delete mode 100644 akos.cpp delete mode 100644 akos.h create mode 100644 backends/dc/.cvsignore create mode 100644 backends/dc/Makefile create mode 100644 backends/dc/README create mode 100644 backends/dc/audio.cpp create mode 100644 backends/dc/dc.h create mode 100644 backends/dc/dcmain.cpp create mode 100644 backends/dc/display.cpp create mode 100644 backends/dc/icon.cpp create mode 100644 backends/dc/icon.h create mode 100644 backends/dc/input.cpp create mode 100644 backends/dc/label.cpp create mode 100644 backends/dc/label.h create mode 100644 backends/dc/portdefs.h create mode 100644 backends/dc/selector.cpp create mode 100644 backends/dc/vmsave.cpp create mode 100644 backends/mac/Carbon.r create mode 100644 backends/mac/CarbonPort-ReadMe.txt create mode 100644 backends/mac/mac.cpp create mode 100644 backends/mac/macos.h create mode 100644 backends/mac/scummvm.icns create mode 100644 backends/mac/scummvm.mcp create mode 100644 backends/morphos/Makefile create mode 100644 backends/morphos/MorphOS.readme create mode 100644 backends/morphos/morphos.cpp create mode 100644 backends/morphos/morphos.h create mode 100644 backends/morphos/morphos_scaler.cpp create mode 100644 backends/morphos/morphos_scaler.h create mode 100644 backends/morphos/morphos_sound.cpp create mode 100644 backends/morphos/morphos_start.cpp create mode 100644 backends/morphos/morphos_timer.cpp create mode 100644 backends/morphos/morphos_timer.h create mode 100644 backends/sdl/fb2opengl.h create mode 100644 backends/sdl/sdl.cpp create mode 100644 backends/sdl/sdl_gl.cpp create mode 100644 backends/wince/MenuTitle.bmp create mode 100644 backends/wince/PocketSCUMM.rc create mode 100644 backends/wince/PocketSCUMM.vcc create mode 100644 backends/wince/PocketSCUMM.vcp create mode 100644 backends/wince/PocketSCUMM.vcw create mode 100644 backends/wince/bitmaps.cpp create mode 100644 backends/wince/findgame.cpp create mode 100644 backends/wince/gapi_keys.cpp create mode 100644 backends/wince/gapi_keys.h create mode 100644 backends/wince/missing/assert.h create mode 100644 backends/wince/missing/conio.h create mode 100644 backends/wince/missing/dir.h create mode 100644 backends/wince/missing/direct.h create mode 100644 backends/wince/missing/dirent.h create mode 100644 backends/wince/missing/errno.h create mode 100644 backends/wince/missing/fcntl.h create mode 100644 backends/wince/missing/io.h create mode 100644 backends/wince/missing/missing.cpp create mode 100644 backends/wince/missing/signal.h create mode 100644 backends/wince/missing/sys/stat.h create mode 100644 backends/wince/missing/sys/time.h create mode 100644 backends/wince/missing/sys/types.h create mode 100644 backends/wince/missing/time.h create mode 100644 backends/wince/missing/unistd.h create mode 100644 backends/wince/newres.h create mode 100644 backends/wince/pocketpc.cpp create mode 100644 backends/wince/pocketscumm.ico create mode 100644 backends/wince/resource.h create mode 100644 backends/wince/screen.cpp create mode 100644 backends/wince/screen.h create mode 100644 backends/x11/x11.cpp delete mode 100644 boxes.cpp delete mode 100644 boxes.h delete mode 100644 bundle.cpp delete mode 100644 bundle.h create mode 100644 common/config-file.cpp create mode 100644 common/config-file.h create mode 100644 common/gameDetector.cpp create mode 100644 common/gameDetector.h create mode 100644 common/main.cpp create mode 100644 common/scummsys.h create mode 100644 common/stdafx.cpp create mode 100644 common/stdafx.h create mode 100644 common/system.h create mode 100644 common/timer.cpp create mode 100644 common/timer.h create mode 100644 common/util.cpp create mode 100644 common/util.h delete mode 100644 config-file.cpp delete mode 100644 config-file.h delete mode 100644 copying.txt delete mode 100644 costume.cpp delete mode 100644 costume.h delete mode 100644 dc/.cvsignore delete mode 100644 dc/Makefile delete mode 100644 dc/README delete mode 100644 dc/audio.cpp delete mode 100644 dc/dc.h delete mode 100644 dc/dcmain.cpp delete mode 100644 dc/display.cpp delete mode 100644 dc/icon.cpp delete mode 100644 dc/icon.h delete mode 100644 dc/input.cpp delete mode 100644 dc/label.cpp delete mode 100644 dc/label.h delete mode 100644 dc/portdefs.h delete mode 100644 dc/selector.cpp delete mode 100644 dc/vmsave.cpp delete mode 100644 debian/.cvsignore delete mode 100644 debian/README.Debian delete mode 100644 debian/changelog.cvs delete mode 100644 debian/changelog.debian delete mode 100644 debian/changelog.debian_official delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/prepare delete mode 100755 debian/rules delete mode 100644 debian/scummvm.dirs delete mode 100644 debian/scummvm.docs delete mode 100644 debug.cpp delete mode 100644 debug.h delete mode 100644 debugrl.cpp delete mode 100644 debugrl.h delete mode 100644 engine.cpp delete mode 100644 engine.h delete mode 100644 fb2opengl.h delete mode 100644 gameDetector.cpp delete mode 100644 gameDetector.h delete mode 100644 gapi_keys.h delete mode 100644 gfx.cpp delete mode 100644 gfx.h delete mode 100644 gui.cpp delete mode 100644 gui.h create mode 100644 gui/gui.cpp create mode 100644 gui/gui.h create mode 100644 gui/guimaps.h create mode 100644 gui/newgui.cpp create mode 100644 gui/newgui.h delete mode 100644 guimaps.h delete mode 100644 insane.cpp delete mode 100644 mac/Carbon.r delete mode 100644 mac/CarbonPort-ReadMe.txt delete mode 100644 mac/ScummVM_Mac_Prefix.h delete mode 100644 mac/mac.cpp delete mode 100755 mac/macos.h delete mode 100644 mac/scummvm.mcp delete mode 100644 main.cpp delete mode 100644 morphos/Makefile delete mode 100644 morphos/MorphOS.readme delete mode 100644 morphos/morphos.cpp delete mode 100644 morphos/morphos.h delete mode 100644 morphos/morphos_scaler.cpp delete mode 100644 morphos/morphos_scaler.h delete mode 100644 morphos/morphos_sound.cpp delete mode 100644 morphos/morphos_start.cpp delete mode 100644 morphos/morphos_timer.cpp delete mode 100644 morphos/morphos_timer.h delete mode 100644 newgui.cpp delete mode 100644 newgui.h delete mode 100644 object.cpp delete mode 100644 object.h delete mode 100644 readme.txt delete mode 100644 resource.cpp delete mode 100644 resource.h delete mode 100644 saveload.cpp delete mode 100644 saveload.h delete mode 100644 scaler.cpp delete mode 100644 scaler.h delete mode 100644 script.cpp delete mode 100644 script_v1.cpp delete mode 100644 script_v2.cpp delete mode 100644 scumm.h create mode 100644 scumm/actor.cpp create mode 100644 scumm/actor.h create mode 100644 scumm/akos.cpp create mode 100644 scumm/akos.h create mode 100644 scumm/boxes.cpp create mode 100644 scumm/boxes.h create mode 100644 scumm/bundle.cpp create mode 100644 scumm/bundle.h create mode 100644 scumm/costume.cpp create mode 100644 scumm/costume.h create mode 100644 scumm/debug.cpp create mode 100644 scumm/debug.h create mode 100644 scumm/debugrl.cpp create mode 100644 scumm/debugrl.h create mode 100644 scumm/engine.cpp create mode 100644 scumm/engine.h create mode 100644 scumm/gfx.cpp create mode 100644 scumm/gfx.h create mode 100644 scumm/imuse.cpp create mode 100644 scumm/imuse.h create mode 100644 scumm/insane.cpp create mode 100644 scumm/object.cpp create mode 100644 scumm/object.h create mode 100644 scumm/resource.cpp create mode 100644 scumm/resource.h create mode 100644 scumm/resource_v3.cpp create mode 100644 scumm/resource_v4.cpp create mode 100644 scumm/saveload.cpp create mode 100644 scumm/saveload.h create mode 100644 scumm/scaler.cpp create mode 100644 scumm/scaler.h create mode 100644 scumm/script.cpp create mode 100644 scumm/script_v1.cpp create mode 100644 scumm/script_v2.cpp create mode 100644 scumm/scumm.h create mode 100644 scumm/scummvm.cpp create mode 100644 scumm/smush.h create mode 100644 scumm/sound.h create mode 100644 scumm/string.cpp create mode 100644 scumm/sys.cpp create mode 100644 scumm/vars.cpp create mode 100644 scumm/verbs.cpp delete mode 100644 scummsys.h delete mode 100644 scummvm.cpp delete mode 100644 sdl.cpp delete mode 100644 sdl_gl.cpp create mode 100644 simon/debug.cpp create mode 100644 simon/intern.h create mode 100644 simon/items.cpp create mode 100644 simon/res.cpp delete mode 100644 simon/simondebug.cpp delete mode 100644 simon/simonintern.h delete mode 100644 simon/simonitems.cpp delete mode 100644 simon/simonres.cpp delete mode 100644 simon/simonsys.cpp delete mode 100644 simon/simonverb.cpp delete mode 100644 simon/simonvga.cpp create mode 100644 simon/sys.cpp create mode 100644 simon/verb.cpp create mode 100644 simon/vga.cpp delete mode 100644 smush.h delete mode 100644 sound.cpp delete mode 100644 sound.h delete mode 100644 sound/imuse.cpp delete mode 100644 sound/imuse.h create mode 100644 sound/sound.cpp create mode 100644 sound/sound.h delete mode 100644 stdafx.cpp delete mode 100644 stdafx.h delete mode 100644 string.cpp delete mode 100644 sys.cpp delete mode 100644 system.h delete mode 100644 timer.cpp delete mode 100644 timer.h delete mode 100644 util.cpp delete mode 100644 util.h delete mode 100644 v3/resource_v3.cpp delete mode 100644 v4/resource_v4.cpp delete mode 100644 vars.cpp delete mode 100644 verbs.cpp delete mode 100644 whatsnew.txt delete mode 100755 wince/MenuTitle.bmp delete mode 100644 wince/PocketSCUMM.rc delete mode 100755 wince/PocketSCUMM.vcc delete mode 100644 wince/PocketSCUMM.vcp delete mode 100755 wince/PocketSCUMM.vcw delete mode 100755 wince/bitmaps.cpp delete mode 100644 wince/findgame.cpp delete mode 100644 wince/gapi_keys.cpp delete mode 100644 wince/missing/assert.h delete mode 100644 wince/missing/conio.h delete mode 100644 wince/missing/dir.h delete mode 100644 wince/missing/direct.h delete mode 100644 wince/missing/dirent.h delete mode 100644 wince/missing/errno.h delete mode 100644 wince/missing/fcntl.h delete mode 100644 wince/missing/io.h delete mode 100644 wince/missing/missing.cpp delete mode 100644 wince/missing/signal.h delete mode 100644 wince/missing/sys/stat.h delete mode 100644 wince/missing/sys/time.h delete mode 100644 wince/missing/sys/types.h delete mode 100644 wince/missing/time.h delete mode 100644 wince/missing/unistd.h delete mode 100644 wince/newres.h delete mode 100644 wince/pocketpc.cpp delete mode 100644 wince/pocketscumm.ico delete mode 100644 wince/resource.h delete mode 100644 wince/screen.cpp delete mode 100644 wince/screen.h delete mode 100644 x11.cpp diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 605f60dabd..0000000000 --- a/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.DS_Store -.gdb_history -*.s[0-9][0-9] -*.c[0-9][0-9] -scummvm diff --git a/.indent.pro b/.indent.pro deleted file mode 100644 index afb9cd1c33..0000000000 --- a/.indent.pro +++ /dev/null @@ -1,15 +0,0 @@ --br -bap -nbc -lp -ce -cdw -brs -nbad -nbc -npsl -nip -ts2 -ncs -nbs --npcs -nbap -l105 --Tbool -Tbyte -Tvoid -Tuint32 -Tuint8 -Tuint16 -Tint -Tint8 -Tint16 -Tint32 --TFILE --TOSystem -TScumm -TThreadProc -TSoundProc -TEvent -TProperty --TConfig -Thashconfig -TGameDetector -TSaveLoadEntry -TScummPoint --TGui -TGuiWidget -TNewGui -TWidget -TDialog --TArrayHeader -TMemBlkHeader -TVerbSlot -TObjectData -TImageHeader -TRoomHeader --TCodeHeader -TResHdr -TBompHeader -TBompDrawData -TBlastObject -TLoadedCostume --TActor -TBox -TBoxCoords -TVirtScreen -TPathVertex -TPathNode -TFindObjectInRoom --TMidiChannelAdl -TSoundEngine -TPart -TPlayer -TSong --TSerializer -TMidiDriver -TIMuseInternal -TIMuseDriver -TStreamCallback --TSoundMixer -TPlayingSoundHandle -TPremixProc -TMIDIEVENT -TFM_OPL --TItem -TChild -TChild1 -TChild2 -TTimeEvent -TSubroutine -TSubroutineLine --TFillOrCopyStruct -TTrack -TNoteRec -TMidiEvent diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000..bf35a23684 --- /dev/null +++ b/COPYING @@ -0,0 +1,341 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile b/Makefile index 9320484c29..b7746c1bfc 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ # $Header$ -CC = g++ +CXX = c++ CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar DEFINES = LDFLAGS := -INCLUDES:= -I./ -I./sound +INCLUDES:= -I. -Icommon -Iscumm -Isound LIBS = -lncurses # Uncomment this to activate the MAD lib for compressed sound files -# DEFINES += -DCOMPRESSED_SOUND_FILE -# LIBS += -lmad +DEFINES += -DCOMPRESSED_SOUND_FILE +LIBS += -lmad # Uncomment this to activate the ALSA lib for midi # DEFINES += -DUSE_ALSA @@ -19,23 +19,23 @@ LIBS = -lncurses # Beware, only define one of them, otherwise the compilation will blow up. # Comment this if you want to disable SDL output -OBJS = sdl.o +OBJS = backends/sdl/sdl.o INCLUDES += `sdl-config --cflags` LIBS += `sdl-config --libs` DEFINES += -DUNIX # Uncomment this (instead of the above) to activate the SDL with OpenGL output -# OBJS = sdl_gl.o +# OBJS = backends/sdl/sdl_gl.o # INCLUDES += `sdl-config --cflags` # LIBS += `sdl-config --libs` -lGL # DEFINES += -DUNIX # Uncomment this in addition to the above if you compile on Mac OS X -# LIBS += -framework QuickTime -framework AudioUnit -# DEFINES += -DMACOSX +LIBS += -framework QuickTime -framework AudioUnit +DEFINES += -DMACOSX # Uncomment this if you rather want X11 output -# OBJS = x11.o +# OBJS = backends/x11/x11.o # DEFINES += -DUNIX -DX11_BACKEND # LDFLAGS := -L/usr/X11R6/lib -L/usr/local/lib # INCLUDES+= -I/usr/X11R6/include diff --git a/Makefile.common b/Makefile.common index 84256ef674..6fe2133ff4 100644 --- a/Makefile.common +++ b/Makefile.common @@ -4,31 +4,44 @@ ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip -INCS = scumm.h scummsys.h stdafx.h - -OBJS += util.o newgui.o gui/widget.o gui/dialog.o \ - gui/ListWidget.o gui/ScrollBarWidget.o \ - actor.o akos.o boxes.o bundle.o config-file.o costume.o debug.o \ - debugrl.o engine.o gameDetector.o gfx.o gui.o insane.o main.o object.o \ - resource.o saveload.o scaler.o script.o script_v1.o script_v2.o \ - scummvm.o sound.o string.o sys.o timer.o vars.o verbs.o \ - sound/imuse.o sound/fmopl.o sound/mixer.o \ - v3/resource_v3.o v4/resource_v4.o \ - simon/midi.o simon/simon.o simon/simonsys.o simon/simonvga.o \ - simon/simondebug.o simon/simonres.o simon/simonitems.o simon/simonverb.o \ - sound/mididrv.o - -DISTFILES=$(OBJS:.o=.cpp) Makefile scummvm.dsp scummvm.dsw stdafx.cpp \ - whatsnew.txt readme.txt copying.txt \ - actor.h akos.h boxes.h bundle.h cmdline.h config-file.h costume.h debug.h \ - debugrl.h engine.h fb2opengl.h gameDetector.h gapi_keys.h gfx.h gui.h guimaps.h \ - newgui.h object.h resource.h saveload.h scaler.h scumm.h scummsys.h smush.h \ - sound.h stdafx.h system.h timer.h util.h sound/fmopl.h +INCS = scumm/scumm.h common/scummsys.h common/stdafx.h + +COMMON_OBJS = common/config-file.o common/gameDetector.o common/main.o \ + common/timer.o common/util.o + +GUI_OBJS = gui/gui.o gui/newgui.o gui/widget.o gui/dialog.o gui/ListWidget.o \ + gui/ScrollBarWidget.o + +SCUMM_OBJS = scumm/actor.o scumm/akos.o scumm/boxes.o scumm/bundle.o \ + scumm/costume.o scumm/debug.o scumm/debugrl.o scumm/engine.o scumm/gfx.o \ + scumm/imuse.o scumm/insane.o scumm/object.o scumm/resource.o \ + scumm/resource_v3.o scumm/resource_v4.o scumm/saveload.o scumm/scaler.o \ + scumm/script.o scumm/script_v1.o scumm/script_v2.o scumm/scummvm.o \ + scumm/string.o scumm/sys.o scumm/vars.o scumm/verbs.o + +SIMON_OBJS = simon/debug.o simon/items.o simon/midi.o simon/res.o simon/simon.o \ + simon/sys.o simon/verb.o simon/vga.o + +SOUND_OBJS = sound/fmopl.o sound/mididrv.o sound/mixer.o sound/sound.o + +OBJS += $(COMMON_OBJS) $(GUI_OBJS) scumm/libscumm.a simon/libsimon.a $(SOUND_OBJS) + +DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \ + debugrl.h whatsnew.txt readme.txt copying.txt \ + scummvm.dsp scummvm.dsw sound/fmopl.h gui.h sound.h all: scummvm$(EXEEXT) scummvm$(EXEEXT): $(OBJS) - $(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) + +scumm/libscumm.a: $(SCUMM_OBJS) + ar cru $@ $+ + ranlib $@ + +simon/libsimon.a: $(SIMON_OBJS) + ar cru $@ $+ + ranlib $@ clean: rm -f $(OBJS) scummvm$(EXEEXT) @@ -37,7 +50,7 @@ clean: # Default (dumb) compile & dependcy rules .cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + $(CXX) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o $(OBJS): $(INCS) @@ -45,10 +58,10 @@ $(OBJS): $(INCS) # dependency tracking. #DEPDIR := .deps #.cpp.o: -# mkdir -p $(DEPDIR) -# $(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o -# echo -n "$(*D)/" > $(DEPDIR)/$(*F).d -# cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d" -# rm -f "$(DEPDIR)/$(*F).d2" +# mkdir -p $(*D)/$(DEPDIR) +# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o +# echo -n "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d +# cat "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d" +# rm -f "$(*D)/$(DEPDIR)/$(*F).d2" # #-include $(DEPDIR)/*.d diff --git a/Makefile.irix b/Makefile.irix deleted file mode 100644 index 1cd508ec04..0000000000 --- a/Makefile.irix +++ /dev/null @@ -1,21 +0,0 @@ -# $Header$ - -CC = CC -CFLAGS = -O2 -Olimit 9000 -mips2 -#CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar -# Remove -DHAVE_NO_BOOL if your compiler has a builtin bool type -DEFINES = -DUNIX -DHAVE_NO_BOOL -DCOMPRESSED_SOUND_FILE -LDFLAGS := -INCLUDES:= `sdl-config --cflags` -I./ -I./sound -CPPFLAGS= $(DEFINES) $(INCLUDES) - -# Add -lmad for -DCOMPRESSED_SOUND_FILE -LIBS = `sdl-config --libs` -lmad -lm - -OBJS = sdl.o - -include Makefile.common - -dist: - rm -f $(ZIPFILE) - zip -q $(ZIPFILE) $(DISTFILES) diff --git a/Makefile.mingw b/Makefile.mingw deleted file mode 100644 index 5c56fa5d57..0000000000 --- a/Makefile.mingw +++ /dev/null @@ -1,45 +0,0 @@ -# Where is scummvm will be installed -SCUMMVMPATH=C:/scummvm -SRC=. -VPATH=$(SRC) - -### Modify these paths -SDL_CFLAGS=-I$(SRC)/sdl/include -SDL_LIBS=-L$(SRC)/sdl/lib -lSDLmain -lSDL - -# If MAD (MPEG Audio Decoder) header and library isn't installed remove -lmad and -DCOMPRESSED_SOUND_FILE -CC = g++ -CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar -DEFINES = -DCOMPRESSED_SOUND_FILE -LDFLAGS :=-mwindows -mconsole -INCLUDES:= $(SDL_CFLAGS) -I./ -I./sound -CPPFLAGS= $(DEFINES) $(INCLUDES) -LIBS = -lmingw32 -lwinmm -lmad $(SDL_LIBS) -EXEEXT :=.exe - -# Uncomment this for SDL normal output -OBJS = sdl.o scummvmico.o -# Or uncomment this for SDL with OpenGL output -#OBJS = sdl_gl.o scummvmico.o -#LIBS += -lopengl32 - -include Makefile.common - -scummvmico.o: scummvm.ico - windres scummvm.rc scummvmico.o - - -# Some additional targets -install: scummvm$(EXEEXT) - mkdir -p $(SCUMMVMPATH) - strip scummvm$(EXEEXT) -o $(SCUMMVMPATH)/scummvm$(EXEEXT) - -dist: install - cp copying.txt $(SCUMMVMPATH) - cp readme.txt $(SCUMMVMPATH) - cp whatsnew.txt $(SCUMMVMPATH) - cp SDL/README-SDL.txt $(SCUMMVMPATH) - cp SDL/lib/SDL.dll $(SCUMMVMPATH) - u2d $(SCUMMVMPATH)/*.txt - -.PHONY: install dist diff --git a/Makefile.qtopia b/Makefile.qtopia deleted file mode 100644 index e33cf8451f..0000000000 --- a/Makefile.qtopia +++ /dev/null @@ -1,20 +0,0 @@ -# $Header$ - -CC = arm-linux-g++ -CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar -DEFINES = -DUNIX -DCOMPRESSED_SOUND_FILE -DBYPASS_COPY_PROT -DQTOPIA -DSCUMM_NEED_ALIGNMENT -LDFLAGS := -INCLUDES:= `/opt/Qtopia/sharp/bin/sdl-config --cflags` -I./ -I./sound -CPPFLAGS= $(DEFINES) $(INCLUDES) - -# Add -lmad for -DCOMPRESSED_SOUND_FILE -LIBS = `/opt/Qtopia/sharp/bin/sdl-config --libs` -lmad -#-lncurses - -OBJS = sdl.o - -include Makefile.common - -dist: - rm -f $(ZIPFILE) - zip -q $(ZIPFILE) $(DISTFILES) diff --git a/NEWS b/NEWS new file mode 100644 index 0000000000..b5ebaabfc9 --- /dev/null +++ b/NEWS @@ -0,0 +1,28 @@ +For a more comprehensive changelog for the latest experimental CVS code, see: + http://scummvm.sourceforge.net/daily/ChangeLog + +0.2.0 (2002-04-14) +- core engine rewrite +- enhanced ingame GUI, including options/volume settings. +- auto-save feature +- added more command-line options, and configuration file +- new ports and platforms (MorphOS, Macintosh, Dreamcast, Solaris, IRIX, etc) +- graphics filtering added (2xSAI, Super2xSAI, SuperEagle, AdvMame2x) +- support for MAD MP3 compressed audio +- support for first non-SCUMM games (Simon the Sorcerer) +- support for V4 games (Loom CD) +- enhanced V6 game support (Sam and Max is now completable) +- experimental support for V7 games (Full Throttle/The Dig) +- experimental support for V3 games (Zak256/Indy3) + +0.1.0 (2002-01-13) +- loads of changes + +0.0.2 (2001-10-12): +- bug fixes +- save & load support + +0.0.1 (2001-10-08): +- initial version + + diff --git a/README b/README new file mode 100644 index 0000000000..dd2a4e1527 --- /dev/null +++ b/README @@ -0,0 +1,560 @@ +ScummVM README +Last updated: 2002-07-08 +Release version: 0.2.2 [CVS] +------------------------------------------------------------------------ + +For more information, compatibility lists, details on donating, the latest +release, progress reports and more, please visit the ScummVM home page +at: http://scummvm.sourceforge.net/ + + +About: +------ + +ScummVM is an implementation of the SCUMM (Script Creation Utility for +Maniac Mansion) engine used in various Lucas Arts games such as Monkey +Island and Day of the Tentacle. At this time ScummVM should be considered +ALPHA software, as it's still under heavy development. Be aware that while +many games will work with few major bugs, crashes can happen. Also note +that saved games can, and probably will, be incompatible between releases. + +Also ScummVM is capable of playing several non-SCUMM games, at the moment +this includes Simon The Sorcerer. + +If you enjoy ScummVM feel free to donate using the PayPal button on the +ScummVM homepage. This will help us buy utilities needed to develop ScummVM +easier and quicker. If you cannot donate, help and contribute a patch! + +Contacting: +----------- +The easiest way to contact the ScummVM team is by subitting bug reports or +commenting in our forums. You can also join and e-mail the scummvm-devel +mailing list, or chat with us on irc (#scummvm, irc.openprojects.net) + +Supported Games: +---------------- + +At the moment the following games have been reported to work, and should +be playable to the end: + + Loom (256 color CD version) [Game: loomcd] + Zak McKraken (256 color FM Towns version) [Game: zak256] + Monkey Island 1 (CD version) [Game: monkey1] + Monkey Island 2 [Game: monkey2] + Indiana Jones And The Fate Of Atlantis [Game: atlantis] + Day Of The Tentacle [Game: tentacle] + Sam & Max [Game: samnmax] + Simon The Sorcerer [Game: simon1dos/simon1win] + + +The following games should load, but are not yet fully playable. Play these at +your own risk, and please do not file bug reports about them. If you want +the latest updates on game compatibility, visit our web site and view the +compatibility chart. + + Monkey Island 1 (VGA floppy) [Game: monkeyvga] + Indiana Jones and the Last Crusade (256 color) [Game: indy3] + Full Throttle [Game: ft] + The Dig [Game: dig] + +The following games are SCUMM engine, but NOT supported by ScummVM (yet). + + Maniac Mansion + Zak McKraken (16 color floppy version) + Monkey Island 1 (EGA, 16 color floppy version) + Loom (16 color floppy version) + Curse of Monkey Island + +Please be aware that the engine may contains bugs and non-implemented- +features that sometimes make it impossible to finish the game. Save often, +and please file a bug report (details on submitted bug reports are below) +if you discover such a bug. + + +Supported Platforms: +------------------- + +ScummVM has been ported to run on many platforms and operating systems. +Links to these ports can be found either on the ScummVM web page or by a +Google search. Many thanks to the effort of porters. If you have a port of +ScummVM and wish to commit it into the main CVS, feel free to contact us! + + Windows - SDL + Windows CE - SDL (iPaq and other handheld devices) + Linux - SDL/X11 (includes iPaq devices running Linux) + Macintosh - SDL/CUSTOM (Including Classic and Mac OS X) + AmigaOS - SDL/AGA + MorphOS - SDL + BeOS - SDL + Acorn (RiscOS) - ??? + Dreamcast - ??? + UNIX - SDL (SDL may work on Solaris, IRIX, *BSD) + +Known Bugs: +----------- + +This release has the following known bugs. There is no need to report them, +although patches to fix them are welcome. If you discover a bug that is not +listed here, nor in the compatibility table on the web site, please see +the section on Reporting Bugs. + + Indy 4 (Fate Of Atlantis): + - Keyboard fighting does not work. ScummVM now defaults to + using mouse fighting. + + + Sam and Max: + - Subgames are not all fully functional. + + - Conroy singing in Bumpusville may work incorrectly. Eg, + music will overlap and Conroy will get stuck singing. Just + hit escape to skip the cutscene. This is due to SNM using + a different iMUSE implementation to previous games. + + + Zak McKracken Fm Towns: + - The Fm Towns 256 color version of Zak McKracken is rare, + And as the ScummVM team does not encourage piracy in any + way, we do not know where to buy or download a copy of this + game. Petition LucasArts to re-release it :) + + - No music or sound effects yet. + + + Loom (256 Talkie): + - If you are having random crashes, this is a Windows bug. + Try copying the data files from CD to your hard disk. + + - Bobbin may sometimes appear to walk backwards. + + + Monkey 1 (CD Version): + - If you are having random crashes, this is a Windows bug. + Try copying the data files from CD to your hard disk. + + +Reporting Bugs: +--------------- +To report a bug, please create a SourceForge account and follow the bugs +link from our homepage. Please make sure the bug is reproducible, and +still exists in the latest daily build/current CVS version. Also check the +compatibility listing for that game to ensure the issue is not already known. + +Do NOT report bugs listed as being completable above. + +Please include the following information: + - Game version (PLEASE test the latest CVS/Daily build) + - Bug details, including instructions on reproducing + - Language of game (English, German, etc) + - Version of game (Talkie, Floppy...) + - Platform and Compiler (Win32, Linux, etc) + - Attach a save game if possible + - If this bug only occurred recently, please note the last + version without the bug, and the first version including + the bug. That way we can fix it quicker by looking at the + changes made. + + +Compiling: +---------- + +You need SDL-1.2.2 or newer (older versions may work, but are unsupported), and +a supported compiler. Several compilers, including GCC, mingw and Microsoft +Visual C++ are supported. If you wish to use MP3-compressed CD tracks or +.SOU files, you will need to install the MAD library and define +COMPRESSED_SOUND_FILE. Tools for compressing .SOU files to .SO3 files can be +found in the 'tools' CVS module, or in the 'scummvm-tools' package. + +You can also comment/uncomment appropriate lines in the Makefile to use +sdl_gl.cpp instead of sdl.cpp. This allows hardware accelerated bilinear +filtering by using OpenGL textures. + +On Win9x/NT/XP you can define USE_WINDBG and attach WinDbg to browse debug +messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml). + + GCC: + * Type make (or gmake if that's what GNU make is called on your + system) and hopefully ScummVM will compile for you. + + Microsoft Visual C++: + * Open the workspace, scummwm.dsw + * Enter the path to the SDL include files in Tools|Options|Directories + * Now it should compile successfully. + + BeOS: + * Open the 'scummvm.proj' file in BeIDE. Compile as normal. + + PocketPC - Windows CE: + * Download the SDLAudio library: + http://arisme.free.fr/PocketScumm/sources/SDLAudio-1.2.3-src.zip + * Open and compile the SDLAudio WCEBuild/WCEBuild workspace in EVC++ + * Open the ScummVM wince/PocketScumm workspace + * Enter the SDLAudio directory to your includes path + * Enter the compiled SDLAudio.lib to your link libraries list + * Now it should compile successfully + + +Running: +-------- + +Before you run the engine, you need to put the game's datafiles in a +directory. The filenames must be in lowercase on *nix systems +(monkey2.000 and monkey2.001). If you use a game with speech, the file +monster.sou must reside in the same directory as the datafiles. + +For example, to run a copy of Monkey Island installed in C:\Games\LucasArts +under Windows, you would make a shortcut calling this command: + + C:\Games\LucasArts\scummvm.exe -f -pC:\Games\LucasArts\monkey\ monkey + +Under BSD, Linux, or similar, the commandline would be: + /path/to/scummvm -f -p/games/LucasArts/monkey/ monkey + +Or, if you have, for example, Full Throttle on CD, and your CD drive is D:, +and you wish to disable subtitles and run in fullscreen: + + C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ ft + /path/to/scummvm -f -n -p/mnt/cdrom/resource/ ft + +Note that if you run the game once this way, and specify the -w commandline +parameter (or edit the config file manually), ScummVM will remember the +path, and other settings for this game. Documentation on the configuration +file can be found near the end of this readme. + +The short game name you see at the end of the command line is very +important. A short list is contained at the top of this file. You can also +get the current list of games and game names at: + http://scummvm.sourceforge.net/compatibility.php + +For the adventurous, who like to live on the edge... you can download daily +builds of Win32, Redhat, Debian and other packages here: + Daily builds - http://scummvm.sourceforge.net/daily/ + + +Command Line Options: +--------------------- + + scummvm [OPTIONS] [GAME] + + [GAME] - Short name of game to load. E.g. monkey for Monkey Island. + + -p - Path to where the game is installed. Default is Cwd. + -b - Start in room . + -c - Drive to play cd audio from. E.g., 0 is first drive. + -s - Set the sfx volume, 0-255. Default is '100' + -m - Set the music volume, 0-100. Default is '60' + -t - Set music tempo. Adlib default: 0x1F0000, Midi: 0x460000 + -e - Select sound engine. See below. + -g - Select graphics scaler. See below. + -f - Full-screen mode. + -n - Disable subtitles. Use with games that have voice. + -y - Set talk speed ('yak option'). Default is '60' + -a - Enable amiga pal conversion, for playing Amiga versions + -d[] - Set debug verbosity to + -w[] - Write configuration file + -l - Load alternate configration file + +In game Hot Keys: +----------------- + Ctrl 0-9 and Shift 0-9 - load and save games + Ctrl-Alt 1-7 - cycles between graphics filters + Ctrl-z OR Alt-x - quits + Ctrl-f - runs in fast mode. + Ctrl-g - runs in really REALLY fast mode. + Ctrl-d - starts the debugger. + Ctrl-s - shows memory consumption. + [ and ] - master volume, down/up + - and + - text speed, slower / faster + F5 - displays a save/load box. + Space - pauses + Period (.) - skips current line of text in some games + Alt-Enter - toggles full screen/windowed + Enter - Left Mouse Button Press + Tab - Right Mouse Button Press + Keyboard Arrow Keys - Mouse Movement + +Note that using ctrl-f and ctrl-g are not recommended: Games can crash when +being ran faster than their normal speed, as scripts will loose syncronisation + +Graphics filters: +----------------- +ScummVM offers several anti-aliasing filters to attempt to improve visual +quality. These are the same filters used in many other emulators, such as +MAME. + +They are: + -gnormal - No filtering, original 320x200 resolution. Fastest. + -g2x - No filtering, double screen/window size to 640x400 (default) + -g3x - No filtering, triple screen/window size to 800x600 + -g2xsai - 2xsai filtering, double screen/window size to 640x400 + -gsuper2xsai - Enhanced 2xsai filtering. 640x400 screen/window size + -gsupereagle - Less blurry than 2xsai, but slower. Also 640x400 + -gadvmame2x - 640x400 scaling. Doesn't rely on blurring like 2xSAI. + +Note that filters are very slow when ScummVM is compiled in a debug +configuration without optimizations. And there is always a speed impact when +using any form of anti-aliasing/linear filtering. Also note that the FmTowns +Zak (zak256 target) uses an original resolution of 320x480 - hence for this +game scalers will be 640x480 and 960x720. + +The alternative to these scalers is to try using the SDL_gl.cpp target. This +will allow you to use hardware accelerated functions, like bilinear filtering +and FSAA, on suitable OpenGL capable cards. + +Autosaves: +---------- + +Because ScummVM is still a beta product, it -can- crash and/or hang +occasionally. As such, every five minutes it will save a game in Slot 0. This +game can be loaded via Ctrl-0, or the F5 menu. This autosaving only applies to +Scumm games, not other games (such as Simon the Sorcerer) + + +Savegames: +---------- + +Savegames are by default put in the current directory. You can specify the save +in the config file by setting the savepath parameter. See the example config +file later in this readme. + +You can also use the environment variable SCUMMVM_SAVEPATH to specify where to +put save games. Don't forget the trailing directory separator. Also be aware +that saved games can, and probably WILL, break between ScummVM releases. + +Bash (Linux) Example: + export SCUMMVM_SAVEPATH=/tmp/scummvm_savegames/ + +Windows example: + set SCUMMVM_SAVEPATH=C:\saved_games\ + + +Music and Sound: +---------------- +By default, on most operating systems, ScummVM will automatically use ADLIB +emulation. However, some games do not include Adlib music - such as Sam and +Max. Note: MIDI may not be available on all operating systems or may need +manual configuration. + +If you ARE using MIDI, you have several different choices of output, +depending on your operating system and configuration. + + -eadlib - Uses internal Adlib Emulation (default) + -ewindows - Windows MIDI. Uses built-in sequencer, for Windows users + -emidiemu - Emulated midi music, for Sam and Max (BETA - BUGGY) + -eseq - Uses /dev/sequencer for MIDI, *nix users. See below. + -eqt - Quicktime sound, for Macintosh users. + -ecore - CoreAudio sound, for MacOS X users. + -eamidi - Uses the MorphOS MIDI system, for MorphOS users + -ealsa - Output using ALSA sequencer device. See below. + -enull - Null output. Don't play any music. + + +Playing sound with Adlib emulation: +----------------------------------- +By default an Adlib card will be emulated and ScummVM will output the music +as sampled waves. This is the default mode for most games, and offers the +best compatability between machines and games. However, Sam and Max does not +include Adlib emulation. + + +Playing sound with MIDI emulation: +---------------------------------- +Until recently, some games (particually Sam and Max) were only able to run +in MIDI mode. This prevented music for these games from working on platforms +that do not support MIDI, or soundcards that do not provide MIDI drivers (eg, +many soundcards will not play MIDI under Linux). We have recently added an +'emulated MIDI' technology. It can be accessed using the 'midiemu' option, +and is the default for Sam and Max on UNIX platforms. -HOWEVER-, it is still +very buggy and the emulation is not perfect. If you are capable of using +native midi, we recommend using one of the MIDI modes below, or Adlib if +your game includes music in the appropriate format. + + +Playing sound with Native MIDI: +------------------------------- +Use the appropriate -e command line option from the list above to +select your preferred MIDI device. For example, if you wish to use the +Windows MIDI driver, use the -ewindows option. + + +Playing sound with Sequencer MIDI: [UNIX ONLY] +---------------------------------- +If your soundcard driver supports a sequencer, you may set the environment +variable "SCUMMVM_MIDI" to your sequencer device - eg, /dev/sequencer + +If you have problems with not hearing audio in this configuration, it is +possible you will need to set the "SCUMMVM_MIDIPORT" variable to 1 or 2. This +selects the port on the selected sequencer to use. Then start scummvm with the +-eseq parameter. This should work on several cards, and may offer better +performance and quality than Adlib or MIDI emulation. However, for those +systems where sequencer support does not work, you can always fall back on +either of those methods. + + +Playing sound with ALSA sequencer: [UNIX ONLY] +---------------------------------- +If you have installed the ALSA driver with the sequencer support, then +set the environment variable "SCUMMVM_PORT" to your sequencer port - eg 65:0 + +Here is a little howto on how to use the ALSA sequencer with your soundcard. +In all cases, to have a list of all the sequencer ports you have, try the +command "aconnect -o -l". On my system it gives me the output: +client 64: 'External MIDI 0' [type=kernel] + 0 'MIDI 0-0 ' +client 65: 'Emu10k1 WaveTable' [type=kernel] + 0 'Emu10k1 Port 0 ' + 1 'Emu10k1 Port 1 ' + 2 'Emu10k1 Port 2 ' + 3 'Emu10k1 Port 3 ' +client 128: 'Client-128' [type=user] + 0 'TiMidity port 0 ' + 1 'TiMidity port 1 ' + +It means the external MIDI output of my sound card is located on the +port 64:0, that I've got four WaveTable MIDI outputs in 65:0, 65:1, 65:2 +and 65:3, and that I've got two TiMidity ports, located at 128:0 and 128:1. + +If you have a FM-chip on your card, like the SB16, then you have to load +the soundfonts using the sbiload software. Example: + sbiload -p 65:0 /etc/std.o3 /etc/drums.o3 + +If you have a WaveTable capable sound card, you have to load a sbk or sf2 +soundfont using the sfxload software. If you manage to do so, please mail +me since I managed to get it working only once, and never again. + +If you don't have a MIDI capable soundcard, or if you want to take +advantage of your TiMidity samples, then you can ask TiMidity to become an +alsa sequencer output. Here is a quick way to do so: + timidity -iAqqq -B2,8 -Os1S -s 44100 & + +Then the TiMidity port will be visible from the 'aconnect -o -l' list. You +should launch it beeing as root, since it will try to set up some real time +priority. + + +Using MP3 files for CD audio: +----------------------------- +Use LAME or some other mp3 encoder to rip the cd audio tracks to files. Name +the files track1.mp3 track2.mp3 etc. ScummVM must be compiled with MAD support +to use this option. You'll need to rip the file from the CD as a WAV file, +then encode the MP3 files in Constant Bit Rate sampled at 22 kHz. This can +be done with the following LAME command line: + +lame -t -q 0 -b 96 --resample 22.05 track1.wav track1.mp3 + + +Compressing MONSTER.SOU with MP3:. +--------------------------------- +You need LAME, and our extract util from the tools dir to perform this task, +and ScummVM must be compiled with MAD support. + +Make a backup file of your MONSTER.SOU before attempting this. Copy your +MONSTER.SOU file to a temporary folder. Then run: + extract monster.sou + +In about 30 minutes or so, you will have a much smaller monster.so3 file, +copy this file to your game dir. You can safely remove the monter.sou file. + + +Coding style: +------------ +For ScummVM coding, we use hugging braces, and two-space tab indents. +We occasionally run the following 'indent' parameters to ensure everything +is kept standard: + +-br -bap -nbc -lp -ce -cdw -brs -nbad -nbc -npsl -nip -ts2 -ncs -nbs +-npcs -nbap -Tbyte -Tvoid -Tuint32 -Tuint8 -Tuint16 -Tint -Tint8 +-Tint16 -Tint32 -TArrayHeader -TMemBlkHeader -TVerbSlot -TObjectData +-TImageHeader -TRoomHeader -TCodeHeader -TResHdr -TBompHeader +-TMidiChannelAdl -TGui -TScumm -TSoundEngine -TPart -TPlayer + + +Configuration file: +------------------- +By default, the configuration file is saved in, and loaded from: + + Windows: \scummvm.ini, + Linux: ~/.scummvmrc + Others: scummvm.ini in the current directory + +An example config file is as follows: + + [scummvm] + gfx_mode=supereagle + fullscreen=true + savepath=C:\saves\ + + [tentacle] + path=C:\tentacle\ + nosubtitles=true + master_volume=98 + music_volume=40 + sfx_volume=255 + + [loomcd] + cdrom=1 + path=C:\loom\ + talkspeed=55 + + [monkey2] + path=C:\amiga_mi2\ + music_driver=windows + amiga=true + + + +Credits: +-------- + The core ScummVM team: + James Brown - Current lead developer, ScummVM + Vincent Hamm - Developer, ScummVM (inactive) + Max Horn - Developer, ScummVM, MacOS X port, new GUI + Jeremy Newman - Webmaster + Ludvig Strigeus - Original developer, Scumm and SimonVM. (Retired) + + Porters: + Lionel Ulmer - X11/Linux port + Nicolas Bacca - PocketPC/WinCE port + Mutwin Kraus - MacOS Carbon port (Retired) + Marcus Comstedt - Dreamcast port + Ruediger Hanke - MorphOS port + + Contributors: + Claudio Matsuoka - Daily Linux/BeOS builds (http://scummvm.sf.net/daily/) + Travis Howell - Daily Win32 builds + Janne Huttunen - V3 actor mask support, Dig/FT SMUSH audio + Jeroen Janssen - Numerous readability and bugfix patches + Gregory Montoir - AdvanceMAME Scale-2X implementation + Mikesch Nepomuk - MI1 VGA Floppy patches. + Edward Rudd - Fixes for playing MP3 versions of MI1/Loom Audio + Daniel Schepler - Final MI1 CD music support + Tim 'realmz' - Initial MI1 CD music support + Jonathan 'khalek' - Expert weaver in the Loom + Nicolas Noble - Config file and ALSA support + Pawel Kolodziejski - Added missing Dig SMUSH codecs + Felix Jakschitsc - His hard work on Zak256 + Andre Souza - SDL-based OpenGL renderer + Kovacs Endre Janos - Several fixes for Simon1 + Ralph Brorsen - Helped write the new GUI + + And to all the contributors, users, and beta testers we've missed. + Thanks! + + Special thanks to: + Sander Buskens - For his work on the initial reversing of Monkey2 + Jimmi Thogersen - For ScummRev, and much obscure code/documentation + Kevin Carnes - For Scumm16, the basis of ScummVM older gfx codecs + + Aric Wilmunder, Ron Gilbert, David Fox, Vince Lee, and all those at + LucasFilm/LucasArts who made SCUMM the insane mess to reimplement + that it is today. Feel free to drop us a line and tell us what you + think, guys! + + + + +------------------------------------------------------------------------ +Good Luck and Happy Adventuring! +The ScummVM team. +http://scummvm.sourceforge.net/ +------------------------------------------------------------------------ diff --git a/actor.cpp b/actor.cpp deleted file mode 100644 index 697a1cdadf..0000000000 --- a/actor.cpp +++ /dev/null @@ -1,1418 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "akos.h" -#include "costume.h" -#include "resource.h" - -#include - -void Actor::initActor(int mode) -{ - if (mode == 1) { - costume = 0; - room = 0; - x = 0; - y = 0; - facing = 180; - newDirection = 180; - } else if (mode == 2) { - facing = 180; - newDirection = 180; - } - - elevation = 0; - width = 24; - talkColor = 15; - new_2 = 0; - new_1 = -80; - scaley = scalex = 0xFF; - charset = 0; - sound[0] = 0; - sound[1] = 0; - sound[2] = 0; - sound[3] = 0; - sound[4] = 0; - sound[5] = 0; - sound[6] = 0; - sound[7] = 0; - newDirection = 0; - - stopActorMoving(); - - shadow_mode = 0; - layer = 0; - - setActorWalkSpeed(8, 2); - - ignoreBoxes = 0; - forceClip = 0; - new_3 = 0; - initFrame = 1; - walkFrame = 2; - standFrame = 3; - talkFrame1 = 4; - talkFrame2 = 5; - - walk_script = 0; - talk_script = 0; - - if (_vm->_features & GF_AFTER_V7) { - _vm->_classData[number] = _vm->_classData[0]; - } else { - _vm->_classData[number] = 0; - } -} - -void Actor::stopActorMoving() -{ - _vm->stopScriptNr(walk_script); - moving = 0; -} - -void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) -{ - if (newSpeedX == speedx && newSpeedY == speedy) - return; - - speedx = newSpeedX; - speedy = newSpeedY; - - if (moving) { - calcMovementFactor(walkdata.newx, walkdata.newy); - } -} - -int Scumm::getAngleFromPos(int x, int y) -{ - if (_gameId == GID_DIG) { - double temp = atan2((double)x, (double)-y); - return normalizeAngle((int)(temp * 180 / 3.1415926535)); - } else { - if (abs(y) * 2 < abs(x)) { - if (x > 0) - return 90; - return 270; - } else { - if (y > 0) - return 180; - return 0; - } - } -} - -int Actor::calcMovementFactor(int newX, int newY) -{ - int actorX, actorY; - int diffX, diffY; - int32 XYFactor, YXFactor; - - actorX = x; - actorY = y; - - if (actorX == newX && actorY == newY) - return 0; - - diffX = newX - actorX; - diffY = newY - actorY; - YXFactor = speedy << 16; - - if (diffY < 0) - YXFactor = -YXFactor; - - XYFactor = YXFactor * diffX; - if (diffY != 0) { - XYFactor /= diffY; - } else { - YXFactor = 0; - } - - if ((uint) abs((int)(XYFactor >> 16)) > speedx) { - XYFactor = speedx << 16; - if (diffX < 0) - XYFactor = -XYFactor; - - YXFactor = XYFactor * diffY; - if (diffX != 0) { - YXFactor /= diffX; - } else { - XYFactor = 0; - } - } - - walkdata.x = actorX; - walkdata.y = actorY; - walkdata.newx = newX; - walkdata.newy = newY; - walkdata.XYFactor = XYFactor; - walkdata.YXFactor = YXFactor; - walkdata.xfrac = 0; - walkdata.yfrac = 0; - - newDirection = _vm->getAngleFromPos(XYFactor, YXFactor); - - return actorWalkStep(); -} - -int Actor::remapDirection(int dir, bool is_walking) -{ - int specdir; - byte flags; - bool flipX; - bool flipY; - - if (!ignoreBoxes) { - specdir = _vm->_extraBoxFlags[walkbox]; - if (specdir) { - if (specdir & 0x8000) { - dir = specdir & 0x3FFF; - } else { - error("remapDirection: special dir not implemented"); - } - } - - flags = _vm->getBoxFlags(walkbox); - - flipX = (walkdata.XYFactor > 0); - flipY = (walkdata.YXFactor > 0); - - // FIXME - this special cases for the class might be necesary for other - // games besides Loom CD! - - // Check for X-Flip - if ((flags & kBoxXFlip) || isInClass(_vm->_gameId == GID_LOOM256 ? 19 : 30)) { - dir = 360 - dir; - flipX = !flipX; - } - // Check for Y-Flip - if ((flags & kBoxYFlip) || isInClass(_vm->_gameId == GID_LOOM256 ? 18 : 29)) { - dir = 180 - dir; - flipY = !flipY; - } - - switch (flags & 7) { - case 1: - if (is_walking) // Actor is walking - return flipX ? 90 : 270; - else // Actor is standing/turning - return (dir == 90) ? 90 : 270; - case 2: - if (is_walking) // Actor is walking - return flipY ? 180 : 0; - else // Actor is standing/turning - return (dir == 0) ? 0 : 180; - case 3: - return 270; - case 4: - return 90; - case 5: - return 0; - case 6: - return 180; - } - } - /* Or 1024 in to signal direction interpolation should be done */ - return normalizeAngle(dir) | 1024; -} - -int Actor::updateActorDirection(bool is_walking) -{ - int from, to; - int diff; - int dirType; - int dir; - int num; - bool shouldInterpolate; - - dirType = _vm->akos_hasManyDirections(this); - - from = toSimpleDir(dirType, facing); - dir = remapDirection(newDirection, is_walking); - shouldInterpolate = (dir & 1024); - to = toSimpleDir(dirType, dir & 1023); - num = numSimpleDirDirections(dirType); - - if (shouldInterpolate) { - // Turn left or right, depending on which is shorter. - diff = to - from; - if (abs(diff) > (num >> 1)) - diff = -diff; - - if (diff > 0) { - to = from + 1; - } else if (diff < 0){ - to = from - 1; - } - } - - dir = fromSimpleDir(dirType, (to + num) % num); - - return dir; -} - -void Actor::setBox(int box) -{ - walkbox = box; - - setupActorScale(); -} - - -int Actor::actorWalkStep() -{ - int tmpX, tmpY; - int actorX, actorY; - int distX, distY; - int direction; - - needRedraw = true; - needBgReset = true; - - direction = updateActorDirection(true); - if (!(moving & MF_IN_LEG) || facing != direction) { - if (walkFrame != frame || facing != direction) { - startWalkAnim(walkFrame == frame ? 2 : 1, direction); - } - moving |= MF_IN_LEG; - } - - actorX = x; - actorY = y; - - if (walkbox != walkdata.curbox && _vm->checkXYInBoxBounds(walkdata.curbox, actorX, actorY)) { - setBox(walkdata.curbox); - } - - distX = abs(walkdata.newx - walkdata.x); - distY = abs(walkdata.newy - walkdata.y); - - if (abs(actorX - walkdata.x) >= distX && abs(actorY - walkdata.y) >= distY) { - moving &= ~MF_IN_LEG; - return 0; - } - - tmpX = ((actorX + 8000) << 16) + walkdata.xfrac + (walkdata.XYFactor >> 8) * scalex; - walkdata.xfrac = (uint16)tmpX; - actorX = (tmpX >> 16) - 8000; - - tmpY = (actorY << 16) + walkdata.yfrac + (walkdata.YXFactor >> 8) * scalex; - walkdata.yfrac = (uint16)tmpY; - actorY = (tmpY >> 16); - - if (abs(actorX - walkdata.x) > distX) { - actorX = walkdata.newx; - } - - if (abs(actorY - walkdata.y) > distY) { - actorY = walkdata.newy; - } - - x = actorX; - y = actorY; - return 1; -} - - -void Actor::setupActorScale() -{ - uint16 scale; - byte *resptr; - - if (_vm->_features & GF_NO_SCALLING) { - scalex = 0xFF; - scaley = 0xFF; - return; - } - - if (ignoreBoxes != 0) - return; - - if (_vm->getBoxFlags(walkbox) & kBoxPlayerOnly) - return; - - scale = _vm->getBoxScale(walkbox); - - if (scale & 0x8000) { - scale = (scale & 0x7FFF) + 1; - resptr = _vm->getResourceAddress(rtScaleTable, scale); - if (resptr == NULL) - error("Scale table %d not defined", scale); - int theY = y; - if (theY >= 200) - theY = 199; - else if (theY < 0) - theY = 0; - scale = resptr[theY]; - } - - if (scale > 255) - warning("Actor %d at %d, scale %d out of range", number, y, scale); - - // FIXME - Quick fix to ft's fuel tower bug (by yazoo) - if (scale == 1 && _vm->_currentRoom == 76) - scale = 0xFF; - - scalex = (byte)scale; - scaley = (byte)scale; -} - -void Actor::startAnimActor(int frame) -{ - if (_vm->_features & GF_NEW_COSTUMES) { - switch (frame) { - case 1001: - frame = initFrame; - break; - case 1002: - frame = walkFrame; - break; - case 1003: - frame = standFrame; - break; - case 1004: - frame = talkFrame1; - break; - case 1005: - frame = talkFrame2; - break; - } - - if (costume != 0) { - animProgress = 0; - needRedraw = true; - needBgReset = true; - if (frame == initFrame) - cost.reset(); - _vm->akos_decodeData(this, frame, (uint) - 1); - } - - } else { - switch (frame) { - case 0x38: - frame = initFrame; - break; - case 0x39: - frame = walkFrame; - break; - case 0x3A: - frame = standFrame; - break; - case 0x3B: - frame = talkFrame1; - break; - case 0x3C: - frame = talkFrame2; - break; - } - - if (isInCurrentRoom() && costume) { - animProgress = 0; - cost.animCounter1 = 0; - needRedraw = true; - - if (initFrame == frame) - cost.reset(); - - if (frame != 0x3E) { - _vm->cost_decodeData(this, frame, (uint) - 1); - } - } - - needBgReset = true; - } -} - -void Actor::animateActor(int anim) -{ - int cmd, dir; - - if (_vm->_features & GF_AFTER_V7) { - - if (anim == 0xFF) - anim = 2000; - - cmd = anim / 1000; - dir = anim % 1000; - - } else { - - cmd = anim >> 2; - dir = oldDirToNewDir(anim & 3); - - // Convert into old cmd code - cmd = 0x3F - cmd + 2; - - } - - switch (cmd) { - case 2: - stopActorMoving(); - startAnimActor(standFrame); - break; - case 3: - moving &= ~MF_TURN; - setDirection(dir); - break; - case 4: - turnToDirection(dir); - break; - default: - startAnimActor(anim); - } -} - -void Actor::setDirection(int direction) -{ - uint aMask; - int i; - uint16 vald; - - if (facing == direction) - return; - - facing = normalizeAngle(direction); - - if (costume == 0) - return; - - aMask = 0x8000; - for (i = 0; i < 16; i++, aMask >>= 1) { - vald = cost.frame[i]; - if (vald == 0xFFFF) - continue; - if (_vm->_features & GF_AFTER_V7) - _vm->akos_decodeData(this, vald, aMask); - else - _vm->cost_decodeData(this, vald, aMask); - } - - needRedraw = true; - needBgReset = true; -} - -void Actor::putActor(int dstX, int dstY, byte newRoom) -{ - if (visible && _vm->_currentRoom != newRoom && _vm->_vars[_vm->VAR_TALK_ACTOR] == number) { - _vm->clearMsgQueue(); - } - - x = dstX; - y = dstY; - room = newRoom; - needRedraw = true; - needBgReset = true; - - if (_vm->_vars[_vm->VAR_EGO] == number) { - _vm->_egoPositioned = true; - } - - if (visible) { - if (isInCurrentRoom()) { - if (moving) { - startAnimActor(standFrame); - moving = 0; - } - adjustActorPos(); - } else { - hideActor(); - } - } else { - if (isInCurrentRoom()) - showActor(); - } -} - -int Actor::getActorXYPos(int &xPos, int &yPos) -{ - if (!isInCurrentRoom()) - return -1; - - xPos = x; - yPos = y; - return 0; -} - -AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY, int pathfrom) -{ - AdjustBoxResult abr, tmp; - uint threshold; - uint best; - int box, iterations = 0; /* Use iterations for those odd times we get stuck in the loop */ - int firstValidBox, i, j; - byte flags, b; - - if (_vm->_features & GF_SMALL_HEADER) - firstValidBox = 0; - else - firstValidBox = 1; - - abr.x = dstX; - abr.y = dstY; - abr.dist = 0; - - if (ignoreBoxes == 0) { - threshold = 30; - - while (1) { - iterations++; - if (iterations > 1000) - return abr; /* Safety net */ - box = _vm->getNumBoxes() - 1; - if (box < firstValidBox) - return abr; - - best = (uint) 0xFFFF; - b = 0; - - if (!(_vm->_features & GF_OLD256) || box) - for (j = box; j >= firstValidBox; j--) { - flags = _vm->getBoxFlags(j); - - if (flags & kBoxInvisible && (!(flags & kBoxPlayerOnly) || isInClass(31))) - continue; - - if (pathfrom >= firstValidBox) { - - if (flags & kBoxLocked && (!(flags & kBoxPlayerOnly))) - continue; - - i = _vm->getPathToDestBox(pathfrom, j); - if (i == -1) - continue; - - if (_vm->_features & GF_OLD256) { - // FIXME - we check here if the box suggested by getPathToDestBox - // is locked or not. This prevents us from walking thru - // closed doors in some cases in Zak256. However a better fix - // would be to recompute the box matrix whenever flags change. - flags = _vm->getBoxFlags(i); - if (flags & kBoxLocked && (!(flags & kBoxPlayerOnly))) - continue; - if (flags & kBoxInvisible && (!(flags & kBoxPlayerOnly) || isInClass(31))) - continue; - } - } - - if (!_vm->inBoxQuickReject(j, dstX, dstY, threshold)) - continue; - - if (_vm->checkXYInBoxBounds(j, dstX, dstY)) { - abr.x = dstX; - abr.y = dstY; - abr.dist = j; - return abr; - } - - tmp = _vm->getClosestPtOnBox(j, dstX, dstY); - - if (tmp.dist >= best) - continue; - - abr.x = tmp.x; - abr.y = tmp.y; - - if (tmp.dist == 0) { - abr.dist = j; - return abr; - } - best = tmp.dist; - b = j; - } - - if (threshold == 0 || threshold * threshold >= best) { - abr.dist = b; - return abr; - } - threshold = (threshold == 30) ? 80 : 0; - } - } - - return abr; -} - -void Actor::adjustActorPos() -{ - AdjustBoxResult abr; - byte flags; - - abr = adjustXYToBeInBox(x, y, -1); - - x = abr.x; - y = abr.y; - walkdata.destbox = (byte)abr.dist; - - setBox(abr.dist); - - walkdata.destx = -1; - - moving = 0; - cost.animCounter2 = 0; - - if (_vm->_features & GF_AFTER_V7) { - stopActorMoving(); - } - - flags = _vm->getBoxFlags(walkbox); - if (flags & 7) { - turnToDirection(facing); - } -} - -void Actor::turnToDirection(int newdir) -{ - if (newdir == -1) - return; - - moving &= ~MF_TURN; - - if (newdir != facing) { - moving = MF_TURN; - newDirection = newdir; - - // FIXME - workaround for bug #558236 - if (_vm->_gameId == GID_INDY4 && room == 39 && x == 617 && y == 125 && newdir == 180) - startAnimActor(standFrame); - } -} - -void Actor::hideActor() -{ - if (!visible) - return; - - if (moving) { - startAnimActor(standFrame); - moving = 0; - } - visible = false; - cost.animCounter2 = 0; - needRedraw = false; - needBgReset = true; -} - -void Actor::showActor() -{ - if (_vm->_currentRoom == 0 || visible) - return; - - adjustActorPos(); - - _vm->ensureResourceLoaded(rtCostume, costume); - - if (costumeNeedsInit) { - startAnimActor(initFrame); - costumeNeedsInit = false; - } - moving = 0; - visible = true; - needRedraw = true; -} - -void Scumm::showActors() -{ - int i; - Actor *a; - - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - if (a->isInCurrentRoom()) - a->showActor(); - } -} - -void Scumm::stopTalk() -{ - int act; - - _sound->stopTalkSound(); - - _haveMsg = 0; - _talkDelay = 0; - - act = _vars[VAR_TALK_ACTOR]; - if (act && act < 0x80) { - Actor *a = derefActorSafe(act, "stopTalk"); - if (a->isInCurrentRoom() && _useTalkAnims) { - a->startAnimActor(a->talkFrame2); - _useTalkAnims = false; - } - _vars[VAR_TALK_ACTOR] = 0xFF; - } - _keepText = false; - restoreCharsetBg(); -} - -void Scumm::clearMsgQueue() -{ - _messagePtr = (byte *)" "; - stopTalk(); -} - -void Scumm::walkActors() -{ - int i; - Actor *a; - - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - if (a->isInCurrentRoom()) - if (_features & GF_OLD256) - a->walkActorOld(); - else - a->walkActor(); - } -} - -/* Used in Scumm v5 only. Play sounds associated with actors */ -void Scumm::playActorSounds() -{ - int i; - Actor *a; - - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - if (a->cost.animCounter2 && a->isInCurrentRoom() && a->sound) { - _currentScript = 0xFF; - _sound->addSoundToQueue(a->sound[0]); - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - a->cost.animCounter2 = 0; - } - return; - } - } -} - - -#define DRAW_ORDER(x) ((x)->y - ((x)->layer << 11)) - -void Scumm::processActors() -{ - int i; - Actor *actors[MAX_ACTORS], *a, **ac, **ac2, *tmp, **end; - int numactors = 0; - - // Make a list of all actors in this room - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - if (a->isInCurrentRoom()) - actors[numactors++] = a; - } - if (!numactors) - return; - - end = actors + numactors; - - // Sort actors by position before we draw them (to ensure that actors in - // front are drawn after those "behind" them). - for (ac = end - 1; ac >= actors; --ac) { - for (ac2 = actors; ac2 != ac; ++ac2) { - if (DRAW_ORDER(*ac2) > DRAW_ORDER(*(ac2 + 1))) { - tmp = *(ac2 + 1); - *(ac2 + 1) = *ac2; - *ac2 = tmp; - } - } - } - - // Finally draw the now sorted actors - for (ac = actors; ac != end; ++ac) { - a = *ac; - if (a->costume) { - CHECK_HEAP getMaskFromBox(a->walkbox); - a->drawActorCostume(); - CHECK_HEAP a->animateCostume(); - } - } -} - -void Actor::drawActorCostume() -{ - if (!needRedraw) - return; - - // FIXME: ugly fix for samnmax inventory - if (_vm->_gameId == GID_SAMNMAX && _vm->getState(995)) - return; - - needRedraw = false; - - setupActorScale(); - - if (!(_vm->_features & GF_AFTER_V7)) { - CostumeRenderer cr(_vm); - - cr._actorX = x - _vm->virtscr->xstart; - cr._actorY = y - elevation; - cr._scaleX = scalex; - cr._scaleY = scaley; - - cr._outheight = _vm->virtscr->height; - - cr._zbuf = _vm->getMaskFromBox(walkbox); - - if (forceClip) - cr._zbuf = forceClip; - else if (isInClass(20)) - cr._zbuf = 0; - else if (cr._zbuf > _vm->gdi._numZBuffer) - cr._zbuf = (byte)_vm->gdi._numZBuffer; - - cr._shadow_table = _vm->_shadowPalette; - - cr.setCostume(costume); - cr.setPalette(palette); - cr.setFacing(facing); - - top = 0xFF; - - bottom = 0; - - /* if the actor is partially hidden, redraw it next frame */ - if (cr.drawCostume(this) & 1) { - needBgReset = true; - needRedraw = true; - } - } else { - AkosRenderer ar(_vm); - - ar.x = x - _vm->virtscr->xstart; - ar.y = y - elevation; - ar.scale_x = scalex; - ar.scale_y = scaley; - ar.clipping = forceClip; - if (ar.clipping == 100) { - ar.clipping = _vm->getMaskFromBox(walkbox); - if (ar.clipping > (byte)_vm->gdi._numZBuffer) - ar.clipping = _vm->gdi._numZBuffer; - } - ar.charsetmask = _vm->_vars[_vm->VAR_CHARSET_MASK] != 0; - - ar.outptr = _vm->virtscr->screenPtr + _vm->virtscr->xstart; - ar.outwidth = _vm->virtscr->width; - ar.outheight = _vm->virtscr->height; - - ar.shadow_mode = shadow_mode; - ar.shadow_table = _vm->_shadowPalette; - - ar.setCostume(costume); - ar.setPalette(palette); - ar.setFacing(this); - - ar.dirty_id = number; - - ar.cd = &cost; - - ar.draw_top = top = 0x7fffffff; - ar.draw_bottom = bottom = 0; - ar.drawCostume(); - top = ar.draw_top; - bottom = ar.draw_bottom; - } -} - -void Actor::animateCostume() -{ - if (costume == 0) - return; - - animProgress++; - if (animProgress >= animSpeed) { - animProgress = 0; - - if (_vm->_features & GF_AFTER_V7) { - byte *akos = _vm->getResourceAddress(rtCostume, costume); - assert(akos); - if (_vm->akos_increaseAnims(akos, this)) { - needRedraw = true; - needBgReset = true; - } - } else { - LoadedCostume lc(_vm); - lc.loadCostume(costume); - if (lc.increaseAnims(this)) { - needRedraw = true; - needBgReset = true; - } - } - } -} - -void Scumm::setActorRedrawFlags() -{ - int i, j; - uint32 bits; - - if (_fullRedraw) { - for (j = 0; j < NUM_ACTORS; j++) { - Actor *a = derefActor(j); - a->needRedraw = true; - a->needBgReset = true; - } - } else { - for (i = 0; i < 40; i++) { - bits = gfxUsageBits[_screenStartStrip + i]; - if (bits & 0x3FFFFFFF) { - for (j = 0; j < NUM_ACTORS; j++) { - if ((bits & (1 << j)) && bits != (uint32)(1 << j)) { - Actor *a = derefActor(j); - a->needRedraw = true; - a->needBgReset = true; - } - } - } - } - } -} - -int Scumm::getActorFromPos(int x, int y) -{ - uint32 drawbits; - int i; - - drawbits = gfxUsageBits[x >> 3]; - if (!(drawbits & 0x3FFFFFFF)) - return 0; - for (i = 1; i < NUM_ACTORS; i++) { - Actor *a = derefActor(i); - if (drawbits & (1 << i) && !getClass(i, 32) && y >= a->top && y <= a->bottom) { - return i; - } - } - return 0; -} - -void Scumm::actorTalk() -{ - int oldact; - Actor *a; - - _msgPtrToAdd = charset._buffer; - _messagePtr = addMessageToStack(_messagePtr); - assert((int)(_msgPtrToAdd - charset._buffer) < (int)(sizeof(charset._buffer))); - - if (_actorToPrintStrFor == 0xFF) { - if (!_keepText) - stopTalk(); - _vars[VAR_TALK_ACTOR] = 0xFF; - oldact = 0; - } else { - a = derefActorSafe(_actorToPrintStrFor, "actorTalk"); - if (!a->isInCurrentRoom() && !(_features & GF_AFTER_V7)) { - oldact = 0xFF; - } else { - if (!_keepText) - stopTalk(); - _vars[VAR_TALK_ACTOR] = a->number; - if (!string[0].no_talk_anim) { - a->startAnimActor(a->talkFrame1); - _useTalkAnims = true; - } - oldact = _vars[VAR_TALK_ACTOR]; - } - } - if (oldact >= 0x80) - return; - - if (_vars[VAR_TALK_ACTOR] > 0x7F) { - _charsetColor = (byte)string[0].color; - } else { - a = derefActorSafe(_vars[VAR_TALK_ACTOR], "actorTalk(2)"); - _charsetColor = a->talkColor; - } - charset._bufPos = 0; - _talkDelay = 0; - _haveMsg = 0xFF; - _vars[VAR_HAVE_MSG] = 0xFF; - CHARSET_1(); -} - -void Actor::setActorCostume(int c) -{ - int i; - - costumeNeedsInit = true; - - if (visible) { - hideActor(); - cost.reset(); - costume = c; - showActor(); - } else { - costume = c; - cost.reset(); - } - - for (i = 0; i < 32; i++) - palette[i] = 0xFF; -} - -void Actor::startWalkActor(int destX, int destY, int dir) -{ - AdjustBoxResult abr; - - abr = adjustXYToBeInBox(destX, destY, walkbox); - - if (!isInCurrentRoom()) { - x = abr.x; - y = abr.y; - if (dir != -1) - setDirection(dir); - return; - } - - if (ignoreBoxes != 0) { - abr.dist = 0; - walkbox = 0; - } else { - if (_vm->checkXYInBoxBounds(walkdata.destbox, abr.x, abr.y)) { - abr.dist = walkdata.destbox; - } else { - abr = adjustXYToBeInBox(abr.x, abr.y, walkbox); - } - if (moving && walkdata.destdir == dir && walkdata.destx == abr.x && walkdata.desty == abr.y) - return; - } - - if (x == abr.x && y == abr.y) { - turnToDirection(dir); - return; - } - - walkdata.destx = abr.x; - walkdata.desty = abr.y; - walkdata.destbox = (byte)abr.dist; /* a box */ - walkdata.destdir = dir; - moving = (moving & MF_IN_LEG) | MF_NEW_LEG; - walkdata.point3x = 32000; - - walkdata.curbox = walkbox; -} - -void Actor::startWalkAnim(int cmd, int angle) -{ - if (angle == -1) - angle = facing; - -/*FIXME: (yazoo): the walk script are buggy in dig causing - * troubles while walking. It's disabled until I can - * find a proper fix - * note: walk scripts aren't required to make the game - * work as usual */ - -/* int16 args[16]; - - if (walk_script != 0) { - args[2] = angle; - args[0] = number; - args[1] = cmd; - _vm->runScript(walk_script, 1, 0, args); - } else*/ { - switch (cmd) { - case 1: /* start walk */ - setDirection(angle); - startAnimActor(walkFrame); - break; - case 2: /* change dir only */ - setDirection(angle); - break; - case 3: /* stop walk */ - turnToDirection(angle); - startAnimActor(standFrame); - break; - } - } -} - -void Actor::walkActor() -{ - int j; - int16 foundPathX, foundPathY; - - if (!moving) - return; - - if (!(moving & MF_NEW_LEG)) { - if (moving & MF_IN_LEG && actorWalkStep()) - return; - - if (moving & MF_LAST_LEG) { - moving = 0; - setBox(walkdata.destbox); - startWalkAnim(3, walkdata.destdir); - return; - } - - if (moving & MF_TURN) { - j = updateActorDirection(false); - if (facing != j) - setDirection(j); - else - moving = 0; - return; - } - - setBox(walkdata.curbox); - moving &= MF_IN_LEG; - } - - do { - moving &= ~MF_NEW_LEG; - if ((!walkbox && (!(_vm->_features & GF_SMALL_HEADER)))) { - setBox(walkdata.destbox); - walkdata.curbox = walkdata.destbox; - break; - } - if (walkbox == walkdata.destbox) - break; - j = _vm->getPathToDestBox(walkbox, walkdata.destbox); - if (j == -1 || j > 0xF0) { - walkdata.destbox = walkbox; - moving |= MF_LAST_LEG; - return; - } - walkdata.curbox = j; - - if (_vm->findPathTowards(this, walkbox, j, walkdata.destbox, foundPathX, foundPathY)) - break; - if (calcMovementFactor(foundPathX, foundPathY)) - return; - - setBox(walkdata.curbox); - } while (1); - - moving |= MF_LAST_LEG; - calcMovementFactor(walkdata.destx, walkdata.desty); -} - -void Actor::walkActorOld() -{ - ScummPoint gateLoc[5]; // Gate locations - int new_dir, next_box; - - if (!moving) - return; - - if (moving & MF_NEW_LEG) { - restart: - moving &= ~MF_NEW_LEG; - - if (walkbox == 0xFF) { - walkbox = walkdata.destbox; - walkdata.curbox = walkdata.destbox; - moving |= MF_LAST_LEG; - calcMovementFactor(walkdata.destx, walkdata.desty); - return; - } - - if (walkbox == walkdata.destbox) { - moving |= MF_LAST_LEG; - calcMovementFactor(walkdata.destx, walkdata.desty); - return; - } - - next_box = _vm->getPathToDestBox(walkbox, walkdata.destbox); - - if (next_box == -1) { - moving |= MF_LAST_LEG; - return; - } - - walkdata.curbox = next_box; - - _vm->findPathTowardsOld(this, walkbox, next_box, walkdata.destbox, gateLoc); - if (gateLoc[2].x == 32000 && gateLoc[3].x == 32000) { - moving |= MF_LAST_LEG; - calcMovementFactor(walkdata.destx, walkdata.desty); - return; - } - - if (gateLoc[2].x != 32000) { - if (calcMovementFactor(gateLoc[2].x, gateLoc[2].y)) { - walkdata.point3x = gateLoc[3].x; - walkdata.point3y = gateLoc[3].y; - return; - } - } - - if (calcMovementFactor(gateLoc[3].x, gateLoc[3].y)) - return; - - walkbox = walkdata.destbox; - goto restart; - - } - - if (moving & MF_IN_LEG) { - if (actorWalkStep()) - return; - } - - if (moving & MF_LAST_LEG) { - moving = 0; - startWalkAnim(3, walkdata.destdir); - return; - } - - if (moving & MF_TURN) { - new_dir = updateActorDirection(false); - if (facing != new_dir) { - setDirection(new_dir); - return; - } - moving = 0; - return; - } - - if (walkdata.point3x != 32000) { - if (calcMovementFactor(walkdata.point3x, walkdata.point3y)) { - walkdata.point3x = 32000; - return; - } - walkdata.point3x = 32000; - } - - walkbox = walkdata.curbox; - moving &= MF_IN_LEG; - moving |= MF_NEW_LEG; - goto restart; -} - -byte *Actor::getActorName() -{ - byte *ptr = _vm->getResourceAddress(rtActorName, number); - if (ptr == NULL) - return (byte *)" "; - return ptr; -} - -void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold) -{ - byte *akos, *rgbs, *akpl; - int akpl_size, i; - int r, g, b; - byte akpl_color; - - if (!isInCurrentRoom()) { - warning("Remap actor %d not in current room", number); - return; - } - - if (costume < 1 || costume >= _vm->_numCostumes - 1) { - warning("Remap actor %d invalid costume", number, costume); - return; - } - - akos = _vm->getResourceAddress(rtCostume, costume); - akpl = findResource(MKID('AKPL'), akos); - - //get num palette entries - akpl_size = RES_SIZE(akpl) - 8; - - //skip resource header - akpl = RES_DATA(akpl); - - rgbs = findResource(MKID('RGBS'), akos); - - if (!rgbs) { - warning("Can't remap actor %d costume %d doesn't contain an RGB block", number, costume); - return; - } - // skip resource header - rgbs = RES_DATA(rgbs); - - for (i = 0; i < akpl_size; i++) { - r = *rgbs++; - g = *rgbs++; - b = *rgbs++; - - akpl_color = *akpl++; - - // allow remap of generic palette entry? - if (!shadow_mode || akpl_color >= 16) { - if (r_fact != 256) - r = (r * r_fact) >> 8; - if (g_fact != 256) - g = (g * g_fact) >> 8; - if (b_fact != 256) - b = (b * b_fact) >> 8; - palette[i] = _vm->remapPaletteColor(r, g, b, threshold); - } - } -} - -void Scumm::resetActorBgs() -{ - Actor *a; - int i; - uint32 onlyActorFlags, bitpos; - - for (i = 0; i < 40; i++) { - onlyActorFlags = (gfxUsageBits[_screenStartStrip + i] &= 0x3FFFFFFF); - a = getFirstActor(); - bitpos = 1; - - while (onlyActorFlags) { - if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) { - gfxUsageBits[_screenStartStrip + i] ^= bitpos; - - if ((a->bottom - a->top) >= 0) - gdi.resetBackground(a->top, a->bottom, i); - } - bitpos <<= 1; - onlyActorFlags >>= 1; - a++; - } - } - - for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { - a->needBgReset = false; - } -} - -void Actor::classChanged(int cls, bool value) -{ - switch(cls) { - case 20: // Never clip - break; - case 21: // Always clip - forceClip = value; - break; - case 22: // Ignore boxes - ignoreBoxes = value; - break; - case 29: // Y flip - break; - case 30: // X flip - break; - case 31: // ?? - break; - } -} - -bool Actor::isInClass(int cls) -{ - return _vm->getClass(number, cls); -} diff --git a/actor.h b/actor.h deleted file mode 100644 index d0b3ba8d35..0000000000 --- a/actor.h +++ /dev/null @@ -1,179 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - - -#ifndef ACTOR_H -#define ACTOR_H - -#include -#include "scummsys.h" - -class Scumm; - -enum MoveFlags { - MF_NEW_LEG = 1, - MF_IN_LEG = 2, - MF_TURN = 4, - MF_LAST_LEG = 8 -}; - -struct ActorWalkData { - int16 destx, desty; // Final destination - byte destbox; - int16 destdir; - byte curbox; - int16 x, y; // Current position - int16 newx, newy; // Next position on our way to the destination - int32 XYFactor, YXFactor; - uint16 xfrac, yfrac; - int point3x, point3y; -}; - -struct CostumeData { - byte active[16]; - uint16 animCounter1; - byte animCounter2; - uint16 stopped; - uint16 curpos[16]; - uint16 start[16]; - uint16 end[16]; - uint16 frame[16]; - - void reset() { - stopped = 0; - for (int i = 0; i < 16; i++) { - active[i] = 0; - curpos[i] = start[i] = end[i] = frame[i] = 0xFFFF; - } - } -}; - -class Actor { - -public: - int x, y, top, bottom; - int elevation; - uint width; - byte number; - uint16 facing; - uint16 costume; - byte room; - byte talkColor; - byte scalex, scaley; - byte charset; - int16 newDirection; - byte moving; - byte ignoreBoxes; - byte forceClip; - byte initFrame, walkFrame, standFrame, talkFrame1, talkFrame2; - bool needRedraw, needBgReset, costumeNeedsInit, visible; - byte shadow_mode; - bool flip; - uint speedx, speedy; - byte frame; - byte walkbox; - byte mask; // This field is *NOT* used anymore, only kept around to make saveload.cpp happy - byte animProgress, animSpeed; - int16 new_1, new_2; - uint16 talk_script, walk_script; - byte new_3; - int8 layer; - ActorWalkData walkdata; - int16 animVariable[16]; - uint16 sound[8]; - CostumeData cost; - byte palette[64]; - -protected: - Scumm *_vm; - -public: - - // Constructor, sets all data to 0 - Actor() { - memset(this, 0, sizeof(Actor)); - } void initActorClass(Scumm *scumm) { - _vm = scumm; - } -//protected: - void hideActor(); - void showActor(); - - void initActor(int mode); - void putActor(int x, int y, byte room); - void setActorWalkSpeed(uint newSpeedX, uint newSpeedY); -protected: - int calcMovementFactor(int newx, int newy); - int actorWalkStep(); - int remapDirection(int dir, bool is_walking); - void setupActorScale(); -public: - void stopActorMoving(); - void startWalkAnim(int cmd, int angle); - void startAnimActor(int frame); - -protected: - void setBox(int box); - int updateActorDirection(bool is_walking); - -public: - void setDirection(int direction); - int getActorXYPos(int &x, int &y); - - AdjustBoxResult adjustXYToBeInBox(int dstX, int dstY, int pathfrom); -protected: - void adjustActorPos(); -public: - void turnToDirection(int newdir); - void walkActor(); - void drawActorCostume(); - void animateCostume(); - void setActorCostume(int c); - byte *getActorName(); - void startWalkActor(int x, int y, int dir); - - void remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold); - void walkActorOld(); - - void animateActor(int anim); - - bool isInCurrentRoom() { - return room == _vm->_currentRoom; - } - int getRoom() { - return room; - } - - int getAnimVar(byte var) { - return animVariable[var]; - } - void setAnimVar(byte var, int value) { - animVariable[var] = value; - } - - void classChanged(int cls, bool value); - -protected: - bool isInClass(int cls); -}; - -#endif diff --git a/akos.cpp b/akos.cpp deleted file mode 100644 index 78eabfeb14..0000000000 --- a/akos.cpp +++ /dev/null @@ -1,1199 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "akos.h" - -bool Scumm::akos_hasManyDirections(Actor *a) -{ - if (_features & GF_NEW_COSTUMES) { - byte *akos; - AkosHeader *akhd; - - akos = getResourceAddress(rtCostume, a->costume); - assert(akos); - - akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos); - return (akhd->flags & 2) != 0; - } - return 0; -} - -int Scumm::akos_frameToAnim(Actor *a, int frame) -{ - if (akos_hasManyDirections(a)) - return toSimpleDir(1, a->facing) + frame * 8; - else - return newDirToOldDir(a->facing) + frame * 4; -} - -void Scumm::akos_decodeData(Actor *a, int frame, uint usemask) -{ - uint anim; - byte *akos, *r; - AkosHeader *akhd; - uint offs; - int i; - byte code; - uint16 start, len; - uint16 mask; - - if (a->costume == 0) - return; - - anim = akos_frameToAnim(a, frame); - - akos = getResourceAddress(rtCostume, a->costume); - assert(akos); - - akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos); - - if (anim >= READ_LE_UINT16(&akhd->num_anims)) - return; - - r = findResourceData(MKID('AKCH'), akos); - assert(r); - - offs = READ_LE_UINT16(r + anim * sizeof(uint16)); - if (offs == 0) - return; - r += offs; - - i = 0; - mask = READ_LE_UINT16(r); - r += sizeof(uint16); - do { - if (mask & 0x8000) { - code = *r++; - if (usemask & 0x8000) { - switch (code) { - case 1: - a->cost.active[i] = 0; - a->cost.frame[i] = frame; - a->cost.end[i] = 0; - a->cost.start[i] = 0; - a->cost.curpos[i] = 0; - break; - case 4: - a->cost.stopped |= 1 << i; - break; - case 5: - a->cost.stopped &= ~(1 << i); - break; - default: - start = READ_LE_UINT16(r); - len = READ_LE_UINT16(r + sizeof(uint16)); - r += sizeof(uint16) * 2; - - a->cost.active[i] = code; - a->cost.frame[i] = frame; - a->cost.end[i] = start + len; - a->cost.start[i] = start; - a->cost.curpos[i] = start; - break; - } - } else { - if (code != 1 && code != 4 && code != 5) - r += sizeof(uint16) * 2; - } - } - i++; - mask <<= 1; - usemask <<= 1; - } while ((uint16)mask); -} - -void AkosRenderer::setPalette(byte *new_palette) -{ - byte *the_akpl; - uint size, i; - - the_akpl = _vm->findResourceData(MKID('AKPL'), akos); - size = _vm->getResourceDataSize(akpl); - - if (size > 256) - error("akos_setPalette: %d is too many colors", size); - - for (i = 0; i < size; i++) { - palette[i] = new_palette[i] != 0xFF ? new_palette[i] : the_akpl[i]; - } -} - -void AkosRenderer::setCostume(int costume) -{ - akos = _vm->getResourceAddress(rtCostume, costume); - assert(akos); - - akhd = (AkosHeader *) _vm->findResourceData(MKID('AKHD'), akos); - akof = (AkosOffset *) _vm->findResourceData(MKID('AKOF'), akos); - akci = _vm->findResourceData(MKID('AKCI'), akos); - aksq = _vm->findResourceData(MKID('AKSQ'), akos); - akcd = _vm->findResourceData(MKID('AKCD'), akos); - akpl = _vm->findResourceData(MKID('AKPL'), akos); - codec = READ_LE_UINT16(&akhd->codec); -} - -void AkosRenderer::setFacing(Actor *a) -{ - mirror = (newDirToOldDir(a->facing) != 0 || akhd->flags & 1); - if (a->flip) - mirror ^= 1; -} - -bool AkosRenderer::drawCostume() -{ - int i; - bool result = false; - - move_x = move_y = 0; - for (i = 0; i < 16; i++) - result |= drawCostumeChannel(i); - return result; -} - -bool AkosRenderer::drawCostumeChannel(int chan) -{ - uint code; - byte *p; - AkosOffset *off; - AkosCI *the_akci; - uint i, extra; - - if (!cd->active[chan] || cd->stopped & (1 << chan)) - return false; - - p = aksq + cd->curpos[chan]; - - code = p[0]; - if (code & 0x80) - code = (code << 8) | p[1]; - - if (code == AKC_Return) - return false; - - if (code != AKC_ComplexChan) { - off = akof + (code & 0xFFF); - - assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((byte *)akof - 4) - 8); - assert((code & 0x7000) == 0); - - srcptr = akcd + READ_LE_UINT32(&off->akcd); - the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci)); - - move_x_cur = move_x + (int16)READ_LE_UINT16(&the_akci->rel_x); - move_y_cur = move_y + (int16)READ_LE_UINT16(&the_akci->rel_y); - width = READ_LE_UINT16(&the_akci->width); - height = READ_LE_UINT16(&the_akci->height); - move_x += (int16)READ_LE_UINT16(&the_akci->move_x); - move_y -= (int16)READ_LE_UINT16(&the_akci->move_y); - - switch (codec) { - case 1: - codec1(); - break; - case 5: - codec5(); - break; - case 16: - codec16(); - break; - default: - error("akos_drawCostumeChannel: invalid codec %d", codec); - } - } else { - extra = p[2]; - p += 3; - - for (i = 0; i != extra; i++) { - code = p[4]; - if (code & 0x80) - code = ((code & 0xF) << 8) | p[5]; - off = akof + code; - - srcptr = akcd + READ_LE_UINT32(&off->akcd); - the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci)); - - move_x_cur = move_x + (int16)READ_LE_UINT16(p + 0); - move_y_cur = move_y + (int16)READ_LE_UINT16(p + 2); - - p += (p[4] & 0x80) ? 6 : 5; - - width = READ_LE_UINT16(&the_akci->width); - height = READ_LE_UINT16(&the_akci->height); - - switch (codec) { - case 1: - codec1(); - break; - case 5: - codec5(); - break; - case 16: - codec16(); - break; - default: - error("akos_drawCostumeChannel: invalid codec %d", codec); - } - } - } - - return true; -} - -void akos_c1_0y_decode(AkosRenderer * ar) -{ - byte len, color; - byte *src, *dst; - int height; - uint y; - uint scrheight; - - len = ar->v1.replen; - src = ar->srcptr; - dst = ar->v1.destptr; - color = ar->v1.repcolor; - scrheight = ar->outheight; - height = ar->height; - y = ar->v1.y; - - if (len) - goto StartPos; - - do { - len = *src++; - color = len >> ar->v1.shl; - len &= ar->v1.mask; - if (!len) - len = *src++; - - do { - if (color && y < scrheight) { - *dst = ar->palette[color]; - } - - dst += ar->outwidth; - y++; - if (!--height) { - if (!--ar->v1.skip_width) - return; - dst -= ar->v1.y_pitch; - height = ar->height; - y = ar->v1.y; - } - StartPos:; - } while (--len); - } while (1); -} - -void akos_generic_decode(AkosRenderer * ar) -{ - byte *src, *dst; - byte len, height, maskbit; - uint y, color; - const byte *scaleytab, *mask; - - - y = ar->v1.y; - - len = ar->v1.replen; - src = ar->srcptr; - dst = ar->v1.destptr; - color = ar->v1.repcolor; - height = ar->height; - - scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; - maskbit = revBitMask[ar->v1.x & 7]; - mask = ar->v1.mask_ptr + (ar->v1.x >> 3); - - if (len) - goto StartPos; - - do { - len = *src++; - color = len >> ar->v1.shl; - len &= ar->v1.mask; - if (!len) - len = *src++; - - do { - if (*scaleytab++ < ar->scale_y) { - if (color && y < ar->outheight - && (!ar->v1.mask_ptr || !((mask[0] | mask[ar->v1.imgbufoffs]) & maskbit))) { - *dst = ar->palette[color]; - } - mask += 40; - dst += ar->outwidth; - y++; - } - if (!--height) { - if (!--ar->v1.skip_width) - return; - height = ar->height; - y = ar->v1.y; - - scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; - - if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) { - ar->v1.x += ar->v1.scaleXstep; - if ((uint) ar->v1.x >= 320) - return; - maskbit = revBitMask[ar->v1.x & 7]; - ar->v1.destptr += ar->v1.scaleXstep; - } - mask = ar->v1.mask_ptr + (ar->v1.x >> 3); - ar->v1.tmp_x += ar->v1.scaleXstep; - dst = ar->v1.destptr; - } - StartPos:; - } while (--len); - } while (1); -} - - -void akos_c1_spec1(AkosRenderer * ar) -{ - byte *src, *dst; - byte len, height, pcolor, maskbit; - uint y, color; - const byte *scaleytab, *mask; - - - y = ar->v1.y; - - len = ar->v1.replen; - src = ar->srcptr; - dst = ar->v1.destptr; - color = ar->v1.repcolor; - height = ar->height; - - scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; - maskbit = revBitMask[ar->v1.x & 7]; - mask = ar->v1.mask_ptr + (ar->v1.x >> 3); - - if (len) - goto StartPos; - - do { - len = *src++; - color = len >> ar->v1.shl; - len &= ar->v1.mask; - if (!len) - len = *src++; - - do { - if (*scaleytab++ < ar->scale_y) { - if (color && y < ar->outheight - && (!ar->v1.mask_ptr || !((mask[0] | mask[ar->v1.imgbufoffs]) & maskbit))) { - pcolor = ar->palette[color]; - if (pcolor == 13) - pcolor = ar->shadow_table[*dst]; - *dst = pcolor; - } - mask += 40; - dst += ar->outwidth; - y++; - } - if (!--height) { - if (!--ar->v1.skip_width) - return; - height = ar->height; - y = ar->v1.y; - - scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; - - if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) { - ar->v1.x += ar->v1.scaleXstep; - if ((uint) ar->v1.x >= 320) - return; - maskbit = revBitMask[ar->v1.x & 7]; - ar->v1.destptr += ar->v1.scaleXstep; - } - mask = ar->v1.mask_ptr + (ar->v1.x >> 3); - ar->v1.tmp_x += ar->v1.scaleXstep; - dst = ar->v1.destptr; - } - StartPos:; - } while (--len); - } while (1); -} - -const byte default_scale_table[768] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, - - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, - - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, -}; - - -void AkosRenderer::codec1() -{ - int num_colors; - bool use_scaling; - int i, j; - int cur_x, x_right, x_left, skip = 0, tmp_x, tmp_y; - int cur_y, y_top, y_bottom; - bool y_clipping; - bool masking; - int step; - - - /* implement custom scale table */ - - - - if (_vm->isGlobInMemory(rtString, _vm->_vars[_vm->VAR_CUSTOMSCALETABLE])) { - v1.scaletable = _vm->getStringAddressVar(_vm->VAR_CUSTOMSCALETABLE); - } else { - v1.scaletable = default_scale_table; - } - - /* Setup color decoding variables */ - num_colors = _vm->getResourceDataSize(akpl); - if (num_colors == 32) { - v1.mask = (1 << 3) - 1; - v1.shl = 3; - } else if (num_colors == 64) { - v1.mask = (1 << 2) - 1; - v1.shl = 2; - } else { - v1.mask = (1 << 4) - 1; - v1.shl = 4; - } - - use_scaling = (scale_x != 0xFF) || (scale_y != 0xFF); - - cur_x = x; - cur_y = y; - - if (use_scaling) { - - /* Scale direction */ - v1.scaleXstep = -1; - if (move_x_cur < 0) { - move_x_cur = -move_x_cur; - v1.scaleXstep = 1; - } - - if (mirror) { - /* Adjust X position */ - tmp_x = 0x180 - move_x_cur; - j = tmp_x; - for (i = 0; i < move_x_cur; i++) { - if (v1.scaletable[j++] < scale_x) - cur_x -= v1.scaleXstep; - } - - x_left = x_right = cur_x; - - j = tmp_x; - for (i = 0, skip = 0; i < width; i++) { - if (x_right < 0) { - skip++; - tmp_x = j; - } - if (v1.scaletable[j++] < scale_x) - x_right++; - } - } else { - /* No mirror */ - /* Adjust X position */ - tmp_x = 0x180 + move_x_cur; - j = tmp_x; - for (i = 0; i < move_x_cur; i++) { - if (v1.scaletable[j++] < scale_x) - cur_x += v1.scaleXstep; - } - - x_left = x_right = cur_x; - - j = tmp_x; - for (i = 0, skip = 0; i < width; i++) { - if (x_left >= (int)outwidth) { - tmp_x = j; - skip++; - } - if (v1.scaletable[j--] < scale_x) - x_left--; - } - } - - if (skip) - skip--; - - step = -1; - if (move_y_cur < 0) { - move_y_cur = -move_y_cur; - step = -step; - } - - tmp_y = 0x180 - move_y_cur; - for (i = 0; i < move_y_cur; i++) { - if (v1.scaletable[tmp_y++] < scale_y) - cur_y -= step; - } - - y_top = y_bottom = cur_y; - tmp_y = 0x180 - move_y_cur; - for (i = 0; i < height; i++) { - if (v1.scaletable[tmp_y++] < scale_y) - y_bottom++; - } - - tmp_y = 0x180 - move_y_cur; - } else { - if (!mirror) - move_x_cur = -move_x_cur; - - cur_x += move_x_cur; - cur_y += move_y_cur; - - if (mirror) { - x_left = cur_x; - x_right = cur_x + width; - } else { - x_right = cur_x; - x_left = cur_x - width; - } - - y_top = cur_y; - y_bottom = cur_y + height; - - tmp_x = 0x180; - tmp_y = 0x180; - } - - v1.tmp_x = tmp_x; - v1.tmp_y = tmp_y; - v1.skip_width = width; - - v1.scaleXstep = -1; - if (mirror) - v1.scaleXstep = -v1.scaleXstep; - - if ((uint) y_top >= (uint) outheight || y_bottom <= 0) - return; - - if ((int)x_left >= (int)outwidth || x_right <= 0) - return; - - v1.replen = 0; - v1.y_pitch = height * outwidth; - - if (mirror) { - v1.y_pitch--; - if (!use_scaling) - skip = -cur_x; - if (skip > 0) { - v1.skip_width -= skip; - codec1_ignorePakCols(skip); - cur_x = 0; - } else { - skip = x_right - outwidth; - if (skip > 0) - v1.skip_width -= skip; - } - } else { - v1.y_pitch++; - if (!use_scaling) { - skip = x_right - outwidth + 1; - } - if (skip > 0) { - v1.skip_width -= skip; - codec1_ignorePakCols(skip); - cur_x = outwidth - 1; - } else { - skip = -1 - x_left; - if (skip > 0) - v1.skip_width -= skip; - } - } - - v1.x = cur_x; - v1.y = cur_y; - - if (v1.skip_width <= 0 || height <= 0) - return; - - _vm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, 1 << dirty_id); - - y_clipping = ((uint) y_bottom > outheight || y_top < 0); - - if ((uint) y_top > (uint) outheight) - y_top = 0; - - if ((uint) y_bottom > (uint) outheight) - y_bottom = outheight; - - if (y_top < draw_top) - draw_top = y_top; - if (y_bottom > draw_bottom) - draw_bottom = y_bottom; - - if (cur_x == -1) - cur_x = 0; /* ?? */ - - v1.destptr = outptr + cur_x + cur_y * outwidth; - - masking = false; - if (clipping) { - masking = _vm->isMaskActiveAt(x_left, y_top, x_right, y_bottom, - _vm->getResourceAddress(rtBuffer, 9) + - _vm->gdi._imgBufOffs[clipping] + _vm->_screenStartStrip) != 0; - } - - v1.mask_ptr = NULL; - - if (masking || charsetmask || shadow_mode) { - v1.mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + cur_y * 40 + _vm->_screenStartStrip; - v1.imgbufoffs = _vm->gdi._imgBufOffs[clipping]; - if (!charsetmask && masking) { - v1.mask_ptr += v1.imgbufoffs; - v1.imgbufoffs = 0; - } - } - - switch (shadow_mode) { - case 1: - akos_c1_spec1(this); - return; - case 2: -// akos_c1_spec2(this); - warning("akos_c1_spec2"); - return; - case 3: -// akos_c1_spec3(this); - warning("akos_c1_spec3"); - return; - } - - akos_generic_decode(this); - -// akos_c1_0y_decode(this); - -#if 0 - - switch (((byte)y_clipping << 3) | ((byte)use_scaling << 2) | ((byte)masking << 1) | (byte)charsetmask) { - case 0: - akos_c1_0_decode(this); - break; - case 0 + 8: - akos_c1_0y_decode(this); - break; - case 2: - case 1: - akos_c1_12_decode(this); - break; - case 2 + 8: - case 1 + 8: - akos_c1_12y_decode(this); - break; - case 3 + 8: - case 3: - akos_c1_3_decode(this); - break; - case 4: - akos_c1_4_decode(this); - break; - case 4 + 8: - akos_c1_4y_decode(this); - break; - case 6: - case 5: - akos_c1_56_decode(this); - break; - case 6 + 8: - case 5 + 8: - akos_c1_56y_decode(this); - break; - case 7: - case 7 + 8: - akos_c1_7_decode(this); - break; - } -#endif -} - - -void AkosRenderer::codec1_ignorePakCols(int num) -{ - int n; - byte repcolor; - byte replen; - byte *src; - - n = height; - if (num > 1) - n *= num; - src = srcptr; - do { - repcolor = *src++; - replen = repcolor & v1.mask; - if (replen == 0) { - replen = *src++; - } - do { - if (!--n) { - v1.repcolor = repcolor >> v1.shl; - v1.replen = replen; - srcptr = src; - return; - } - } while (--replen); - } while (1); -} - - -void AkosRenderer::codec5() -{ - VirtScreen *vs; - BompDrawData bdd; - - int moveX; - int moveY; - int left; - int var_20; - int max_width; - - int right; - int top; - int bottom; - - vs = &_vm->virtscr[0]; - //setBlastObjectMode(shadow_mode); // not implemented yet - moveX = move_x_cur; - moveY = move_y_cur; - - if (!mirror) { - left = (x - moveX - width) + 1; - } else { - left = x + moveX - 1; - } - - var_20 = 0; - max_width = outwidth; - - right = left + width - 1; - top = y + moveY; - bottom = top + height; - - if (left < 0) - left = 0; - if (left > max_width) - left -= left - max_width; - - // Yazoo: this is not correct, but fix a lots of bugs for the momment - - draw_top = 0; - draw_bottom = vs->height; - - _vm->updateDirtyRect(0, left, right + 1, top, bottom + 1, 1 << dirty_id); - - bdd.dataptr = srcptr; - bdd.out = outptr; - bdd.outheight = outheight; - bdd.outwidth = outwidth; - bdd.scale_x = 0xFF; - bdd.scale_y = 0xFF; - bdd.srcheight = height; - bdd.srcwidth = width; - bdd.x = left + 1; - bdd.y = top; - - _vm->drawBomp(&bdd, 0, bdd.dataptr, 0, 0); -} - -void AkosRenderer::codec16() -{ - warning("akos_codec16: not implemented"); -} - - -bool Scumm::akos_increaseAnims(byte *akos, Actor *a) -{ - byte *aksq, *akfo; - int i; - uint size; - bool result; - - aksq = findResourceData(MKID('AKSQ'), akos); - akfo = findResourceData(MKID('AKFO'), akos); - - size = getResourceDataSize(akfo) >> 1; - - result = false; - for (i = 0; i != 0x10; i++) { - if (a->cost.active[i] != 0) - result |= akos_increaseAnim(a, i, aksq, (uint16 *)akfo, size); - } - return result; -} - - -#define GW(o) ((int16)READ_LE_UINT16(aksq+curpos+(o))) -#define GUW(o) READ_LE_UINT16(aksq+curpos+(o)) -#define GB(o) aksq[curpos+(o)] - -bool Scumm::akos_increaseAnim(Actor *a, int chan, byte *aksq, uint16 *akfo, int numakfo) -{ - byte active; - uint old_curpos, curpos, end; - uint code; - bool flag_value; - int tmp, tmp2; - - active = a->cost.active[chan]; - end = a->cost.end[chan]; - old_curpos = curpos = a->cost.curpos[chan]; - flag_value = false; - - do { - - code = aksq[curpos]; - if (code & 0x80) - code = (code << 8) | aksq[curpos + 1]; - - switch (active) { - case 6: - switch (code) { - case AKC_JumpIfSet: - case AKC_AddVar: - case AKC_SetVar: - case AKC_SkipGE: - case AKC_SkipG: - case AKC_SkipLE: - case AKC_SkipL: - case AKC_SkipNE: - case AKC_SkipE: - curpos += 5; - break; - case AKC_JumpTable: - case AKC_SetActorClip: - case AKC_Ignore3: - case AKC_Ignore2: - case AKC_Ignore: - case AKC_StartAnim: - case AKC_CmdQue3: - curpos += 3; - break; - case AKC_SoundStuff: - curpos += 8; - break; - case AKC_Cmd3: - case AKC_SetVarInActor: - case AKC_SetDrawOffs: - curpos += 6; - break; - case AKC_ClearFlag: - case AKC_HideActor: - case AKC_CmdQue3Quick: - case AKC_Return: - curpos += 2; - break; - case AKC_JumpGE: - case AKC_JumpG: - case AKC_JumpLE: - case AKC_JumpL: - case AKC_JumpNE: - case AKC_JumpE: - case AKC_Random: - curpos += 7; - break; - case AKC_Flip: - case AKC_Jump: - curpos += 4; - break; - case AKC_ComplexChan: - curpos += 3; - tmp = aksq[curpos - 1]; - while (--tmp >= 0) { - curpos += 4; - curpos += (aksq[curpos] & 0x80) ? 2 : 1; - } - break; - default: - if (code & 0xC000) - error("akos_increaseAnim: invalid code %x", code); - curpos += (code & 0x8000) ? 2 : 1; - } - break; - case 2: - curpos += (code & 0x8000) ? 2 : 1; - if (curpos > end) - curpos = a->cost.start[chan]; - break; - case 3: - if (curpos != end) - curpos += (code & 0x8000) ? 2 : 1; - break; - } - - code = aksq[curpos]; - if (code & 0x80) - code = (code << 8) | aksq[curpos + 1]; - - if (flag_value && code != AKC_ClearFlag) - continue; - - switch (code) { - case AKC_StartAnimInActor: - akos_queCommand(4, derefActorSafe(a->getAnimVar(GB(2)), - "akos_increaseAnim:29"), a->getAnimVar(GB(3)), 0); - continue; - - case AKC_Random: - a->setAnimVar(GB(6), getRandomNumberRng(GW(2), GW(4))); - continue; - case AKC_SkipGE: - case AKC_SkipG: - case AKC_SkipLE: - case AKC_SkipL: - case AKC_SkipNE: - case AKC_SkipE: - if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_SkipStart)) - flag_value = true; - continue; - case AKC_IncVar: - a->setAnimVar(0, a->getAnimVar(0) + 1); - continue; - case AKC_SetVar: - a->setAnimVar(GB(4), GW(2)); - continue; - case AKC_AddVar: - a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2)); - continue; - case AKC_Flip: - a->flip = GW(2) != 0; - continue; - case AKC_CmdQue3: - tmp = GB(2); - if ((uint) tmp < 8) - akos_queCommand(3, a, a->sound[tmp], 0); - continue; - case AKC_CmdQue3Quick: - akos_queCommand(3, a, a->sound[1], 0); - continue; - case AKC_StartAnim: - akos_queCommand(4, a, GB(2), 0); - continue; - case AKC_StartVarAnim: - akos_queCommand(4, a, a->getAnimVar(GB(2)), 0); - continue; - case AKC_SetVarInActor: - derefActorSafe(a->getAnimVar(GB(2)), "akos_increaseAnim:9")->setAnimVar(GB(3), GW(4) - ); - continue; - case AKC_HideActor: - akos_queCommand(1, a, 0, 0); - continue; - case AKC_SetActorClip: - akos_queCommand(5, a, GB(2), 0); - continue; - case AKC_SoundStuff: - tmp = GB(2); - if (tmp >= 8) - continue; - tmp2 = GB(4); - if (tmp2 < 1 || tmp2 > 3) - error("akos_increaseAnim:8 invalid code %d", tmp2); - akos_queCommand(tmp2 + 6, a, a->sound[tmp], GB(6)); - continue; - case AKC_SetDrawOffs: - akos_queCommand(6, a, GW(2), GW(4)); - continue; - case AKC_JumpTable: - if (akfo == NULL) - error("akos_increaseAnim: no AKFO table"); - tmp = a->getAnimVar(GB(2)) - 1; - if (tmp < 0 || tmp >= numakfo - 1) - error("akos_increaseAnim: invalid jump value %d", tmp); - curpos = READ_LE_UINT16(&akfo[tmp]); - break; - case AKC_JumpIfSet: - if (!a->getAnimVar(GB(4))) - continue; - a->setAnimVar(GB(4), 0); - curpos = GUW(2); - break; - - case AKC_ClearFlag: - flag_value = false; - continue; - - case AKC_Jump: - curpos = GUW(2); - break; - - case AKC_Return: - case AKC_ComplexChan: - break; - - case AKC_Ignore: - case AKC_Ignore2: - case AKC_Ignore3: - continue; - - case AKC_JumpE: - case AKC_JumpNE: - case AKC_JumpL: - case AKC_JumpLE: - case AKC_JumpG: - case AKC_JumpGE: - if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_JumpStart)) - continue; - curpos = GUW(2); - break; - - default: - if ((code & 0xC000) == 0xC000) - error("Undefined uSweat token %X", code); - } - break; - } while (1); - - int code2 = aksq[curpos]; - if (code2 & 0x80) - code2 = (code2 << 8) | aksq[curpos + 1]; - assert((code2 & 0xC000) != 0xC000 || code2 == AKC_ComplexChan || code2 == AKC_Return); - - a->cost.curpos[chan] = curpos; - - return curpos != old_curpos; -} - -void Scumm::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) -{ -// warning("akos_queCommand(%d,%d,%d,%d)", cmd, a->number, param_1, param_2); -} - - -bool Scumm::akos_compare(int a, int b, byte cmd) -{ - switch (cmd) { - case 0: - return a == b; - case 1: - return a != b; - case 2: - return a < b; - case 3: - return a <= b; - case 4: - return a > b; - default: - return a >= b; - } -} diff --git a/akos.h b/akos.h deleted file mode 100644 index d24f4b48bc..0000000000 --- a/akos.h +++ /dev/null @@ -1,170 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - - - -#if !defined(__GNUC__) -#pragma START_PACK_STRUCTS -#endif - -struct CostumeData; - -struct AkosHeader { - byte x_1[2]; - byte flags; - byte x_2; - uint16 num_anims; - uint16 x_3; - uint16 codec; -} GCC_PACK; - -struct AkosOffset { - uint32 akcd; - uint16 akci; -} GCC_PACK; - -struct AkosCI { - uint16 width, height; - int16 rel_x, rel_y; - int16 move_x, move_y; -} GCC_PACK; - -#if !defined(__GNUC__) -#pragma END_PACK_STRUCTS -#endif - -struct AkosRenderer { -//protected: - CostumeData *cd; - int x, y; /* where to draw costume */ - byte scale_x, scale_y; /* scaling */ - byte clipping; /* clip mask */ - bool charsetmask; - byte shadow_mode; - uint16 codec; - bool mirror; /* draw actor mirrored */ - byte dirty_id; - byte *outptr; - uint outwidth, outheight; - - /* pointer to various parts of the costume resource */ - byte *akos; - AkosHeader *akhd; - - /* current move offset */ - int move_x, move_y; - /* movement of cel to decode */ - int move_x_cur, move_y_cur; - /* width and height of cel to decode */ - int width, height; - - byte *srcptr; - byte *shadow_table; - - struct { - /* codec stuff */ - const byte *scaletable; - byte mask, shl; - bool doContinue; - byte repcolor; - byte replen; - int scaleXstep; - int x, y; - int tmp_x, tmp_y; - int y_pitch; - int skip_width; - byte *destptr; - byte *mask_ptr; - int imgbufoffs; - } v1; - - /* put less used stuff at the bottom to optimize opcodes */ - int draw_top, draw_bottom; - byte *akpl, *akci, *aksq; - AkosOffset *akof; - byte *akcd; - - byte palette[256]; - -protected: - Scumm *_vm; - -public: - - // Constructor, sets all data to 0 - AkosRenderer(Scumm *scumm) { - memset(this, 0, sizeof(AkosRenderer)); - _vm = scumm; - } bool drawCostume(); - void setPalette(byte *palette); - void setCostume(int costume); - void setFacing(Actor * a); - bool drawCostumeChannel(int chan); - void codec1(); - void codec5(); - void codec16(); - void codec1_ignorePakCols(int num); - void c1_spec2(); - void c1_spec3(); -}; - -enum AkosOpcodes { - AKC_Return = 0xC001, - AKC_SetVar = 0xC010, - AKC_CmdQue3 = 0xC015, - AKC_ComplexChan = 0xC020, - AKC_Jump = 0xC030, - AKC_JumpIfSet = 0xC031, - AKC_AddVar = 0xC040, - AKC_Ignore = 0xC050, - AKC_IncVar = 0xC060, - AKC_CmdQue3Quick = 0xC061, - AKC_SkipStart = 0xC070, - AKC_SkipE = 0xC070, - AKC_SkipNE = 0xC071, - AKC_SkipL = 0xC072, - AKC_SkipLE = 0xC073, - AKC_SkipG = 0xC074, - AKC_SkipGE = 0xC075, - AKC_StartAnim = 0xC080, - AKC_StartVarAnim = 0xC081, - AKC_Random = 0xC082, - AKC_SetActorClip = 0xC083, - AKC_StartAnimInActor = 0xC084, - AKC_SetVarInActor = 0xC085, - AKC_HideActor = 0xC086, - AKC_SetDrawOffs = 0xC087, - AKC_JumpTable = 0xC088, - AKC_SoundStuff = 0xC089, - AKC_Flip = 0xC08A, - AKC_Cmd3 = 0xC08B, - AKC_Ignore3 = 0xC08C, - AKC_Ignore2 = 0xC08D, - AKC_JumpStart = 0xC090, - AKC_JumpE = 0xC090, - AKC_JumpNE = 0xC091, - AKC_JumpL = 0xC092, - AKC_JumpLE = 0xC093, - AKC_JumpG = 0xC094, - AKC_JumpGE = 0xC095, - AKC_ClearFlag = 0xC09F -}; diff --git a/backends/dc/.cvsignore b/backends/dc/.cvsignore new file mode 100644 index 0000000000..ed6bd2b99e --- /dev/null +++ b/backends/dc/.cvsignore @@ -0,0 +1,5 @@ +scummvm +sound +v3 +v4 +simon diff --git a/backends/dc/Makefile b/backends/dc/Makefile new file mode 100644 index 0000000000..18ba20d6fc --- /dev/null +++ b/backends/dc/Makefile @@ -0,0 +1,39 @@ +# $Header$ + +ronindir = /usr/local/ronin + +VPATH = .. + +CC = sh-elf-g++ -ml -m4-single-only +CFLAGS = -O1 -Wno-multichar +DEFINES = -D__DC__ -DNONSTANDARD_PORT -DNONSTANDARD_SAVE +LDFLAGS := -Wl,-Ttext,0x8c010000 -nostartfiles ronin/crt0.o +INCLUDES:= -I./ -I../ -I../sound +CPPFLAGS= $(DEFINES) $(INCLUDES) +LIBS = ronin/libronin.a ronin/libz.a -lm +EXEEXT = + +OBJS = dcmain.o display.o audio.o input.o selector.o icon.o \ + label.o vmsave.o + +include ../Makefile.common + +INCS += portdefs.h dc.h + +$(OBJS): Makefile sound/.create simon/.create v3/.create v4/.create ronin + +sound/.create: + mkdir sound && touch $@ + +simon/.create: + mkdir simon && touch $@ + +v3/.create: + mkdir v3 && touch $@ + +v4/.create: + mkdir v4 && touch $@ + +ronin: + ln -s $(ronindir) $@ + diff --git a/backends/dc/README b/backends/dc/README new file mode 100644 index 0000000000..d4bf04c5bd --- /dev/null +++ b/backends/dc/README @@ -0,0 +1,20 @@ +Compiling ScummVM for SEGA Dreamcast +==================================== + +If you want to compile ScummVM for your Dreamcast, +you'll need the following: + +* gcc-3.0.x configured as a cross-compiler for `sh-elf' + (including corresponding binutils) + +* newlib for sh-elf : + +* libronin-0.3 : + +* GNU make + + +Edit the Makefile to contain the path to libronin if you installed it +somewhere other than /usr/local/ronin, then run `make', and you should +get an ELF binary with the name `scummvm'. + diff --git a/backends/dc/audio.cpp b/backends/dc/audio.cpp new file mode 100644 index 0000000000..863c1e97ac --- /dev/null +++ b/backends/dc/audio.cpp @@ -0,0 +1,86 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "dc.h" + +EXTERN_C void *memcpy4(void *s1, const void *s2, unsigned int n); + +void initSound() +{ + stop_sound(); + do_sound_command(CMD_SET_FREQ_EXP(FREQ_22050_EXP)); + do_sound_command(CMD_SET_BUFFER(3)); +} + +bool OSystem_Dreamcast::set_sound_proc(void *param, SoundProc *proc, + byte format) +{ +#if SAMPLE_MODE == 0 + assert(format == SOUND_16BIT); +#elif SAMPLE_MODE == 1 + assert(format == SOUND_8BIT); +#else +#error Invalid SAMPLE_MODE +#endif + _sound_proc_param = param; + _sound_proc = proc; + + return true; +} + +void OSystem_Dreamcast::checkSound() +{ + int n; + int curr_ring_buffer_samples; + + if(read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY) + start_sound(); + + curr_ring_buffer_samples = read_sound_int(&SOUNDSTATUS->ring_length); + + n = read_sound_int(&SOUNDSTATUS->samplepos); + + if((n-=fillpos)<0) + n += curr_ring_buffer_samples; + + n = ADJUST_BUFFER_SIZE(n-10); + + if(n<100) + return; + + _sound_proc(_sound_proc_param, (byte*)temp_sound_buffer, + SAMPLES_TO_BYTES(n)); + + if(fillpos+n > curr_ring_buffer_samples) { + int r = curr_ring_buffer_samples - fillpos; + memcpy4(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r)); + fillpos = 0; + n -= r; + memcpy4(RING_BUF, temp_sound_buffer+r, SAMPLES_TO_BYTES(n)); + } else { + memcpy4(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n)); + } + if((fillpos += n) >= curr_ring_buffer_samples) + fillpos = 0; +} diff --git a/backends/dc/dc.h b/backends/dc/dc.h new file mode 100644 index 0000000000..4a2b78cfb7 --- /dev/null +++ b/backends/dc/dc.h @@ -0,0 +1,102 @@ +#include + +#define NUM_BUFFERS 4 + +class OSystem_Dreamcast : public OSystem { + + public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + static OSystem *create(); + + + private: + + int _ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_old_x, _ms_old_y; + int _ms_hotspot_x, _ms_hotspot_y, _ms_visible, _devpoll; + int _current_shake_pos, _screen_h; + unsigned char *_ms_buf; + SoundProc *_sound_proc; + void *_sound_proc_param; + + unsigned char *screen; + unsigned short *mouse; + void *screen_tx[NUM_BUFFERS]; + void *mouse_tx[NUM_BUFFERS]; + int current_buffer; + unsigned short palette[256]; + + short temp_sound_buffer[RING_BUFFER_SAMPLES]; + + void checkSound(); + + void drawMouse(int xdraw, int ydraw, int w, int h, + unsigned char *buf, bool visible); + +}; + +extern int handleInput(struct mapledev *pad, + int &mouse_x, int &mouse_y, + byte &shiftFlags); +extern void initSound(); +extern bool selectGame(GameDetector *d, char *&, char *&, class Icon &); + diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp new file mode 100644 index 0000000000..a64643a004 --- /dev/null +++ b/backends/dc/dcmain.cpp @@ -0,0 +1,201 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "mididrv.h" +#include "gameDetector.h" +#include "dc.h" +#include "icon.h" + + +Icon icon; + + +OSystem *OSystem_Dreamcast_create() { + return OSystem_Dreamcast::create(); +} + +OSystem *OSystem_Dreamcast::create() { + OSystem_Dreamcast *syst = new OSystem_Dreamcast(); + return syst; +} + +/* CD Audio */ +static bool find_track(int track, int &first_sec, int &last_sec) +{ + struct TOC *toc = cdfs_gettoc(); + if(!toc) + return false; + int i, first, last; + first = TOC_TRACK(toc->first); + last = TOC_TRACK(toc->last); + if(first < 1 || last > 99 || first > last) + return false; + for(i=last; i>=first; --i) + if(!(TOC_CTRL(toc->entry[i-1])&4)) + if(track==1) { + first_sec = TOC_LBA(toc->entry[i-1]); + last_sec = TOC_LBA(toc->entry[i]); + return true; + } else + --track; + return false; +} + +void OSystem_Dreamcast::play_cdrom(int track, int num_loops, + int start_frame, int end_frame) +{ + int first_sec, last_sec; +#if 1 + if(num_loops) + --num_loops; +#endif + if(num_loops>14) num_loops=14; + else if(num_loops<0) num_loops=15; // infinity + if(!find_track(track, first_sec, last_sec)) + return; + if(end_frame) + last_sec = first_sec + start_frame + end_frame; + first_sec += start_frame; + play_cdda_sectors(first_sec, last_sec, num_loops); +} + +void OSystem_Dreamcast::stop_cdrom() +{ + stop_cdda(); +} + +bool OSystem_Dreamcast::poll_cdrom() +{ + extern int getCdState(); + return getCdState() == 3; +} + +void OSystem_Dreamcast::update_cdrom() +{ + // Dummy. The CD drive takes care of itself. +} + +uint32 OSystem_Dreamcast::property(int param, Property *value) +{ + switch(param) { + + case PROP_GET_SAMPLE_RATE: + return 22050; + + } + + return 0; +} + +void OSystem_Dreamcast::quit() { + exit(0); +} + +void *OSystem_Dreamcast::create_thread(ThreadProc *proc, void *param) { + warning("Creating a thread! (not supported.)\n"); +} + +uint32 OSystem_Dreamcast::get_msecs() +{ + static uint32 msecs=0; + static unsigned int t0=0; + + unsigned int t = Timer(); + unsigned int dm, dt = t - t0; + + t0 = t; + dm = (dt << 6)/3125U; + dt -= (dm * 3125U)>>6; + t0 -= dt; + + return msecs += dm; +} + +void OSystem_Dreamcast::delay_msecs(uint msecs) +{ + get_msecs(); + unsigned int t, start = Timer(); + int time = (((unsigned int)msecs)*100000U)>>11; + while(((int)((t = Timer())-start))mouse.x, oldmousey = s->mouse.y; + time = (((unsigned int)time)*100000U)>>11; + int mask = getimask(); + while(((int)((t = Timer())-start))0) { + setimask(15); + checkSound(); + handleInput(locked_get_pads(), s->mouse.x, s->mouse.y, + s->_leftBtnPressed, s->_rightBtnPressed, s->_keyPressed); + setimask(mask); + devpoll += USEC_TO_TIMER(17000); + if(s->mouse.x != oldmousex || s->mouse.y != oldmousey) { + extern void updateScreen(Scumm *s); + updateScreen(s); + oldmousex = s->mouse.x; + oldmousey = s->mouse.y; + } + } +} +*/ + +void dc_init_hardware(void) +{ +#ifndef NOSERIAL + serial_init(57600); + usleep(2000000); + printf("Serial OK\r\n"); +#endif + + cdfs_init(); + maple_init(); + dc_setup_ta(); + init_arm(); +} + +int dc_setup(GameDetector &detector) +{ + static char *argv[] = { "scummvm", NULL, NULL, NULL }; + static int argc = 3; + + initSound(); + + if(!selectGame(&detector, argv[2], argv[1], icon)) + exit(0); + + detector.parseCommandLine(argc, argv); + + return 0; +} diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp new file mode 100644 index 0000000000..97c7f2aed5 --- /dev/null +++ b/backends/dc/display.cpp @@ -0,0 +1,303 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "dc.h" + +#define SCREEN_W 320 +#define SCREEN_H 240 +#define MOUSE_W 64 +#define MOUSE_H 64 + +#define TOP_OFFSET (240.0-_screen_h) + +#define QACR0 (*(volatile unsigned int *)(void *)0xff000038) +#define QACR1 (*(volatile unsigned int *)(void *)0xff00003c) + + +#define COPYPIXEL(n) do { \ + unsigned short _tmp = pal[*s++]; \ + d[n] = _tmp|(pal[*s++]<<16); \ +} while(0) + +static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short *pal) +{ + unsigned char *s = (unsigned char *)src; + unsigned int *d = (unsigned int *)(void *) + (0xe0000000 | (((unsigned long)dest) & 0x03ffffc0)); + QACR0 = ((0xa4000000>>26)<<2)&0x1c; + QACR1 = ((0xa4000000>>26)<<2)&0x1c; + while(cnt--) { + COPYPIXEL(0); + COPYPIXEL(1); + COPYPIXEL(2); + COPYPIXEL(3); + asm("pref @%0" : : "r" (s+4*16)); + COPYPIXEL(4); + COPYPIXEL(5); + COPYPIXEL(6); + COPYPIXEL(7); + asm("pref @%0" : : "r" (d)); + d += 8; + COPYPIXEL(0); + COPYPIXEL(1); + COPYPIXEL(2); + COPYPIXEL(3); + asm("pref @%0" : : "r" (s+4*16)); + COPYPIXEL(4); + COPYPIXEL(5); + COPYPIXEL(6); + COPYPIXEL(7); + asm("pref @%0" : : "r" (d)); + d += 8; + } +} + +void commit_dummy_transpoly() +{ + struct polygon_list mypoly; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| + TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA; + mypoly.texture = 0; + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + ta_commit_list(&mypoly); +} + + +void OSystem_Dreamcast::set_palette(const byte *colors, uint start, uint num) +{ + unsigned short *dst = palette + start; + if(num>0) + while( num-- ) { + *dst++ = ((colors[0]<<7)&0x7c00)| + ((colors[1]<<2)&0x03e0)| + ((colors[2]>>3)&0x001f); + colors += 4; + } +} + +void OSystem_Dreamcast::init_size(uint w, uint h) +{ + assert(w == SCREEN_W && h <= SCREEN_H); + + _screen_h = h; + ta_sync(); + if(!screen) + screen = new unsigned char[SCREEN_W*SCREEN_H]; + for(int i=0; i>5, palette ); + src += SCREEN_W; + dst += SCREEN_W; + } + + // *((volatile unsigned int *)(void*)0xa05f8040) = 0x00ff00; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE| + TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512; + mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED| + TA_TEXTUREMODE_STRIDE|TA_TEXTUREMODE_ADDRESS(screen_tx[current_buffer]); + + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + + ta_begin_frame(); + // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0000ff; + ta_commit_list(&mypoly); + + myvertex.cmd = TA_CMD_VERTEX; + myvertex.ocolour = 0; + myvertex.colour = 0; + myvertex.z = 0.5; + myvertex.u = 0.0; + myvertex.v = 0.0; + + myvertex.x = 0.0; + myvertex.y = _current_shake_pos*2.0+TOP_OFFSET; + ta_commit_list(&myvertex); + + myvertex.x = SCREEN_W*2.0; + myvertex.u = SCREEN_W/512.0; + ta_commit_list(&myvertex); + + myvertex.x = 0.0; + myvertex.y += _screen_h*2.0; + myvertex.u = 0.0; + myvertex.v = _screen_h*(1/512.0); + ta_commit_list(&myvertex); + + myvertex.x = SCREEN_W*2.0; + myvertex.u = SCREEN_W/512.0; + myvertex.cmd |= TA_CMD_VERTEX_EOS; + ta_commit_list(&myvertex); + + ta_commit_end(); + // *((volatile unsigned int *)(void*)0xa05f8040) = 0xffff00; + drawMouse(_ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_buf, _ms_visible); + // *((volatile unsigned int *)(void*)0xa05f8040) = 0xff00ff; + ta_commit_frame(); + + current_buffer++; + current_buffer &= NUM_BUFFERS-1; + // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0; +} + +void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h, + unsigned char *buf, bool visible) +{ + struct polygon_list mypoly; + struct packed_colour_vertex_list myvertex; + + unsigned short *dst = (unsigned short *)mouse_tx[current_buffer]; + int y=0; + + if(visible && w<=MOUSE_W && h<=MOUSE_H) + for(int y=0; y +#include + +#include "icon.h" + +void Icon::create_vmicon(void *buffer) +{ + unsigned short *pal = (unsigned short *)buffer; + unsigned char *pix = ((unsigned char *)buffer)+32; + + for(int n = 0; n<16; n++) { + int p = palette[n]; + pal[n] = + ((p>>16)&0xf000)| + ((p>>12)&0x0f00)| + ((p>> 8)&0x00f0)| + ((p>> 4)&0x000f); + } + + for(int line = 0; line < 32; line++) { + memcpy(pix, &bitmap[32/2*(31-line)], 32/2); + pix += 32/2; + } +} + +void Icon::create_texture() +{ + static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21, + 64, 65, 68, 69, 80, 81, 84, 85 }; + unsigned short *tex = (unsigned short *)ta_txalloc(512); + unsigned short *linebase; + unsigned char *src = bitmap+sizeof(bitmap)-17; + for(int y=0; y<16; y++) { + linebase = tex + (tt[y]<<1); + for(int x=0; x<16; x++, --src) + linebase[tt[x]] = src[16]|(src[0]<<8); + src -= 16; + } + texture = tex; +} + +void Icon::set_palette(int pal) +{ + unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000; + for(int n = 0; n<16; n++) + (*hwpal)[pal][n] = palette[n]; +} + +void Icon::draw(float x1, float y1, float x2, float y2, int pal, + unsigned int argb) +{ + struct polygon_list mypoly; + struct packed_colour_vertex_list myvertex; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| + TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA| + TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_U_SIZE_32| + TA_POLYMODE2_V_SIZE_32; + mypoly.texture = TA_TEXTUREMODE_CLUT4|TA_TEXTUREMODE_CLUTBANK4(pal)| + TA_TEXTUREMODE_ADDRESS(texture); + + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + + ta_commit_list(&mypoly); + + myvertex.cmd = TA_CMD_VERTEX; + myvertex.ocolour = 0; + myvertex.colour = argb; + myvertex.z = 0.5; + myvertex.u = 0.0; + myvertex.v = 1.0; + + myvertex.x = x1; + myvertex.y = y1; + ta_commit_list(&myvertex); + + myvertex.x = x2; + myvertex.v = 0.0; + ta_commit_list(&myvertex); + + myvertex.x = x1; + myvertex.y = y2; + myvertex.u = 1.0; + myvertex.v = 1.0; + ta_commit_list(&myvertex); + + myvertex.x = x2; + myvertex.v = 0.0; + myvertex.cmd |= TA_CMD_VERTEX_EOS; + ta_commit_list(&myvertex); +} + +int Icon::find_unused_pixel() +{ + int use[16]; + memset(use, 0, sizeof(use)); + for(int n=0; n<32*32/2; n++) { + unsigned char pix = bitmap[n]; + use[pix&0xf]++; + use[pix>>4]++; + } + for(int i=0; i<16; i++) + if(!use[i]) + return i; + return -1; +} + +bool Icon::load_image2(void *data, int len) +{ + struct { + int size, w, h; + short pla, bitcnt; + int comp, sizeimg, xres, yres, used, imp; + } hdr; + if(len < 40) + return false; + memcpy(&hdr, data, 40); + if(hdr.size != 40 || hdr.sizeimg<=0 || hdr.w<0 || hdr.h<0 || + hdr.bitcnt<0 || hdr.used<0) + return false; + if(!hdr.used) + hdr.used = 1<>= 1; + if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len || + hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3)) + return false; + if(hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16) + return false; + memcpy(palette, ((char *)data)+hdr.size, hdr.used<<2); + memcpy(bitmap, ((char *)data)+hdr.size+(hdr.used<<2), 32*32/2); + for(int i=0; i<16; i++) + palette[i] |= 0xff000000; + for(int i=hdr.used; i<16; i++) + palette[i] = 0; + int unused = find_unused_pixel(); + if(unused >= 0) { + unsigned char *mask = + ((unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2; + unsigned char *pix = bitmap; + for(int y=0; y<32; y++) + for(int x=0; x<32/8; x++) { + unsigned char mbits = *mask++; + for(int z=0; z<4; z++) { + unsigned char pbits = *pix; + if(mbits & 64) pbits = (pbits & ~0xf) | unused; + if(mbits & 128) pbits = (pbits & 0xf) | (unused << 4); + *pix++ = pbits; + mbits <<= 2; + } + } + palette[unused] = 0; + } + return true; +} + +bool Icon::load_image1(void *data, int len, int offs) +{ + struct { + char w, h, colors, rsrv; + short pla, bitcnt; + int bytes, offs; + } hdr; + if(len < offs+16) + return false; + memcpy(&hdr, ((char *)data)+offs, 16); + if(hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len) + return load_image2(((char *)data)+hdr.offs, hdr.bytes); + else + return false; +} + +bool Icon::load(void *data, int len, int offs) +{ + struct { short rsrv, type, cnt; } hdr; + memset(bitmap, 0, sizeof(bitmap)); + memset(palette, 0, sizeof(palette)); + texture = NULL; + if(len < offs+6) + return false; + memcpy(&hdr, ((char *)data)+offs, 6); + if(hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len) + return false; + for(int i=0; i=0) { + int sz; + sz = read(fd, buf, sizeof(buf)); + close(fd); + if(sz>0) + return load(buf, sz); + } + return false; +} diff --git a/backends/dc/icon.h b/backends/dc/icon.h new file mode 100644 index 0000000000..b9cf344bab --- /dev/null +++ b/backends/dc/icon.h @@ -0,0 +1,21 @@ + +class Icon +{ + private: + unsigned char bitmap[32*32/2]; + unsigned int palette[16]; + void *texture; + + int find_unused_pixel(); + bool load_image1(void *data, int len, int offs); + bool load_image2(void *data, int len); + + public: + bool load(void *data, int len, int offs = 0); + bool load(const char *filename); + void create_texture(); + void set_palette(int pal); + void draw(float x1, float y1, float x2, float y2, int pal, + unsigned argb = 0xffffffff); + void create_vmicon(void *buffer); +}; diff --git a/backends/dc/input.cpp b/backends/dc/input.cpp new file mode 100644 index 0000000000..ed7289e463 --- /dev/null +++ b/backends/dc/input.cpp @@ -0,0 +1,173 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "dc.h" + +int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, + byte &shiftFlags) +{ + int lmb=0, rmb=0, newkey=0; + static int lastkey = 0; + static byte lastlmb = 0, lastrmb = 0; + shiftFlags = 0; + for(int i=0; i<4; i++, pad++) + if(pad->func & MAPLE_FUNC_CONTROLLER) { + int buttons = pad->cond.controller.buttons; + + if(!(buttons & 0x060e)) exit(0); + + if(!(buttons & 4)) lmb++; + if(!(buttons & 2)) rmb++; + + if(!(buttons & 8)) newkey = 319; + else if(!(buttons & 512)) newkey = ' '; + else if(!(buttons & 1024)) newkey = '0'; + + if(!(buttons & 128)) mouse_x++; + if(!(buttons & 64)) mouse_x--; + if(!(buttons & 32)) mouse_y++; + if(!(buttons & 16)) mouse_y--; + + mouse_x += ((int)pad->cond.controller.joyx-128)>>4; + mouse_y += ((int)pad->cond.controller.joyy-128)>>4; + } else if(pad->func & MAPLE_FUNC_MOUSE) { + int buttons = pad->cond.mouse.buttons; + + if(!(buttons & 4)) lmb++; + if(!(buttons & 2)) rmb++; + + if(!(buttons & 8)) newkey = 319; + + mouse_x += pad->cond.mouse.axis1; + mouse_y += pad->cond.mouse.axis2; + pad->cond.mouse.axis1 = 0; + pad->cond.mouse.axis2 = 0; + } else if(pad->func & MAPLE_FUNC_KEYBOARD) { + for(int p=0; p<6; p++) { + int shift = pad->cond.kbd.shift; + int key = pad->cond.kbd.key[p]; + if(shift & 0x08) lmb++; + if(shift & 0x80) rmb++; + if(shift & 0x11) shiftFlags |= OSystem::KBD_CTRL; + if(shift & 0x44) shiftFlags |= OSystem::KBD_ALT; + if(shift & 0x22) shiftFlags |= OSystem::KBD_SHIFT; + if(key >= 4 && key <= 0x1d) + newkey = key+('a'-4); + else if(key >= 0x1e && key <= 0x26) + newkey = key+((shift & 0x22)? ('!'-0x1e) : ('1'-0x1e)); + else if(key >= 0x59 && key <= 0x61) + newkey = key+('1'-0x59); + else if(key >= 0x3a && key <= 0x43) + newkey = key+(315-0x3a); + else switch(key) { + case 0x27: case 0x62: + newkey = ((shift & 0x22)? '~' : '0'); break; + case 0x28: case 0x58: + newkey = 13; break; + case 0x29: + newkey = 27; break; + case 0x2a: + newkey = 8; break; + case 0x2b: + newkey = 9; break; + case 0x2c: + newkey = ' '; break; + case 0x4c: + if((shift & 0x11) && (shift & 0x44)) + exit(0); + break; + case 0x4f: + mouse_x++; break; + case 0x50: + mouse_x--; break; + case 0x51: + mouse_y++; break; + case 0x52: + mouse_y--; break; + } + } + } + + if(lmb && !lastlmb) { + lastlmb = 1; + return -OSystem::EVENT_LBUTTONDOWN; + } else if(lastlmb && !lmb) { + lastlmb = 0; + return -OSystem::EVENT_LBUTTONUP; + } + if(rmb && !lastrmb) { + lastrmb = 1; + return -OSystem::EVENT_RBUTTONDOWN; + } else if(lastrmb && !rmb) { + lastrmb = 0; + return -OSystem::EVENT_RBUTTONUP; + } + + if(!newkey) + lastkey = 0; + else if(newkey != lastkey) + return lastkey = newkey; + + return 0; +} + +bool OSystem_Dreamcast::poll_event(Event *event) +{ + unsigned int t = Timer(); + if(((int)(t-_devpoll))<0) + return false; + _devpoll += USEC_TO_TIMER(17000); + int mask = getimask(); + setimask(15); + checkSound(); + int e = handleInput(locked_get_pads(), _ms_cur_x, _ms_cur_y, + event->kbd.flags); + setimask(mask); + if (_ms_cur_x<0) _ms_cur_x=0; + if (_ms_cur_x>319) _ms_cur_x=319; + if (_ms_cur_y<0) _ms_cur_y=0; + if (_ms_cur_y>=_screen_h) _ms_cur_y=_screen_h-1; + event->mouse.x = _ms_cur_x; + event->mouse.y = _ms_cur_y; + event->kbd.ascii = event->kbd.keycode = 0; + if(e<0) { + event->event_code = -e; + return true; + } else if(e>0) { + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = e; + event->kbd.ascii = (e>='a' && e<='z' && (event->kbd.flags & KBD_SHIFT)? + e &~ 0x20 : e); + return true; + } else if(_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) { + event->event_code = EVENT_MOUSEMOVE; + _ms_old_x = _ms_cur_x; + _ms_old_y = _ms_cur_y; + return true; + } else { + event->event_code = 0; + return false; + } +} + diff --git a/backends/dc/label.cpp b/backends/dc/label.cpp new file mode 100644 index 0000000000..8f263eec0a --- /dev/null +++ b/backends/dc/label.cpp @@ -0,0 +1,131 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include +#include + +#include "label.h" + +static void *get_romfont_address() +{ + void *ret; + __asm__("jsr @%1; mov #0,r1; mov r0,%0" : + "=r" (ret) : "r" (*(void **)0x8c0000b4) : + "pr", "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7"); + return ret; +} + +static void draw_char(unsigned short *dst, int mod, int c, void *font_base) +{ + unsigned char *src; + int i, j; + if(c<=32 || c>255 || (c>=127 && c<160)) c=160; + if(c<128) c -= 32; else c -= 64; + src = c*36 + (unsigned char *)font_base; + for(i=0; i<12; i++) { + int n = (src[0]<<16)|(src[1]<<8)|src[2]; + for(j=0; j<12; j++, n<<=1) + if(n & (1<<23)) { + dst[j] = 0xffff; + dst[j+1] = 0xffff; + dst[j+2] = 0xa108; + dst[j+mod] = 0xa108; + dst[j+mod+1] = 0xa108; + } + dst += mod; + for(j=0; j<12; j++, n<<=1) + if(n & (1<<23)) { + dst[j] = 0xffff; + dst[j+1] = 0xffff; + dst[j+2] = 0xa108; + dst[j+mod] = 0xa108; + dst[j+mod+1] = 0xa108; + } + dst += mod; + src += 3; + } +} + +void Label::create_texture(const char *text) +{ + void *font = get_romfont_address(); + int l = strlen(text); + if(l>64) l=64; + int w = 14*l; + for(tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u0) + draw_char(tex+(p-=14), u, text[--l], font); + texture = tex; +} + +void Label::draw(float x, float y, unsigned int argb, float scale) +{ + struct polygon_list mypoly; + struct packed_colour_vertex_list myvertex; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| + TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA| + TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_V_SIZE_32|tex_u; + mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED| + TA_TEXTUREMODE_ADDRESS(texture); + + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + + ta_commit_list(&mypoly); + + myvertex.cmd = TA_CMD_VERTEX; + myvertex.ocolour = 0; + myvertex.colour = argb; + myvertex.z = 0.5; + myvertex.u = 0.0; + myvertex.v = 0.0; + + myvertex.x = x; + myvertex.y = y; + ta_commit_list(&myvertex); + + myvertex.x = x+u*scale; + myvertex.u = 1.0; + ta_commit_list(&myvertex); + + myvertex.x = x; + myvertex.y = y+25.0*scale; + myvertex.u = 0.0; + myvertex.v = 25.0/32.0; + ta_commit_list(&myvertex); + + myvertex.x = x+u*scale; + myvertex.u = 1.0; + myvertex.cmd |= TA_CMD_VERTEX_EOS; + ta_commit_list(&myvertex); +} + diff --git a/backends/dc/label.h b/backends/dc/label.h new file mode 100644 index 0000000000..d4a407307d --- /dev/null +++ b/backends/dc/label.h @@ -0,0 +1,11 @@ +class Label +{ + private: + void *texture; + int tex_u, u; + + public: + void create_texture(const char *text); + void draw(float x, float y, unsigned int argb = 0xffffffff, + float scale = 1.0); +}; diff --git a/backends/dc/portdefs.h b/backends/dc/portdefs.h new file mode 100644 index 0000000000..fd7929ffe7 --- /dev/null +++ b/backends/dc/portdefs.h @@ -0,0 +1,9 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp new file mode 100644 index 0000000000..22cba5bbfc --- /dev/null +++ b/backends/dc/selector.cpp @@ -0,0 +1,487 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "mididrv.h" +#include "gameDetector.h" +#include "dc.h" +#include "icon.h" +#include "label.h" + +#include + + +#define MAX_GAMES 100 +#define MAX_DIR 100 + + +void draw_solid_quad(float x1, float y1, float x2, float y2, + int c0, int c1, int c2, int c3) +{ + struct polygon_list mypoly; + struct packed_colour_vertex_list myvertex; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR| + TA_CMD_POLYGON_GOURAUD_SHADING; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED; + mypoly.texture = 0; + + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + + ta_commit_list(&mypoly); + + myvertex.cmd = TA_CMD_VERTEX; + myvertex.ocolour = 0; + myvertex.z = 0.5; + myvertex.u = 0.0; + myvertex.v = 0.0; + + myvertex.colour = c0; + myvertex.x = x1; + myvertex.y = y1; + ta_commit_list(&myvertex); + + myvertex.colour = c1; + myvertex.x = x2; + ta_commit_list(&myvertex); + + myvertex.colour = c2; + myvertex.x = x1; + myvertex.y = y2; + ta_commit_list(&myvertex); + + myvertex.colour = c3; + myvertex.x = x2; + myvertex.cmd |= TA_CMD_VERTEX_EOS; + ta_commit_list(&myvertex); +} + +void draw_trans_quad(float x1, float y1, float x2, float y2, + int c0, int c1, int c2, int c3) +{ + struct polygon_list mypoly; + struct packed_colour_vertex_list myvertex; + + mypoly.cmd = + TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| + TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR| + TA_CMD_POLYGON_GOURAUD_SHADING; + mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; + mypoly.mode2 = + TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| + TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA; + mypoly.texture = 0; + + mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; + + ta_commit_list(&mypoly); + + myvertex.cmd = TA_CMD_VERTEX; + myvertex.ocolour = 0; + myvertex.z = 0.5; + myvertex.u = 0.0; + myvertex.v = 0.0; + + myvertex.colour = c0; + myvertex.x = x1; + myvertex.y = y1; + ta_commit_list(&myvertex); + + myvertex.colour = c1; + myvertex.x = x2; + ta_commit_list(&myvertex); + + myvertex.colour = c2; + myvertex.x = x1; + myvertex.y = y2; + ta_commit_list(&myvertex); + + myvertex.colour = c3; + myvertex.x = x2; + myvertex.cmd |= TA_CMD_VERTEX_EOS; + ta_commit_list(&myvertex); +} + + +struct Game +{ + char dir[256]; + char filename_base[256]; + char text[256]; + Icon icon; + Label label; +}; + +struct Dir +{ + char name[256]; + char deficon[256]; +}; + +static Game the_game; + +static bool isGame(const char *fn, char *base) +{ + int l = strlen(fn); + if(l>4 && (!strcasecmp(fn+l-4, ".000") || + !strcasecmp(fn+l-4, ".SM0"))) { + strcpy(base, fn); + base[l-4]='\0'; + return true; + } + if(!strcasecmp(fn, "00.LFL") || + !strcasecmp(fn, "000.LFL")) { + *base = '\0'; + return true; + } + return false; +} + +static void checkName(GameDetector *d, Game &game) +{ + d->_exe_name = game.filename_base; + if(d->detectGame()) { + char *n = d->getGameName(); + strcpy(game.text, n); + free(n); + } else + strcpy(game.text, game.filename_base); + d->_exe_name = NULL; +} + +static bool checkExe(const char *dir, const char *f) +{ + char fn[520]; + int fd; + sprintf(fn, "%s%s.EXE", dir, f); + if((fd = open(fn, O_RDONLY))<0) + return false; + close(fd); + return true; +} + +static bool isIcon(const char *fn) +{ + int l = strlen(fn); + if(l>4 && !strcasecmp(fn+l-4, ".ICO")) + return true; + else + return false; +} + +static bool loadIcon(Game &game, Dir *dirs, int num_dirs) +{ + char icofn[520]; + sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base); + if(game.icon.load(icofn)) + return true; + for(int i=0; id_size < 0) { + if(num_dirs < MAX_DIR) { + strcpy(dirs[num_dirs].name, dirs[curr_dir-1].name); + if(strlen(dirs[num_dirs].name)+strlen(entry->d_name)<255) { + strcat(dirs[num_dirs].name, entry->d_name); + strcat(dirs[num_dirs].name, "/"); + num_dirs++; + } + } + } else + if(isIcon(entry->d_name)) + strcpy(dirs[curr_dir-1].deficon, entry->d_name); + else if(curr_game < max && + isGame(entry->d_name, games[curr_game].filename_base)) { + strcpy(games[curr_game].dir, dirs[curr_dir-1].name); + if(!*games[curr_game].filename_base) { + int i; + for(i=strlen(games[curr_game].dir)-1; --i>=0; ) + if(games[curr_game].dir[i]=='/') + break; + if(i>=0) { + strcpy(games[curr_game].filename_base, + games[curr_game].dir+i+1); + games[curr_game].filename_base[strlen(games[curr_game]. + filename_base)-1]='\0'; +#if 0 + games[curr_game].dir[i+1]='\0'; +#endif + } + if(checkExe(games[curr_game].dir, "loom")) + strcpy(games[curr_game].filename_base, "loomcd"); + } + checkName(d, games[curr_game]); +#if 0 + printf("Registered game <%s> in <%s> <%s> because of <%s> <%s>\n", + games[curr_game].text, games[curr_game].dir, + games[curr_game].filename_base, + dirs[curr_dir-1].name, entry->d_name); +#endif + curr_game++; + } + closedir(dirp); + } + } + for(int i=0; i= 6) + wasopen = 1; + if(s > 0 && s < 6 && wasopen) { + cdfs_reinit(); + chdir("/"); + chdir("/"); + ta_sync(); + ta_txrelease(mark); + return; + } + + ta_begin_frame(); + + drawBackground(); + + ta_commit_end(); + + lab.draw(166.0, 200.0, 0xffff2020); + + ta_commit_frame(); + + int mousex = 0, mousey = 0; + byte shiftFlags; + + int mask = getimask(); + setimask(15); + handleInput(locked_get_pads(), mousex, mousey, shiftFlags); + setimask(mask); + } +} + +static void drawGameLabel(Game &game, int pal, float x, float y, + unsigned int argb, int fade = 0, float scale = 1.0) +{ + unsigned int fade_alpha = (255-fade)<<24; + + game.icon.draw(x, y, x+32.0*scale, y+32.0*scale, pal, 0xffffff|fade_alpha); + game.label.draw(x+54.0*scale, y+4.0*scale, argb|fade_alpha, scale); +} + +int gameMenu(Game *games, int num_games) +{ + int top_game = 0, selector_pos = 0; + int mousex = 0, mousey = 0; + + if(!num_games) + return -1; + + for(;;) { + + if(getCdState()>=6) + return -1; + + ta_begin_frame(); + + drawBackground(); + + ta_commit_end(); + + float y = 40.0; + for(int i=top_game, cnt=0; cnt<10 && i=16) { + if(selector_pos + top_game + 1 < num_games) + if(++selector_pos >= 10) { + --selector_pos; + ++top_game; + } + mousey -= 16; + } else if(mousey<=-16) { + if(selector_pos + top_game > 0) + if(--selector_pos < 0) { + ++selector_pos; + --top_game; + } + mousey += 16; + } + } +} + +bool selectGame(GameDetector *d, char *&ret, char *&dir_ret, Icon &icon) +{ + Game *games = new Game[MAX_GAMES]; + int selected, num_games; + + ta_sync(); + void *mark = ta_txmark(); + + for(;;) { + num_games = findGames(d, games, MAX_GAMES); + + for(int i=0; i= num_games) + selected = -1; + + if(selected >= 0) + the_game = games[selected]; + + delete games; + + if(selected>=0) { +#if 0 + chdir(the_game.dir); +#else + chdir("/"); + static char dirarg[258]; + sprintf(dirarg, "-p%s", the_game.dir); + dir_ret = dirarg; +#endif + ret = the_game.filename_base; + icon = the_game.icon; + return true; + } else + return false; +} diff --git a/backends/dc/vmsave.cpp b/backends/dc/vmsave.cpp new file mode 100644 index 0000000000..34bf2e40fa --- /dev/null +++ b/backends/dc/vmsave.cpp @@ -0,0 +1,266 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002 Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "mididrv.h" +#include "gameDetector.h" +#include "dc.h" +#include "icon.h" +#include "saveload.h" + +#include + + +// Savegame can not be bigger than this, even before compression +#define MAX_SAVE_SIZE (128*1024) + + +enum vmsaveResult { + VMSAVE_OK, + VMSAVE_NOVM, + VMSAVE_NOSPACE, + VMSAVE_WRITEERROR, +}; + + +static int lastvm=-1; + +static vmsaveResult trySave(GameDetector *d, const char *data, int size, + const char *filename, class Icon &icon, int vm) +{ + struct vmsinfo info; + struct superblock super; + struct vms_file file; + struct vms_file_header header; + struct timestamp tstamp; + struct tm tm; + time_t t; + unsigned char iconbuffer[512+32]; + + if(!vmsfs_check_unit(vm, 0, &info)) + return VMSAVE_NOVM; + if(!vmsfs_get_superblock(&info, &super)) + return VMSAVE_NOVM; + int free_cnt = vmsfs_count_free(&super); + if(vmsfs_open_file(&super, filename, &file)) + free_cnt += file.blks; + if(((128+512+size+511)>>9) > free_cnt) + return VMSAVE_NOSPACE; + + memset(&header, 0, sizeof(header)); + strncpy(header.shortdesc, "ScummVM savegame", 16); + char *game_name = d->getGameName(); + strncpy(header.longdesc, game_name, 32); + free(game_name); + strncpy(header.id, "ScummVM", 16); + icon.create_vmicon(iconbuffer); + header.numicons = 1; + memcpy(header.palette, iconbuffer, sizeof(header.palette)); + time(&t); + tm = *localtime(&t); + tstamp.year = tm.tm_year+1900; + tstamp.month = tm.tm_mon+1; + tstamp.day = tm.tm_mday; + tstamp.hour = tm.tm_hour; + tstamp.minute = tm.tm_min; + tstamp.second = tm.tm_sec; + tstamp.wkday = (tm.tm_wday+6)%7; + + vmsfs_beep(&info, 1); + + vmsfs_errno = 0; + if(!vmsfs_create_file(&super, filename, &header, + iconbuffer+sizeof(header.palette), NULL, + data, size, &tstamp)) { + fprintf(stderr, "%s\n", vmsfs_describe_error()); + vmsfs_beep(&info, 0); + return VMSAVE_WRITEERROR; + } + + vmsfs_beep(&info, 0); + return VMSAVE_OK; +} + +static bool tryLoad(char *&buffer, int &size, const char *filename, int vm) +{ + struct vmsinfo info; + struct superblock super; + struct vms_file file; + struct vms_file_header header; + struct timestamp tstamp; + struct tm tm; + time_t t; + unsigned char iconbuffer[512+32]; + + if(!vmsfs_check_unit(vm, 0, &info)) + return false; + if(!vmsfs_get_superblock(&info, &super)) + return false; + if(!vmsfs_open_file(&super, filename, &file)) + return false; + + buffer = new char[size = file.size]; + + if(vmsfs_read_file(&file, (unsigned char *)buffer, size)) + return true; + + delete buffer; + return false; +} + +vmsaveResult writeSaveGame(GameDetector *d, const char *data, int size, + const char *filename, class Icon &icon) +{ + vmsaveResult r, res = VMSAVE_NOVM; + + if(lastvm >= 0 && + (res = trySave(d, data, size, filename, icon, lastvm)) == VMSAVE_OK) + return res; + + for(int i=0; i<24; i++) + if((r = trySave(d, data, size, filename, icon, i)) == VMSAVE_OK) { + lastvm = i; + return r; + } else if(r > res) + res = r; + + return res; +} + +bool readSaveGame(char *&buffer, int &size, const char *filename) +{ + if(lastvm >= 0 && + tryLoad(buffer, size, filename, lastvm)) + return true; + + for(int i=0; i<24; i++) + if(tryLoad(buffer, size, filename, i)) { + lastvm = i; + return true; + } + + return false; +} + + +struct vmStreamContext { + bool issave; + char *buffer; + int pos, size; + char filename[16]; +}; + +bool SerializerStream::fopen(const char *filename, const char *mode) +{ + vmStreamContext *c = new vmStreamContext; + context = c; + if(strchr(mode, 'w')) { + c->issave = true; + strncpy(c->filename, filename, 16); + c->pos = 0; + c->buffer = new char[c->size = MAX_SAVE_SIZE]; + return true; + } else if(readSaveGame(c->buffer, c->size, filename)) { + if(c->size > 0 && c->buffer[0] != 'S') { + // Data does not start with "SCVM". Maybe compressed? + char *expbuf = new char[MAX_SAVE_SIZE]; + unsigned long destlen = MAX_SAVE_SIZE; + if(!uncompress((Bytef*)expbuf, &destlen, (Bytef*)c->buffer, c->size)) { + delete(c->buffer); + c->buffer = expbuf; + c->size = destlen; + } else delete expbuf; + } + c->issave = false; + c->pos = 0; + return true; + } else { + delete c; + context = NULL; + return false; + } +} + +void SerializerStream::fclose() +{ + extern GameDetector detector; + extern Icon icon; + + if(context) { + vmStreamContext *c = (vmStreamContext *)context; + if(c->issave) { + if(c->pos) { + // Try compression + char *compbuf = new char[c->pos]; + unsigned long destlen = c->pos; + if(!compress((Bytef*)compbuf, &destlen, (Bytef*)c->buffer, c->pos)) { + delete c->buffer; + c->buffer = compbuf; + c->pos = destlen; + } else delete compbuf; + } + writeSaveGame(&detector, c->buffer, c->pos, + c->filename, icon); + } + delete c->buffer; + delete c; + context = NULL; + } +} + +int SerializerStream::fread(void *buf, int size, int cnt) +{ + vmStreamContext *c = (vmStreamContext *)context; + + if (!c || c->issave) + return -1; + + int nbyt = size*cnt; + if (c->pos + nbyt > c->size) { + cnt = (c->size - c->pos)/size; + nbyt = size*cnt; + } + if (nbyt) + memcpy(buf, c->buffer + c->pos, nbyt); + c->pos += nbyt; + return cnt; +} + +int SerializerStream::fwrite(void *buf, int size, int cnt) +{ + vmStreamContext *c = (vmStreamContext *)context; + + if (!c || !c->issave) + return -1; + + int nbyt = size*cnt; + if (c->pos + nbyt > c->size) { + cnt = (c->size - c->pos)/size; + nbyt = size*cnt; + } + if (nbyt) + memcpy(c->buffer + c->pos, buf, nbyt); + c->pos += nbyt; + return cnt; +} + diff --git a/backends/mac/Carbon.r b/backends/mac/Carbon.r new file mode 100644 index 0000000000..a296c97b26 --- /dev/null +++ b/backends/mac/Carbon.r @@ -0,0 +1,111 @@ +/* + * Permit this Carbon application to launch on OS X + * + * © 1997-2000 Metrowerks Corp. + * + * Questions and comments to: + * + * + */ + +#include "MacTypes.r" +#include "Dialogs.r" +#include "Balloons.r" +#include "Menus.r" +#include "Finder.r" +#include "Quickdraw.r" +#include "Icons.r" +#include "Processes.r" +#include "Controls.r" + +/*----------------------------carb ¥ Carbon on OS X launch information --------------------------*/ +type 'carb' { +}; + + +resource 'carb'(0) { +}; + +resource 'ALRT' (129) { + {55, 39, 153, 407}, + 128, + { /* array: 4 elements */ + /* [1] */ + OK, visible, sound1, + /* [2] */ + OK, visible, sound1, + /* [3] */ + OK, visible, sound1, + /* [4] */ + OK, visible, sound1 + }, + alertPositionParentWindowScreen +}; + +resource 'DITL'(128) { + { + {8, 74, 61, 356}, + StaticText { + disabled, + "^0" + }, + + {70, 299, 90, 357}, + Button { + enabled, + "OK" + } + } +}; + +resource 'MENU'(999) { + 999, 63, allEnabled, enabled, "Please Select a GameÉ", + { + "Maniac Mansion (C64)", noIcon, noKey, noMark, plain, + "Zak McKracken and the Alien Mindbenders (C64)", noIcon, noKey, noMark, plain, + "Maniac Mansion", noIcon, noKey, noMark, plain, + "Zak McKracken and the Alien Mindbenders", noIcon, noKey, noMark, plain, + "Indiana Jones and the Last Crusade", noIcon, noKey, noMark, plain, + "Indiana Jones and the Last Crusade (256)", noIcon, noKey, noMark, plain, + "Zak McKracken and the Alien Mindbenders (256)", noIcon, noKey, noMark, plain, + "Loom", noIcon, noKey, noMark, plain, + "Monkey Island 1 (EGA)", noIcon, noKey, noMark, plain, + "Monkey Island 1 (256 color Floppy version)", noIcon, noKey, noMark, plain, + "Loom (256 color CD version)", noIcon, noKey, noMark, plain, + "Monkey Island 1", noIcon, noKey, noMark, plain, + "Monkey Island 1 (alt)", noIcon, noKey, noMark, plain, + "Monkey Island 2: LeChuck's revenge", noIcon, noKey, noMark, plain, + "Indiana Jones 4 and the Fate of Atlantis", noIcon, noKey, noMark, plain, + "Indiana Jones 4 and the Fate of Atlantis (Demo)", noIcon, noKey, noMark, plain, + "Day Of The Tentacle", noIcon, noKey, noMark, plain, + "Day Of The Tentacle (Demo)", noIcon, noKey, noMark, plain, + "Sam & Max", noIcon, noKey, noMark, plain, + "Sam & Max (Demo)", noIcon, noKey, noMark, plain, + "Full Throttle", noIcon, noKey, noMark, plain, + "The Dig", noIcon, noKey, noMark, plain, + "The Curse of Monkey Island", noIcon, noKey, noMark, plain, + "-", noIcon, noKey, noMark, plain, + "Simon the Sorcerer 1 (DOS)", noIcon, noKey, noMark, plain, + "Simon the Sorcerer 1 (Windows)", noIcon, noKey, noMark, plain, + "Simon the Sorcerer 2 (Windows)", noIcon, noKey, noMark, plain + } +}; + +resource 'MENU'(1000) { + 1000, 63, allEnabled, enabled, apple, + { + "About ScummVMÉ", noIcon, noKey, noMark, plain, + "-", noIcon, noKey, noMark, plain + } +}; + +resource 'MENU'(1001) { + 1001, 63, allEnabled, enabled, "File", + { + "New Game", noIcon, "N", noMark, plain, + "Open Game", noIcon, "O", noMark, plain, + "Save Game", noIcon, "S", noMark, plain, + "-", noIcon, noKey, noMark, plain, + "Q", noIcon, "Q", noMark, plain + } +}; \ No newline at end of file diff --git a/backends/mac/CarbonPort-ReadMe.txt b/backends/mac/CarbonPort-ReadMe.txt new file mode 100644 index 0000000000..262b9a50f8 --- /dev/null +++ b/backends/mac/CarbonPort-ReadMe.txt @@ -0,0 +1,34 @@ +README FOR THE MAC CARBON PORT + +Runs on Mac OS X 10.1 (could also run on 10.0.x, but not tested), and Mac OS 8.6 or later (with CarbonLib +installed). + +HOW TO COMPILE? +Launch the scummvm.mcp file in CodeWarrior and choose one of the Targets to compile. For just playing, +you should choose "ScummVM Final", the Debug one is just for Developing. +Binaries will come up to the Website with the release 0.2.0, which will be hopefully soon. + +NOTES: +Put the games in a folder in the same directory as ScummVM, which have the name of the Data Files, like this: + +-- - ScummVM + \- monkey2- + \- monkey2.000 + - monkey2.001 + + +Hope this will help you :) + +CHANGES: +- Thanks to Florent Boudet, QuickTime MIDI has been added, although it currently only works with DOTT +- Added SFX Sound Support +- Now draws the Games Cursors + +BUGS: +- On OS X it got some Problems with KeyDown-Events (seems to work now, most of the time) +- Bad behaviour of the Application towards other, will be fixed soon. +- Some minor bugs + +If you find any bugs, just make a Bug Report on our SourceForge Page. + +-- Mutle \ No newline at end of file diff --git a/backends/mac/mac.cpp b/backends/mac/mac.cpp new file mode 100644 index 0000000000..f22d72666b --- /dev/null +++ b/backends/mac/mac.cpp @@ -0,0 +1,1790 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 Mutwin Kraus (Mac Port) and The ScummVM Project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include +#include + +#include "stdafx.h" +#include "scumm.h" +#include "mididrv.h" +#include "gameDetector.h" +//#include "mp3_cd.h" +#include "gui.h" +//#include "gameDetector.h" +#include "scaler.h" + +#define MAX(a,b) (((a)<(b)) ? (b) : (a)) +#define MIN(a,b) (((a)>(b)) ? (b) : (a)) + +class OSystem_MAC : public OSystem { +public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Add a new callback timer + void set_timer(int timer, int (*callback)(int)) { /* FIXME - TODO */ } + + // Mutex handling + void *create_mutex(void) { return NULL; /* FIXME - TODO */ } + void lock_mutex(void *mutex) { /* FIXME - TODO */ } + void unlock_mutex(void *mutex) { /* FIXME - TODO */ } + void delete_mutex(void *mutex) { /* FIXME - TODO */ } + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + static OSystem *create(int gfx_mode, bool full_screen); + + void sound_callback(SndChannel *chan, SndCommand *cmd_passed); +private: + typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height); + + GWorldPtr screenBuf; + WindowRef wref; + CTabHandle pal; + Rect blit_rect; + + enum { + DF_WANT_RECT_OPTIM = 1 << 0, + DF_REAL_8BIT = 1 << 1, + DF_SEPARATE_TEMPSCREEN = 1 << 2, + DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 + }; + + int _mode; + bool _full_screen; + bool _mouse_visible; + bool _mouse_drawn; + uint32 _mode_flags; + byte _internal_scaling; + + bool force_full; //Force full redraw on next update_screen + bool cksum_valid; + + enum { + NUM_DIRTY_RECT = 100, + + MAX_MOUSE_W = 40, + MAX_MOUSE_H = 40, + MAX_SCALING = 3 + }; + + int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; + Rect *dirty_rect_list; + int num_dirty_rects; + uint32 *dirty_checksums; + + int scaling; + + /* CD Audio */ + int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; + uint32 cd_end_time, cd_stop_time, cd_next_second; + + struct MousePos { + int16 x,y,w,h; + }; + + byte *_ms_buf; + byte *_ms_backup; + MousePos _ms_cur; + MousePos _ms_old; + int16 _ms_hotspot_x; + int16 _ms_hotspot_y; + int _current_shake_pos; + + byte* _gfx_buf; /* Graphics memory */ + int16 *_sai_buf, *_tmp_buf; + uint _palette_changed_first, _palette_changed_last; + + TwoXSaiProc *_sai_func; + + void add_dirty_rgn_auto(const byte *buf); + void mk_checksums(const byte *buf); + + static void fill_sound(void *userdata, uint8 * stream, int len); + + void add_dirty_rect(int x, int y, int w, int h); + + void draw_mouse(); + void undraw_mouse(); + + void load_gfx_mode(); + void unload_gfx_mode(); + + void hotswap_gfx_mode(); + + void get_320x200_image(byte *buf); + + void init_mac_stuff(); + void set_scaling(); + void blit_to_screen(); + void update_rects(); + + static void autosave(Scumm * scumm); + + UInt8 *buffer[2]; + CmpSoundHeader header; + SndChannelPtr channel; + int size; + SoundProc *sndProc; + void * parameter; +}; + +KeyMap fKeyMap; + +Boolean CommandKeyDown() +{ + GetKeys(fKeyMap); // get info + if (fKeyMap[1] & 0x8000) + return true; + else + return false; +} + +static unsigned char *CToPascal(char *str) { + register char *p,*q; + register long len; + + len = strlen(str); + if (len > 255) len = 255; + p = str + len; + q = p-1; + while (p != str) + *p-- = *q--; + *str = len; + return((unsigned char *)str); +} + +static char *PascalToC(unsigned char *str) { + register unsigned char *p,*q,*end; + + end = str + *str; + q = (p=str) + 1; + + while (p < end) + *p++ = *q++; + *p = '\0'; + + return((char *)str); +} + +const EventTypeSpec kCmdEvents[] = +{ + { kEventClassMouse, kEventMouseDown }, + { kEventClassMouse, kEventMouseUp }, + { kEventClassMouse, kEventMouseMoved }, + { kEventClassKeyboard, kEventRawKeyDown }, + { kEventClassCommand, kEventProcessCommand } +}; + +const EventTypeSpec kWindowEvents[] = +{ + { kEventClassWindow, kEventWindowDrawContent }, + { kEventClassWindow, kEventWindowHandleContentClick }, + { kEventClassWindow, kEventWindowClose } +}; + +pascal OSErr QuitEventHandler(const AppleEvent *theEvent, AppleEvent *theReply, SInt32 refCon) +{ + //OSystem_MAC::quit(); + return(noErr); +} + +enum +{ + kNewGameCmd = 'newG', + kQuitCmd = kHICommandQuit, + kOpenGameCmd = 'opnG', + kSaveGameCmd = 'savG', + kPrefsCmd = kHICommandPreferences, + kAboutCmd = 'abtG' +}; + +ControlRef radioGroupRef, musicVolumeSlider, masterVolumeSlider; +char *gameTitle; +ControlRef popUpControlRef, checkBoxControlRef; + +OSStatus prefsEventHandler(EventHandlerCallRef eventHandlerCallRef,EventRef eventRef, + void *userData) +{ + OSStatus result = eventNotHandledErr; + UInt32 eventClass; + UInt32 eventKind; + ControlRef controlRef; + ControlID controlID; + + eventClass = GetEventClass(eventRef); + eventKind = GetEventKind(eventRef); + + if(eventClass == kEventClassControl) + { + if(eventKind == kEventControlHit) + { + GetEventParameter(eventRef,kEventParamDirectObject,typeControlRef,NULL, + sizeof(ControlRef),NULL,&controlRef); + + GetControlID(controlRef,&controlID); + if(controlID.id == 'okay') + { + /*scumm->_noSubtitles = (Boolean)!GetControlValue(checkBoxControlRef); + short scale = GetControlValue(radioGroupRef); + if(scale != scumm->_scale) + wm->ChangeScaling(scale); + short music_vol = GetControlValue(musicVolumeSlider); + if(music_vol != sound.get_music_volume()) + sound.set_music_volume(music_vol); + short master_vol = GetControlValue(masterVolumeSlider); + if(master_vol != sound.get_master_volume()) + sound.set_master_volume(master_vol);*/ + QuitAppModalLoopForWindow((WindowRef)userData); + DisposeWindow((WindowRef)userData); + result = noErr; + } + } + } +} + +void Preferences() +{ + WindowRef prefsWin; + OSStatus osError = noErr; + Rect rect = { 0,0,210,300 }; + Rect okButtonRect; + ControlID controlID; + ControlRef controlRef; + EventTypeSpec dialogEvents[] = { kEventClassControl, kEventControlHit }; + + osError = CreateNewWindow(kMovableModalWindowClass,kWindowStandardHandlerAttribute,&rect, &prefsWin); + SetWTitle(prefsWin, "\pPreferences"); + RepositionWindow(prefsWin,FrontWindow(),kWindowAlertPositionOnMainScreen); + SetThemeWindowBackground(prefsWin,kThemeBrushDialogBackgroundActive,false); + CreateRootControl(prefsWin,&controlRef); + + SetRect(&rect, 5, 5, 150, 21); + + CreateStaticTextControl(prefsWin, &rect, CFSTR("ScummVM Preferences"), NULL, &controlRef); + AutoEmbedControl(controlRef, prefsWin); + + SetRect(&okButtonRect, 225, 180, 295, 200); + + CreatePushButtonControl(prefsWin,&okButtonRect,CFSTR("OK"),&controlRef); + SetWindowDefaultButton(prefsWin,controlRef); + controlID.id = 'okay'; + SetControlID(controlRef,&controlID); + AutoEmbedControl(controlRef,prefsWin); + + SetRect(&rect, 150, 35, 260, 51); + + CreateCheckBoxControl(prefsWin,&rect, CFSTR("Subtitles"), 1, true, &checkBoxControlRef); + AutoEmbedControl(checkBoxControlRef, prefsWin); + + //if(scumm->_noSubtitles) + SetControlValue(checkBoxControlRef, false); + + OffsetRect(&rect, 0, 20); + + CreateCheckBoxControl(prefsWin,&rect, CFSTR("Fullscreen"), 0, true, &controlRef); + AutoEmbedControl(controlRef, prefsWin); + DeactivateControl(controlRef); + + Rect RadioGroupRect; + SetRect(&RadioGroupRect, 5, 35, 120, 100); + CreateRadioGroupControl(prefsWin, &RadioGroupRect, &radioGroupRef); + AutoEmbedControl(radioGroupRef, prefsWin); + + ControlRef radioButton; + + Rect RadioButtonRect; + SetRect(&RadioButtonRect, 5, 35, 120, 51); + CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 1x"), 0, true, &radioButton); + AutoEmbedControl(radioButton, prefsWin); + + OffsetRect(&RadioButtonRect, 0, 20); + CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 2x"), 0, true, &radioButton); + AutoEmbedControl(radioButton, prefsWin); + + OffsetRect(&RadioButtonRect, 0, 20); + CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 3x"), 0, true, &radioButton); + AutoEmbedControl(radioButton, prefsWin); + + //SetControlValue(radioGroupRef, scumm->_scale); + + SetRect(&rect, 5, 110, 175, 146); + + CreateSliderControl(prefsWin, &rect, 100, 1, 100, + kControlSliderPointsDownOrRight, 10, false, NULL, &musicVolumeSlider); + AutoEmbedControl(musicVolumeSlider, prefsWin); + + OffsetRect(&rect, 0, 36); + + CreateSliderControl(prefsWin, &rect, 100, 1, 100, + kControlSliderPointsDownOrRight, 10, false, NULL, &masterVolumeSlider); + AutoEmbedControl(masterVolumeSlider, prefsWin); + + OffsetRect(&rect, 180, -36); + + CreateStaticTextControl(prefsWin, &rect, CFSTR("Music Volume"), NULL, &controlRef); + AutoEmbedControl(controlRef, prefsWin); + + OffsetRect(&rect, 0, 36); + + CreateStaticTextControl(prefsWin, &rect, CFSTR("Master Volume"), NULL, &controlRef); + AutoEmbedControl(controlRef, prefsWin); + + InstallWindowEventHandler(prefsWin, NewEventHandlerUPP((EventHandlerProcPtr) prefsEventHandler), + GetEventTypeCount(dialogEvents),dialogEvents,prefsWin,NULL); + ShowWindow(prefsWin); + osError = RunAppModalLoopForWindow(prefsWin); +} + +void LaunchGame(int id) +{ + switch(id) + { + case 6: + gameTitle = "indy3"; + break; + + case 7: + gameTitle = "zak256"; + break; + + case 8: + gameTitle = "loom"; + break; + + case 9: + gameTitle = "monkeyEGA"; + break; + + case 10: + gameTitle = "monkeyVGA"; + break; + + case 11: + gameTitle = "loomcd"; + break; + + case 12: + gameTitle = "monkey"; + break; + + case 13: + gameTitle = "monkey1"; + break; + + case 14: + gameTitle = "monkey2"; + break; + + case 15: + gameTitle = "atlantis"; + break; + + case 16: + gameTitle = "playfate"; + break; + + case 17: + gameTitle = "tentacle"; + break; + + case 18: + gameTitle = "dottdemo"; + break; + + case 19: + gameTitle = "samnmax"; + break; + + case 20: + gameTitle = "snmdemo"; + break; + + case 21: + gameTitle = "ft"; + break; + + case 22: + gameTitle = "dig"; + break; + + case 25: + gameTitle = "simon1dos"; + break; + + case 26: + gameTitle = "simon1win"; + break; + + case 27: + gameTitle = "simon2win"; + break; + } +} + +OSStatus dialogEventHandler(EventHandlerCallRef eventHandlerCallRef,EventRef eventRef, + void *userData) +{ + OSStatus result = eventNotHandledErr; + UInt32 eventClass; + UInt32 eventKind; + ControlRef controlRef; + ControlID controlID; + + eventClass = GetEventClass(eventRef); + eventKind = GetEventKind(eventRef); + + if(eventClass == kEventClassControl) + { + if(eventKind == kEventControlHit) + { + + GetEventParameter(eventRef,kEventParamDirectObject,typeControlRef,NULL, + sizeof(ControlRef),NULL,&controlRef); + + GetControlID(controlRef,&controlID); + if(controlID.id == 'okay') + { + QuitAppModalLoopForWindow((WindowRef)userData); + LaunchGame(GetControlValue(popUpControlRef)); + + DisposeWindow((WindowRef)userData); + result = noErr; + } + else if(controlID.id == 'cncl') + { + QuitAppModalLoopForWindow((WindowRef)userData); + DisposeWindow((WindowRef)userData); + ExitToShell(); + } + } + } + return result; +} + +char* SelectGame() +{ + WindowRef aboutWin; + OSStatus osError = noErr; + Rect rect = { 0,0,120,350 }; + Rect pushButtonRect = { 75,250,96,330 }; + Rect popupRect = { 10, 10, 26, 330 }; + ControlID controlID; + ControlRef controlRef; + Rect checkboxRect = { 36, 10, 50, 80 }; + EventTypeSpec dialogEvents[] = { kEventClassControl, kEventControlHit }; + + InitCursor(); + + SIOUXSettings.autocloseonquit = true; + SIOUXSettings.asktosaveonclose = false; + SIOUXSettings.showstatusline = false; + SIOUXSettings.fontsize = 9; + GetFNum("\pMonaco",&SIOUXSettings.fontid); + SIOUXSettings.standalone = false; + SIOUXSettings.setupmenus = false; + SIOUXSettings.toppixel = 40; + SIOUXSettings.leftpixel = 5; + + osError = CreateNewWindow(kMovableModalWindowClass,kWindowStandardHandlerAttribute,&rect, &aboutWin); + SetWTitle(aboutWin, "\pPlease Select a GameÉ"); + RepositionWindow(aboutWin,FrontWindow(),kWindowAlertPositionOnMainScreen); + SetThemeWindowBackground(aboutWin,kThemeBrushDialogBackgroundActive,false); + CreateRootControl(aboutWin,&controlRef); + + CreatePushButtonControl(aboutWin,&pushButtonRect,CFSTR("OK"),&controlRef); + SetWindowDefaultButton(aboutWin,controlRef); + controlID.id = 'okay'; + SetControlID(controlRef,&controlID); + AutoEmbedControl(controlRef,aboutWin); + + OffsetRect(&pushButtonRect, -100, 0); + CreatePushButtonControl(aboutWin,&pushButtonRect,CFSTR("Cancel"),&controlRef); + SetWindowCancelButton(aboutWin,controlRef); + controlID.id = 'cncl'; + SetControlID(controlRef,&controlID); + AutoEmbedControl(controlRef,aboutWin); + + CreatePopupButtonControl(aboutWin, &popupRect, CFSTR("Game: "), 999, false, -1, 0, NULL, &popUpControlRef); + SetWindowDefaultButton(aboutWin,popUpControlRef); + controlID.id = 'game'; + + SetControlID(popUpControlRef,&controlID); + + AutoEmbedControl(controlRef,aboutWin); + + InstallWindowEventHandler(aboutWin, NewEventHandlerUPP((EventHandlerProcPtr) dialogEventHandler), + GetEventTypeCount(dialogEvents),dialogEvents,aboutWin,NULL); + ShowWindow(aboutWin); + osError = RunAppModalLoopForWindow(aboutWin); + return gameTitle; +} + +OSystem *OSystem_MAC::create(int gfx_mode, bool full_screen) { + Rect rectWin; + OSystem_MAC *syst = new OSystem_MAC(); + syst->_mode = gfx_mode; + syst->_full_screen = full_screen; + + /* Macintosh init */ + syst->init_mac_stuff(); + + return syst; +} + +void OSystem_MAC::autosave(Scumm * scumm) +{ + scumm->_doAutosave = true; + + return interval; +} + +OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen) { + return OSystem_MAC::create(gfx_mode, full_screen); +} + +void OSystem_MAC::set_palette(const byte *colors, uint start, uint num) { + const byte *b = colors; + + (*pal)->ctSeed = TickCount(); + for(int i = start; i < num; i++, b += 4) { + (*pal)->ctTable[i].value = i; + (*pal)->ctTable[i].rgb.red = b[0]<<8; + (*pal)->ctTable[i].rgb.green = b[1]<<8; + (*pal)->ctTable[i].rgb.blue = b[2]<<8; + } + + CTabChanged(pal); + + if(_sai_func) + UpdateGWorld(&screenBuf, 16, &blit_rect, NULL, NULL, 0); + else + UpdateGWorld(&screenBuf, 8, &blit_rect, pal, NULL, 0); + + if(start < _palette_changed_first) + _palette_changed_first = start; + + if(start + num > _palette_changed_last) + _palette_changed_last = start + num; +} + +void OSystem_MAC::load_gfx_mode() { + force_full = true; + scaling = 1; + _internal_scaling = 1; + _mode_flags = 0; + _sai_func = NULL; + + switch(_mode) { + case GFX_2XSAI: + _sai_func = _2xSaI; + break; + + case GFX_SUPER2XSAI: + _sai_func = Super2xSaI; + break; + + case GFX_SUPEREAGLE: + _sai_func = SuperEagle; + break; + + case GFX_ADVMAME2X: + _sai_func = AdvMame2x; + break; + + case GFX_DOUBLESIZE: + scaling = 2; + _internal_scaling = 2; + _mode_flags = DF_WANT_RECT_OPTIM; + break; + + case GFX_TRIPLESIZE: + if (_full_screen) { + warning("full screen in useless in triplesize mode, reverting to normal mode"); + goto normal_mode; + } + scaling = 3; + _internal_scaling = 3; + _mode_flags = DF_WANT_RECT_OPTIM; + break; + + case GFX_NORMAL: + normal_mode:; + _mode_flags = DF_WANT_RECT_OPTIM; + break; + + } + + if(_sai_func) + { + _mode_flags = DF_WANT_RECT_OPTIM | DF_SEPARATE_TEMPSCREEN | DF_UPDATE_EXPAND_1_PIXEL; + + Init_2xSaI(565); + _tmp_buf = (int16*)calloc((SCREEN_WIDTH+3)*(SCREEN_HEIGHT+3), sizeof(int16)); + + scaling = 2; + } + else + { + switch(scaling) { + case 3: + _sai_func = Normal3x; + break; + case 2: + _sai_func = Normal2x; + break; + case 1: + _sai_func = Normal1x; + break; + } + + _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; + } + + set_scaling(); +} + +void OSystem_MAC::unload_gfx_mode() { + //warning("STUB: unload_gfx_mode()"); /* FIXME: Must free data here */ + +} + +void OSystem_MAC::init_size(uint w, uint h) { + //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) + // error("320x200 is the only game resolution supported"); + + SCREEN_WIDTH = w; + SCREEN_HEIGHT = h; + CKSUM_NUM = (SCREEN_WIDTH * SCREEN_HEIGHT / (8*8)); + dirty_rect_list = (Rect*)calloc(NUM_DIRTY_RECT, sizeof(Rect)); + _ms_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); + dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); + + load_gfx_mode(); +} + +void OSystem_MAC::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { + if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { + /* Special, optimized case for full screen updates. + * It tries to determine what areas were actually changed, + * and just updates those, on the actual display. */ + add_dirty_rgn_auto(buf); + } else { + /* Clip the coordinates */ + if (x < 0) { w+=x; buf-=x; x = 0; } + + if (y < 0) { h+=y; buf-=y*pitch; y = 0; } + if (w >= SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } + if (h >= SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } + + if (w<=0 || h<=0) + return; + + cksum_valid = false; + add_dirty_rect(x, y, w, h); + } + + /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ + if (_mouse_drawn) + undraw_mouse(); + + byte *dst = (byte*)buf + y * SCREEN_WIDTH + x; + do { + memcpy(dst, buf, w); + dst += SCREEN_WIDTH; + buf += pitch; + } while(--h); +} + +void OSystem_MAC::add_dirty_rect(int x, int y, int w, int h) { + if (force_full) + return; + + if (num_dirty_rects == NUM_DIRTY_RECT) + force_full = true; + else { + Rect *r = &dirty_rect_list[num_dirty_rects++]; + + /* Update the dirty region by 1 pixel for graphics drivers + * that "smear" the screen */ + if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { + x--; + y--; + w+=2; + h+=2; + } + + /* clip */ + if (x<0) { w+=x; x=0; } + if (y<0) { h+=y; y=0; } + if (w>=SCREEN_WIDTH-x) { w=SCREEN_WIDTH-x; } + if (h>=SCREEN_HEIGHT-y) { h=SCREEN_HEIGHT-y; } + + if (_internal_scaling != 1) { + x *= _internal_scaling; + y *= _internal_scaling; + w *= _internal_scaling; + h *= _internal_scaling; + } + + r->left = x; + r->top = y; + r->right = x + w; + r->bottom = y + h; + } +} + +#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) +#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] +void OSystem_MAC::mk_checksums(const byte *buf) { + uint32 *sums = dirty_checksums; + uint x,y; + + /* the 8x8 blocks in buf are enumerated starting in the top left corner and + * reading each line at a time from left to right */ + for(y=0; y!=SCREEN_HEIGHT/8; y++,buf+=SCREEN_WIDTH*(8-1)) + for(x=0; x!=SCREEN_WIDTH/8; x++,buf+=8) { + uint32 a = x; + uint32 b = y; + + DOLINE(0); ROL(a,13); ROL(b,11); + DOLINE(2); ROL(a,13); ROL(b,11); + DOLINE(4); ROL(a,13); ROL(b,11); + DOLINE(6); ROL(a,13); ROL(b,11); + + a*=0xDEADBEEF; + b*=0xBAADF00D; + + DOLINE(1); ROL(a,13); ROL(b,11); + DOLINE(3); ROL(a,13); ROL(b,11); + DOLINE(5); ROL(a,13); ROL(b,11); + DOLINE(7); ROL(a,13); ROL(b,11); + + /* output the checksum for this block */ + *sums++=a+b; + } +} +#undef DOLINE +#undef ROL + + +void OSystem_MAC::add_dirty_rgn_auto(const byte *buf) { + assert( ((uint32)buf & 3) == 0); + + /* generate a table of the checksums */ + mk_checksums(buf); + +if (!cksum_valid) { + force_full = true; + cksum_valid = true; + } + + /* go through the checksum list, compare it with the previous checksums, + and add all dirty rectangles to a list. try to combine small rectangles + into bigger ones in a simple way */ + if (!force_full) { + uint x,y,w; + uint32 *ck = dirty_checksums; + + for(y=0; y!=SCREEN_HEIGHT/8; y++) { + for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { + if (ck[0] != ck[CKSUM_NUM]) { + /* found a dirty 8x8 block, now go as far to the right as possible, + and at the same time, unmark the dirty status by setting old to new. */ + w=0; + do { + ck[w+CKSUM_NUM] = ck[w]; + w++; + } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); + + add_dirty_rect(x*8, y*8, w*8, 8); + + if (force_full) + goto get_out; + } + } + } + } else { + get_out:; + /* Copy old checksums to new */ + memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); + } +} + +void OSystem_MAC::update_screen() { +#if 0 + /* First make sure the mouse is drawn, if it should be drawn. */ + draw_mouse(); + + if (_palette_changed_last != 0) { + //warning("MAC: Palette should be uploaded!");/* FIXME: Add Palette changing code */ + + /*GDevice **odisplay; + odisplay = GetGDevice(); + SetGDevice(GetMainDevice()); + SetEntries(0, (**pal).ctSize, (ColorSpec *)&(**pal).ctTable); + SetGDevice(odisplay);*/ + + /*_palette_changed_last = 0; + if (_mode_flags & DF_FORCE_FULL_ON_PALETTE) + */force_full = true; + } + + /* force a full redraw, accomplish that by adding one big rect to the dirty + * rect list */ + if (force_full) { + num_dirty_rects = 1; + + dirty_rect_list[0].left = 0; + dirty_rect_list[0].top = 0; + dirty_rect_list[0].right = SCREEN_WIDTH; + dirty_rect_list[0].bottom = SCREEN_HEIGHT; + } + + if (num_dirty_rects > 0) + { + Rect *r; + uint32 srcPitch, dstPitch; + Rect *last_rect = dirty_rect_list + num_dirty_rects; + + /* Convert appropriate parts of the image into 16bpp */ + if ((_mode_flags & DF_REAL_8BIT) == 0) { + Rect dst; + for(r=dirty_rect_list; r!=last_rect; ++r) { + dst = *r; + dst.left++; + dst.top++; + dst.right++; + dst.bottom++; + } + } + + /*srcPitch = sdl_tmpscreen->pitch; + dstPitch = sdl_hwscreen->pitch;*/ + + if ((_mode_flags & DF_REAL_8BIT) == 0) { + for(r=dirty_rect_list; r!=last_rect; ++r) { + register int dst_y = r->y + _current_shake_pos; + register int dst_h = 0; + if (dst_y < SCREEN_HEIGHT) { + dst_h = r->h; + if (dst_h > SCREEN_HEIGHT - dst_y) + dst_h = SCREEN_HEIGHT - dst_y; + + r->x <<= 1; + dst_y <<= 1; + + _sai_func((byte*)sdl_tmpscreen->pixels + (r->x+2) + (r->y+1)*srcPitch, srcPitch, NULL, + (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); + } + + r->y = dst_y; + r->w <<= 1; + r->h = dst_h << 1; + } + } else { + for(r=dirty_rect_list; r!=last_rect; ++r) { + register int dst_y = r->y + _current_shake_pos; + register int dst_h = 0; + if (dst_y < SCREEN_HEIGHT) { + dst_h = r->h; + if (dst_h > SCREEN_HEIGHT - dst_y) + dst_h = SCREEN_HEIGHT - dst_y; + + dst_y *= scaling; + + _sai_func((byte*)sdl_tmpscreen->pixels + r->x + r->y*srcPitch, srcPitch, NULL, + (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); + } + + r->x *= scaling; + r->y = dst_y; + r->w *= scaling; + r->h = dst_h * scaling; + } + } + + if (force_full) { + dirty_rect_list[0].y = 0; + dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; + } + } + + /*if(_mode_flags & DF_2xSAI) + { + Rect *r; + uint32 area = 0; + + Rect *dr = dirty_rect_list + num_dirty_rects; + + for(r = dirty_rect_list; r != dr; r++) + { + GWorldPtr gw; + Rect rec; + SetRect(&rec, 0, 0, 320, 200); + NewGWorldFromPtr(&gw, 16, &rec, NULL, NULL, 0, (char*)_tmp_buf, rec.right); + CopyBits(GetPortBitMapForCopyBits(gw), GetPortBitMapForCopyBits(screenBuf), + r, r, srcCopy, 0L); + } + + for(r = dirty_rect_list; r != dr; r++) + { + _sai_func((byte*)_tmp_buf + r->left * 2 + r->top * 640, 640, NULL, + (byte*)_sai_buf + r->left * 4 + r->top * 640 * 4, 640 * 2, + r->right - r->left, r->bottom - r->top); + + area += (r->right - r->left) * (r->bottom - r->top); + + r->left <<= 1; + r->right <<= 1; + r->top <<= 1; + r->bottom <<= 1; + } + }*/ + + update_rects(); + //blit_to_screen(); + + num_dirty_rects = 0; + +#endif +} + +bool OSystem_MAC::show_mouse(bool visible) { + if (_mouse_visible == visible) + return visible; + + bool last = _mouse_visible; + _mouse_visible = visible; + + if (visible) + draw_mouse(); + else + undraw_mouse(); + + return last; +} + +void OSystem_MAC::set_mouse_pos(int x, int y) { + if (x != _ms_cur.x || y != _ms_cur.y) { + _ms_cur.x = x; + _ms_cur.y = y; + undraw_mouse(); + } +} + +void OSystem_MAC::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { + _ms_cur.w = w; + _ms_cur.h = h; + + _ms_hotspot_x = hotspot_x; + _ms_hotspot_y = hotspot_y; + + _ms_buf = (byte*)buf; + + undraw_mouse(); +} + +void OSystem_MAC::set_shake_pos(int shake_pos) { + /*int old_shake_pos = _current_shake_pos; + int dirty_height, dirty_blackheight; + int dirty_top, dirty_blacktop; + + if (shake_pos != old_shake_pos) { + _current_shake_pos = shake_pos; + force_full = true; + + /* Old shake pos was current_shake_pos, new is shake_pos. + * Move the screen up or down to account for the change. + */ + //SDL_Rect dstr = { 0, shake_pos*scaling, 320*scaling, 200*scaling }; + //SDL_Rect srcr = { 0, old_shake_pos*scaling, 320*scaling, 200*scaling }; + //SDL_BlitSurface(sdl_screen, &srcr, sdl_screen, &dstr); + /* Rect srcr, dstr; + + SetRect(&srcr, 0, old_shake_pos * scaling, 320 * scaling, 200 * scaling); + SetRect(&dstr, 0, shake_pos * scaling, 320 * scaling, 200 * scaling); + + CopyBits(GetPortBitMapForCopyBits(screenBuf), GetPortBitMapForCopyBits(GetWindowPort(wref)), + &srcr, &dstr, srcCopy, 0L); + + /* Refresh either the upper part of the screen, + * or the lower part */ + /* if (shake_pos > old_shake_pos) { + dirty_height = MIN(shake_pos, 0) - MIN(old_shake_pos, 0); + dirty_top = -MIN(shake_pos, 0); + dirty_blackheight = MAX(shake_pos, 0) - MAX(old_shake_pos, 0); + dirty_blacktop = MAX(old_shake_pos, 0); + } else { + dirty_height = MAX(old_shake_pos, 0) - MAX(shake_pos, 0); + dirty_top = 200 - MAX(old_shake_pos, 0); + dirty_blackheight = MIN(old_shake_pos, 0) - MIN(shake_pos, 0); + dirty_blacktop = 200 + MIN(shake_pos, 0); + } + + /* Fill the dirty area with blackness or the scumm image */ + //SDL_Rect blackrect = {0, dirty_blacktop*scaling, 320*scaling, dirty_blackheight*scaling}; + //SDL_FillRect(sdl_screen, &blackrect, 0); + + /* FIXME: Um, screen seems to glitch since this + 'not needed' function was removed */ + //g_scumm->redrawLines(dirty_top, dirty_top + dirty_height); +/* }*/ +} + +uint32 OSystem_MAC::get_msecs() { + UnsignedWide ms; + + Microseconds(&ms); + return(ms.lo / 1000); +} + +void OSystem_MAC::delay_msecs(uint msecs) { + uint32 start = get_msecs(); + Event dummy; + + do { + poll_event(&dummy); /* Do something to avoid CPU lock */ + if(get_msecs() >= start + msecs) + break; + } while (1); +} + +void *OSystem_MAC::create_thread(ThreadProc *proc, void *param) { + warning("MAC: Stub create_thread()"); + //NewThread(kCooperativeThread, (void*)proc, param, 0L, kCreateIfNeeded, NULL, NULL); +} + +int mapKey(int key, byte code, byte mod) +{ + switch(code) { + case 0x35: + key = 27; + break; + case 0x31: + key = 32; + break; + case 0x60: + key = 601; + break; + } + + return key; +} + +bool OSystem_MAC::poll_event(Event *event) +{ + EventRef theEvent; + EventTargetRef theTarget; + OSStatus theErr; + + OSStatus result = eventNotHandledErr; + HICommand command; + Point mouse; + + theTarget = GetEventDispatcherTarget(); + theErr = ReceiveNextEvent(GetEventTypeCount(kCmdEvents), kCmdEvents, kEventDurationNoWait,true, &theEvent); + + GetEventParameter( theEvent, kEventParamDirectObject, typeHICommand, NULL, + sizeof( HICommand ), NULL, &command ); + + switch(GetEventClass(theEvent)) + { + case kEventClassWindow: + switch(GetEventKind(theEvent)) + { + case kEventWindowDrawContent: + break; + + case kEventWindowHandleContentClick: + EventMouseButton btn; + + GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, + sizeof(EventMouseButton), NULL, &btn); + + if(btn == kEventMouseButtonPrimary) + event->event_code = EVENT_RBUTTONDOWN; + else if(btn == kEventMouseButtonSecondary) + event->event_code = EVENT_LBUTTONDOWN; + + debug(1, "Mouse down!"); + + if(wref != FrontWindow()) + { +// FIXME - seems some versions of the CarbonLib stub are missing ActivateWindow +// ActivateWindow(wref, true); + BringToFront(wref); + } + return true; + break; + + case kEventWindowClose: + quit(); + break; + } + break; + + case kEventClassCommand: + switch(command.commandID) + { + case kNewGameCmd: + + break; + + case kOpenGameCmd: + //scumm->_saveLoadSlot = 0; + //scumm->_saveLoadFlag = 2; + break; + + case kSaveGameCmd: + //scumm->_saveLoadSlot = 0; + //sprintf(scumm->_saveLoadName, "Quicksave %d", scumm->_saveLoadSlot); + //scumm->_saveLoadFlag = 1; + break; + + case kQuitCmd: + quit(); + break; + + case kPrefsCmd: + //Preferences(); + break; + + case kAboutCmd: + //About(); + break; + } + break; + + case kEventClassKeyboard: + if(GetEventKind(theEvent) == kEventRawKeyDown) + { + char key; + UInt32 mod, code; + + GetEventParameter(theEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &code); + GetEventParameter(theEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key); + GetEventParameter(theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &mod); + + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = code; + event->kbd.ascii = mapKey(key, code, mod); + debug(1, "Key down: %c", event->kbd.ascii); + return true; + } + break; + + case kEventClassMouse: + EventMouseButton btn; + Rect winRect; + + switch(GetEventKind(theEvent)) + { + case kEventMouseDown: + WindowRef theWin; + + GetEventParameter(theEvent, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), + NULL, &theWin); + if(theWin != FrontWindow()) + { +// FIXME - seems some versions of the CarbonLib stub are missing ActivateWindow +// ActivateWindow(theWin, true); + BringToFront(theWin); + } + + GetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &mouse); + + GetWindowBounds(wref, kWindowContentRgn, &winRect); + if(PtInRect(mouse, &winRect)) + { + GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, + sizeof(EventMouseButton), NULL, &btn); + + if(btn == kEventMouseButtonPrimary) + event->event_code = EVENT_RBUTTONDOWN; + else if(btn == kEventMouseButtonSecondary) + event->event_code = EVENT_LBUTTONDOWN; + + debug(1, "Mouse down!"); + } + break; + + case kEventMouseUp: + + GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, + sizeof(EventMouseButton), NULL, &btn); + + if(btn == kEventMouseButtonPrimary) + event->event_code = EVENT_RBUTTONUP; + else if(btn == kEventMouseButtonSecondary) + event->event_code = EVENT_LBUTTONUP; + + debug(1, "Mouse up!"); + + return true; + break; + + case kEventMouseMoved: + GetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &mouse); + + GetWindowBounds(wref, kWindowContentRgn, &winRect); + if(PtInRect(mouse, &winRect)) + { + CGrafPtr oldPort; + + GetPort(&oldPort); + SetPortWindowPort(wref); + GlobalToLocal(&mouse); + + event->event_code = EVENT_MOUSEMOVE; + event->mouse.x = mouse.h / scaling; + event->mouse.y = mouse.v / scaling; + + //scumm->mouse.x = mouse.h/wm->scale; + //scumm->mouse.y = mouse.v/wm->scale; + } + Point offset = {0, 0}; + ShieldCursor(&winRect, offset); + return true; + break; + } + break; + } + + if(theErr == noErr && theEvent != NULL) { + SendEventToEventTarget (theEvent, theTarget); + ReleaseEvent(theEvent); + } +} + +pascal void sound_callback(SndChannel *chan, SndCommand *cmd_passed) +{ + OSystem_MAC* syst = (OSystem_MAC*)chan->userInfo; + syst->sound_callback(chan, cmd_passed); +} + +void OSystem_MAC::sound_callback(SndChannel *chan, SndCommand *cmd_passed) +{ + UInt32 fill_me, play_me; + SndCommand cmd; + + fill_me = cmd_passed->param2; + play_me = ! fill_me; + + header.samplePtr = (Ptr)buffer[play_me]; + + cmd.cmd = bufferCmd; + cmd.param1 = 0; + cmd.param2 = (long)&header; + + SndDoCommand(chan, &cmd, 0); + + memset(buffer[fill_me], 0, size); + //sndProc(parameter, buffer[fill_me], size); + //SoundMixer::on_generate_samples(parameter, buffer[fill_me], size); + + cmd.cmd = callBackCmd; + cmd.param1 = 0; + cmd.param2 = play_me; + + SndDoCommand(chan, &cmd, 0); +} + +bool OSystem_MAC::set_sound_proc(void *param, SoundProc *proc, byte format) +{ + SndCallBackUPP callback; + int sample_size; + + memset(&header, 0, sizeof(header)); + callback = NewSndCallBackUPP(::sound_callback); + size = ((0x9010 & 0xFF) / 8) * 2048; + sample_size = size / 2048 * 8; + header.numChannels = 1; + header.sampleSize = sample_size; + header.sampleRate = SAMPLES_PER_SEC << 16; + header.numFrames = 2048; + header.encode = cmpSH; + + for(int i = 0; i < 2; i++) + { + buffer[i] = (UInt8*)malloc(sizeof(UInt8) * size); + memset(buffer[i], 0, size); + } + + channel = (SndChannelPtr)malloc(sizeof(*channel)); + channel->qLength = 128; + channel->userInfo = (long)this; + SndNewChannel(&channel, sampledSynth, initMono, callback); + + SndCommand cmd; + cmd.cmd = callBackCmd; + cmd.param2 = 0; + SndDoCommand(channel, &cmd, 0); + + sndProc = proc; + parameter = param; + + return true; +} + + +/* retrieve the 320x200 bitmap currently being displayed */ +void OSystem_MAC::get_320x200_image(byte *buf) +{ + /* make sure the mouse is gone */ + undraw_mouse(); + + byte *src; + int x,y; + + switch(_internal_scaling) { + case 1: + memcpy(buf, _gfx_buf, 320*200); + break; + + case 2: + src = (byte*)_gfx_buf; + for(y=0; y!=200; y++) { + for(x=0; x!=320; x++) + buf[x] = src[x*2]; + buf += 320; + src += 320 * 2 * 2; + } + break; + + case 3: + src = (byte*)_gfx_buf; + for(y=0; y!=200; y++) { + for(x=0; x!=320; x++) + buf[x] = src[x*3]; + buf += 320; + src += 320 * 3 * 3; + } + break; + } +} + +void OSystem_MAC::hotswap_gfx_mode() +{ + /* hmm, need to allocate a 320x200 bitmap + * which will contain the "backup" of the screen during the change. + * then draw that to the new screen right after it's setup. + */ + + byte *bak_mem = (byte*)malloc(320*200); + + get_320x200_image(bak_mem); + + unload_gfx_mode(); + load_gfx_mode(); + + force_full = true; + + /* reset palette ? */ + pal = (CTabHandle)NewHandleClear(sizeof(ColorTable) + 255 * sizeof(ColorSpec)); + (*pal)->ctFlags = 0; + (*pal)->ctSize = 255; + + /* blit image */ + copy_rect(bak_mem, 320, 0, 0, 320, 200); + free(bak_mem); + + update_screen(); +} + +uint32 OSystem_MAC::property(int param, Property *value) { + switch(param) { + case PROP_TOGGLE_FULLSCREEN: + _full_screen ^= true; + return 1; + + case PROP_SET_WINDOW_CAPTION: + StringPtr gameText = CToPascal((char*)value->caption); + SetWTitle(wref, gameText); + return 1; + + case PROP_OPEN_CD: + break; + + case PROP_SET_GFX_MODE: + if(value->gfx_mode >= 7) + return 0; + _mode = value->gfx_mode; + hotswap_gfx_mode(); + return 1; + + + case PROP_SHOW_DEFAULT_CURSOR: + break; + + case PROP_GET_SAMPLE_RATE: + return SAMPLES_PER_SEC; + break; + } + + return 0; +} + +void OSystem_MAC::quit() { + unload_gfx_mode(); + + QuitApplicationEventLoop(); + ExitToShell(); +} + +void OSystem_MAC::draw_mouse() { + if (_mouse_drawn || !_mouse_visible) + return; + _mouse_drawn = true; + + const int ydraw = _ms_cur.y + _current_shake_pos - _ms_hotspot_y; + const int xdraw = _ms_cur.x - _ms_hotspot_x; + const int w = _ms_cur.w; + const int h = _ms_cur.h; + int x,y; + byte color; + byte *dst, *bak = _ms_backup; + byte *buf = _ms_buf; + + _ms_old.w = w; + _ms_old.h = h; + _ms_old.x = xdraw; + _ms_old.y = ydraw; + + byte *src; + if(_sai_func) + src = (byte*)_tmp_buf; + else + src = _gfx_buf; + + switch(_internal_scaling) { + case 1: + dst = (byte *)src + ydraw * 320 + xdraw; + + for (y = 0; y < h; y++, dst += 320, bak += MAX_MOUSE_W, buf += w) { + if ((uint) (ydraw + y) < 200) { + for (x = 0; x < w; x++) { + if ((uint) (xdraw + x) < 320) { + bak[x] = dst[x]; + if ((color = buf[x]) != 0xFF) { + dst[x] = color; + } + } + } + } + } + break; + + case 2: + dst = (byte *)src + ydraw * 640 * 2 + xdraw * 2; + + for (y = 0; y < h; y++, dst += 640 * 2, bak += MAX_MOUSE_W * 2, buf += w) { + if ((uint) (ydraw + y) < 200) { + for (x = 0; x < w; x++) { + if ((uint) (xdraw + x) < 320) { + bak[x * 2] = dst[x * 2]; + bak[x * 2 + 1] = dst[x * 2 + 1]; + if ((color = buf[x]) != 0xFF) { + dst[x * 2] = color; + dst[x * 2 + 1] = color; + dst[x * 2 + 640] = color; + dst[x * 2 + 1 + 640] = color; + } + } + } + } + } + break; + + case 3: + dst = (byte *)src + ydraw * 960 * 3 + xdraw * 3; + + for (y = 0; y < h; y++, dst += 960 * 3, bak += MAX_MOUSE_W * 3, buf += w) { + if ((uint) (ydraw + y) < 200) { + for (x = 0; x < w; x++) { + if ((uint) (xdraw + x) < 320) { + bak[x * 3] = dst[x * 3]; + bak[x * 3 + 1] = dst[x * 3 + 1]; + bak[x * 3 + 2] = dst[x * 3 + 2]; + if ((color = buf[x]) != 0xFF) { + dst[x * 3] = color; + dst[x * 3 + 1] = color; + dst[x * 3 + 2] = color; + dst[x * 3 + 960] = color; + dst[x * 3 + 1 + 960] = color; + dst[x * 3 + 2 + 960] = color; + dst[x * 3 + 960 + 960] = color; + dst[x * 3 + 1 + 960 + 960] = color; + dst[x * 3 + 2 + 960 + 960] = color; + } + } + } + } + } + break; + } + + add_dirty_rect(xdraw,ydraw,w,h); +} + +void OSystem_MAC::undraw_mouse() { + if (!_mouse_drawn) + return; + _mouse_drawn = false; + + byte *dst, *bak = _ms_backup; + byte *src; + const int old_mouse_x = _ms_old.x; + const int old_mouse_y = _ms_old.y; + const int old_mouse_w = _ms_old.w; + const int old_mouse_h = _ms_old.h; + int x,y; + + if(_sai_func) + src = (byte*)_tmp_buf; + else + src = _gfx_buf; + + switch(_internal_scaling) { + case 1: + dst = (byte *)src + old_mouse_y * 320 + old_mouse_x; + + for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W, dst += 320) { + if ((uint) (old_mouse_y + y) < 200) { + for (x = 0; x < old_mouse_w; x++) { + if ((uint) (old_mouse_x + x) < 320) { + dst[x] = bak[x]; + } + } + } + } + break; + + case 2: + dst = (byte *)src + old_mouse_y * 640 * 2 + old_mouse_x * 2; + + for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W * 2, dst += 640 * 2) { + if ((uint) (old_mouse_y + y) < 200) { + for (x = 0; x < old_mouse_w; x++) { + if ((uint) (old_mouse_x + x) < 320) { + dst[x * 2 + 640] = dst[x * 2] = bak[x * 2]; + dst[x * 2 + 640 + 1] = dst[x * 2 + 1] = bak[x * 2 + 1]; + } + } + } + } + break; + + case 3: + dst = (byte *)src + old_mouse_y * 960 * 3 + old_mouse_x * 3; + + for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W * 3, dst += 960 * 3) { + if ((uint) (old_mouse_y + y) < 200) { + for (x = 0; x < old_mouse_w; x++) { + if ((uint) (old_mouse_x + x) < 320) { + dst[x * 3 + 960] = dst[x * 3 + 960 + 960] = dst[x * 3] = + bak[x * 3]; + dst[x * 3 + 960 + 1] = dst[x * 3 + 960 + 960 + 1] = + dst[x * 3 + 1] = bak[x * 3 + 1]; + dst[x * 3 + 960 + 2] = dst[x * 3 + 960 + 960 + 2] = + dst[x * 3 + 2] = bak[x * 3 + 2]; + } + } + } + } + break; + } + + add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); +} + +void OSystem_MAC::stop_cdrom() { +} + +void OSystem_MAC::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { + /* Reset sync count */ + g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0; +} + +bool OSystem_MAC::poll_cdrom() { +} + +void OSystem_MAC::update_cdrom() { +} + + + +/*************************************************************/ +/** Mac specific code ****************************************/ +void OSystem_MAC::set_scaling() { + Rect rectWin; + SetRect(&rectWin, 0, 0, 320 * scaling, 200 * scaling); + HideWindow(wref); + SetWindowBounds(wref, kWindowContentRgn, &rectWin); + RepositionWindow(wref, NULL, kWindowCenterOnMainScreen); + ShowWindow(wref); + blit_rect = rectWin; + + if(_sai_func) + { + Rect r; + + //SetRect(&r, 0, 0, 320, 240); + _sai_buf = (int16*)malloc((320 * 200) * 2 * sizeof(int16)); + + NewGWorldFromPtr(&screenBuf, 16, &blit_rect, NULL, nil, 0, (char *)_sai_buf, blit_rect.right); + } + else + { + _gfx_buf = (byte*)malloc((320 * 200) * scaling * sizeof(byte)); + NewGWorldFromPtr(&screenBuf, 8, &blit_rect, pal, nil, 0, (char *)_gfx_buf, blit_rect.right); + } + + //NewGWorldFromPtr(&screenBuf, 8, &blit_rect, pal, nil, 0, (char *)_gfx_buf, blit_rect.right); + + //if(screenBuf != NULL) + // UpdateGWorld(&screenBuf, 8, &blit_rect, pal, NULL, NULL); +} + +void OSystem_MAC::blit_to_screen() +{ + CopyBits(GetPortBitMapForCopyBits(screenBuf), + GetPortBitMapForCopyBits(GetWindowPort(wref)), &blit_rect, &blit_rect, srcCopy, 0L); +} + +void OSystem_MAC::init_mac_stuff() +{ + Rect rectWin; + + + MenuRef AppleMenu = GetMenu(1000); + InsertMenu(AppleMenu, 0); + SetMenuItemCommandID(AppleMenu, 1, kAboutCmd); + MenuRef FileMenu = GetMenu(1001); + SetMenuItemCommandID(FileMenu, 1, kNewGameCmd); + SetMenuItemCommandID(FileMenu, 2, kOpenGameCmd); + SetMenuItemCommandID(FileMenu, 3, kSaveGameCmd); + SetMenuItemCommandID(FileMenu, 5, kQuitCmd); + DeleteMenuItems(FileMenu, CountMenuItems(FileMenu)-1, 2); + InsertMenu(FileMenu, 0); + MenuRef windMenu; + CreateStandardWindowMenu(0, &windMenu); + InsertMenu(windMenu, 0); + EnableMenuCommand(NULL, kPrefsCmd); + DrawMenuBar(); + + SetRect(&rectWin, 0, 0, 320, 200); + UInt32 WinAttrib = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | + kWindowInWindowMenuAttribute | kWindowStandardHandlerAttribute); + + if(noErr != CreateNewWindow(kDocumentWindowClass, WinAttrib, &rectWin, &wref)) + { + //Error("Couldn't create Window!"); + } + + RepositionWindow(wref, NULL, kWindowCenterOnMainScreen); + + Str255 WindowTitle = "\pScummVM"; + SetWTitle(wref, WindowTitle); + + SetPortWindowPort(wref); + //ShowWindow(wref); + + InstallStandardEventHandler(GetWindowEventTarget(wref)); + + //OSStatus err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(QuitEventHandler), 0L, false); + + blit_rect = rectWin; + pal = (CTabHandle)NewHandleClear(sizeof(ColorTable) + 255 * sizeof(ColorSpec)); + (*pal)->ctFlags = 0; + (*pal)->ctSize = 255; + //NewGWorld(&screenBuf, 8, &blit_rect, 0, 0, 0); +} + +void OSystem_MAC::update_rects() +{ + for(int i = 0; i < num_dirty_rects; i++) + { + Rect rec = dirty_rect_list[i]; + + CopyBits(GetPortBitMapForCopyBits(screenBuf), + GetPortBitMapForCopyBits(GetWindowPort(wref)), + &rec, &rec, srcCopy, 0L); + } +} diff --git a/backends/mac/macos.h b/backends/mac/macos.h new file mode 100644 index 0000000000..09c40456e9 --- /dev/null +++ b/backends/mac/macos.h @@ -0,0 +1,24 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * + * + */ + + //#define MACOS_SDL + #define MACOS_CARBON + \ No newline at end of file diff --git a/backends/mac/scummvm.icns b/backends/mac/scummvm.icns new file mode 100644 index 0000000000..5f5e10d732 Binary files /dev/null and b/backends/mac/scummvm.icns differ diff --git a/backends/mac/scummvm.mcp b/backends/mac/scummvm.mcp new file mode 100644 index 0000000000..41a29050f4 Binary files /dev/null and b/backends/mac/scummvm.mcp differ diff --git a/backends/morphos/Makefile b/backends/morphos/Makefile new file mode 100644 index 0000000000..00fd3992d1 --- /dev/null +++ b/backends/morphos/Makefile @@ -0,0 +1,48 @@ +vpath %.cpp ../:../sound/:../v3/:../v4/:../simon/:../gui/ +vpath %.h ../ + +CC = g++ +CFLAGS = -Wno-multichar -fstrength-reduce -fno-rtti -O2 +DEFINES = -DNO_PPCINLINE_STDARG -DNO_PPCINLINE_VARARGS +LDFLAGS := -noixemul -s +INCLUDES:= -I../ -I../sound +CPPFLAGS= $(DEFINES) $(INCLUDES) +LIBS = -lamiga -lamigastubs -lcdda +ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip + +INCS = scumm.h scummsys.h stdafx.h + +GUIOBJS = widget.o dialog.o newgui.o ListWidget.o ScrollBarWidget.o + +SIMONOBJS = midi.o simon.o simondebug.o simonitems.o simonres.o simonsys.o simonverb.o simonvga.o + +OBJS = actor.o akos.o boxes.o config-file.o costume.o gfx.o object.o resource.o \ + saveload.o script.o scummvm.o sound.o string.o sys.o verbs.o \ + morphos.o morphos_scaler.o morphos_sound.o morphos_start.o morphos_timer.o \ + script_v1.o script_v2.o debug.o gui.o imuse.o fmopl.o mixer.o mididrv.o \ + debugrl.o vars.o insane.o gameDetector.o resource_v3.o resource_v4.o \ + util.o main.o bundle.o $(GUIOBJS) $(SIMONOBJS) + +DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \ + windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \ + scummvm.dsp scummvm.dsw sound/fmopl.h + +.cpp.o: + $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + +all: scummvm + +scummvm: $(OBJS) + $(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) + +#$(OBJS): Makefile + +clean: + rm -f $(OBJS) scummvm + +dist: + rm -f $(ZIPFILE) + zip -q $(ZIPFILE) $(DISTFILES) + +check: +$(OBJS): $(INCS) diff --git a/backends/morphos/MorphOS.readme b/backends/morphos/MorphOS.readme new file mode 100644 index 0000000000..693ae324c4 --- /dev/null +++ b/backends/morphos/MorphOS.readme @@ -0,0 +1,13 @@ +This directory contains the source for the MorphOS port of ScummVM. To build, you +must have a proper Geek Gadgets installation. Just type "make" in the MorphOS +subdirectory. If you don't have the includes for AMidi 2 and cdda.library, check +my webpage. If they aren't uploaded yet, feel free to e-mail me. + +You don't have to build ScummVM yourself. The latest official and CVS binaries are +available from my website at: + +http://www.muenster.de/~tomjoad/scummvm.html + +Ruediger Hanke +tomjoad@muenster.de + diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp new file mode 100644 index 0000000000..a949cbfd2f --- /dev/null +++ b/backends/morphos/morphos.cpp @@ -0,0 +1,1293 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 Rüdiger Hanke + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * MorphOS interface + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "morphos.h" +#include "morphos_scaler.h" + +static TagItem FindCDTags[] = { { CDFA_VolumeName, 0 }, + { TAG_DONE, 0 } + }; +static TagItem PlayTags[] = { { CDPA_StartTrack, 1 }, + { CDPA_StartFrame, 0 }, + { CDPA_EndTrack, 1 }, + { CDPA_EndFrame, 0 }, + { CDPA_Loops, 1 }, + { TAG_DONE, 0 } + }; + +TagItem musicProcTags[] = { { NP_Entry, 0 }, + { NP_Name, (ULONG)"ScummVM Music Thread" }, + { NP_Priority, 0 }, + { TAG_DONE, 0 } + }; +TagItem soundProcTags[] = { { NP_Entry, 0 }, + { NP_Name, (ULONG)"ScummVM Sound Thread" }, + { NP_Priority, 0 }, + { TAG_DONE, 0 } + }; + +#define BLOCKSIZE_X 32 +#define BLOCKSIZE_Y 8 + +#define BLOCKS_X (ScummBufferWidth/BLOCKSIZE_X) +#define BLOCKS_Y (ScummBufferHeight/BLOCKSIZE_Y) +#define BLOCK_ID(x, y) ((y/BLOCKSIZE_Y)*BLOCKS_X+(x/BLOCKSIZE_X)) + +OSystem_MorphOS *OSystem_MorphOS::create(int game_id, SCALERTYPE gfx_scaler, bool full_screen) +{ + OSystem_MorphOS *syst = new OSystem_MorphOS(game_id, gfx_scaler, full_screen); + + return syst; +} + +OSystem_MorphOS::OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen) +{ + GameID = game_id; + ScummScreen = NULL; + ScummWindow = NULL; + ScummBuffer = NULL; + ScummScreenBuffer[0] = NULL; + ScummScreenBuffer[1] = NULL; + ScummRenderTo = NULL; + ScummNoCursor = NULL; + ScummMusicThread = NULL; + ScummSoundThread = NULL; + ScummWinX = -1; + ScummWinY = -1; + ScummDefaultMouse = false; + ScummOrigMouse = false; + ScummShakePos = 0; + ScummScaler = gfx_mode; + ScummScale = (gfx_mode == ST_NONE) ? 0 : 1; + ScummDepth = 0; + Scumm16ColFmt16 = false; + ScummScrWidth = 0; + ScummScrHeight = 0; + ScreenChanged = false; + DirtyBlocks = NULL; + BlockColors = NULL; + Scaler = NULL; + FullScreenMode = full_screen; + CDrive = NULL; + CDDATrackOffset = 0; + strcpy(ScummWndTitle, "ScummVM MorphOS"); + TimerMsgPort = NULL; + TimerIORequest = NULL; + + OpenATimer(&TimerMsgPort, (IORequest **) &TimerIORequest, UNIT_MICROHZ); + + TimerBase = TimerIORequest->tr_node.io_Device; + ScummNoCursor = (UWORD *) AllocVec(16, MEMF_CHIP | MEMF_CLEAR); + UpdateRegion = NewRegion(); + NewUpdateRegion = NewRegion(); + if (!UpdateRegion || !NewUpdateRegion) + error("Could not create region for screen update"); +} + +OSystem_MorphOS::~OSystem_MorphOS() +{ + if (DirtyBlocks) + { + FreeVec(DirtyBlocks); + + for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) + FreeVec(BlockColors[b]); + FreeVec(BlockColors); + } + + if (Scaler) + delete Scaler; + + if (UpdateRegion) + DisposeRegion(UpdateRegion); + + if (NewUpdateRegion) + DisposeRegion(NewUpdateRegion); + + if (CDrive && CDDABase) + { + CDDA_Stop(CDrive); + CDDA_ReleaseDrive(CDrive); + } + + if (TimerIORequest) + { + CloseDevice((IORequest *) TimerIORequest); + DeleteIORequest((IORequest *) TimerIORequest); + } + + if (TimerMsgPort) + DeleteMsgPort(TimerMsgPort); + + if (ScummMusicThread) + { + Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C); + ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ + ReleaseSemaphore(&ScummMusicThreadRunning); + } + + if (ScummSoundThread) + { + Signal((Task *) ScummSoundThread, SIGBREAKF_CTRL_C); + ObtainSemaphore(&ScummSoundThreadRunning); /* Wait for thread to finish */ + ReleaseSemaphore(&ScummSoundThreadRunning); + } + + if (ScummNoCursor) + FreeVec(ScummNoCursor); + + if (ScummBuffer) + FreeVec(ScummBuffer); + + if (ScummRenderTo && !ScummScreen) + FreeBitMap (ScummRenderTo); + + if (ScummWindow) + CloseWindow(ScummWindow); + + if (ScummScreen) + { + if (ScummScreenBuffer[0]) + FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); + if( ScummScreenBuffer[1] ) + FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); + CloseScreen(ScummScreen); + } +} + +bool OSystem_MorphOS::OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required) +{ + *req = NULL; + const char *err_msg = NULL; + + *port = CreateMsgPort(); + if (*port) + { + *req = (IORequest *) CreateIORequest(*port, sizeof (timerequest)); + if (*req) + { + if (OpenDevice(TIMERNAME, unit, *req, 0)) + { + DeleteIORequest(*req); + *req = NULL; + err_msg = "Failed to open timer device"; + } + } + else + err_msg = "Failed to create IO request"; + } + else + err_msg = "Failed to create message port"; + + if (err_msg) + { + if (required) + error(err_msg); + warning(err_msg); + } + + return *req != NULL; +} + +uint32 OSystem_MorphOS::get_msecs() +{ + int ticks = clock(); + ticks *= (1000/CLOCKS_PER_SEC); + return ticks; +} + +void OSystem_MorphOS::delay_msecs(uint msecs) +{ + TimerIORequest->tr_node.io_Command = TR_ADDREQUEST; + TimerIORequest->tr_time.tv_secs = 0; + TimerIORequest->tr_time.tv_micro = msecs*1000; + DoIO((IORequest *) TimerIORequest); +} + +void OSystem_MorphOS::set_timer(int timer, int (*callback)(int)) +{ + warning("set_timer() unexpectedly called"); +} + +void *OSystem_MorphOS::create_thread(ThreadProc *proc, void *param) +{ + static EmulFunc ThreadEmulFunc; + + ThreadEmulFunc.Trap = TRAP_FUNC; + ThreadEmulFunc.Address = (ULONG)proc; + ThreadEmulFunc.StackSize = 16000; + ThreadEmulFunc.Extension = 0; + ThreadEmulFunc.Arg1 = (ULONG)param; + musicProcTags[0].ti_Data = (ULONG)&ThreadEmulFunc; + ScummMusicThread = CreateNewProc(musicProcTags); + return ScummMusicThread; +} + +void *OSystem_MorphOS::create_mutex(void) +{ + SignalSemaphore *sem = (SignalSemaphore *) AllocVec(sizeof (SignalSemaphore), MEMF_PUBLIC); + + if (sem) + InitSemaphore(sem); + + return sem; +} + +void OSystem_MorphOS::lock_mutex(void *mutex) +{ + ObtainSemaphore((SignalSemaphore *) mutex); +} + +void OSystem_MorphOS::unlock_mutex(void *mutex) +{ + ReleaseSemaphore((SignalSemaphore *)mutex); +} + +void OSystem_MorphOS::delete_mutex(void *mutex) +{ + FreeVec(mutex); +} + +uint32 OSystem_MorphOS::property(int param, Property *value) +{ + switch (param) + { + case PROP_TOGGLE_FULLSCREEN: + CreateScreen(CSDSPTYPE_TOGGLE); + return 1; + + case PROP_SET_WINDOW_CAPTION: + sprintf(ScummWndTitle, "ScummVM MorphOS - %s", value->caption); + if (ScummWindow) + SetWindowTitles(ScummWindow, ScummWndTitle, ScummWndTitle); + return 1; + + case PROP_OPEN_CD: + FindCDTags[0].ti_Data = (ULONG) ((GameID == GID_LOOM256) ? "LoomCD" : "Monkey1CD"); + if (!CDDABase) CDDABase = OpenLibrary("cdda.library", 2); + if (CDDABase) + { + CDrive = CDDA_FindNextDrive(NULL, FindCDTags); + if (!CDrive && GameID == GID_MONKEY) + { + FindCDTags[0].ti_Data = (ULONG) "Madness"; + CDrive = CDDA_FindNextDrive(NULL, FindCDTags); + } + if (CDrive) + { + if (!CDDA_ObtainDrive(CDrive, CDDA_SHARED_ACCESS, NULL)) + { + CDrive = NULL; + warning("Failed to obtain CD drive - music will not play"); + } + else if (GameID == GID_LOOM256) + { + // Offset correction *may* be required + CDS_TrackInfo ti = { sizeof (CDS_TrackInfo) }; + + if (CDDA_GetTrackInfo(CDrive, 1, 0, &ti)) + CDDATrackOffset = ti.ti_TrackStart.tm_Format.tm_Frame-22650; + } + } + else + warning( "Could not find game CD inserted in CD-ROM drive - cd audio will not play" ); + } + else + warning( "Failed to open cdda.library - cd audio will not play" ); + break; + + case PROP_SHOW_DEFAULT_CURSOR: + if (value->show_cursor) + ClearPointer(ScummWindow); + else + SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); + ScummOrigMouse = ScummDefaultMouse = value->show_cursor; + break; + + case PROP_GET_SAMPLE_RATE: + return SAMPLES_PER_SEC; + } + + return 0; +} + +void OSystem_MorphOS::play_cdrom(int track, int num_loops, int start_frame, int length) +{ + if (CDrive && start_frame >= 0) + { + if (start_frame > 0) + start_frame -= CDDATrackOffset; + + PlayTags[0].ti_Data = track; + PlayTags[1].ti_Data = start_frame; + PlayTags[2].ti_Data = (length == 0) ? track+1 : track; + PlayTags[3].ti_Data = length ? start_frame+length : 0; + PlayTags[4].ti_Data = (num_loops == 0) ? 1 : num_loops; + CDDA_Play(CDrive, PlayTags); + } +} + +void OSystem_MorphOS::stop_cdrom() +{ + CDDA_Stop(CDrive); +} + +bool OSystem_MorphOS::poll_cdrom() +{ + ULONG status; + + if (CDrive == NULL) + return false; + + CDDA_GetAttr(CDDA_Status, CDrive, &status); + return status == CDDA_Status_Busy; +} + +void OSystem_MorphOS::update_cdrom() +{ +} + +void OSystem_MorphOS::quit() +{ + exit(0); +} + +#define CVT8TO32(col) ((col<<24) | (col<<16) | (col<<8) | col) + +void OSystem_MorphOS::set_palette(const byte *colors, uint start, uint num) +{ + const byte *data = colors; + UWORD changed_colors[256]; + UWORD num_changed = 0; + + for (uint i = start; i != start+num; i++) + { + ULONG color32 = (data[0] << 16) | (data[1] << 8) | data[2]; + if (color32 != ScummColors[i]) + { + if (ScummDepth == 8) + SetRGB32(&ScummScreen->ViewPort, i, CVT8TO32(data[0]), CVT8TO32(data[1]), CVT8TO32(data[2])); + ScummColors16[i] = Scumm16ColFmt16 ? (((data[0]*31)/255) << 11) | (((data[1]*63)/255) << 5) | ((data[ 2 ]*31)/255) : (((data[0]*31)/255) << 10) | (((data[1]*31)/255) << 5) | ((data[2]*31)/255); + ScummColors[i] = color32; + changed_colors[num_changed++] = i; + } + data += 4; + } + + if (ScummScale || ScummDepth != 8) + { + if (DirtyBlocks && num_changed < 200) + { + for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) + { + UWORD *block_colors = BlockColors[b]; + UWORD *color_ptr = changed_colors; + for (int c = 0; c < num_changed; c++) + { + if (block_colors[*color_ptr++]) + { + UWORD x, y; + x = b % BLOCKS_X; + y = b / BLOCKS_X; + DirtyBlocks[b] = true; + AddUpdateRect(x*BLOCKSIZE_X, y*BLOCKSIZE_Y, BLOCKSIZE_X, BLOCKSIZE_Y); + break; + } + } + } + } + else + AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); + } +} + +void OSystem_MorphOS::CreateScreen(CS_DSPTYPE dspType) +{ + ULONG mode = INVALID_ID; + int depths[] = { 8, 15, 16, 24, 32, 0 }; + int i; + Screen *wb = NULL; + + if (dspType != CSDSPTYPE_KEEP) + FullScreenMode = (dspType == CSDSPTYPE_FULLSCREEN) || (dspType == CSDSPTYPE_TOGGLE && !FullScreenMode); + + if (ScummRenderTo && !ScummScreen) + FreeBitMap(ScummRenderTo); + ScummRenderTo = NULL; + + if (ScummWindow) + { + if (ScummScreen == NULL) + { + ScummWinX = ScummWindow->LeftEdge; + ScummWinY = ScummWindow->TopEdge; + } + CloseWindow (ScummWindow); + ScummWindow = NULL; + } + + if (ScummScreen) + { + if (ScummScreenBuffer[0]) + FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); + if (ScummScreenBuffer[1]) + FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); + CloseScreen(ScummScreen); + ScummScreen = NULL; + } + + ScummScrWidth = ScummBufferWidth << ScummScale; + ScummScrHeight = ScummBufferHeight << ScummScale; + + if (FullScreenMode) + { + for (i = ScummScale; mode == INVALID_ID && depths[i]; i++) + mode = BestCModeIDTags(CYBRBIDTG_NominalWidth, ScummScrWidth, + CYBRBIDTG_NominalHeight, ScummScrHeight, + CYBRBIDTG_Depth, depths[i], + TAG_DONE + ); + ScummDepth = depths[i-1]; + + if (mode == INVALID_ID) + error("Could not find suitable screenmode"); + + ScummScreen = OpenScreenTags(NULL, SA_AutoScroll, TRUE, + SA_Depth, ScummDepth, + SA_Width, STDSCREENWIDTH, + SA_Height, STDSCREENHEIGHT, + SA_DisplayID, mode, + SA_ShowTitle, FALSE, + SA_Type, CUSTOMSCREEN, + SA_Title, "ScummVM MorphOS", + TAG_DONE + ); + + if (ScummScreen == NULL) + error("Failed to open screen"); + + ULONG RealDepth = GetBitMapAttr(&ScummScreen->BitMap, BMA_DEPTH); + if (RealDepth != ScummDepth) + { + warning("Screen did not open in expected depth"); + ScummDepth = RealDepth; + } + ScummScreenBuffer[0] = AllocScreenBuffer(ScummScreen, NULL, SB_SCREEN_BITMAP); + ScummScreenBuffer[1] = AllocScreenBuffer(ScummScreen, NULL, 0); + ScummRenderTo = ScummScreenBuffer[1]->sb_BitMap; + ScummPaintBuffer = 1; + + if (ScummScreenBuffer[0] == NULL || ScummScreenBuffer[1] == NULL) + error("Failed to allocate screen buffer"); + + // Make both buffers black to avoid grey strip on bottom of screen + RastPort rp; + InitRastPort(&rp); + SetRGB32(&ScummScreen->ViewPort, 0, 0, 0, 0); + rp.BitMap = ScummScreenBuffer[0]->sb_BitMap; + FillPixelArray(&ScummScreen->RastPort, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); + rp.BitMap = ScummRenderTo; + FillPixelArray(&rp, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); + + if (ScummDepth == 8) + { + for (int color = 0; color < 256; color++) + { + ULONG r, g, b; + + r = (ScummColors[color] >> 16) & 0xff; + g = (ScummColors[color] >> 8) & 0xff; + b = (ScummColors[color] >> 0) & 0xff; + SetRGB32(&ScummScreen->ViewPort, color, CVT8TO32(r), CVT8TO32(g), CVT8TO32(b)); + } + } + } + else + { + wb = LockPubScreen(NULL); + if (wb == NULL) + error("Could not lock default public screen"); + + ScreenToFront(wb); + } + + ScummWindow = OpenWindowTags(NULL, WA_Left, (wb && ScummWinX >= 0) ? ScummWinX : 0, + WA_Top, wb ? ((ScummWinY >= 0) ? ScummWinY : wb->BarHeight+1) : 0, + WA_InnerWidth, FullScreenMode ? ScummScreen->Width : ScummScrWidth, + WA_InnerHeight, FullScreenMode ? ScummScreen->Height : ScummScrHeight, + WA_Activate, TRUE, + WA_Title, wb ? ScummWndTitle : NULL, + WA_ScreenTitle, wb ? ScummWndTitle : NULL, + WA_Borderless, FullScreenMode, + WA_CloseGadget, !FullScreenMode, + WA_DepthGadget, !FullScreenMode, + WA_DragBar, !FullScreenMode, + WA_ReportMouse, TRUE, + WA_RMBTrap, TRUE, + WA_IDCMP, IDCMP_RAWKEY | + IDCMP_MOUSEMOVE | + IDCMP_CLOSEWINDOW | + IDCMP_MOUSEBUTTONS, + WA_CustomScreen, FullScreenMode ? (ULONG)ScummScreen : (ULONG)wb, + TAG_DONE + ); + + if (wb) + UnlockPubScreen(NULL, wb); + + if (ScummWindow == NULL) + error("Failed to open window"); + + if (!ScummDefaultMouse) + { + SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); + ScummOrigMouse = false; + } + + if (ScummScreen == NULL) + { + ScummDepth = GetCyberMapAttr(ScummWindow->RPort->BitMap, CYBRMATTR_DEPTH); + if (ScummDepth == 8) + error("Workbench screen must be running in 15 bit or higher"); + + ScummRenderTo = AllocBitMap(ScummScrWidth, ScummScrHeight, ScummDepth, BMF_MINPLANES, ScummWindow->RPort->BitMap); + if (ScummRenderTo == NULL) + error("Failed to allocate bitmap"); + } + + if ((ScummDepth == 15 && Scumm16ColFmt16) || (ScummDepth == 16 && !Scumm16ColFmt16)) + { + for (int col = 0; col < 256; col++) + { + int r = (ScummColors[col] >> 16) & 0xff; + int g = (ScummColors[col] >> 8) & 0xff; + int b = ScummColors[col] & 0xff; + ScummColors16[col] = (Scumm16ColFmt16 == false) ? (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255) : (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); + } + + Scumm16ColFmt16 = (ScummDepth == 16); + } + + if (Scaler) + { + delete Scaler; + Scaler = NULL; + } + + if (ScummScale) + { + Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); + if (Scaler == NULL) + { + warning("Failed to create scaler - scaling will be disabled"); + SwitchScalerTo(ST_NONE); + } + } + + AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); +} + +void OSystem_MorphOS::SwitchScalerTo(SCALERTYPE newScaler) +{ + if (newScaler == ST_NONE && ScummScale != 0) + { + if (Scaler) + { + delete Scaler; + Scaler = NULL; + } + ScummScale = 0; + ScummScaler = ST_NONE; + CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); + } + else + { + if (ScummScale == 0) + { + ScummScale = 1; + ScummScaler = newScaler; + CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); + } + else if (ScummScaler != newScaler) + { + ScummScaler = newScaler; + if (Scaler) + delete Scaler; + Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); + if (Scaler == NULL) + { + warning("Failed to create scaler - scaling will be disabled"); + SwitchScalerTo(ST_NONE); + } + else + AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); + } + } +} + +bool OSystem_MorphOS::poll_event(Event *event) +{ + IntuiMessage *ScummMsg; + + if (ScummMsg = (IntuiMessage *) GetMsg(ScummWindow->UserPort)) + { + switch (ScummMsg->Class) + { + case IDCMP_RAWKEY: + { + InputEvent FakedIEvent; + char charbuf; + int qual = 0; + + memset(&FakedIEvent, 0, sizeof (InputEvent)); + FakedIEvent.ie_Class = IECLASS_RAWKEY; + FakedIEvent.ie_Code = ScummMsg->Code; + + if (ScummMsg->Qualifier & (IEQUALIFIER_LALT | IEQUALIFIER_RALT)) + qual |= KBD_ALT; + if (ScummMsg->Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)) + qual |= KBD_SHIFT; + if (ScummMsg->Qualifier & IEQUALIFIER_CONTROL) + qual |= KBD_CTRL; + event->kbd.flags = qual; + + event->event_code = EVENT_KEYDOWN; + + if (ScummMsg->Code >= 0x50 && ScummMsg->Code <= 0x59) + { + /* + * Function key + */ + event->kbd.ascii = (ScummMsg->Code-0x50)+315; + event->kbd.keycode = 0; + } + else if (MapRawKey(&FakedIEvent, &charbuf, 1, NULL) == 1) + { + if (qual == KBD_CTRL) + { + switch (charbuf) + { + case 'z': + ReplyMsg((Message *) ScummMsg); + quit(); + } + } + else if (qual == KBD_ALT) + { + if (charbuf >= '0' && charbuf <= '9') + { + SCALERTYPE new_scaler = MorphOSScaler::FindByIndex(charbuf-'0'); + ReplyMsg((Message *) ScummMsg); + if (new_scaler != ST_INVALID) + SwitchScalerTo(new_scaler); + return false; + } + else if (charbuf == 'x') + { + ReplyMsg((Message *) ScummMsg); + quit(); + } + else if (charbuf == 0x0d) + { + ReplyMsg((Message *) ScummMsg); + CreateScreen(CSDSPTYPE_TOGGLE); + return false; + } + } + + event->kbd.ascii = charbuf; + event->kbd.keycode = event->kbd.ascii; + } + break; + } + + case IDCMP_MOUSEMOVE: + { + LONG newx, newy; + + newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; + newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; + + if (!FullScreenMode && !ScummDefaultMouse) + { + if (newx < 0 || newx > ScummBufferWidth || + newy < 0 || newy > ScummBufferHeight + ) + { + if (!ScummOrigMouse) + { + ScummOrigMouse = true; + ClearPointer(ScummWindow); + } + } + else if (ScummOrigMouse) + { + ScummOrigMouse = false; + SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); + } + } + else if (FullScreenMode) + newy = newy > ScummScale)-2; + + event->event_code = EVENT_MOUSEMOVE; + event->mouse.x = newx; + event->mouse.y = newy; + break; + } + + case IDCMP_MOUSEBUTTONS: + { + int newx, newy; + + newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; + newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; + + switch (ScummMsg->Code) + { + case SELECTDOWN: + event->event_code = EVENT_LBUTTONDOWN; + break; + + case SELECTUP: + event->event_code = EVENT_LBUTTONUP; + break; + + case MENUDOWN: + event->event_code = EVENT_RBUTTONDOWN; + break; + + case MENUUP: + event->event_code = EVENT_RBUTTONUP; + break; + + default: + ReplyMsg((Message *)ScummMsg); + return false; + } + event->mouse.x = newx; + event->mouse.y = newy; + break; + } + + case IDCMP_CLOSEWINDOW: + ReplyMsg((Message *)ScummMsg); + exit(0); + } + + if (ScummMsg) + ReplyMsg((Message *) ScummMsg); + + return true; + } + + return false; +} + +void OSystem_MorphOS::set_shake_pos(int shake_pos) +{ + ScummShakePos = shake_pos; + AddUpdateRect(0, 0, 320, 200); +} + +#define MOUSE_INTERSECTS(x, y, w, h) \ + (!((MouseOldX+MouseOldWidth <= x ) || (MouseOldX >= x+w) || \ + (MouseOldY+MouseOldHeight <= y) || (MouseOldY >= y+h))) + +/* Copy part of bitmap */ +void OSystem_MorphOS::copy_rect(const byte *src, int pitch, int x, int y, int w, int h) +{ + byte *dst; + + if (x < 0) { w+=x; src-=x; x = 0; } + if (y < 0) { h+=y; src-=y*pitch; y = 0; } + if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } + if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } + + if (w <= 0 || h <= 0) + return; + + if (MouseDrawn) + { + if (MOUSE_INTERSECTS(x, y, w, h)) + UndrawMouse(); + } + + AddUpdateRect(x, y, w, h); + + dst = (byte *)ScummBuffer+y*ScummBufferWidth + x; + if (DirtyBlocks) + { + int cx, cy; + int block = BLOCK_ID(x, y); + int line_block = block; + int start_block = BLOCKSIZE_X-(x % BLOCKSIZE_X); + int start_y_block = BLOCKSIZE_Y-(y % BLOCKSIZE_Y); + int next_block; + int next_y_block; + UWORD *block_cols = BlockColors[block]; + + if (start_block == 0) + start_block = BLOCKSIZE_X; + if (start_y_block == 0) + start_y_block = BLOCKSIZE_Y; + + next_block = start_block; + next_y_block = start_y_block; + for (cy = 0; cy < h; cy++) + { + for (cx = 0; cx < w; cx++) + { + UWORD old_pixel = *dst; + UWORD src_pixel = *src++; + if (old_pixel != src_pixel) + { + *dst++ = src_pixel; + block_cols[old_pixel]--; + block_cols[src_pixel]++; + } + else + dst++; + if (--next_block == 0) + { + block++; + block_cols = BlockColors[block]; + next_block = BLOCKSIZE_X; + } + } + if (--next_y_block == 0) + { + line_block += BLOCKS_X; + next_y_block = BLOCKSIZE_Y; + } + block = line_block; + block_cols = BlockColors[block]; + next_block = start_block; + dst += ScummBufferWidth-w; + src += pitch-w; + } + } + else + { + do + { + memcpy(dst, src, w); + dst += ScummBufferWidth; + src += pitch; + } while (--h); + } +} + +bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) +{ + if (x < 0) { w+=x; x = 0; } + if (y < 0) { h+=y; y = 0; } + if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } + if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } + + if (w <= 0 || h <= 0) + return false; + + Rectangle update_rect = { x, y, x+w, y+h }; + OrRectRegion(NewUpdateRegion, &update_rect); + ScreenChanged = true; + + return true; +} + +void OSystem_MorphOS::update_screen() +{ + DrawMouse(); + + if (!ScreenChanged) + return; + + OrRegionRegion(NewUpdateRegion, UpdateRegion); + + if (ScummShakePos) + { + RastPort rp; + + InitRastPort(&rp); + rp.BitMap = ScummRenderTo; + + uint32 src_y = 0; + uint32 dest_y = 0; + if (ScummShakePos < 0) + src_y = -ScummShakePos; + else + dest_y = ScummShakePos; + + if (!ScummScale) + { + if (ScummDepth == 8) + WritePixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, RECTFMT_LUT8); + else + WriteLUTPixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, ScummColors, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, CTABFMT_XRGB8); + } + else if (Scaler->Prepare(ScummRenderTo)) + { + Scaler->Scale(0, src_y, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y); + Scaler->Finish(); + } + + if (ScummShakePos < 0) + FillPixelArray(&rp, 0, (ScummBufferHeight-1) << ScummScale, ScummScrWidth, -ScummShakePos << ScummScale, 0); + else + FillPixelArray(&rp, 0, 0, ScummScrWidth, ScummShakePos << ScummScale, 0); + } + else if (!ScummScale) + { + RastPort rp; + + InitRastPort(&rp); + rp.BitMap = ScummRenderTo; + + uint32 src_x, src_y; + uint32 src_w, src_h; + uint32 reg_x, reg_y; + RegionRectangle *update_rect = UpdateRegion->RegionRectangle; + + reg_x = UpdateRegion->bounds.MinX; + reg_y = UpdateRegion->bounds.MinY; + while (update_rect) + { + src_x = update_rect->bounds.MinX; + src_y = update_rect->bounds.MinY; + src_w = update_rect->bounds.MaxX-src_x; + src_h = update_rect->bounds.MaxY-src_y; + src_x += reg_x; + src_y += reg_y; + + if (src_x) src_x--; + if (src_y) src_y--; + src_w += 2; + if (src_x+src_w >= ScummBufferWidth) + src_w = ScummBufferWidth-src_x; + src_h += 2; + if (src_y+src_h >= ScummBufferHeight) + src_h = ScummBufferHeight-src_y; + + if (ScummDepth == 8) + WritePixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, src_x, src_y, src_w, src_h, RECTFMT_LUT8); + else + WriteLUTPixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, ScummColors, src_x, src_y, src_w, src_h, CTABFMT_XRGB8); + + update_rect = update_rect->Next; + } + } + else + { + uint32 src_x, src_y; + uint32 src_w, src_h; + uint32 reg_x, reg_y; + RegionRectangle *update_rect = UpdateRegion->RegionRectangle; + + reg_x = UpdateRegion->bounds.MinX; + reg_y = UpdateRegion->bounds.MinY; + + if (!Scaler->Prepare(ScummRenderTo)) + update_rect = NULL; + + while (update_rect) + { + src_x = update_rect->bounds.MinX; + src_y = update_rect->bounds.MinY; + src_w = update_rect->bounds.MaxX-src_x; + src_h = update_rect->bounds.MaxY-src_y; + src_x += reg_x; + src_y += reg_y; + + if (src_x) src_x--; + if (src_y) src_y--; + src_w += 2; + if (src_x+src_w >= ScummBufferWidth) + src_w = ScummBufferWidth-src_x; + src_h += 2; + if (src_y+src_h >= ScummBufferHeight) + src_h = ScummBufferHeight-src_y; + + Scaler->Scale(src_x, src_y, src_x, src_y, src_w, src_h); + update_rect = update_rect->Next; + } + Scaler->Finish(); + } + + if (ScummScreen) + { + while (!ChangeScreenBuffer(ScummScreen, ScummScreenBuffer[ScummPaintBuffer])); + ScummPaintBuffer = !ScummPaintBuffer; + ScummRenderTo = ScummScreenBuffer[ScummPaintBuffer]->sb_BitMap; + } + else + { + int32 x = (UpdateRegion->bounds.MinX-1) << ScummScale; + int32 y = (UpdateRegion->bounds.MinY-1) << ScummScale; + if (x < 0) x = 0; + if (y < 0) y = 0; + int32 w = (UpdateRegion->bounds.MaxX << ScummScale)-x+(1 << ScummScale); + int32 h = (UpdateRegion->bounds.MaxY << ScummScale)-y+(1 << ScummScale); + if (x+w > ScummScrWidth) w = ScummScrWidth-x; + if (y+h > ScummScrHeight) h = ScummScrHeight-y; + BltBitMapRastPort(ScummRenderTo, x, y, ScummWindow->RPort, ScummWindow->BorderLeft+x, ScummWindow->BorderTop+y, w, h, ABNC | ABC); + WaitBlit(); + } + + Region *new_region_part = NewUpdateRegion; + NewUpdateRegion = UpdateRegion; + ClearRegion(NewUpdateRegion); + UpdateRegion = new_region_part; + + ScreenChanged = false; + memset(DirtyBlocks, 0, BLOCKS_X*BLOCKS_Y*sizeof (bool)); +} + +void OSystem_MorphOS::DrawMouse() +{ + int x,y; + byte *dst,*bak; + byte color; + + if (MouseDrawn || !MouseVisible) + return; + MouseDrawn = true; + + const int ydraw = MouseY - MouseHotspotY; + const int xdraw = MouseX - MouseHotspotX; + const int w = MouseWidth; + const int h = MouseHeight; + bak = MouseBackup; + byte *buf = MouseImage; + + MouseOldX = xdraw; + MouseOldY = ydraw; + MouseOldWidth = w; + MouseOldHeight = h; + + AddUpdateRect(xdraw, ydraw, w, h); + + dst = (byte*)ScummBuffer + ydraw*ScummBufferWidth + xdraw; + bak = MouseBackup; + + for (y = 0; y < h; y++, dst += ScummBufferWidth, bak += MAX_MOUSE_W, buf += w) + { + if ((uint)(ydraw+y) < ScummBufferHeight) + { + for( x = 0; x= 0; --b) + FreeVec(BlockColors[b]); + FreeVec(BlockColors); + BlockColors = NULL; + } + } + + if (!BlockColors) + { + FreeVec(DirtyBlocks); + DirtyBlocks = NULL; + } + } + + CreateScreen(CSDSPTYPE_KEEP); +} + diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h new file mode 100644 index 0000000000..75d2c79f7b --- /dev/null +++ b/backends/morphos/morphos.h @@ -0,0 +1,206 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 Rüdiger Hanke (MorphOS port) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * MorphOS-specific header file + * + * $Header$ + * + */ + +#ifndef MORPHOS_MORPHOS_H +#define MORPHOS_MORPHOS_H + +#include +#include +#include +#include +#include +#include + +#include "morphos_scaler.h" + +class OSystem_MorphOS : public OSystem +{ + public: + OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen); + virtual ~OSystem_MorphOS(); + + // Set colors of the palette + virtual void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + virtual void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + virtual void update_screen(); + + // Either show or hide the mouse cursor + virtual bool show_mouse(bool visible); + + // Set the position of the mouse cursor + virtual void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + virtual void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + virtual void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + virtual uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + virtual void delay_msecs(uint msecs); + + // Add a new callback timer + virtual void set_timer(int timer, int (*callback)(int)); + + // Mutex handling + virtual void *create_mutex(void); + virtual void lock_mutex(void *mutex); + virtual void unlock_mutex(void *mutex); + virtual void delete_mutex(void *mutex); + + // Create a thread + virtual void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + virtual bool poll_event(Event *event); + + // Set the function to be invoked whenever samples need to be generated + virtual bool set_sound_proc(void *param, SoundProc *proc, byte format); + void fill_sound (byte * stream, int len); + + virtual uint32 property(int param, Property *value); + + // Poll cdrom status + // Returns true if cd audio is playing + virtual bool poll_cdrom(); + + // Play cdrom audio track + virtual void play_cdrom(int track, int num_loops, int start_frame, int length); + + // Stop cdrom audio track + virtual void stop_cdrom(); + + // Update cdrom audio status + virtual void update_cdrom(); + + // Quit + virtual void quit(); + + static OSystem_MorphOS *create(int game_id, SCALERTYPE gfx_scaler, bool full_screen); + + static bool OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required = true); + + private: + typedef enum { CSDSPTYPE_WINDOWED, CSDSPTYPE_FULLSCREEN, CSDSPTYPE_TOGGLE, CSDSPTYPE_KEEP } CS_DSPTYPE; + + static const int MAX_MOUSE_W = 40; + static const int MAX_MOUSE_H = 40; + + void CreateScreen(CS_DSPTYPE dspType); + void SwitchScalerTo(SCALERTYPE newScaler); + bool AddUpdateRect(WORD x, WORD y, WORD w, WORD h); + + void DrawMouse(); + void UndrawMouse(); + + /* Display-related attributes */ + Screen *ScummScreen; + Window *ScummWindow; + char ScummWndTitle[125]; + APTR ScummBuffer; + int ScummBufferWidth; + int ScummBufferHeight; + ScreenBuffer *ScummScreenBuffer[2]; + BitMap *ScummRenderTo; + ULONG ScummPaintBuffer; + int ScummScrWidth; + int ScummScrHeight; + int ScummDepth; + bool Scumm16ColFmt16; + UWORD *ScummNoCursor; + ULONG ScummColors[256]; + USHORT ScummColors16[256]; + WORD ScummWinX; + WORD ScummWinY; + bool ScummDefaultMouse; + bool ScummOrigMouse; + int ScummShakePos; + bool FullScreenMode; + bool ScreenChanged; + UWORD **BlockColors; + bool *DirtyBlocks; + Region *UpdateRegion; + Region *NewUpdateRegion; + + /* Sound-related attributes */ + Process *ScummMusicThread; + Process *ScummSoundThread; + SoundProc *SoundProc; + void *SoundParam; + + /* CD-ROM related attributes */ + CDRIVEPTR CDrive; + ULONG CDDATrackOffset; + + /* Scaling-related attributes */ + SCALERTYPE ScummScaler; + int ScummScale; + MorphOSScaler *Scaler; + + /* Mouse cursor-related attributes */ + bool MouseVisible, MouseDrawn; + int MouseX, MouseY; + int MouseWidth, MouseHeight; + int MouseOldX, MouseOldY; + int MouseOldWidth, MouseOldHeight; + int MouseHotspotX, MouseHotspotY; + byte *MouseImage, MouseBackup[MAX_MOUSE_W*MAX_MOUSE_H]; + + /* Timer-related attributes */ + MsgPort *TimerMsgPort; + timerequest *TimerIORequest; + + /* Game-related attributes */ + int GameID; +}; + +int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType); +bool init_morphos_music(ULONG MidiUnit); +void exit_morphos_music(); + +int morphos_main(int argc, char *argv[]); + +extern OSystem_MorphOS *TheSystem; +extern SignalSemaphore ScummMusicThreadRunning; +extern SignalSemaphore ScummSoundThreadRunning; + +extern STRPTR ScummMusicDriver; +extern LONG ScummMidiUnit; +extern IOMidiRequest *ScummMidiRequest; +extern timerequest *MusicTimerIORequest; + +#endif + diff --git a/backends/morphos/morphos_scaler.cpp b/backends/morphos/morphos_scaler.cpp new file mode 100644 index 0000000000..dca4383016 --- /dev/null +++ b/backends/morphos/morphos_scaler.cpp @@ -0,0 +1,823 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" + +#include +#include + +#include + +#include "morphos.h" +#include "morphos_scaler.h" + +#define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D)) +#define INTERPOLATE(A, B) (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)) +#define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask) +#define SWAP_WORD(word) word = ((word & 0xff) << 8) | (word >> 8) + +MorphOSScaler::GfxScaler MorphOSScaler::ScummScalers[11] + = { { "none", "normal", ST_NONE }, + { "Point", "2x", ST_POINT }, + { "AdvMame2x", "advmame2x", ST_ADVMAME2X }, + { "SuperEagle", "supereagle", ST_SUPEREAGLE }, + { "Super2xSaI", "super2xsai", ST_SUPER2XSAI }, + { NULL, NULL, ST_INVALID }, + { NULL, NULL, ST_INVALID }, + { NULL, NULL, ST_INVALID }, + { NULL, NULL, ST_INVALID }, + { NULL, NULL, ST_INVALID }, + // This is the end marker ... do not assign a scaler to it! + { NULL, NULL, ST_INVALID } + }; + +MorphOSScaler::MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) +{ + dest = NULL; + handle = NULL; + + Buffer = buffer; + BufferWidth = width; + BufferHeight = height; + + ScummColors = col_table; + ScummColors16 = col_table16; + + /* Initialize scaling stuff */ + int minr, ming, minb; + ULONG depth = GetCyberMapAttr(bmap, CYBRMATTR_DEPTH); + + if (depth > 16) + { + minr = 1 << 16; + ming = 1 << 8; + minb = 1; + } + else + { + minr = 1 << ((depth == 15) ? 10 : 11); + ming = 1 << 5; + minb = 1; + } + + int pixfmt = GetCyberMapAttr(bmap, CYBRMATTR_PIXFMT); + + ScummPCMode = false; + if (pixfmt == PIXFMT_RGB15PC || pixfmt == PIXFMT_BGR15PC || + pixfmt == PIXFMT_RGB16PC || pixfmt == PIXFMT_BGR16PC) + ScummPCMode = true; + + colorMask = (MakeColor(pixfmt, 255, 0, 0) - minr) | (MakeColor(pixfmt, 0, 255, 0) - ming) | (MakeColor(pixfmt, 0, 0, 255) - minb); + lowPixelMask = minr | ming | minb; + qcolorMask = (MakeColor(pixfmt, 255, 0, 0) - 3*minr) | (MakeColor(pixfmt, 0, 255, 0) - 3*ming) | (MakeColor(pixfmt, 0, 0, 255) - 3*minb); + qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3); + redblueMask = MakeColor(pixfmt, 255, 0, 255); + greenMask = MakeColor(pixfmt, 0, 255, 0); + + PixelsPerMask = (depth <= 16) ? 2 : 1; + + if (PixelsPerMask == 2) + { + colorMask |= (colorMask << 16); + qcolorMask |= (qcolorMask << 16); + lowPixelMask |= (lowPixelMask << 16); + qlowpixelMask |= (qlowpixelMask << 16); + } +} + +MorphOSScaler::~MorphOSScaler() +{ + Finish(); +} + +MorphOSScaler *MorphOSScaler::Create(SCALERTYPE scaler_type, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) +{ + MorphOSScaler *new_scaler = NULL; + + switch (scaler_type) + { + case ST_POINT: + new_scaler = new PointScaler(buffer, width, height, col_table, col_table16, bmap); + break; + + case ST_ADVMAME2X: + new_scaler = new AdvMame2xScaler(buffer, width, height, col_table, col_table16, bmap); + break; + + case ST_SUPEREAGLE: + new_scaler = new SuperEagleScaler(buffer, width, height, col_table, col_table16, bmap); + break; + + case ST_SUPER2XSAI: + new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); + break; + + default: + warning("Invalid scaler requested - falling back to Super2xSaI"); + new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); + break; + } + + return new_scaler; +} + +bool MorphOSScaler::Prepare(BitMap *render_bmap) +{ + handle = LockBitMapTags(render_bmap, LBMI_BYTESPERPIX, &dest_bpp, + LBMI_BYTESPERROW, &dest_pitch, + LBMI_BASEADDRESS, &dest, + LBMI_PIXFMT, &dest_pixfmt, + TAG_DONE); + + return handle != NULL; +} + +void MorphOSScaler::Finish() +{ + if (handle) + { + UnLockBitMap(handle); + handle = NULL; + } +} + +uint32 MorphOSScaler::MakeColor(int pixfmt, int r, int g, int b) +{ + uint32 col = 0; + + switch (pixfmt) + { + case PIXFMT_RGB15: + case PIXFMT_RGB15PC: + col = (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); + break; + + case PIXFMT_BGR15: + case PIXFMT_BGR15PC: + col = (((b*31)/255) << 10) | (((g*31)/255) << 5) | ((r*31)/255); + break; + + case PIXFMT_RGB16: + case PIXFMT_RGB16PC: + col = (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255); + break; + + case PIXFMT_BGR16: + case PIXFMT_BGR16PC: + col = (((b*31)/255) << 11) | (((g*63)/255) << 5) | ((r*31)/255); + break; + + case PIXFMT_RGB24: + case PIXFMT_ARGB32: + col = (r << 16) | (g << 8) | b; + break; + + case PIXFMT_BGR24: + col = (b << 16) | (g << 8) | r; + break; + + case PIXFMT_BGRA32: + col = (b << 24) | (g << 16) | (r << 8); + break; + + case PIXFMT_RGBA32: + col = (r << 24) | (g << 16) | (b << 8); + break; + + default: + error("Unsupported pixel format: %d. Please contact author at tomjoad@muenster.de.", pixfmt); + } + + return col; +} + +void Super2xSaIScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) +{ + unsigned int x, y; + unsigned long color[16]; + byte *src; + + if (!handle) + return; + + src = ((byte *)Buffer)+src_y*BufferWidth+src_x; + + /* Point to the first 3 lines. */ + src_line[0] = src; + src_line[1] = src; + src_line[2] = src + BufferWidth; + src_line[3] = src + BufferWidth * 2; + + dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; + dst_line[1] = dst_line[0]+dest_pitch; + + if (PixelsPerMask == 2) + { + byte *sbp; + sbp = src_line[0]; + color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; + color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors16[*(sbp+1)]; color[7] = ScummColors16[*(sbp+2)]; + sbp = src_line[2]; + color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[*(sbp+1)]; color[11] = ScummColors16[*(sbp+2)]; + sbp = src_line[3]; + color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[*(sbp+1)]; color[15] = ScummColors16[*(sbp+2)]; + } + else + { + byte *lbp; + lbp = src_line[0]; + color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; + color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors[*(lbp+1)]; color[7] = ScummColors[*(lbp+2)]; + lbp = src_line[2]; + color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[*(lbp+1)]; color[11] = ScummColors[*(lbp+2)]; + lbp = src_line[3]; + color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[*(lbp+1)]; color[15] = ScummColors[*(lbp+2)]; + } + + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + { + unsigned long product1a, product1b, product2a, product2b; + +//--------------------------------------- B0 B1 B2 B3 0 1 2 3 +// 4 5* 6 S2 -> 4 5* 6 7 +// 1 2 3 S1 8 9 10 11 +// A0 A1 A2 A3 12 13 14 15 +//-------------------------------------- + if (color[9] == color[6] && color[5] != color[10]) + { + product2b = color[9]; + product1b = product2b; + } + else if (color[5] == color[10] && color[9] != color[6]) + { + product2b = color[5]; + product1b = product2b; + } + else if (color[5] == color[10] && color[9] == color[6]) + { + int r = 0; + + r += GET_RESULT(color[6], color[5], color[8], color[13]); + r += GET_RESULT(color[6], color[5], color[4], color[1]); + r += GET_RESULT(color[6], color[5], color[14], color[11]); + r += GET_RESULT(color[6], color[5], color[2], color[7]); + + if (r > 0) + product1b = color[6]; + else if (r < 0) + product1b = color[5]; + else + product1b = INTERPOLATE(color[5], color[6]); + + product2b = product1b; + + } + else + { + if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12]) + product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]); + else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15]) + product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]); + else + product2b = INTERPOLATE(color[9], color[10]); + + if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0]) + product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]); + else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3]) + product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]); + else + product1b = INTERPOLATE(color[5], color[6]); + } + + if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14]) + product2a = INTERPOLATE(color[9], color[5]); + else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12]) + product2a = INTERPOLATE(color[9], color[5]); + else + product2a = color[9]; + + if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2]) + product1a = INTERPOLATE(color[9], color[5]); + else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0]) + product1a = INTERPOLATE(color[9], color[5]); + else + product1a = color[5]; + + if (PixelsPerMask == 2) + { + if (ScummPCMode) + { + SWAP_WORD(product1a); + SWAP_WORD(product1b); + SWAP_WORD(product2a); + SWAP_WORD(product2b); + } + *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; + *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; + } + else + { + *((unsigned long *) (&dst_line[0][x * 8])) = product1a; + *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; + *((unsigned long *) (&dst_line[1][x * 8])) = product2a; + *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; + } + + /* Move color matrix forward */ + color[0] = color[1]; color[4] = color[5]; color[8] = color[9]; color[12] = color[13]; + color[1] = color[2]; color[5] = color[6]; color[9] = color[10]; color[13] = color[14]; + color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15]; + + if (src_x+x < BufferWidth-3) + { + x += 3; + if (PixelsPerMask == 2) + { + color[3] = ScummColors16[*(src_line[0] + x) ]; + color[7] = ScummColors16[*(src_line[1] + x) ]; + color[11] = ScummColors16[*(src_line[2] + x) ]; + color[15] = ScummColors16[*(src_line[3] + x) ]; + } + else + { + color[3] = ScummColors[*(src_line[0] + x)]; + color[7] = ScummColors[*(src_line[1] + x)]; + color[11] = ScummColors[*(src_line[2] + x)]; + color[15] = ScummColors[*(src_line[3] + x)]; + } + x -= 3; + } + } + + /* We're done with one line, so we shift the source lines up */ + src_line[0] = src_line[1]; + src_line[1] = src_line[2]; + src_line[2] = src_line[3]; + + /* Read next line */ + if (src_y + y + 3 >= BufferHeight) + src_line[3] = src_line[2]; + else + src_line[3] = src_line[2] + BufferWidth; + + /* Then shift the color matrix up */ + if (PixelsPerMask == 2) + { + byte *sbp; + sbp = src_line[0]; + color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = ScummColors16[ *(sbp + 1) ]; color[3] = ScummColors16[*(sbp + 2)]; + sbp = src_line[1]; + color[4] = ScummColors16[*sbp]; color[5] = color[4]; color[6] = ScummColors16[ *(sbp + 1) ]; color[7] = ScummColors16[*(sbp + 2)]; + sbp = src_line[2]; + color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[ *(sbp + 1) ]; color[11] = ScummColors16[*(sbp + 2)]; + sbp = src_line[3]; + color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[ *(sbp + 1) ]; color[15] = ScummColors16[*(sbp + 2)]; + + if (src_x + x > 0) + { + color[0] = ScummColors16[src_line[0][-1]]; + color[4] = ScummColors16[src_line[1][-1]]; + color[8] = ScummColors16[src_line[2][-1]]; + color[12] = ScummColors16[src_line[3][-1]]; + } + } + else + { + byte *lbp; + lbp = src_line[0]; + color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = ScummColors[ *(lbp + 1) ]; color[3] = ScummColors[*(lbp+2)]; + lbp = src_line[1]; + color[4] = ScummColors[*lbp]; color[5] = color[4]; color[6] = ScummColors[ *(lbp + 1) ]; color[7] = ScummColors[*(lbp+2)]; + lbp = src_line[2]; + color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[ *(lbp + 1) ]; color[11] = ScummColors[*(lbp+2)]; + lbp = src_line[3]; + color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[ *(lbp + 1) ]; color[15] = ScummColors[*(lbp+2)]; + } + + if (src_y + y < BufferHeight - 1) + { + dst_line[0] = dst_line[1]+dest_pitch; + dst_line[1] = dst_line[0]+dest_pitch; + } + } +} + +void SuperEagleScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) +{ + unsigned int x, y; + unsigned long color[12]; + byte *src; + + if (!handle) + return; + + src = (byte *)Buffer+src_y*BufferWidth+src_x; + + /* Point to the first 3 lines. */ + src_line[0] = src; + src_line[1] = src; + src_line[2] = src + BufferWidth; + src_line[3] = src + BufferWidth * 2; + + dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; + dst_line[1] = dst_line[0]+dest_pitch; + + x = 0, y = 0; + + if (PixelsPerMask == 2) + { + byte *sbp; + sbp = src_line[0]; + color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; + color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; + sbp = src_line[2]; + color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; + sbp = src_line[3]; + color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; + } + else + { + byte *lbp; + lbp = src_line[0]; + color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; + color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; + lbp = src_line[2]; + color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; + lbp = src_line[3]; + color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; + } + + for (y = 0; y < height; y++) + { + /* Todo: x = width - 2, x = width - 1 */ + + for (x = 0; x < width; x++) + { + unsigned long product1a, product1b, product2a, product2b; + +//--------------------------------------- B1 B2 0 1 +// 4 5 6 S2 -> 2 3 4 5 +// 1 2 3 S1 6 7 8 9 +// A1 A2 10 11 + + if (color[7] == color[4] && color[3] != color[8]) + { + product1b = product2a = color[7]; + + if ((color[6] == color[7]) || (color[4] == color[1])) + product1a = INTERPOLATE(color[7], INTERPOLATE(color[7], color[3])); + else + product1a = INTERPOLATE(color[3], color[4]); + + if ((color[4] == color[5]) || (color[7] == color[10])) + product2b = INTERPOLATE(color[7], INTERPOLATE(color[7], color[8])); + else + product2b = INTERPOLATE(color[7], color[8]); + } + else if (color[3] == color[8] && color[7] != color[4]) + { + product2b = product1a = color[3]; + + if ((color[0] == color[3]) || (color[5] == color[9])) + product1b = INTERPOLATE(color[3], INTERPOLATE(color[3], color[4])); + else + product1b = INTERPOLATE(color[3], color[1]); + + if ((color[8] == color[11]) || (color[2] == color[3])) + product2a = INTERPOLATE(color[3], INTERPOLATE(color[3], color[2])); + else + product2a = INTERPOLATE(color[7], color[8]); + + } + else if (color[3] == color[8] && color[7] == color[4]) + { + register int r = 0; + + r += GET_RESULT(color[4], color[3], color[6], color[10]); + r += GET_RESULT(color[4], color[3], color[2], color[0]); + r += GET_RESULT(color[4], color[3], color[11], color[9]); + r += GET_RESULT(color[4], color[3], color[1], color[5]); + + if (r > 0) + { + product1b = product2a = color[7]; + product1a = product2b = INTERPOLATE(color[3], color[4]); + } + else if (r < 0) + { + product2b = product1a = color[3]; + product1b = product2a = INTERPOLATE(color[3], color[4]); + } + else + { + product2b = product1a = color[3]; + product1b = product2a = color[7]; + } + } + else + { + product2b = product1a = INTERPOLATE(color[7], color[4]); + product2b = Q_INTERPOLATE(color[8], color[8], color[8], product2b); + product1a = Q_INTERPOLATE(color[3], color[3], color[3], product1a); + + product2a = product1b = INTERPOLATE(color[3], color[8]); + product2a = Q_INTERPOLATE(color[7], color[7], color[7], product2a); + product1b = Q_INTERPOLATE(color[4], color[4], color[4], product1b); + } + + if (PixelsPerMask == 2) + { + if (ScummPCMode) + { + SWAP_WORD(product1a); + SWAP_WORD(product1b); + SWAP_WORD(product2a); + SWAP_WORD(product2b); + } + *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; + *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; + } + else + { + *((unsigned long *) (&dst_line[0][x * 8])) = product1a; + *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; + *((unsigned long *) (&dst_line[1][x * 8])) = product2a; + *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; + } + + /* Move color matrix forward */ + color[0] = color[1]; + color[2] = color[3]; color[3] = color[4]; color[4] = color[5]; + color[6] = color[7]; color[7] = color[8]; color[8] = color[9]; + color[10] = color[11]; + + if (src_x+x < BufferWidth - 2) + { + x += 2; + if (PixelsPerMask == 2) + { + color[1] = ScummColors16[ *(src_line[0] + x) ]; + if (src_x+x < BufferWidth-1) + { + color[5] = ScummColors16[*(src_line[1]+x+1)]; + color[9] = ScummColors16[*(src_line[2]+x+1)]; + } + color[11] = ScummColors16[*(src_line[3]+x)]; + } + else + { + color[1] = ScummColors[*(src_line[0]+x)]; + if (src_x+x < BufferWidth-1) + { + color[5] = ScummColors[*(src_line[1]+x+1)]; + color[9] = ScummColors[ *(src_line[2]+x+1)]; + } + color[11] = ScummColors[*(src_line[3]+x)]; + } + x -= 2; + } + } + + /* We're done with one line, so we shift the source lines up */ + src_line[0] = src_line[1]; + src_line[1] = src_line[2]; + src_line[2] = src_line[3]; + + /* Read next line */ + if (src_y+y+3 >= BufferHeight) + src_line[3] = src_line[2]; + else + src_line[3] = src_line[2] + BufferWidth; + + /* Then shift the color matrix up */ + if (PixelsPerMask == 2) + { + byte *sbp; + sbp = src_line[0]; + color[0] = ScummColors16[*sbp]; color[1] = ScummColors16[*(sbp+1)]; + sbp = src_line[1]; + color[2] = ScummColors16[*sbp]; color[3] = color[2]; color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; + sbp = src_line[2]; + color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; + sbp = src_line[3]; + color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; + } + else + { + byte *lbp; + lbp = src_line[0]; + color[0] = ScummColors[*lbp]; color[1] = ScummColors[*(lbp+1)]; + lbp = src_line[1]; + color[2] = ScummColors[*lbp]; color[3] = color[2]; color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; + lbp = src_line[2]; + color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; + lbp = src_line[3]; + color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; + } + + + if (src_y + y < BufferHeight - 1) + { + dst_line[0] = dst_line[1]+dest_pitch; + dst_line[1] = dst_line[0]+dest_pitch; + } + } +} + +void AdvMame2xScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) +{ + if (!handle) + return; + + byte *src = (byte *)Buffer+src_y*BufferWidth+src_x; + + src_line[0] = src; + src_line[1] = src; + src_line[2] = src + BufferWidth; + + dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; + dst_line[1] = dst_line[0]+dest_pitch; + + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + uint32 B, D, E, F, H; + + if (PixelsPerMask == 2) + { + // short A = *(src + i - nextlineSrc - 1); + B = ScummColors16[src_line[0][x]]; + // short C = *(src + i - nextlineSrc + 1); + D = ScummColors16[src_line[1][x-1]]; + E = ScummColors16[src_line[1][x]]; + F = ScummColors16[src_line[1][x+1]]; + // short G = *(src + i + nextlineSrc - 1); + H = ScummColors16[src_line[2][x]]; + // short I = *(src + i + nextlineSrc + 1); + } + else + { + // short A = *(src + i - nextlineSrc - 1); + B = ScummColors[src_line[0][x]]; + // short C = *(src + i - nextlineSrc + 1); + D = ScummColors[src_line[1][x-1]]; + E = ScummColors[src_line[1][x]]; + F = ScummColors[src_line[1][x+1]]; + // short G = *(src + i + nextlineSrc - 1); + H = ScummColors[src_line[2][x]]; + // short I = *(src + i + nextlineSrc + 1); + } + + + if (PixelsPerMask == 2) + { + if (ScummPCMode) + { + SWAP_WORD(B); + SWAP_WORD(D); + SWAP_WORD(E); + SWAP_WORD(F); + SWAP_WORD(H); + } + *((unsigned long *) (&dst_line[0][x * 4])) = ((D == B && B != F && D != H ? D : E) << 16) | (B == F && B != D && F != H ? F : E); + *((unsigned long *) (&dst_line[1][x * 4])) = ((D == H && D != B && H != F ? D : E) << 16) | (H == F && D != H && B != F ? F : E); + } + else + { + *((unsigned long *) (&dst_line[0][x * 8])) = D == B && B != F && D != H ? D : E; + *((unsigned long *) (&dst_line[0][x * 8 + 4])) = B == F && B != D && F != H ? F : E; + *((unsigned long *) (&dst_line[1][x * 8])) = D == H && D != B && H != F ? D : E; + *((unsigned long *) (&dst_line[1][x * 8 + 4])) = H == F && D != H && B != F ? F : E; + } + } + + src_line[0] = src_line[1]; + src_line[1] = src_line[2]; + if (src_y+y+2 >= BufferHeight) + src_line[2] = src_line[1]; + else + src_line[2] = src_line[1] + BufferWidth; + + if (src_y+y < BufferHeight-1) + { + dst_line[0] = dst_line[1]+dest_pitch; + dst_line[1] = dst_line[0]+dest_pitch; + } + } +} + +void PointScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) +{ + byte *src; + uint32 color; + uint32 r, g, b; + uint32 x, y; + + if (!handle) + return; + + src = (byte *)Buffer+src_y*BufferWidth+src_x; + + dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; + dst_line[1] = dst_line[0]+dest_pitch; + + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + { + r = (ScummColors[*(src+x)] >> 16) & 0xff; + g = (ScummColors[*(src+x)] >> 8) & 0xff; + b = ScummColors[*(src+x)] & 0xff; + + color = MakeColor(dest_pixfmt, r, g, b); + if (PixelsPerMask == 2) + { + if (ScummPCMode) + SWAP_WORD(color); + + *((unsigned long *) (&dst_line[0][x * 4])) = (color << 16) | color; + *((unsigned long *) (&dst_line[1][x * 4])) = (color << 16) | color; + } + else + { + *((unsigned long *) (&dst_line[0][x * 8])) = color; + *((unsigned long *) (&dst_line[0][x * 8 + 4])) = color; + *((unsigned long *) (&dst_line[1][x * 8])) = color; + *((unsigned long *) (&dst_line[1][x * 8 + 4])) = color; + } + } + + src += BufferWidth; + + if (src_y+y < BufferHeight-1) + { + dst_line[0] = dst_line[1]+dest_pitch; + dst_line[1] = dst_line[0]+dest_pitch; + } + } +} + +SCALERTYPE MorphOSScaler::FindByName(const char *ScalerName) +{ + int scaler = 0; + + while (ScummScalers[scaler].gs_Name) + { + if (!stricmp(ScalerName, ScummScalers[scaler].gs_Name)) + return ScummScalers[scaler].gs_Type; + scaler++; + } + + if (ScummScalers[scaler].gs_Name == NULL) + { + puts("Invalid scaler name. Please use one of the following:"); + for (scaler = 0; ScummScalers[scaler].gs_Name != NULL; scaler++) + printf(" %s\n", ScummScalers[scaler].gs_Name); + } + + return ST_INVALID; +} + +SCALERTYPE MorphOSScaler::FindByIndex(int index) +{ + if (index >= 0 && index < 10 && ScummScalers[index].gs_Name) + return ScummScalers[index].gs_Type; + + return ST_INVALID; +} + +const char *MorphOSScaler::GetParamName(SCALERTYPE type) +{ + int scaler = 0; + + while (ScummScalers[scaler].gs_Name) + { + if (ScummScalers[scaler].gs_Type == type) + return ScummScalers[scaler].gs_ParamName; + scaler++; + } + + return NULL; +} + diff --git a/backends/morphos/morphos_scaler.h b/backends/morphos/morphos_scaler.h new file mode 100644 index 0000000000..c23de6cb8a --- /dev/null +++ b/backends/morphos/morphos_scaler.h @@ -0,0 +1,93 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef MORPHOS_MORPHOSSCALER_H +#define MORPHOS_MORPHOSSCALER_H + +#include + +typedef enum { ST_INVALID = 0, ST_NONE, ST_POINT, ST_ADVMAME2X, ST_SUPEREAGLE, ST_SUPER2XSAI } SCALERTYPE; + +class MorphOSScaler +{ + public: + MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); + virtual ~MorphOSScaler(); + + bool Prepare(BitMap *render_bmap); + void Finish(); + + virtual void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) = 0; + + static MorphOSScaler *Create(SCALERTYPE st, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); + + static SCALERTYPE FindByName(const char *ScalerName); + static SCALERTYPE FindByIndex(int index); + static const char *GetParamName(SCALERTYPE type); + + protected: + struct GfxScaler + { + STRPTR gs_Name; + STRPTR gs_ParamName; + SCALERTYPE gs_Type; + }; + + static GfxScaler ScummScalers[11]; + + static uint32 MakeColor(int pixfmt, int r, int g, int b); + + byte *dest; + uint32 dest_bpp; + uint32 dest_pitch; + uint32 dest_pixfmt; + APTR handle; + + uint32 colorMask; + uint32 lowPixelMask; + uint32 qcolorMask; + uint32 qlowpixelMask; + uint32 redblueMask; + uint32 greenMask; + int PixelsPerMask; + byte *src_line[4]; + byte *dst_line[2]; + bool ScummPCMode; + + APTR Buffer; + int BufferWidth; + int BufferHeight; + ULONG *ScummColors; + USHORT *ScummColors16; +}; + +#define DECLARE_SCALER(scaler_name) class scaler_name ## Scaler : public MorphOSScaler \ + { public: scaler_name ## Scaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) : MorphOSScaler(buffer, width, height, col_table, col_table16, bmap) {} \ + void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height); \ + }; + + +DECLARE_SCALER(Point) +DECLARE_SCALER(AdvMame2x) +DECLARE_SCALER(SuperEagle) +DECLARE_SCALER(Super2xSaI) + +#endif + diff --git a/backends/morphos/morphos_sound.cpp b/backends/morphos/morphos_sound.cpp new file mode 100644 index 0000000000..0585b8708b --- /dev/null +++ b/backends/morphos/morphos_sound.cpp @@ -0,0 +1,284 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 Rüdiger Hanke + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * MorphOS sound support + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "morphos.h" + +#define AHI_BUF_SIZE (8*1024) + +SignalSemaphore ScummMusicThreadRunning; +SignalSemaphore ScummSoundThreadRunning; + +static MsgPort *ahiPort = NULL; +static AHIRequest *ahiReq[2] = { NULL, NULL }; +static UWORD ahiCurBuf = 0; +static bool ahiReqSent[2] = { false, false }; +static BYTE ahiDevice = -1; + UBYTE ahiUnit = AHI_DEFAULT_UNIT; +static char *ahiBuf[2] = { NULL, NULL }; + +static MsgPort *ScummMidiPort = NULL; + IOMidiRequest *ScummMidiRequest = NULL; +static MsgPort *MusicTimerMsgPort = NULL; + timerequest *MusicTimerIORequest = NULL; + +bool init_morphos_music(ULONG MidiUnit) +{ + if (ScummMusicDriver && !stricmp(ScummMusicDriver, "-eamidi")) // just as ugly as the line below ... + { + MidiUnit = ScummMidiUnit; // Ugly fix, but ... + ScummMidiPort = CreateMsgPort(); + if (ScummMidiPort) + { + ScummMidiRequest = (IOMidiRequest *) CreateIORequest(ScummMidiPort, sizeof (IOMidiRequest)); + if (ScummMidiRequest) + { + ScummMidiRequest->amr_Version = 2; + if (OpenDevice("amidi.device", MidiUnit, (IORequest *) ScummMidiRequest, AMIDIF_MIDISERVER)) + { + DeleteIORequest((IORequest *) ScummMidiRequest); + DeleteMsgPort(ScummMidiPort); + ScummMidiRequest = NULL; + ScummMidiPort = NULL; + } + } + else + { + DeleteMsgPort(ScummMidiPort); + ScummMidiPort = NULL; + } + } + + if (!ScummMidiRequest) + { + warning("Could not open AMidi - music will not play"); + return false; + } + } + + MusicTimerMsgPort = CreateMsgPort(); + if (MusicTimerMsgPort) + { + MusicTimerIORequest = (timerequest *) CreateIORequest(MusicTimerMsgPort, sizeof (timerequest)); + if (MusicTimerIORequest) + { + if (OpenDevice("timer.device", UNIT_MICROHZ, (IORequest *) MusicTimerIORequest, 0)) + { + DeleteIORequest((IORequest *) MusicTimerIORequest); + DeleteMsgPort(MusicTimerMsgPort); + MusicTimerIORequest = NULL; + MusicTimerMsgPort = NULL; + } + } + else + { + DeleteMsgPort(MusicTimerMsgPort); + MusicTimerMsgPort = NULL; + } + } + + if (!MusicTimerIORequest) + { + warning("Could not open timer device - music will not play"); + return false; + } + + return true; +} + + +void exit_morphos_music() +{ + if (ScummMidiRequest) + { + CloseDevice((IORequest *) ScummMidiRequest); + DeleteIORequest((IORequest *) ScummMidiRequest); + DeleteMsgPort(ScummMidiPort); + } + + if (MusicTimerIORequest) + { + CloseDevice((IORequest *) MusicTimerIORequest); + DeleteIORequest((IORequest *) MusicTimerIORequest); + DeleteMsgPort(MusicTimerMsgPort); + } +} + + +static bool init_morphos_sound() +{ + if (!(ahiPort = CreateMsgPort())) + return false; + + if (!(ahiReq[0] = (AHIRequest *) CreateIORequest(ahiPort, sizeof (AHIRequest)))) + { + DeleteMsgPort(ahiPort); + ahiPort = NULL; + return false; + } + + if (!(ahiReq[1] = (AHIRequest *) AllocVec(sizeof (AHIRequest), MEMF_PUBLIC))) + { + DeleteIORequest(ahiReq[0]); + DeleteMsgPort(ahiPort); + ahiReq[0] = NULL; + ahiPort = NULL; + return false; + } + + if (!(ahiBuf[0] = (char *) AllocVec(2*AHI_BUF_SIZE, MEMF_PUBLIC))) + { + FreeVec(ahiReq[1]); + DeleteIORequest(ahiReq[0]); + DeleteMsgPort(ahiPort); + ahiReq[0] = NULL; + ahiReq[1] = NULL; + ahiPort = NULL; + return false; + } + ahiBuf[1] = &ahiBuf[0][AHI_BUF_SIZE]; + + ahiReq[0]->ahir_Version = 4; + if (ahiDevice = OpenDevice(AHINAME, 0, (IORequest *) ahiReq[0], 0)) + { + FreeVec(ahiBuf[0]); + FreeVec(ahiReq[1]); + DeleteIORequest(ahiReq[0]); + DeleteMsgPort(ahiPort); + ahiBuf[0] = NULL; + ahiReq[0] = NULL; + ahiReq[1] = NULL; + ahiPort = NULL; + return false; + } + + CopyMem(ahiReq[0], ahiReq[1], sizeof (AHIRequest)); + + ahiCurBuf = 0; + ahiReqSent[0] = FALSE; + ahiReqSent[1] = FALSE; + + return true; +} + + +static void exit_morphos_sound() +{ + if (ahiReq[1]) + FreeVec(ahiReq[1]); + + if (ahiReq[0]) + { + CloseDevice((IORequest *) ahiReq[0]); + DeleteIORequest(ahiReq[0]); + } + + if (ahiBuf[0]) + FreeVec((APTR) ahiBuf[0]); + + if (ahiPort) + DeleteMsgPort(ahiPort); +} + +int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType) +{ + ULONG signals; + bool initialized; + + ObtainSemaphore(&ScummSoundThreadRunning); + + initialized = init_morphos_sound(); + if (!initialized) + { + warning("Sound could not be initialized. The game may hang at some point (press Ctrl-z then)."); + Wait(SIGBREAKF_CTRL_C); + } + else + { + for (;;) + { + while (!ahiReqSent[ahiCurBuf] || CheckIO((IORequest *) ahiReq[ahiCurBuf])) + { + AHIRequest *req = ahiReq[ahiCurBuf]; + UWORD ahiOtherBuf = !ahiCurBuf; + + if (ahiReqSent[ahiCurBuf]) + WaitIO((IORequest *) req); + + syst->fill_sound((byte *) ahiBuf[ahiCurBuf], AHI_BUF_SIZE); + + req->ahir_Std.io_Message.mn_Node.ln_Pri = 0; + req->ahir_Std.io_Command = CMD_WRITE; + req->ahir_Std.io_Data = ahiBuf[ahiCurBuf]; + req->ahir_Std.io_Length = AHI_BUF_SIZE; + req->ahir_Type = SampleType; + req->ahir_Frequency = SAMPLES_PER_SEC; + req->ahir_Position = 0x8000; + req->ahir_Volume = 0x10000; + req->ahir_Link = (ahiReqSent[ahiOtherBuf] && !CheckIO((IORequest *) ahiReq[ahiOtherBuf])) ? ahiReq[ahiOtherBuf] : NULL; + SendIO((IORequest *)req); + + ahiReqSent[ahiCurBuf] = true; + ahiCurBuf = ahiOtherBuf; + } + + signals = Wait(SIGBREAKF_CTRL_C | (1 << ahiPort->mp_SigBit)); + + if (signals & SIGBREAKF_CTRL_C) + break; + } + + if (ahiReqSent[ahiCurBuf]) + { + AbortIO((IORequest *) ahiReq[ahiCurBuf]); + WaitIO((IORequest *) ahiReq[ahiCurBuf]); + ahiReqSent[ahiCurBuf] = false; + } + + if (ahiReqSent[!ahiCurBuf]) + { + AbortIO((IORequest *) ahiReq[!ahiCurBuf]); + WaitIO((IORequest *) ahiReq[!ahiCurBuf]); + ahiReqSent[!ahiCurBuf] = false; + } + } + + exit_morphos_sound(); + + ReleaseSemaphore(&ScummSoundThreadRunning); + RemTask(NULL); + return 0; +} + diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp new file mode 100644 index 0000000000..d3305cbe14 --- /dev/null +++ b/backends/morphos/morphos_start.cpp @@ -0,0 +1,359 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 Rüdiger Hanke (MorphOS port) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * MorphOS startup handling + * + * $Header$ + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "stdafx.h" +#include "scumm.h" +#include "morphos.h" +#include "morphos_scaler.h" + +extern "C" WBStartup *_WBenchMsg; + +// For command line parsing +static STRPTR usageTemplate = "STORY/A,DATAPATH/K,WBWINDOW/S,SCALER/K,AMIGA/S,MIDIUNIT/K/N,MUSIC/K,MUSICVOL/K/N,SFXVOL/K/N,TEMPO/K/N,TALKSPEED/K/N,NOSUBTITLES=NST/S"; +typedef enum { USG_STORY = 0, USG_DATAPATH, USG_WBWINDOW, USG_SCALER, USG_AMIGA, USG_MIDIUNIT, USG_MUSIC, USG_MUSICVOL, USG_SFXVOL, USG_TEMPO, USG_TALKSPEED, USG_NOSUBTITLES } usageFields; +static LONG args[13] = { (ULONG) NULL, (ULONG) NULL, FALSE, (ULONG) NULL, false, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, false }; +static RDArgs *ScummArgs = NULL; + +static char*ScummStory = NULL; +static char*ScummPath = NULL; + STRPTR ScummMusicDriver = NULL; + LONG ScummMidiUnit = 0; +static LONG ScummMidiVolume = 0; +static LONG ScummMidiTempo = 0; +static LONG ScummSfxVolume = 0; +static LONG ScummTalkSpeed = 0; +static SCALERTYPE ScummGfxScaler = ST_INVALID; + +static BPTR OrigDirLock = 0; + +Library *CDDABase = NULL; +Device *TimerBase = NULL; + +OSystem_MorphOS *TheSystem = NULL; + +OSystem *OSystem_MorphOS_create(int game_id, int gfx_mode, bool full_screen) +{ + if (TheSystem) + delete TheSystem; + + SCALERTYPE gfx_scaler = ST_NONE; + switch (gfx_mode) + { + case GFX_DOUBLESIZE: + gfx_scaler = ST_POINT; + break; + + case GFX_SUPEREAGLE: + gfx_scaler = ST_SUPEREAGLE; + break; + + case GFX_SUPER2XSAI: + gfx_scaler = ST_SUPER2XSAI; + break; + } + + TheSystem = OSystem_MorphOS::create(game_id, gfx_scaler, full_screen); + return TheSystem; +} + +void close_resources() +{ + if (TheSystem) + delete TheSystem; + + if (g_scumm) + delete g_scumm; + + if (ScummPath) + FreeVec(ScummPath); + + if (ScummStory) + FreeVec(ScummStory); + + if (ScummArgs) + FreeArgs(ScummArgs); + + if (OrigDirLock) + CurrentDir(OrigDirLock); + + if (CDDABase) + CloseLibrary(CDDABase); +} + +static STRPTR FindMusicDriver(STRPTR argval) +{ + if (!stricmp(argval, "off")) return "-enull"; + if (!stricmp(argval, "midi")) return "-eamidi"; + if (!stricmp(argval, "midiemu")) return "-emidiemu"; + if (!stricmp(argval, "adlib")) return "-eadlib"; + + error("No such music driver supported. Possible values are off, Midi, MidiEmu and Adlib."); + return NULL; +} + +static void ReadToolTypes(WBArg *OfFile) +{ + DiskObject *dobj; + char *ToolValue; + char IconPath[256]; + + NameFromLock(OfFile->wa_Lock, IconPath, 256); + AddPart(IconPath, OfFile->wa_Name, 256); + + dobj = GetDiskObject(IconPath); + if (dobj == NULL) + return; + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "STORY")) + { + if (ScummStory) + FreeVec(ScummStory); + ScummStory = (char *) AllocVec(strlen(ToolValue)+1, MEMF_PUBLIC); + strcpy(ScummStory, ToolValue); + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "DATAPATH")) + { + if (ScummPath) + FreeVec(ScummPath); + ScummPath = (char *) AllocVec(strlen(ToolValue)+4, MEMF_PUBLIC); + strcpy(ScummPath, "-p"); + strcat(ScummPath, ToolValue); + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "WBWINDOW")) + { + if (MatchToolValue(ToolValue, "YES")) + args[USG_WBWINDOW] = TRUE; + else if (MatchToolValue(ToolValue, "NO")) + args[USG_WBWINDOW] = FALSE; + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SCALER")) + { + if ((ScummGfxScaler = MorphOSScaler::FindByName(ToolValue)) == ST_INVALID) + { + FreeDiskObject(dobj); + exit(1); + } + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSIC")) + { + if (!(ScummMusicDriver = FindMusicDriver(ToolValue))) + { + FreeDiskObject(dobj); + exit(1); + } + args[USG_MUSIC] = (ULONG) &ScummMusicDriver; + } + + if( ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MIDIUNIT")) + ScummMidiUnit = atoi(ToolValue); + + if( ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSICVOL")) + { + int vol = atoi(ToolValue); + if (vol >= 0 && vol <= 100) + { + ScummMidiVolume = vol; + args[USG_MUSICVOL] = (ULONG) &ScummMidiVolume; + } + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SFXVOL")) + { + int vol = atoi(ToolValue); + if (vol >= 0 && vol <= 255) + { + ScummSfxVolume = vol; + args[USG_SFXVOL] = (ULONG) &ScummSfxVolume; + } + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TEMPO")) + { + ScummMidiTempo = atoi(ToolValue); + args[USG_TEMPO] = (ULONG) &ScummMidiTempo; + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TALKSPEED")) + { + ScummTalkSpeed = atoi(ToolValue); + args[USG_TALKSPEED] = (ULONG) &ScummMidiTempo; + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SUBTITLES")) + { + if (MatchToolValue(ToolValue, "YES")) + args[USG_NOSUBTITLES] = FALSE; + else if (MatchToolValue(ToolValue, "NO")) + args[USG_NOSUBTITLES] = TRUE; + } + + if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "AMIGA")) + { + if (MatchToolValue(ToolValue, "YES")) + args[USG_AMIGA] = FALSE; + else if (MatchToolValue(ToolValue, "NO")) + args[USG_AMIGA] = TRUE; + } + + FreeDiskObject(dobj); +} + +#undef main + +int main() +{ + int delta; + int last_time, new_time; + char *argv[20]; + char musicvol[6], sfxvol[6], talkspeed[12], tempo[12], scaler[14]; + int argc = 0; + + InitSemaphore(&ScummSoundThreadRunning); + InitSemaphore(&ScummMusicThreadRunning); + + g_scumm = NULL; + atexit(&close_resources); + + if (_WBenchMsg == NULL) + { + /* Parse the command line here */ + ScummArgs = ReadArgs(usageTemplate, args, NULL); + if (ScummArgs == NULL) + { + puts("Error in command line - type \"ScummVM ?\" for usage."); + exit(1); + } + + if (args[USG_STORY]) + { + ScummStory = (char *) AllocVec(strlen((char *) args[USG_STORY])+1, MEMF_PUBLIC); + strcpy(ScummStory, (char *) args[USG_STORY]); + } + + if (args[USG_DATAPATH]) + { + ScummPath = (char *) AllocVec(strlen((char *) args[USG_DATAPATH])+4, MEMF_PUBLIC); + strcpy(ScummPath, "-p"); + strcat(ScummPath, (char *) args[USG_DATAPATH]); + } + + if (args[USG_SCALER]) + { + if ((ScummGfxScaler = MorphOSScaler::FindByName((char *) args[USG_SCALER])) == ST_INVALID) + exit(1); + } + + if (args[USG_MUSIC]) + { + if (!(ScummMusicDriver = FindMusicDriver((char *) args[USG_MUSIC]))) + exit(1); + } + + if (args[USG_MIDIUNIT]) + ScummMidiUnit = *((LONG *) args[USG_MIDIUNIT]); + + if (args[USG_TEMPO]) + ScummMidiTempo = *((LONG *) args[USG_TEMPO]); + + if (args[USG_MUSICVOL]) + ScummMidiVolume = *((LONG *) args[USG_MUSICVOL]); + + if (args[USG_SFXVOL]) + ScummSfxVolume = *((LONG *) args[USG_SFXVOL]); + + if (args[USG_TALKSPEED]) + ScummTalkSpeed = *((LONG *) args[USG_TALKSPEED]); + } + else + { + /* We've been started from Workbench */ + ReadToolTypes(&_WBenchMsg->sm_ArgList[0]); + if (_WBenchMsg->sm_NumArgs > 1) + { + ReadToolTypes(&_WBenchMsg->sm_ArgList[1]); + OrigDirLock = CurrentDir(_WBenchMsg->sm_ArgList[1].wa_Lock); + } + } + + if (ScummPath) + { + char c = ScummPath[strlen(ScummPath)-1]; + if (c != '/' && c != ':') + strcat(ScummPath, "/"); + } + + argv[argc++] = "ScummVM"; + if (ScummPath) argv[argc++] = ScummPath; + if (!args[ USG_WBWINDOW ]) argv[argc++] = "-f"; + if (args[ USG_NOSUBTITLES ]) argv[argc++] = "-n"; + if (args[ USG_AMIGA ]) argv[argc++] = "-a"; + if (args[ USG_MUSIC ]) argv[argc++] = ScummMusicDriver; + if (ScummGfxScaler != ST_INVALID) + { + sprintf(scaler, "-g%s", MorphOSScaler::GetParamName(ScummGfxScaler)); + argv[argc++] = scaler; + } + else + argv[argc++] = "-gsuper2xsai"; + if (args[USG_MUSICVOL] && ScummMidiVolume >= 0 && ScummMidiVolume <= 100) + { + sprintf(musicvol, "-m%d", ScummMidiVolume); + argv[argc++] = musicvol; + } + if (args[USG_SFXVOL] && ScummSfxVolume >= 0 && ScummSfxVolume <= 255) + { + sprintf(sfxvol, "-s%d", ScummSfxVolume); + argv[argc++] = sfxvol; + } + if (args[USG_TEMPO] && ScummMidiTempo > 0) + { + sprintf(tempo, "-t%lx", ScummMidiTempo); + argv[argc++] = tempo; + } + if (args[USG_TALKSPEED] && ScummTalkSpeed >= 0 && ScummTalkSpeed <= 255) + { + sprintf(talkspeed, "-y%d", ScummTalkSpeed); + argv[argc++] = talkspeed; + } + argv[argc++] = ScummStory; + + return morphos_main(argc, argv); +} + diff --git a/backends/morphos/morphos_timer.cpp b/backends/morphos/morphos_timer.cpp new file mode 100644 index 0000000000..d106b9a1a9 --- /dev/null +++ b/backends/morphos/morphos_timer.cpp @@ -0,0 +1,243 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "morphos.h" +#include "timer.h" + +static TagItem TimerServiceTags[] = { { NP_Entry, 0 }, + { NP_Name, (ULONG)"ScummVM Timer Service" }, + { NP_Priority, 20 }, + { TAG_DONE, 0 } + }; + +Timer::Timer(Scumm * system) +{ + static EmulFunc ThreadEmulFunc; + + InitSemaphore(&TimerServiceSemaphore); + + ThreadEmulFunc.Trap = TRAP_FUNC; + ThreadEmulFunc.Address = (ULONG) &TimerService; + ThreadEmulFunc.StackSize = 16000; + ThreadEmulFunc.Extension = 0; + ThreadEmulFunc.Arg1 = (ULONG) this; + TimerServiceTags[0].ti_Data = (ULONG) &ThreadEmulFunc; + TimerServiceThread = CreateNewProc(TimerServiceTags); +} + +Timer::~Timer() +{ + if (TimerServiceThread) + { + Signal((Task *) TimerServiceThread, SIGBREAKF_CTRL_C); + ObtainSemaphore(&TimerServiceSemaphore); + ReleaseSemaphore(&TimerServiceSemaphore); + } +} + +bool Timer::init() +{ + return TimerServiceThread != NULL; +} + +void Timer::release() +{ +} + +bool Timer::installProcedure(int ((*procedure)(int)), int32 interval) +{ + return SendMsg(TSM_MSGID_ADDTIMER, procedure, interval); +} + +void Timer::releaseProcedure(int ((*procedure)(int))) +{ + SendMsg(TSM_MSGID_REMTIMER, procedure, 0); +} + +bool Timer::SendMsg(ULONG msg_id, int ((*procedure)(int)), LONG interval) +{ + if (TimerServiceThread == NULL) + return false; + + TimerServiceMessage *tmsg = (TimerServiceMessage *) AllocVec(sizeof (TimerServiceMessage), MEMF_PUBLIC | MEMF_CLEAR); + if (tmsg == NULL) + return false; + + MsgPort *reply_port = CreateMsgPort(); + if (reply_port == NULL) + { + FreeVec(tmsg); + return false; + } + + tmsg->tsm_Message.mn_Node.ln_Type = NT_MESSAGE; + tmsg->tsm_Message.mn_ReplyPort = reply_port; + tmsg->tsm_Message.mn_Length = sizeof (TimerServiceMessage); + tmsg->tsm_MsgID = msg_id; + tmsg->tsm_Callback = procedure; + tmsg->tsm_Interval = interval; + PutMsg(&TimerServiceThread->pr_MsgPort, tmsg); + WaitPort(reply_port); + GetMsg(reply_port); + + FreeVec(tmsg); + DeleteMsgPort(reply_port); + + return true; +} + +void Timer::TimerService(Timer *this_ptr) +{ + MsgPort *port = &((Process *) FindTask(NULL))->pr_MsgPort; + ULONG port_bit = 1 << port->mp_SigBit; + ULONG signal_mask = SIGBREAKF_CTRL_C | port_bit; + ULONG timer_bits = 0, signals; + ULONG interval, t; + timeval start_callback, end_callback; + + ULONG timers = 0; + TimerSlot timer_slots[MAX_TIMERS]; + + ObtainSemaphore(&this_ptr->TimerServiceSemaphore); + + for (;;) + { + signals = Wait(signal_mask); + + GetSysTime(&start_callback); + + if (signals & port_bit) + { + TimerServiceMessage *tmsg; + + while (tmsg = (TimerServiceMessage *) GetMsg(port)) + { + if (tmsg->tsm_Message.mn_Length == sizeof (TimerServiceMessage)) + { + switch (tmsg->tsm_MsgID) + { + case TSM_MSGID_ADDTIMER: + if (timers < MAX_TIMERS) + { + ULONG unit = UNIT_MICROHZ; + + if (tmsg->tsm_Interval > 1000) + unit = UNIT_VBLANK; + if (OSystem_MorphOS::OpenATimer(&timer_slots[timers].ts_Port, (IORequest **) &timer_slots[timers].ts_IORequest, unit)) + { + timer_slots[timers].ts_Callback = tmsg->tsm_Callback; + timer_slots[timers].ts_Interval = tmsg->tsm_Interval; + timer_slots[timers].ts_SignalBit = 1 << timer_slots[timers].ts_Port->mp_SigBit; + + signal_mask |= timer_slots[timers].ts_SignalBit; + timer_bits |= timer_slots[timers].ts_SignalBit; + + timerequest *req = timer_slots[timers].ts_IORequest; + interval = timer_slots[timers].ts_Interval; + req->tr_node.io_Command = TR_ADDREQUEST; + req->tr_time.tv_secs = interval/1000; + req->tr_time.tv_micro = (interval%1000)*1000; + SendIO(req); + + timers++; + } + } + break; + + case TSM_MSGID_REMTIMER: + { + for (t = 0; t < timers; t++) + { + if (timer_slots[t].ts_Callback == tmsg->tsm_Callback) + { + AbortIO((IORequest *) timer_slots[t].ts_IORequest); + WaitIO((IORequest *) timer_slots[t].ts_IORequest); + signal_mask &= ~timer_slots[t].ts_SignalBit; + timer_bits &= ~timer_slots[t].ts_SignalBit; + DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); + DeleteMsgPort(timer_slots[t].ts_Port); + if (t < timers-1) + memmove(&timer_slots[t], &timer_slots[t+1], sizeof (TimerSlot)*(timers-t-1)); + timers--; + continue; + } + } + break; + } + + default: + warning("MorphOS TimerService received message of unknown type."); + } + } + + ReplyMsg((Message *) tmsg); + } + } + + if (signals & SIGBREAKF_CTRL_C) + break; + + if (signals & timer_bits) + { + for (t = 0; t < timers; t++) + { + if (signals & timer_slots[t].ts_SignalBit) + { + timerequest *req = timer_slots[t].ts_IORequest; + WaitIO((IORequest *) req); + interval = timer_slots[t].ts_Interval; + (*timer_slots[t].ts_Callback)(interval); + GetSysTime(&end_callback); + SubTime(&end_callback, &start_callback); + interval -= end_callback.tv_sec*1000+end_callback.tv_micro/1000+40; + + req->tr_node.io_Command = TR_ADDREQUEST; + req->tr_time.tv_secs = interval/1000; + req->tr_time.tv_micro = (interval%1000)*1000; + SendIO(req); + } + } + } + } + + for (t = 0; t < timers; t++) + { + AbortIO((IORequest *) timer_slots[t].ts_IORequest); + WaitIO((IORequest *) timer_slots[t].ts_IORequest); + DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); + DeleteMsgPort(timer_slots[t].ts_Port); + } + + ReleaseSemaphore(&this_ptr->TimerServiceSemaphore); + RemTask(NULL); +} + diff --git a/backends/morphos/morphos_timer.h b/backends/morphos/morphos_timer.h new file mode 100644 index 0000000000..1593b29a5c --- /dev/null +++ b/backends/morphos/morphos_timer.h @@ -0,0 +1,86 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef MORPHOS_TIMER_H +#define MORPHOS_TIMER_H + +#ifndef TIMER_H +#include "timer.h" // for MAX_TIMER +#endif + +#ifndef EXEC_PORTS_H +#include +#endif + +#ifndef EXEC_IO_H +#include +#endif + +#ifndef EXEC_SEMAPHORES_H +#include +#endif + +#ifndef DOS_DOSEXTENS_H +#include +#endif + +class OSystem; + +#define TSM_MSGID_ADDTIMER 0 +#define TSM_MSGID_REMTIMER 1 + +struct TimerServiceMessage +{ + Message tsm_Message; + ULONG tsm_MsgID; + int ((*tsm_Callback)(int)); + LONG tsm_Interval; +}; + +class Timer +{ + public: + Timer(Scumm * system); + ~Timer(); + + bool init(); + void release(); + bool installProcedure(int ((*procedure)(int)), int32 interval); + void releaseProcedure(int ((*procedure)(int))); + + protected: + bool SendMsg(ULONG MsgID, int ((*procedure)(int)), LONG interval); + static void TimerService(Timer *); + + Process *TimerServiceThread; + SignalSemaphore TimerServiceSemaphore; + + struct TimerSlot + { + MsgPort *ts_Port; + timerequest *ts_IORequest; + ULONG ts_SignalBit; + int ((*ts_Callback)(int)); + LONG ts_Interval; + }; +}; + +#endif + diff --git a/backends/sdl/fb2opengl.h b/backends/sdl/fb2opengl.h new file mode 100644 index 0000000000..39ab98ddc5 --- /dev/null +++ b/backends/sdl/fb2opengl.h @@ -0,0 +1,355 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +// FrameBuffer renderer in an OpenGL texture +// Andre Souza + +#include +#include +#include +#include + +// FLAGS +#define FB2GL_FS 1 // FULLSCREEN +#define FB2GL_RGBA 2 // Use RGBA (else use palette) +#define FB2GL_320 4 // 320x256 texture (else use 256x256) +#define FB2GL_AUDIO 8 // Activate SDL Audio +#define FB2GL_PITCH 16 // On fb2l_update, use pitch (else bytes per pixel) +#define FB2GL_EXPAND 32 // Create a RGB fb with the color lookup table + +// This extension isn't defined in OpenGL 1.1 +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#endif + +class FB2GL { + private: + // Framebuffer for 8 bpp + unsigned char ogl_fb[256][256]; + unsigned char ogl_fbb[256][64]; + // Framebuffer for RGBA */ + unsigned char ogl_fb1[256][256][4]; + unsigned char ogl_fb2[256][64][4]; + // Texture(s) + GLuint texture; + GLuint textureb; + // Display list + GLuint dlist; + // Color Table (256 colors, RGB) + char ogl_ctable[256][3]; + char ogl_temp_ctable[256][3]; // Support for OpenGL 1.1 + char flags; + void maketex(); + void makedlist(int xf, int yf); + void display(); + + public: + SDL_Surface *screen; + FB2GL() { + flags=0; + screen=NULL; + } + int init(int width, int height, int xfix, int yfix, char _flags); + void update(void *fb, int width, int height, int pitch, int xskip, int yskip); + void palette(int index, int r, int g, int b); + void setPalette(int first, int ncolors); +}; + +void FB2GL::maketex() +{ + glGenTextures(0,&texture); + glBindTexture(GL_TEXTURE_2D,texture); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + // Bilinear filtering + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +/* + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +*/ + + if (flags & FB2GL_RGBA) { + glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,256,256,0,GL_RGBA, GL_UNSIGNED_BYTE, ogl_fb1); + } + else { + glTexImage2D(GL_TEXTURE_2D,0,GL_COLOR_INDEX,256,256,0,GL_COLOR_INDEX, GL_UNSIGNED_BYTE, ogl_fb); + } + + if (flags & FB2GL_320) { + glGenTextures(1,&textureb); + glBindTexture(GL_TEXTURE_2D,textureb); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + // Bilinear filtering + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +/* + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +*/ + + if (flags & FB2GL_RGBA) { + glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,64,256,0,GL_RGBA, + GL_UNSIGNED_BYTE, ogl_fb2); + } + else { + glTexImage2D(GL_TEXTURE_2D,0,GL_COLOR_INDEX,64,256,0,GL_COLOR_INDEX, + GL_UNSIGNED_BYTE, ogl_fbb); + } + } + +} + +void FB2GL::makedlist(int xf, int yf) +{ + double xfix=(double)xf/128; // 128 = 256/2 (half texture => 0.0 to 1.0) + double yfix=(double)yf/128; + // End of 256x256 (from -1.0 to 1.0) + double texend = (double)96/160; // 160=320/2 (== 0.0), 256-160=96. + + dlist=glGenLists(1); + glNewList(dlist,GL_COMPILE); + + glEnable(GL_TEXTURE_2D); + + glBindTexture(GL_TEXTURE_2D, texture); + + if (!(flags & FB2GL_320)) { // Normal 256x256 + glBegin(GL_QUADS); + glTexCoord2f(0.0,1.0); glVertex2f(-1.0,-1.0-yfix); // upper left + glTexCoord2f(0.0,0.0); glVertex2f(-1.0,1.0); // lower left + glTexCoord2f(1.0,0.0); glVertex2f(1.0+xfix,1.0); // lower right + glTexCoord2f(1.0,1.0); glVertex2f(1.0+xfix,-1.0-yfix); // upper right + glEnd(); + } + else { // 320x256 + + // First, the 256x256 texture + glBegin(GL_QUADS); + glTexCoord2f(0.0,1.0); glVertex2f(-1.0,-1.0-yfix); // upper left + glTexCoord2f(0.0,0.0); glVertex2f(-1.0,1.0); // lower left + glTexCoord2f(1.0,0.0); glVertex2f(texend+xfix,1.0); // lower right + glTexCoord2f(1.0,1.0); glVertex2f(texend+xfix,-1.0-yfix); // upper right + glEnd(); + + // 64x256 + glBindTexture(GL_TEXTURE_2D, textureb); + + glBegin(GL_QUADS); + glTexCoord2f(0.0,1.0); glVertex2f(texend+xfix,-1.0-yfix); // upper left + glTexCoord2f(0.0,0.0); glVertex2f(texend+xfix,1.0); // lower left + glTexCoord2f(1.0,0.0); glVertex2f(1.0+xfix,1.0); // lower right + glTexCoord2f(1.0,1.0); glVertex2f(1.0+xfix,-1.0-yfix); // upper right + glEnd(); + } + + glDisable(GL_TEXTURE_2D); + + glEndList(); +} + +int FB2GL::init(int width, int height, int xfix, int yfix, char _flags) +{ + char gl_ext[4096]; + gl_ext[0]='\0'; + + flags = _flags; + + // Fullscreen? + if ((flags & FB2GL_FS) && !screen) { + screen = SDL_SetVideoMode(width, height, 0, SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_FULLSCREEN); + } + else if (!screen) { + screen = SDL_SetVideoMode(width, height, 0, SDL_HWPALETTE | SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER); + } + + if (!screen) { + fprintf(stderr, "Couldn't start video res %dx%d\n", width, height); + return 0; + } + + + if (!(flags & FB2GL_RGBA)) { // Check for Paletted Texture Extension + + strcpy(gl_ext, (char *)glGetString(GL_EXTENSIONS)); + fprintf(stderr,"gl_ext= %s\n",gl_ext); + + if ( strstr( gl_ext , "GL_EXT_paletted_texture") ) + glEnable(GL_EXT_paletted_texture); + else { + fprintf(stderr,"Your OpenGL version doesn't support paletted texture\n"); + return 0; + } + } + + maketex(); + makedlist(xfix, yfix); + + return 1; +} + +void FB2GL::display() +{ + glCallList(dlist); + SDL_GL_SwapBuffers(); +} + +void FB2GL::update(void *fb, int w, int h, int pitch, int xskip, int yskip) { + unsigned char *fb1=(unsigned char *)fb; + int x,y,scr_pitch,byte=0; + + if (flags & FB2GL_PITCH) scr_pitch=pitch; + else { + scr_pitch=w*pitch; + byte = pitch; // Bytes perl pixel (for RGBA mode) + } + + if (flags & FB2GL_RGBA) { + + if (flags & FB2GL_EXPAND) { // Expand the 8 bit fb into a RGB fb + + for (y=yskip; y +#include + + +class OSystem_SDL : public OSystem { +public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + // Add a callback timer + void set_timer(int timer, int (*callback)(int)); + + // Mutex handling + void *create_mutex(void); + void lock_mutex(void *mutex); + void unlock_mutex(void *mutex); + void delete_mutex(void *mutex); + + static OSystem *create(int gfx_mode, bool full_screen); + +private: + typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height); + + SDL_Surface *sdl_screen; // unseen game screen + SDL_Surface *sdl_hwscreen; // hardware screen + SDL_Surface *sdl_tmpscreen; // temporary screen (for 2xsai) + SDL_CD *cdrom; + + enum { + DF_WANT_RECT_OPTIM = 1 << 0, + DF_REAL_8BIT = 1 << 1, + DF_SEPARATE_TEMPSCREEN = 1 << 2, + DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 + }; + + int _mode; + bool _full_screen; + bool _mouse_visible; + bool _mouse_drawn; + uint32 _mode_flags; + + bool force_full; //Force full redraw on next update_screen + bool cksum_valid; + + enum { + NUM_DIRTY_RECT = 100, + + MAX_MOUSE_W = 40, + MAX_MOUSE_H = 40, + MAX_SCALING = 3 + }; + + int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; + SDL_Rect *dirty_rect_list; + int num_dirty_rects; + uint32 *dirty_checksums; + + int scaling; + + /* CD Audio */ + int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; + Uint32 cd_end_time, cd_stop_time, cd_next_second; + + /* Keyboard mouse emulation */ + struct KbdMouse { + int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count; + uint32 last_time, delay_time, x_down_time, y_down_time; + } km; + + struct MousePos { + int16 x, y, w, h; + }; + + byte *_mouse_data; + byte *_mouse_backup; + MousePos _mouse_cur_state; + MousePos _mouse_old_state; + int16 _mouse_hotspot_x; + int16 _mouse_hotspot_y; + int _current_shake_pos; + int _new_shake_pos; + TwoXSaiProc *_sai_func; + SDL_Color *_cur_pal; + + uint _palette_changed_first, _palette_changed_last; + + OSystem_SDL() : _current_shake_pos(0), _new_shake_pos(0) {} + + void add_dirty_rgn_auto(const byte *buf); + void mk_checksums(const byte *buf); + + static void fill_sound(void *userdata, Uint8 * stream, int len); + + void add_dirty_rect(int x, int y, int w, int h); + + void draw_mouse(); + void undraw_mouse(); + + void load_gfx_mode(); + void unload_gfx_mode(); + + void hotswap_gfx_mode(); + + void get_320x200_image(byte *buf); + + void setup_icon(); + void kbd_mouse(); +}; + +void atexit_proc() { + SDL_ShowCursor(SDL_ENABLE); + + SDL_QuitSubSystem(SDL_INIT_VIDEO); + SDL_QuitSubSystem(SDL_INIT_TIMER); + SDL_QuitSubSystem(SDL_INIT_CDROM); +#ifndef WIN32 // FIXME: SDL bug - closing audio freezes w/ waveout + SDL_QuitSubSystem(SDL_INIT_AUDIO); +#endif +} + +OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) { + OSystem_SDL *syst = new OSystem_SDL(); + syst->_mode = gfx_mode; + syst->_full_screen = full_screen; + + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) ==-1) { + error("Could not initialize SDL: %s.\n", SDL_GetError()); + } + +#ifdef WIN32 /* Use waveout on win32, not */ + SDL_AudioInit("waveout"); /* dsound - unfortunatly dsound */ +#endif /* doesn't do COOPERATIVE mode*/ + + SDL_ShowCursor(SDL_DISABLE); + + /* Setup the icon */ + syst->setup_icon(); + + /* Clean up on exit */ + atexit(atexit_proc); + + return syst; +} + +void OSystem_SDL::set_timer(int timer, int (*callback)(int)) { + SDL_SetTimer(timer, (SDL_TimerCallback) callback); +} +OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) { + return OSystem_SDL::create(gfx_mode, full_screen); +} + +void OSystem_SDL::set_palette(const byte *colors, uint start, uint num) { + const byte *b = colors; + uint i; + SDL_Color *base = _cur_pal + start; + for(i=0;i!=num;i++) { + base[i].r = b[0]; + base[i].g = b[1]; + base[i].b = b[2]; + b += 4; + } + + if (start < _palette_changed_first) + _palette_changed_first = start; + + if (start + num > _palette_changed_last) + _palette_changed_last = start + num; +} + +void OSystem_SDL::load_gfx_mode() { + force_full = true; + scaling = 1; + _mode_flags = 0; + + _sai_func = NULL; + sdl_tmpscreen = NULL; + + switch(_mode) { + case GFX_2XSAI: + scaling = 2; + _sai_func = _2xSaI; + break; + case GFX_SUPER2XSAI: + scaling = 2; + _sai_func = Super2xSaI; + break; + case GFX_SUPEREAGLE: + scaling = 2; + _sai_func = SuperEagle; + break; + case GFX_ADVMAME2X: + scaling = 2; + _sai_func = AdvMame2x; + break; + + case GFX_DOUBLESIZE: + scaling = 2; + break; + + case GFX_TRIPLESIZE: + if (_full_screen) { + warning("full screen in useless in triplesize mode, reverting to normal mode"); + goto normal_mode; + } + scaling = 3; + break; + + case GFX_NORMAL: +normal_mode:; + scaling = 1; + break; + } + + sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 8, 0, 0, 0, 0); + if (sdl_screen == NULL) + error("sdl_screen failed failed"); + + if (_sai_func) { + uint16 *tmp_screen = (uint16*)calloc((SCREEN_WIDTH+3)*(SCREEN_HEIGHT+3),sizeof(uint16)); + _mode_flags = DF_WANT_RECT_OPTIM | DF_SEPARATE_TEMPSCREEN | DF_UPDATE_EXPAND_1_PIXEL; + + sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 16, + _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE + ); + if (sdl_hwscreen == NULL) + error("sdl_hwscreen failed"); + + /* Need some extra bytes around when using 2XSAI */ + if (sdl_hwscreen->format->Rmask == 0x7C00) // HACK HACK HACK + Init_2xSaI(555); + else + Init_2xSaI(565); + sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen, + SCREEN_WIDTH + 3, SCREEN_HEIGHT + 3, 16, (SCREEN_WIDTH + 3)*2, + sdl_hwscreen->format->Rmask, + sdl_hwscreen->format->Gmask, + sdl_hwscreen->format->Bmask, + sdl_hwscreen->format->Amask); + + if (sdl_tmpscreen == NULL) + error("sdl_tmpscreen failed"); + + } else { + switch(scaling) { + case 3: + _sai_func = Normal3x; + break; + case 2: + _sai_func = Normal2x; + break; + case 1: + _sai_func = Normal1x; + break; + } + + _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; + + sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 8, + _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE + ); + if (sdl_hwscreen == NULL) + error("sdl_hwscreen failed"); + + sdl_tmpscreen = sdl_screen; + } + + // keyboard cursor control, some other better place for it? + km.x_max = SCREEN_WIDTH * scaling - 1; + km.y_max = SCREEN_HEIGHT * scaling - 1; + km.delay_time = 25; + km.last_time = 0; + +} + +void OSystem_SDL::unload_gfx_mode() { + SDL_FreeSurface(sdl_screen); + sdl_screen = NULL; + + SDL_FreeSurface(sdl_hwscreen); + sdl_hwscreen = NULL; + + if (_mode_flags & DF_SEPARATE_TEMPSCREEN) { + free((uint16*)sdl_tmpscreen->pixels); + SDL_FreeSurface(sdl_tmpscreen); + } + sdl_tmpscreen = NULL; +} + +void OSystem_SDL::init_size(uint w, uint h) { + //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) + // error("320x200 is the only game resolution supported"); + + SCREEN_WIDTH = w; + SCREEN_HEIGHT = h; + CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)); + /* allocate palette, it needs to be persistent across + * driver changes, so i'll alloc it here */ + _cur_pal = (SDL_Color*)calloc(sizeof(SDL_Color), 256); + + dirty_rect_list = (SDL_Rect*)calloc(NUM_DIRTY_RECT, sizeof(SDL_Rect)); + _mouse_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); + dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); + + load_gfx_mode(); +} + +void OSystem_SDL::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { + if (sdl_screen == NULL) + return; + + if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { + /* Special, optimized case for full screen updates. + * It tries to determine what areas were actually changed, + * and just updates those, on the actual display. */ + add_dirty_rgn_auto(buf); + } else { + /* Clip the coordinates */ + if (x < 0) { w+=x; buf-=x; x = 0; } + if (y < 0) { h+=y; buf-=y*pitch; y = 0; } + if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } + if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } + + if (w <= 0 || h <= 0) + return; + + cksum_valid = false; + add_dirty_rect(x, y, w, h); + } + + /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ + if (_mouse_drawn) + undraw_mouse(); + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + byte *dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; + do { + memcpy(dst, buf, w); + dst += SCREEN_WIDTH; + buf += pitch; + } while (--h); + + SDL_UnlockSurface(sdl_screen); +} + + +void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) { + if (force_full) + return; + + if (num_dirty_rects == NUM_DIRTY_RECT) + force_full = true; + else { + SDL_Rect *r = &dirty_rect_list[num_dirty_rects++]; + + /* Update the dirty region by 1 pixel for graphics drivers + * that "smear" the screen */ + if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { + x--; + y--; + w+=2; + h+=2; + } + + /* clip */ + if (x < 0) { w+=x; x=0; } + if (y < 0) { h+=y; y=0; } + if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } + if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } + + r->x = x; + r->y = y; + r->w = w; + r->h = h; + } +} + +#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) +#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] +void OSystem_SDL::mk_checksums(const byte *buf) { + uint32 *sums = dirty_checksums; + uint x,y; + const uint last_x = (uint)SCREEN_WIDTH/8; + const uint last_y = (uint)SCREEN_HEIGHT/8; + + /* the 8x8 blocks in buf are enumerated starting in the top left corner and + * reading each line at a time from left to right */ + for(y=0; y != last_y; y++, buf+=SCREEN_WIDTH*(8-1)) + for(x=0; x != last_x; x++, buf+=8) { + uint32 a = x; + uint32 b = y; + + DOLINE(0); ROL(a,13); ROL(b,11); + DOLINE(2); ROL(a,13); ROL(b,11); + DOLINE(4); ROL(a,13); ROL(b,11); + DOLINE(6); ROL(a,13); ROL(b,11); + + a*=0xDEADBEEF; + b*=0xBAADF00D; + + DOLINE(1); ROL(a,13); ROL(b,11); + DOLINE(3); ROL(a,13); ROL(b,11); + DOLINE(5); ROL(a,13); ROL(b,11); + DOLINE(7); ROL(a,13); ROL(b,11); + + /* output the checksum for this block */ + *sums++=a+b; + } +} +#undef DOLINE +#undef ROL + + +void OSystem_SDL::add_dirty_rgn_auto(const byte *buf) { + assert( ((uint32)buf & 3) == 0); + + /* generate a table of the checksums */ + mk_checksums(buf); + + if (!cksum_valid) { + force_full = true; + cksum_valid = true; + } + + /* go through the checksum list, compare it with the previous checksums, + and add all dirty rectangles to a list. try to combine small rectangles + into bigger ones in a simple way */ + if (!force_full) { + int x,y,w; + uint32 *ck = dirty_checksums; + + for(y=0; y!=SCREEN_HEIGHT/8; y++) { + for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { + if (ck[0] != ck[CKSUM_NUM]) { + /* found a dirty 8x8 block, now go as far to the right as possible, + and at the same time, unmark the dirty status by setting old to new. */ + w=0; + do { + ck[w+CKSUM_NUM] = ck[w]; + w++; + } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); + + add_dirty_rect(x*8, y*8, w*8, 8); + + if (force_full) + goto get_out; + } + } + } + } else { + get_out:; + /* Copy old checksums to new */ + memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); + } +} + +void OSystem_SDL::update_screen() { + + if (sdl_hwscreen == NULL) + return; // Can this really happen? + + /* First make sure the mouse is drawn, if it should be drawn. */ + draw_mouse(); + + /* Palette update in case we are NOT in "real" 8 bit color mode. + * Must take place before updating the screen, since the palette must + * be set up for conversion from 8bit to 16bit. + */ + if (((_mode_flags & DF_REAL_8BIT) == 0) && _palette_changed_last != 0) { + SDL_SetColors(sdl_screen, _cur_pal + _palette_changed_first, + _palette_changed_first, + _palette_changed_last - _palette_changed_first); + + _palette_changed_last = 0; + + force_full = true; + } + + + /* If the shake position changed, fill the dirty area with blackness */ + if (_current_shake_pos != _new_shake_pos) { + SDL_Rect blackrect = {0, 0, SCREEN_WIDTH*scaling, _new_shake_pos*scaling}; + SDL_FillRect(sdl_hwscreen, &blackrect, 0); + + _current_shake_pos = _new_shake_pos; + + force_full = true; + } + + /* force a full redraw if requested */ + if (force_full) { + num_dirty_rects = 1; + + dirty_rect_list[0].x = 0; + dirty_rect_list[0].y = 0; + dirty_rect_list[0].w = SCREEN_WIDTH; + dirty_rect_list[0].h = SCREEN_HEIGHT; + } + + /* Only draw anything if necessary */ + if (num_dirty_rects > 0) { + + SDL_Rect *r; + uint32 srcPitch, dstPitch; + SDL_Rect *last_rect = dirty_rect_list + num_dirty_rects; + + /* Convert appropriate parts of the image into 16bpp */ + if ((_mode_flags & DF_REAL_8BIT) == 0) { + SDL_Rect dst; + for(r=dirty_rect_list; r!=last_rect; ++r) { + dst = *r; + dst.x++; + dst.y++; + if (SDL_BlitSurface(sdl_screen, r, sdl_tmpscreen, &dst) != 0) + error("SDL_BlitSurface failed: %s", SDL_GetError()); + } + } + + SDL_LockSurface(sdl_tmpscreen); + SDL_LockSurface(sdl_hwscreen); + + srcPitch = sdl_tmpscreen->pitch; + dstPitch = sdl_hwscreen->pitch; + + if ((_mode_flags & DF_REAL_8BIT) == 0) { + for(r=dirty_rect_list; r!=last_rect; ++r) { + register int dst_y = r->y + _current_shake_pos; + register int dst_h = 0; + if (dst_y < SCREEN_HEIGHT) { + dst_h = r->h; + if (dst_h > SCREEN_HEIGHT - dst_y) + dst_h = SCREEN_HEIGHT - dst_y; + + r->x <<= 1; + dst_y <<= 1; + + _sai_func((byte*)sdl_tmpscreen->pixels + (r->x+2) + (r->y+1)*srcPitch, srcPitch, NULL, + (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); + } + + r->y = dst_y; + r->w <<= 1; + r->h = dst_h << 1; + } + } else { + for(r=dirty_rect_list; r!=last_rect; ++r) { + register int dst_y = r->y + _current_shake_pos; + register int dst_h = 0; + if (dst_y < SCREEN_HEIGHT) { + dst_h = r->h; + if (dst_h > SCREEN_HEIGHT - dst_y) + dst_h = SCREEN_HEIGHT - dst_y; + + dst_y *= scaling; + + _sai_func((byte*)sdl_tmpscreen->pixels + r->x + r->y*srcPitch, srcPitch, NULL, + (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); + } + + r->x *= scaling; + r->y = dst_y; + r->w *= scaling; + r->h = dst_h * scaling; + } + } + + if (force_full) { + dirty_rect_list[0].y = 0; + dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; + } + + SDL_UnlockSurface(sdl_tmpscreen); + SDL_UnlockSurface(sdl_hwscreen); + } + + /* Palette update in case we are in "real" 8 bit color mode. + * Must take place after the screen data was updated, since with + * "real" 8bit mode, palatte changes may be visible immediatly, + * and we want to avoid any ugly effects. + */ + if (_mode_flags & DF_REAL_8BIT && _palette_changed_last != 0) { + SDL_SetColors(sdl_hwscreen, _cur_pal + _palette_changed_first, + _palette_changed_first, + _palette_changed_last - _palette_changed_first); + + _palette_changed_last = 0; + } + + if (num_dirty_rects > 0) { + /* Finally, blit all our changes to the screen */ + SDL_UpdateRects(sdl_hwscreen, num_dirty_rects, dirty_rect_list); + } + + num_dirty_rects = 0; + force_full = false; +} + +void OSystem_SDL::kbd_mouse() { + uint32 time = get_msecs(); + if (time >= km.last_time + km.delay_time) { + km.last_time = time; + if (km.x_down_count == 1) { + km.x_down_time = time; + km.x_down_count = 2; + } + if (km.y_down_count == 1) { + km.y_down_time = time; + km.y_down_count = 2; + } + + if (km.x_vel || km.y_vel) { + if (km.x_down_count) { + if (time > km.x_down_time + km.delay_time*12) { + if (km.x_vel > 0) + km.x_vel++; + else + km.x_vel--; + } else if (time > km.x_down_time + km.delay_time*8) { + if (km.x_vel > 0) + km.x_vel = 5; + else + km.x_vel = -5; + } + } + if (km.y_down_count) { + if (time > km.y_down_time + km.delay_time*12) { + if (km.y_vel > 0) + km.y_vel++; + else + km.y_vel--; + } else if (time > km.y_down_time + km.delay_time*8) { + if (km.y_vel > 0) + km.y_vel = 5; + else + km.y_vel = -5; + } + } + + km.x += km.x_vel; + km.y += km.y_vel; + + if (km.x < 0) { + km.x = 0; + km.x_vel = -1; + km.x_down_count = 1; + } else if (km.x > km.x_max) { + km.x = km.x_max; + km.x_vel = 1; + km.x_down_count = 1; + } + + if (km.y < 0) { + km.y = 0; + km.y_vel = -1; + km.y_down_count = 1; + } else if (km.y > km.y_max) { + km.y = km.y_max; + km.y_vel = 1; + km.y_down_count = 1; + } + + SDL_WarpMouse(km.x, km.y); + } + } +} + +bool OSystem_SDL::show_mouse(bool visible) { + if (_mouse_visible == visible) + return visible; + + bool last = _mouse_visible; + _mouse_visible = visible; + + if (visible) + draw_mouse(); + else + undraw_mouse(); + + return last; +} + +void OSystem_SDL::set_mouse_pos(int x, int y) { + if (x != _mouse_cur_state.x || y != _mouse_cur_state.y) { + _mouse_cur_state.x = x; + _mouse_cur_state.y = y; + undraw_mouse(); + } +} + +void OSystem_SDL::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { + _mouse_cur_state.w = w; + _mouse_cur_state.h = h; + + _mouse_hotspot_x = hotspot_x; + _mouse_hotspot_y = hotspot_y; + + _mouse_data = (byte*)buf; + + undraw_mouse(); +} + +void OSystem_SDL::set_shake_pos(int shake_pos) { + _new_shake_pos = shake_pos; +} + +uint32 OSystem_SDL::get_msecs() { + return SDL_GetTicks(); +} + +void OSystem_SDL::delay_msecs(uint msecs) { + SDL_Delay(msecs); +} + +void *OSystem_SDL::create_thread(ThreadProc *proc, void *param) { + return SDL_CreateThread(proc, param); +} + +int mapKey(int key, byte mod) +{ + if (key >= SDLK_F1 && key <= SDLK_F9) { + return key - SDLK_F1 + 315; + } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { + key &= ~0x20; + } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) + return 0; + return key; +} + +bool OSystem_SDL::poll_event(Event *event) { + SDL_Event ev; + kbd_mouse(); + + for(;;) { + if (!SDL_PollEvent(&ev)) + return false; + + switch(ev.type) { + case SDL_KEYDOWN: { + byte b = 0; + if (ev.key.keysym.mod & KMOD_SHIFT) b |= KBD_SHIFT; + if (ev.key.keysym.mod & KMOD_CTRL) b |= KBD_CTRL; + if (ev.key.keysym.mod & KMOD_ALT) b |= KBD_ALT; + event->kbd.flags = b; + + /* internal keypress? */ + if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { + property(PROP_TOGGLE_FULLSCREEN, NULL); + break; + } + + if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) { + quit(); + break; + } + if (b == (KBD_CTRL|KBD_ALT) && + (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { + Property prop; + prop.gfx_mode = ev.key.keysym.sym - '1'; + property(PROP_SET_GFX_MODE, &prop); + break; + } + #ifdef QTOPIA + // quit on fn+backspace on zaurus + if (ev.key.keysym.sym==127) { + quit(); + break; + } + // map menu key (f11) to f5 (scumm menu) + if (ev.key.keysym.sym==292) { + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = 286; + event->kbd.ascii = mapKey(286, ev.key.keysym.mod); + } + // map center (space) to tab (default action ) + // i wanted to map the calendar button but the calendar comes up + // + else if (ev.key.keysym.sym==32) { + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = 9; + event->kbd.ascii = mapKey(9, ev.key.keysym.mod); + } + // since we stole space (pause) above we'll rebind it to the tab key on the keyboard + else if (ev.key.keysym.sym==9) { + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = 32; + event->kbd.ascii = mapKey(32, ev.key.keysym.mod); + } + else { + // let the events fall through if we didn't change them, this may not be the best way to + // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though. + // and yes i have an huge terminal size so i dont wrap soon enough. + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + } + #endif + #ifndef QTOPIA + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + #endif + + switch(ev.key.keysym.sym) { + case SDLK_LEFT: + km.x_vel = -1; + km.x_down_count = 1; + break; + case SDLK_RIGHT: + km.x_vel = 1; + km.x_down_count = 1; + break; + case SDLK_UP: + km.y_vel = -1; + km.y_down_count = 1; + break; + case SDLK_DOWN: + km.y_vel = 1; + km.y_down_count = 1; + break; + default: + break; + } + + return true; + } + + case SDL_KEYUP: { + event->event_code = EVENT_KEYUP; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + + switch(ev.key.keysym.sym){ + case SDLK_LEFT: + if (km.x_vel < 0) { + km.x_vel = 0; + km.x_down_count = 0; + } + break; + case SDLK_RIGHT: + if (km.x_vel > 0) { + km.x_vel = 0; + km.x_down_count = 0; + } + break; + case SDLK_UP: + if (km.y_vel < 0) { + km.y_vel = 0; + km.y_down_count = 0; + } + break; + case SDLK_DOWN: + if (km.y_vel > 0) { + km.y_vel = 0; + km.y_down_count = 0; + } + break; + default: + break; + } + return true; + } + + case SDL_MOUSEMOTION: + event->event_code = EVENT_MOUSEMOVE; + km.x = event->mouse.x = ev.motion.x; + km.y = event->mouse.y = ev.motion.y; + + event->mouse.x /= scaling; + event->mouse.y /= scaling; + + return true; + + case SDL_MOUSEBUTTONDOWN: + if (ev.button.button == SDL_BUTTON_LEFT) + event->event_code = EVENT_LBUTTONDOWN; + else if (ev.button.button == SDL_BUTTON_RIGHT) + event->event_code = EVENT_RBUTTONDOWN; + else + break; + km.x = event->mouse.x = ev.motion.x; + km.y = event->mouse.y = ev.motion.y; + event->mouse.x /= scaling; + event->mouse.y /= scaling; + + return true; + + case SDL_MOUSEBUTTONUP: + if (ev.button.button == SDL_BUTTON_LEFT) + event->event_code = EVENT_LBUTTONUP; + else if (ev.button.button == SDL_BUTTON_RIGHT) + event->event_code = EVENT_RBUTTONUP; + else + break; + event->mouse.x = ev.button.x; + event->mouse.y = ev.button.y; + event->mouse.x /= scaling; + event->mouse.y /= scaling; + return true; + + case SDL_QUIT: + quit(); + } + } +} + +bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { + SDL_AudioSpec desired; + + /* only one format supported at the moment */ + + desired.freq = SAMPLES_PER_SEC; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = proc; + desired.userdata = param; + if (SDL_OpenAudio(&desired, NULL) != 0) { + return false; + } + SDL_PauseAudio(0); + return true; +} + + +/* retrieve the 320x200 bitmap currently being displayed */ +void OSystem_SDL::get_320x200_image(byte *buf) { + /* make sure the mouse is gone */ + undraw_mouse(); + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + memcpy(buf, sdl_screen->pixels, SCREEN_WIDTH*SCREEN_HEIGHT); + + SDL_UnlockSurface(sdl_screen); +} + +void OSystem_SDL::hotswap_gfx_mode() { + /* hmm, need to allocate a 320x200 bitmap + * which will contain the "backup" of the screen during the change. + * then draw that to the new screen right after it's setup. + */ + + byte *bak_mem = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT); + + get_320x200_image(bak_mem); + + unload_gfx_mode(); + load_gfx_mode(); + + force_full = true; + + /* reset palette */ + if (_mode_flags & DF_REAL_8BIT) + SDL_SetColors(sdl_hwscreen, _cur_pal, 0, 256); + else + SDL_SetColors(sdl_screen, _cur_pal, 0, 256); + + /* blit image */ + OSystem_SDL::copy_rect(bak_mem, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + free(bak_mem); + + OSystem_SDL::update_screen(); +} + +uint32 OSystem_SDL::property(int param, Property *value) { + switch(param) { + + case PROP_TOGGLE_FULLSCREEN: + _full_screen ^= true; + + if (!SDL_WM_ToggleFullScreen(sdl_hwscreen)) { + /* if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode */ + hotswap_gfx_mode(); + } + return 1; + + case PROP_GET_FULLSCREEN: + return _full_screen; + + case PROP_SET_WINDOW_CAPTION: + SDL_WM_SetCaption(value->caption, value->caption); + return 1; + + case PROP_OPEN_CD: + if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) + cdrom = NULL; + else { + cdrom = SDL_CDOpen(value->cd_num); + /* Did if open? Check if cdrom is NULL */ + if (!cdrom) { + warning("Couldn't open drive: %s\n", SDL_GetError()); + } + } + break; + + case PROP_SET_GFX_MODE: + if (value->gfx_mode >= 7) + return 0; + + _mode = value->gfx_mode; + hotswap_gfx_mode(); + + return 1; + + case PROP_SHOW_DEFAULT_CURSOR: + SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); + break; + + case PROP_GET_SAMPLE_RATE: + return SAMPLES_PER_SEC; + } + + return 0; +} + +void OSystem_SDL::quit() { + if(cdrom) { + SDL_CDStop(cdrom); + SDL_CDClose(cdrom); + } + unload_gfx_mode(); + exit(1); +} + +void OSystem_SDL::draw_mouse() { + if (_mouse_drawn || !_mouse_visible) + return; + + int x = _mouse_cur_state.x - _mouse_hotspot_x; + int y = _mouse_cur_state.y - _mouse_hotspot_y; + int w = _mouse_cur_state.w; + int h = _mouse_cur_state.h; + byte color; + byte *src = _mouse_data; // Image representing the mouse + byte *bak = _mouse_backup; // Surface used to backup the area obscured by the mouse + byte *dst; // Surface we are drawing into + + // clip the mouse rect, and addjust the src pointer accordingly + if (x < 0) { + w += x; + src -= x; + x = 0; + } + if (y < 0) { + h += y; + src -= y * _mouse_cur_state.w; + y = 0; + } + if (w > SCREEN_WIDTH - x) + w = SCREEN_WIDTH - x; + if (h > SCREEN_HEIGHT - y) + h = SCREEN_HEIGHT - y; + + // Store the bounding box so that undraw mouse can restore the area the + // mouse currently covers to its original content. + _mouse_old_state.x = x; + _mouse_old_state.y = y; + _mouse_old_state.w = w; + _mouse_old_state.h = h; + + // Quick check to see if anything has to be drawn at all + if (w <= 0 || h <= 0) + return; + + // Draw the mouse cursor; backup the covered area in "bak" + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + add_dirty_rect(x, y, w, h); + + dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; + while (h > 0) { + int width = w; + while (width > 0) { + *bak++ = *dst; + color = *src++; + if (color != 0xFF) // 0xFF = transparent, don't draw + *dst = color; + dst++; + width--; + } + src += _mouse_cur_state.w - w; + bak += MAX_MOUSE_W - w; + dst += SCREEN_WIDTH - w; + h--; + } + + SDL_UnlockSurface(sdl_screen); + + // Finally, set the flag to indicate the mouse has been drawn + _mouse_drawn = true; +} + +void OSystem_SDL::undraw_mouse() { + if (!_mouse_drawn) + return; + _mouse_drawn = false; + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + byte *dst, *bak = _mouse_backup; + const int old_mouse_x = _mouse_old_state.x; + const int old_mouse_y = _mouse_old_state.y; + const int old_mouse_w = _mouse_old_state.w; + const int old_mouse_h = _mouse_old_state.h; + int x,y; + + // No need to do clipping here, since draw_mouse() did that already + + dst = (byte *)sdl_screen->pixels + old_mouse_y * SCREEN_WIDTH + old_mouse_x; + for (y = 0; y < old_mouse_h; ++y, bak += MAX_MOUSE_W, dst += SCREEN_WIDTH) { + for (x = 0; x < old_mouse_w; ++x) { + dst[x] = bak[x]; + } + } + + add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); + + SDL_UnlockSurface(sdl_screen); +} + +void OSystem_SDL::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */ + cd_stop_time = SDL_GetTicks() + 100; + cd_num_loops = 0; + +} + +void OSystem_SDL::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { + if (!num_loops && !start_frame) + return; + + if (!cdrom) + return; + + if (end_frame > 0) + end_frame+=5; + + cd_track = track; + cd_num_loops = num_loops; + cd_start_frame = start_frame; + + SDL_CDStatus(cdrom); + SDL_CDPlayTracks(cdrom, track, start_frame, 0, end_frame); + cd_end_frame = end_frame; + cd_stop_time = 0; + cd_end_time = SDL_GetTicks() + cdrom->track[track].length * 1000 / CD_FPS; +} + +bool OSystem_SDL::poll_cdrom() { + if (!cdrom) + return false; + + return (cd_num_loops != 0 && (SDL_GetTicks() < cd_end_time || SDL_CDStatus(cdrom) != CD_STOPPED)); +} + +void OSystem_SDL::update_cdrom() { + if (!cdrom) + return; + + if (cd_stop_time != 0 && SDL_GetTicks() >= cd_stop_time) { + SDL_CDStop(cdrom); + cd_num_loops = 0; + cd_stop_time = 0; + return; + } + + if (cd_num_loops == 0 || SDL_GetTicks() < cd_end_time) + return; + + if (cd_num_loops != 1 && SDL_CDStatus(cdrom) != CD_STOPPED) { + // Wait another second for it to be done + cd_end_time += 1000; + return; + } + + if (cd_num_loops > 0) + cd_num_loops--; + + if (cd_num_loops != 0) { + SDL_CDPlayTracks(cdrom, cd_track, cd_start_frame, 0, cd_end_frame); + cd_end_time = SDL_GetTicks() + cdrom->track[cd_track].length * 1000 / CD_FPS; + } +} + +void OSystem_SDL::setup_icon() { + int w, h, ncols, nbytes, i; + unsigned int rgba[256], icon[32 * 32]; + unsigned char mask[32][4]; + + sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); + if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { + warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); + return; + } + for (i = 0; i < ncols; i++) { + unsigned char code; + char color[32]; + unsigned int col; + sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); + if (!strcmp(color, "None")) + col = 0x00000000; + else if (!strcmp(color, "black")) + col = 0xFF000000; + else if (color[0] == '#') { + sscanf(color + 1, "%06x", &col); + col |= 0xFF000000; + } else { + warning("Could not load the icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); + return; + } + + rgba[code] = col; + } + memset(mask, 0, sizeof(mask)); + for (h = 0; h < 32; h++) { + char *line = scummvm_icon[1 + ncols + h]; + for (w = 0; w < 32; w++) { + icon[w + 32 * h] = rgba[line[w]]; + if (rgba[line[w]] & 0xFF000000) { + mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); + } + } + } + + SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); + SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); +} + +void *OSystem_SDL::create_mutex(void) { + return (void *) SDL_CreateMutex(); +} + +void OSystem_SDL::lock_mutex(void *mutex) { + SDL_mutexP((SDL_mutex *) mutex); +} + +void OSystem_SDL::unlock_mutex(void *mutex) { + SDL_mutexV((SDL_mutex *) mutex); +} + +void OSystem_SDL::delete_mutex(void *mutex) { + SDL_DestroyMutex((SDL_mutex *) mutex); +} + + +#ifdef USE_NULL_DRIVER + +/* NULL video driver */ +class OSystem_NULL : public OSystem { +public: + void set_palette(const byte *colors, uint start, uint num) {} + void init_size(uint w, uint h); + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {} + void update_screen() {} + bool show_mouse(bool visible) { return false; } + void set_mouse_pos(int x, int y) {} + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {} + void set_shake_pos(int shake_pos) {} + uint32 get_msecs(); + void delay_msecs(uint msecs); + void *create_thread(ThreadProc *proc, void *param) { return NULL; } + bool poll_event(Event *event) { return false; } + bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} + void quit() { exit(1); } + uint32 property(int param, Property *value) { return 0; } + static OSystem *create(int gfx_mode, bool full_screen); +private: + + uint msec_start; + + uint32 get_ticks(); +}; + +void OSystem_NULL::init_size(uint w, uint h, byte sound) { + msec_start = get_ticks(); +} + +uint32 OSystem_NULL::get_ticks() { + uint a = 0; +#ifdef WIN32 + a = GetTickCount(); +#endif +#ifdef UNIX + struct timeval tv; + gettimeofday(&tv, NULL); + a = tv.tv_sec * 1000 + tv.tv_usec/1000; +#endif + + return a; +} + +void OSystem_NULL::delay_msecs(uint msecs) { +#ifdef WIN32 + Sleep(msecs); +#endif +#ifdef UNIX + usleep(msecs*1000); +#endif +} + +uint32 OSystem_NULL::get_msecs() { + return get_ticks() - msec_start; +} + +OSystem *OSystem_NULL_create() { + return new OSystem_NULL(); +} +#else /* USE_NULL_DRIVER */ + +OSystem *OSystem_NULL_create() { + return NULL; +} + +#endif diff --git a/backends/sdl/sdl_gl.cpp b/backends/sdl/sdl_gl.cpp new file mode 100644 index 0000000000..adec2a1f6b --- /dev/null +++ b/backends/sdl/sdl_gl.cpp @@ -0,0 +1,1068 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scummsys.h" +#include "system.h" +#include "sound/mididrv.h" +#include "gameDetector.h" +#include "scaler.h" +#include "scumm.h" // Only #included for error() and warning() + +#include "scummvm.xpm" + +#include +#include + +#ifdef WIN32 +int glColorTable(int, int, int, int, int, void *) { return 0; } +int glGetColorTable(int, int, int, void *) { return 0; } +/* Use OpenGL 1.1 */ +bool OGL_1_1 = true; +#else +bool OGL_1_1 = false; +#endif + +#include "fb2opengl.h" +FB2GL fb2gl; + +class OSystem_SDL : public OSystem { +public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + // Add a callback timer + void set_timer(int timer, int (*callback)(int)); + + // Mutex handling + void *create_mutex(void); + void lock_mutex(void *mutex); + void unlock_mutex(void *mutex); + void delete_mutex(void *mutex); + + static OSystem *create(int gfx_mode, bool full_screen); + +private: + typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height); + + SDL_Surface *sdl_screen; + SDL_Surface *sdl_tmpscreen; + SDL_CD *cdrom; + + enum { + DF_WANT_RECT_OPTIM = 1 << 0, + DF_REAL_8BIT = 1 << 1, + DF_SEPARATE_TEMPSCREEN = 1 << 2, + DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 + }; + + int _mode; + bool _full_screen; + bool _mouse_visible; + bool _mouse_drawn; + uint32 _mode_flags; + + bool force_full; //Force full redraw on next update_screen + bool cksum_valid; + + enum { + NUM_DIRTY_RECT = 100, + + MAX_MOUSE_W = 40, + MAX_MOUSE_H = 40, + MAX_SCALING = 3 + }; + + int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; + SDL_Rect *dirty_rect_list; + int num_dirty_rects; + uint32 *dirty_checksums; + + int scaling; + + /* CD Audio */ + int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; + Uint32 cd_end_time, cd_stop_time, cd_next_second; + + struct MousePos { + int16 x, y, w, h; + }; + + byte *_mouse_data; + byte *_mouse_backup; + MousePos _mouse_cur_state; + MousePos _mouse_old_state; + int16 _mouse_hotspot_x; + int16 _mouse_hotspot_y; + int _current_shake_pos; + int _new_shake_pos; + TwoXSaiProc *_sai_func; + SDL_Color *_cur_pal; + + uint _palette_changed_first, _palette_changed_last; + + OSystem_SDL() : _current_shake_pos(0), _new_shake_pos(0) {} + + void add_dirty_rgn_auto(const byte *buf); + void mk_checksums(const byte *buf); + + static void fill_sound(void *userdata, Uint8 * stream, int len); + + void add_dirty_rect(int x, int y, int w, int h); + + void draw_mouse(); + void undraw_mouse(); + + void load_gfx_mode(); + void unload_gfx_mode(); + + void hotswap_gfx_mode(); + + void get_320x200_image(byte *buf); + + void setup_icon(); +}; + +bool atexit_proc_instaled = false; +void atexit_proc() { + SDL_ShowCursor(SDL_ENABLE); + SDL_Quit(); +} + +OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) { + OSystem_SDL *syst = new OSystem_SDL(); + syst->_mode = gfx_mode; + syst->_full_screen = full_screen; + + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) ==-1) { + error("Could not initialize SDL: %s.\n", SDL_GetError()); + } + +#ifdef WIN32 /* Use waveout on win32, not */ + SDL_AudioInit("waveout"); /* dsound - unfortunatly dsound */ +#endif /* doesn't do COOPERATIVE mode*/ + + SDL_ShowCursor(SDL_DISABLE); + + /* Setup the icon */ + syst->setup_icon(); + +#ifndef MACOSX // Work around a bug in OS X + /* Clean up on exit */ + atexit_proc_instaled = true; + atexit(atexit_proc); +#endif + + return syst; +} + +void OSystem_SDL::set_timer(int timer, int (*callback)(int)) { + SDL_SetTimer(timer, (SDL_TimerCallback) callback); +} +OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) { + return OSystem_SDL::create(gfx_mode, full_screen); +} + +void OSystem_SDL::set_palette(const byte *colors, uint start, uint num) { + const byte *b = colors; + uint i; + + for(i=0;i!=num;i++) { + fb2gl.palette(i+start,b[0],b[1],b[2]); + b += 4; + } + + if (start < _palette_changed_first) + _palette_changed_first = start; + + if (start + num > _palette_changed_last) + _palette_changed_last = start + num; +} + +void OSystem_SDL::load_gfx_mode() { + int gl_flags = FB2GL_320 | FB2GL_PITCH; + force_full = true; + scaling = 1; + _mode_flags = 0; + + _sai_func = NULL; + sdl_tmpscreen = NULL; + + /* It's easier to work with 8 bit (256 colors) */ + _mode_flags |= DF_REAL_8BIT; + + sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 8, 0, 0, 0, 0); + if (sdl_screen == NULL) + error("sdl_screen failed failed"); + + _sai_func = Normal1x; + + _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; + + if (_full_screen) gl_flags |= (FB2GL_FS); + + if (OGL_1_1) { // OpenGL 1.1 + gl_flags |= (FB2GL_RGBA | FB2GL_EXPAND); + fb2gl.init(640,480,0,70,gl_flags ); + } + else { // OpenGL 1.2 + if (!fb2gl.init(640,480,0,70,gl_flags)) { // Try to use 8bpp textures + gl_flags |= (FB2GL_RGBA | FB2GL_EXPAND); // using RGBA textures + fb2gl.init(640,480,0,70,gl_flags); + } + } + +#ifdef MACOSX // Work around a bug in OS X + if (!atexit_proc_instaled) { + atexit_proc_instaled = true; + atexit(atexit_proc); + } +#endif + + SDL_SetGamma(1.25,1.25,1.25); + + sdl_tmpscreen = sdl_screen; +} + +void OSystem_SDL::unload_gfx_mode() { + SDL_FreeSurface(sdl_screen); + sdl_screen = NULL; + + if (_mode_flags & DF_SEPARATE_TEMPSCREEN) { + free((uint16*)sdl_tmpscreen->pixels); + SDL_FreeSurface(sdl_tmpscreen); + } + sdl_tmpscreen = NULL; +} + +void OSystem_SDL::init_size(uint w, uint h) { + //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) + // error("320x200 is the only game resolution supported"); + + SCREEN_WIDTH = w; + SCREEN_HEIGHT = h; + CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)); + /* allocate palette, it needs to be persistent across + * driver changes, so i'll alloc it here */ + _cur_pal = (SDL_Color*)calloc(sizeof(SDL_Color), 256); + + dirty_rect_list = (SDL_Rect*)calloc(NUM_DIRTY_RECT, sizeof(SDL_Rect)); + _mouse_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); + dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); + + load_gfx_mode(); +} + +void OSystem_SDL::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { + if (sdl_screen == NULL) + return; + + if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { + /* Special, optimized case for full screen updates. + * It tries to determine what areas were actually changed, + * and just updates those, on the actual display. */ + add_dirty_rgn_auto(buf); + } else { + /* Clip the coordinates */ + if (x < 0) { w+=x; buf-=x; x = 0; } + if (y < 0) { h+=y; buf-=y*pitch; y = 0; } + if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } + if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } + + if (w <= 0 || h <= 0) + return; + + cksum_valid = false; + add_dirty_rect(x, y, w, h); + } + + /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ + if (_mouse_drawn) + undraw_mouse(); + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + byte *dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; + do { + memcpy(dst, buf, w); + dst += SCREEN_WIDTH; + buf += pitch; + } while (--h); + + SDL_UnlockSurface(sdl_screen); +} + + +void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) { + if (force_full) + return; + + if (num_dirty_rects == NUM_DIRTY_RECT) + force_full = true; + else { + SDL_Rect *r = &dirty_rect_list[num_dirty_rects++]; + + /* Update the dirty region by 1 pixel for graphics drivers + * that "smear" the screen */ + if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { + x--; + y--; + w+=2; + h+=2; + } + + /* clip */ + if (x < 0) { w+=x; x=0; } + if (y < 0) { h+=y; y=0; } + if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } + if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } + + r->x = x; + r->y = y; + r->w = w; + r->h = h; + } +} + +#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) +#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] +void OSystem_SDL::mk_checksums(const byte *buf) { + uint32 *sums = dirty_checksums; + uint x,y; + const uint last_x = (uint)SCREEN_WIDTH/8; + const uint last_y = (uint)SCREEN_HEIGHT/8; + + /* the 8x8 blocks in buf are enumerated starting in the top left corner and + * reading each line at a time from left to right */ + for(y=0; y != last_y; y++, buf+=SCREEN_WIDTH*(8-1)) + for(x=0; x != last_x; x++, buf+=8) { + uint32 a = x; + uint32 b = y; + + DOLINE(0); ROL(a,13); ROL(b,11); + DOLINE(2); ROL(a,13); ROL(b,11); + DOLINE(4); ROL(a,13); ROL(b,11); + DOLINE(6); ROL(a,13); ROL(b,11); + + a*=0xDEADBEEF; + b*=0xBAADF00D; + + DOLINE(1); ROL(a,13); ROL(b,11); + DOLINE(3); ROL(a,13); ROL(b,11); + DOLINE(5); ROL(a,13); ROL(b,11); + DOLINE(7); ROL(a,13); ROL(b,11); + + /* output the checksum for this block */ + *sums++=a+b; + } +} +#undef DOLINE +#undef ROL + + +void OSystem_SDL::add_dirty_rgn_auto(const byte *buf) { + assert( ((uint32)buf & 3) == 0); + + /* generate a table of the checksums */ + mk_checksums(buf); + + if (!cksum_valid) { + force_full = true; + cksum_valid = true; + } + + /* go through the checksum list, compare it with the previous checksums, + and add all dirty rectangles to a list. try to combine small rectangles + into bigger ones in a simple way */ + if (!force_full) { + int x,y,w; + uint32 *ck = dirty_checksums; + + for(y=0; y!=SCREEN_HEIGHT/8; y++) { + for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { + if (ck[0] != ck[CKSUM_NUM]) { + /* found a dirty 8x8 block, now go as far to the right as possible, + and at the same time, unmark the dirty status by setting old to new. */ + w=0; + do { + ck[w+CKSUM_NUM] = ck[w]; + w++; + } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); + + add_dirty_rect(x*8, y*8, w*8, 8); + + if (force_full) + goto get_out; + } + } + } + } else { + get_out:; + /* Copy old checksums to new */ + memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); + } +} + +void OSystem_SDL::update_screen() { + + /* First make sure the mouse is drawn, if it should be drawn. */ + draw_mouse(); + + /* If the shake position changed, fill the dirty area with blackness */ + if (_current_shake_pos != _new_shake_pos) { + + _current_shake_pos = _new_shake_pos; + + } + + /* Palette update in case we are in "real" 8 bit color mode. + * Must take place after the screen data was updated, since with + * "real" 8bit mode, palatte changes may be visible immediatly, + * and we want to avoid any ugly effects. + */ + if (_palette_changed_last != 0) { + fb2gl.setPalette(_palette_changed_first, + _palette_changed_last - _palette_changed_first); + + _palette_changed_last = 0; + } + + fb2gl.update(sdl_tmpscreen->pixels,320,200,320,0,_current_shake_pos); + +} + +bool OSystem_SDL::show_mouse(bool visible) { + if (_mouse_visible == visible) + return visible; + + bool last = _mouse_visible; + _mouse_visible = visible; + + if (visible) + draw_mouse(); + else + undraw_mouse(); + + return last; +} + +void OSystem_SDL::set_mouse_pos(int x, int y) { + if (x != _mouse_cur_state.x || y != _mouse_cur_state.y) { + _mouse_cur_state.x = x; + _mouse_cur_state.y = y; + undraw_mouse(); + } +} + +void OSystem_SDL::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { + _mouse_cur_state.w = w; + _mouse_cur_state.h = h; + + _mouse_hotspot_x = hotspot_x; + _mouse_hotspot_y = hotspot_y; + + _mouse_data = (byte*)buf; + + undraw_mouse(); +} + +void OSystem_SDL::set_shake_pos(int shake_pos) { + _new_shake_pos = shake_pos; +} + +uint32 OSystem_SDL::get_msecs() { + return SDL_GetTicks(); +} + +void OSystem_SDL::delay_msecs(uint msecs) { + SDL_Delay(msecs); +} + +void *OSystem_SDL::create_thread(ThreadProc *proc, void *param) { + return SDL_CreateThread(proc, param); +} + +int mapKey(int key, byte mod) +{ + if (key >= SDLK_F1 && key <= SDLK_F9) { + return key - SDLK_F1 + 315; + } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { + key &= ~0x20; + } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) + return 0; + return key; +} + +bool OSystem_SDL::poll_event(Event *event) { + SDL_Event ev; + + for(;;) { + if (!SDL_PollEvent(&ev)) + return false; + + switch(ev.type) { + case SDL_KEYDOWN: { + byte b = 0; + if (ev.key.keysym.mod & KMOD_SHIFT) b |= KBD_SHIFT; + if (ev.key.keysym.mod & KMOD_CTRL) b |= KBD_CTRL; + if (ev.key.keysym.mod & KMOD_ALT) b |= KBD_ALT; + event->kbd.flags = b; + + /* internal keypress? */ + if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { + property(PROP_TOGGLE_FULLSCREEN, NULL); + break; + } + + if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) { + quit(); + break; + } + + if (b == (KBD_CTRL|KBD_ALT) && + (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { + Property prop; + prop.gfx_mode = ev.key.keysym.sym - '1'; + property(PROP_SET_GFX_MODE, &prop); + break; + } + + + event->event_code = EVENT_KEYDOWN; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + return true; + } + + case SDL_KEYUP: + event->event_code = EVENT_KEYUP; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + + return true; + + case SDL_MOUSEMOTION: + event->event_code = EVENT_MOUSEMOVE; + event->mouse.x = ev.motion.x; + event->mouse.y = ev.motion.y; + + event->mouse.x /= scaling; + event->mouse.y /= scaling; + + return true; + + case SDL_MOUSEBUTTONDOWN: + if (ev.button.button == SDL_BUTTON_LEFT) + event->event_code = EVENT_LBUTTONDOWN; + else if (ev.button.button == SDL_BUTTON_RIGHT) + event->event_code = EVENT_RBUTTONDOWN; + else + break; + event->mouse.x = ev.button.x; + event->mouse.y = ev.button.y; + event->mouse.x /= scaling; + event->mouse.y /= scaling; + + return true; + + case SDL_MOUSEBUTTONUP: + if (ev.button.button == SDL_BUTTON_LEFT) + event->event_code = EVENT_LBUTTONUP; + else if (ev.button.button == SDL_BUTTON_RIGHT) + event->event_code = EVENT_RBUTTONUP; + else + break; + event->mouse.x = ev.button.x; + event->mouse.y = ev.button.y; + event->mouse.x /= scaling; + event->mouse.y /= scaling; + return true; + + case SDL_QUIT: + quit(); + } + } +} + +bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { + SDL_AudioSpec desired; + + /* only one format supported at the moment */ + + desired.freq = SAMPLES_PER_SEC; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = proc; + desired.userdata = param; + if (SDL_OpenAudio(&desired, NULL) != 0) { + return false; + } + SDL_PauseAudio(0); + return true; +} + + +/* retrieve the 320x200 bitmap currently being displayed */ +void OSystem_SDL::get_320x200_image(byte *buf) { + /* make sure the mouse is gone */ + undraw_mouse(); + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + memcpy(buf, sdl_screen->pixels, SCREEN_WIDTH*SCREEN_HEIGHT); + + SDL_UnlockSurface(sdl_screen); +} + +void OSystem_SDL::hotswap_gfx_mode() { + /* hmm, need to allocate a 320x200 bitmap + * which will contain the "backup" of the screen during the change. + * then draw that to the new screen right after it's setup. + */ + + byte *bak_mem = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT); + + get_320x200_image(bak_mem); + + unload_gfx_mode(); + load_gfx_mode(); + + fb2gl.setPalette(0,256); + fb2gl.update(sdl_tmpscreen->pixels,320,200,320,0,_current_shake_pos); + + /* blit image */ + OSystem_SDL::copy_rect(bak_mem, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + free(bak_mem); + + OSystem_SDL::update_screen(); +} + +uint32 OSystem_SDL::property(int param, Property *value) { + switch(param) { + + case PROP_TOGGLE_FULLSCREEN: + _full_screen ^= true; + SDL_WM_ToggleFullScreen(fb2gl.screen); + return 1; + + case PROP_GET_FULLSCREEN: + return _full_screen; + + case PROP_SET_WINDOW_CAPTION: + SDL_WM_SetCaption(value->caption, value->caption); + return 1; + + case PROP_OPEN_CD: + if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) + cdrom = NULL; + else { + cdrom = SDL_CDOpen(value->cd_num); + /* Did if open? Check if cdrom is NULL */ + if (!cdrom) { + warning("Couldn't open drive: %s\n", SDL_GetError()); + } + } + break; + + case PROP_SET_GFX_MODE: + if (value->gfx_mode >= 7) + return 0; + + _mode = value->gfx_mode; + hotswap_gfx_mode(); + + return 1; + + case PROP_SHOW_DEFAULT_CURSOR: + SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); + break; + + case PROP_GET_SAMPLE_RATE: + return SAMPLES_PER_SEC; + } + + return 0; +} + +void OSystem_SDL::quit() { + if(cdrom) { + SDL_CDStop(cdrom); + SDL_CDClose(cdrom); + } + unload_gfx_mode(); + exit(1); +} + +void OSystem_SDL::draw_mouse() { + if (_mouse_drawn || !_mouse_visible) + return; + + int x = _mouse_cur_state.x - _mouse_hotspot_x; + int y = _mouse_cur_state.y - _mouse_hotspot_y; + int w = _mouse_cur_state.w; + int h = _mouse_cur_state.h; + byte color; + byte *src = _mouse_data; // Image representing the mouse + byte *bak = _mouse_backup; // Surface used to backup the area obscured by the mouse + byte *dst; // Surface we are drawing into + + // clip the mouse rect, and addjust the src pointer accordingly + if (x < 0) { + w += x; + src -= x; + x = 0; + } + if (y < 0) { + h += y; + src -= y * _mouse_cur_state.w; + y = 0; + } + if (w > SCREEN_WIDTH - x) + w = SCREEN_WIDTH - x; + if (h > SCREEN_HEIGHT - y) + h = SCREEN_HEIGHT - y; + + // Store the bounding box so that undraw mouse can restore the area the + // mouse currently covers to its original content. + _mouse_old_state.x = x; + _mouse_old_state.y = y; + _mouse_old_state.w = w; + _mouse_old_state.h = h; + + // Quick check to see if anything has to be drawn at all + if (w <= 0 || h <= 0) + return; + + // Draw the mouse cursor; backup the covered area in "bak" + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + add_dirty_rect(x, y, w, h); + + dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; + while (h > 0) { + int width = w; + while (width > 0) { + *bak++ = *dst; + color = *src++; + if (color != 0xFF) // 0xFF = transparent, don't draw + *dst = color; + dst++; + width--; + } + src += _mouse_cur_state.w - w; + bak += MAX_MOUSE_W - w; + dst += SCREEN_WIDTH - w; + h--; + } + + SDL_UnlockSurface(sdl_screen); + + // Finally, set the flag to indicate the mouse has been drawn + _mouse_drawn = true; +} + +void OSystem_SDL::undraw_mouse() { + if (!_mouse_drawn) + return; + _mouse_drawn = false; + + if (SDL_LockSurface(sdl_screen) == -1) + error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + + byte *dst, *bak = _mouse_backup; + const int old_mouse_x = _mouse_old_state.x; + const int old_mouse_y = _mouse_old_state.y; + const int old_mouse_w = _mouse_old_state.w; + const int old_mouse_h = _mouse_old_state.h; + int x,y; + + // No need to do clipping here, since draw_mouse() did that already + + dst = (byte *)sdl_screen->pixels + old_mouse_y * SCREEN_WIDTH + old_mouse_x; + for (y = 0; y < old_mouse_h; ++y, bak += MAX_MOUSE_W, dst += SCREEN_WIDTH) { + for (x = 0; x < old_mouse_w; ++x) { + dst[x] = bak[x]; + } + } + + add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); + + SDL_UnlockSurface(sdl_screen); +} + +void OSystem_SDL::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */ + cd_stop_time = SDL_GetTicks() + 100; + cd_num_loops = 0; + +} + +void OSystem_SDL::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { + if (!num_loops && !start_frame) + return; + + if (!cdrom) + return; + + if (end_frame > 0) + end_frame+=5; + + cd_track = track; + cd_num_loops = num_loops; + cd_start_frame = start_frame; + + SDL_CDStatus(cdrom); + SDL_CDPlayTracks(cdrom, track, start_frame, 0, end_frame); + cd_end_frame = end_frame; + cd_stop_time = 0; + cd_end_time = SDL_GetTicks() + cdrom->track[track].length * 1000 / CD_FPS; +} + +bool OSystem_SDL::poll_cdrom() { + if (!cdrom) + return false; + + return (cd_num_loops != 0 && (SDL_GetTicks() < cd_end_time || SDL_CDStatus(cdrom) != CD_STOPPED)); +} + +void OSystem_SDL::update_cdrom() { + if (!cdrom) + return; + + if (cd_stop_time != 0 && SDL_GetTicks() >= cd_stop_time) { + SDL_CDStop(cdrom); + cd_num_loops = 0; + cd_stop_time = 0; + return; + } + + if (cd_num_loops == 0 || SDL_GetTicks() < cd_end_time) + return; + + if (cd_num_loops != 1 && SDL_CDStatus(cdrom) != CD_STOPPED) { + // Wait another second for it to be done + cd_end_time += 1000; + return; + } + + if (cd_num_loops > 0) + cd_num_loops--; + + if (cd_num_loops != 0) { + SDL_CDPlayTracks(cdrom, cd_track, cd_start_frame, 0, cd_end_frame); + cd_end_time = SDL_GetTicks() + cdrom->track[cd_track].length * 1000 / CD_FPS; + } +} + +void OSystem_SDL::setup_icon() { + int w, h, ncols, nbytes, i; + unsigned int rgba[256], icon[32 * 32]; + unsigned char mask[32][4]; + + sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); + if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { + warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); + return; + } + for (i = 0; i < ncols; i++) { + unsigned char code; + char color[32]; + unsigned int col; + sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); + if (!strcmp(color, "None")) + col = 0x00000000; + else if (!strcmp(color, "black")) + col = 0xFF000000; + else if (color[0] == '#') { + sscanf(color + 1, "%06x", &col); + col |= 0xFF000000; + } else { + warning("Could not load the icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); + return; + } + + rgba[code] = col; + } + memset(mask, 0, sizeof(mask)); + for (h = 0; h < 32; h++) { + char *line = scummvm_icon[1 + ncols + h]; + for (w = 0; w < 32; w++) { + icon[w + 32 * h] = rgba[line[w]]; + if (rgba[line[w]] & 0xFF000000) { + mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); + } + } + } + + SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); + SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); +} + +void *OSystem_SDL::create_mutex(void) { + return (void *) SDL_CreateMutex(); +} + +void OSystem_SDL::lock_mutex(void *mutex) { + SDL_mutexP((SDL_mutex *) mutex); +} + +void OSystem_SDL::unlock_mutex(void *mutex) { + SDL_mutexV((SDL_mutex *) mutex); +} + +void OSystem_SDL::delete_mutex(void *mutex) { + SDL_DestroyMutex((SDL_mutex *) mutex); +} + + +#ifdef USE_NULL_DRIVER + +/* NULL video driver */ +class OSystem_NULL : public OSystem { +public: + void set_palette(const byte *colors, uint start, uint num) {} + void init_size(uint w, uint h); + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {} + void update_screen() {} + bool show_mouse(bool visible) { return false; } + void set_mouse_pos(int x, int y) {} + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {} + void set_shake_pos(int shake_pos) {} + uint32 get_msecs(); + void delay_msecs(uint msecs); + void *create_thread(ThreadProc *proc, void *param) { return NULL; } + bool poll_event(Event *event) { return false; } + bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} + void quit() { exit(1); } + uint32 property(int param, Property *value) { return 0; } + static OSystem *create(int gfx_mode, bool full_screen); +private: + + uint msec_start; + + uint32 get_ticks(); +}; + +void OSystem_NULL::init_size(uint w, uint h, byte sound) { + msec_start = get_ticks(); +} + +uint32 OSystem_NULL::get_ticks() { + uint a = 0; +#ifdef WIN32 + a = GetTickCount(); +#endif +#ifdef UNIX + struct timeval tv; + gettimeofday(&tv, NULL); + a = tv.tv_sec * 1000 + tv.tv_usec/1000; +#endif + + return a; +} + +void OSystem_NULL::delay_msecs(uint msecs) { +#ifdef WIN32 + Sleep(msecs); +#endif +#ifdef UNIX + usleep(msecs*1000); +#endif +} + +uint32 OSystem_NULL::get_msecs() { + return get_ticks() - msec_start; +} + +OSystem *OSystem_NULL_create() { + return new OSystem_NULL(); +} +#else /* USE_NULL_DRIVER */ + +OSystem *OSystem_NULL_create() { + return NULL; +} + +#endif diff --git a/backends/wince/MenuTitle.bmp b/backends/wince/MenuTitle.bmp new file mode 100644 index 0000000000..34faf3fbb2 Binary files /dev/null and b/backends/wince/MenuTitle.bmp differ diff --git a/backends/wince/PocketSCUMM.rc b/backends/wince/PocketSCUMM.rc new file mode 100644 index 0000000000..15fc9433ba --- /dev/null +++ b/backends/wince/PocketSCUMM.rc @@ -0,0 +1,209 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "newres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""newres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_GAMESELECT DIALOG DISCARDABLE 0, 0, 128, 134 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION "Choose a Game" +FONT 8, "System" +BEGIN + LISTBOX IDC_LISTAVAILABLE,6,47,113,70,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + CONTROL 133,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,0,2, + 125,35 + LTEXT "",IDC_GAMEDESC,2,117,116,8 + PUSHBUTTON "Play",IDC_PLAY,52,125,19,9 + LTEXT "",IDC_FILEPATH,5,39,120,8 + PUSHBUTTON "Scan",IDC_SCAN,4,125,19,9 + PUSHBUTTON "Exit",IDC_EXIT,100,125,19,9 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Menubar +// + +IDM_MENU MENU DISCARDABLE +BEGIN + POPUP "PocketSCUMM" + BEGIN + MENUITEM "Load/Save", IDC_LOADSAVE + MENUITEM "Options", IDC_OPTIONS + MENUITEM "Exit", IDC_EXIT + MENUITEM SEPARATOR + MENUITEM "Landscape", IDC_LANDSCAPE + MENUITEM "Skip section", IDC_SKIP + MENUITEM SEPARATOR + MENUITEM "Sound", IDC_SOUND + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Data +// + +IDM_MENU SHMENUBAR DISCARDABLE +BEGIN + IDM_MENU, 1, + I_IMAGENONE, IDM_POCKETSCUMM, TBSTATE_ENABLED, + TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_POCKETSCUMM, 0, 0, +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_GAMESELECT, DIALOG + BEGIN + RIGHTMARGIN, 125 + HORZGUIDE, 2 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CAP_POCKETSCUMM "PocketSCUMM" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// French (France) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) +#ifdef _WIN32 +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 90 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "System" +BEGIN + DEFPUSHBUTTON "OK",IDOK,129,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG1, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 83 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDL_POCKETSCUMM ICON DISCARDABLE "PocketSCUMM.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_MENUTITLE BITMAP DISCARDABLE "MenuTitle.bmp" +#endif // French (France) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/backends/wince/PocketSCUMM.vcc b/backends/wince/PocketSCUMM.vcc new file mode 100644 index 0000000000..9a25751416 --- /dev/null +++ b/backends/wince/PocketSCUMM.vcc @@ -0,0 +1,74 @@ +; CLW file contains information for the MFC ClassWizard + +[General Info] +Version=1 +LastClass= +LastTemplate=CDialog +NewFileInclude1=#include "stdafx.h" +NewFileInclude2=#include "pocketscumm.h" +LastPage=0 + +ClassCount=0 + +ResourceCount=5 +Resource1=IDM_MENU +Resource2=IDD_DIALOG1 +Resource3=IDD_GAMESELECT +Resource4=IDD_GAMESELECT (English (U.S.)) +Resource5=IDM_MENU (English (U.S.)) + +[DLG:IDD_GAMESELECT (English (U.S.))] +Type=1 +Class=? +ControlCount=7 +Control1=IDC_LISTAVAILABLE,listbox,1352728833 +Control2=IDC_STATIC,static,1342177806 +Control3=IDC_GAMEDESC,static,1342308352 +Control4=IDC_PLAY,button,1342242816 +Control5=IDC_FILEPATH,static,1342308352 +Control6=IDC_SCAN,button,1342242816 +Control7=IDC_EXIT,button,1342242816 + +[MNU:IDM_MENU (English (U.S.))] +Type=1 +Class=? +Command1=IDC_LOADSAVE +Command2=IDC_OPTIONS +Command3=IDC_EXIT +Command4=IDC_LANDSCAPE +Command5=IDC_SKIP +Command6=IDC_SOUND +CommandCount=6 + +[DLG:IDD_GAMESELECT] +Type=1 +Class=? +ControlCount=7 +Control1=IDC_LISTAVAILABLE,listbox,1352728833 +Control2=IDC_STATIC,static,1342177806 +Control3=IDC_GAMEDESC,static,1342308352 +Control4=IDC_PLAY,button,1342242816 +Control5=IDC_FILEPATH,static,1342308352 +Control6=IDC_SCAN,button,1342242816 +Control7=IDC_EXIT,button,1342242816 + +[MNU:IDM_MENU] +Type=1 +Class=? +Command1=IDC_LOADSAVE +Command2=IDC_OPTIONS +Command3=IDC_EXIT +Command4=IDC_LANDSCAPE +Command5=IDC_SKIP +Command6=IDC_SOUND +CommandCount=6 + + + +[DLG:IDD_DIALOG1] +Type=1 +Class=? +ControlCount=2 +Control1=IDOK,button,1342242817 +Control2=IDCANCEL,button,1342242816 + diff --git a/backends/wince/PocketSCUMM.vcp b/backends/wince/PocketSCUMM.vcp new file mode 100644 index 0000000000..5809a4d948 --- /dev/null +++ b/backends/wince/PocketSCUMM.vcp @@ -0,0 +1,9228 @@ +# Microsoft eMbedded Visual Tools Project File - Name="PocketSCUMM" - Package Owner=<4> +# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 +# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 +# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 +# TARGTYPE "Win32 (WCE SH4) Application" 0x8601 +# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 + +CFG=PocketSCUMM - Win32 (WCE MIPS) Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "PocketSCUMM.vcn". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "PocketSCUMM.vcn" CFG="PocketSCUMM - Win32 (WCE MIPS) Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "PocketSCUMM - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") +!MESSAGE "PocketSCUMM - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +# PROP ATL_Project 2 + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "MIPSRel" +# PROP BASE Intermediate_Dir "MIPSRel" +# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "MIPSRel" +# PROP Intermediate_Dir "MIPSRel" +# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "MIPS" /D "_MIPS_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "__AUTO_MIXER_ADJUST__" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /Oxs /M$(CECrtMT) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/MIPS" /libpath:"mad/lib/MIPS" /subsystem:$(CESubsystem) /MACHINE:MIPS + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "MIPSDbg" +# PROP BASE Intermediate_Dir "MIPSDbg" +# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "MIPSDbg" +# PROP Intermediate_Dir "MIPSDbg" +# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /M$(CECrtMTDebug) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "SH4Rel" +# PROP BASE Intermediate_Dir "SH4Rel" +# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "SH4Rel" +# PROP Intermediate_Dir "SH4Rel" +# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Qsh4 /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /D "SHx" /D "SH4" /D "_SH4_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Qsh4 /Oxs /M$(CECrtMT) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "SH4Dbg" +# PROP BASE Intermediate_Dir "SH4Dbg" +# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "SH4Dbg" +# PROP Intermediate_Dir "SH4Dbg" +# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /Qsh4 /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Qsh4 /M$(CECrtMTDebug) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "SH3Rel" +# PROP BASE Intermediate_Dir "SH3Rel" +# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "SH3Rel" +# PROP Intermediate_Dir "SH3Rel" +# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "SHx" /D "SH3" /D "_SH3_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "USE_ADLIB" /D "__AUTO_MIXER_ADJUST__" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /YX /Oxs /M$(CECrtMT) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/SH3" /libpath:"mad/lib/SH3" /subsystem:$(CESubsystem) /MACHINE:SH3 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "SH3Dbg" +# PROP BASE Intermediate_Dir "SH3Dbg" +# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "SH3Dbg" +# PROP Intermediate_Dir "SH3Dbg" +# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /M$(CECrtMTDebug) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ARMRel" +# PROP BASE Intermediate_Dir "ARMRel" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ARMRel" +# PROP Intermediate_Dir "ARMRel" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "../sound" /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "ARM" /D "_ARM_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /Oxs /M$(CECrtMT) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/ARM" /libpath:"mad/lib/ARM" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ARMDbg" +# PROP BASE Intermediate_Dir "ARMDbg" +# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ARMDbg" +# PROP Intermediate_Dir "ARMDbg" +# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "../sound" /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /M$(CECrtMTDebug) /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM +# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/ARM" /libpath:"mad/lib/ARM" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "X86EMRel" +# PROP BASE Intermediate_Dir "X86EMRel" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "X86EMRel" +# PROP Intermediate_Dir "X86EMRel" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c +# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "i486" /D "_X86_" /D "x86" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Gz /Oxs /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "X86EMDbg" +# PROP BASE Intermediate_Dir "X86EMDbg" +# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "X86EMDbg" +# PROP Intermediate_Dir "X86EMDbg" +# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c +# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "i486" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_X86_" /D "x86" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Gz /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 +# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 + +!ENDIF + +# Begin Target + +# Name "PocketSCUMM - Win32 (WCE MIPS) Release" +# Name "PocketSCUMM - Win32 (WCE MIPS) Debug" +# Name "PocketSCUMM - Win32 (WCE SH4) Release" +# Name "PocketSCUMM - Win32 (WCE SH4) Debug" +# Name "PocketSCUMM - Win32 (WCE SH3) Release" +# Name "PocketSCUMM - Win32 (WCE SH3) Debug" +# Name "PocketSCUMM - Win32 (WCE ARM) Release" +# Name "PocketSCUMM - Win32 (WCE ARM) Debug" +# Name "PocketSCUMM - Win32 (WCE x86em) Release" +# Name "PocketSCUMM - Win32 (WCE x86em) Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Group "sound" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\sound\fmopl.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_FMOPL=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FMOPL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FMOPL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FMOPL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FMOPL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_FMOPL=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FMOPL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FMOPL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_FMOPL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FMOPL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_FMOPL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FMOPL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FMOPL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_FMOPL=\ + "..\sound\fmopl.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sound\imuse.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_IMUSE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\morphos\morphos.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_IMUSE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_IMUSE=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_IMUSE=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_IMUSE=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_IMUSE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\morphos\morphos.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_IMUSE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_IMUSE=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_IMUSE=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\morphos\morphos.h"\ + "..\saveload.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_IMUSE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_IMUSE=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\morphos\morphos.h"\ + "..\saveload.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_IMUSE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_IMUSE=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_IMUSE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_IMUSE=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sound\mididrv.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDID=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\fmopl.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDID=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_MIDID=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDID=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_MIDID=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\fmopl.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDID=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_MIDID=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\sys\time.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDID=\ + "..\sound.h"\ + "..\sound\gmidi.h"\ + "..\sound\QuickTimeMusic.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sound\mididrv.h +# End Source File +# Begin Source File + +SOURCE=..\sound\mixer.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIXER=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIXER=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_MIXER=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIXER=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_MIXER=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIXER=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_MIXER=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sound\mixer.h +# End Source File +# End Group +# Begin Group "v3" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\v3\resource_v3.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_RESOU=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\myresource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_RESOU=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\myresource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_RESOU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "v4" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\v4\resource_v4.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOUR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOUR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_RESOUR=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOUR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_RESOUR=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOUR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_RESOUR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOUR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "simon" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\simon\midi.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDI_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDI_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDI_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_MIDI_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_MIDI_=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_MIDI_=\ + "..\simon\gmidi.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simon.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMON=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMON=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMON=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMON=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMON=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simon.h +# End Source File +# Begin Source File + +SOURCE=..\simon\simondebug.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMOND=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMOND=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simonitems.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMONI=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONI=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simonres.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMONR=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONR=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simonsys.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMONS=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simonverb.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMONV=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONV=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\simon\simonvga.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SIMONVG=\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SIMONVG=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "gui" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\gui\dialog.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_DIALO=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_DIALO=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_DIALO=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_DIALO=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gui\dialog.h +# End Source File +# Begin Source File + +SOURCE=..\gui\ListWidget.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_LISTW=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_LISTW=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_LISTW=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_LISTW=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_LISTW=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_LISTW=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gui\ListWidget.h +# End Source File +# Begin Source File + +SOURCE=..\gui\ScrollBarWidget.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCROL=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCROL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCROL=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCROL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCROL=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ScrollBarWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCROL=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gui\ScrollBarWidget.h +# End Source File +# Begin Source File + +SOURCE=..\gui\widget.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_WIDGE=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_WIDGE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_WIDGE=\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_WIDGE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_WIDGE=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_WIDGE=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gui\widget.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\actor.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_ACTOR=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_ACTOR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_ACTOR=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_ACTOR=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_ACTOR=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_ACTOR=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_ACTOR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_ACTOR=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_ACTOR=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\costume.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_ACTOR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_ACTOR=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\costume.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_ACTOR=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_ACTOR=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_ACTOR=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_ACTOR=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\akos.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_AKOS_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_AKOS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_AKOS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_AKOS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_AKOS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_AKOS_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_AKOS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_AKOS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_AKOS_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_AKOS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_AKOS_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_AKOS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_AKOS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_AKOS_=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_AKOS_=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\boxes.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_BOXES=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BOXES=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_BOXES=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_BOXES=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_BOXES=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_BOXES=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BOXES=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_BOXES=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_BOXES=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BOXES=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_BOXES=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BOXES=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_BOXES=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_BOXES=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BOXES=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\bundle.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_BUNDL=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_BUNDL=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE="..\config-file.cpp" + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_CONFI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_CONFI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_CONFI=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_CONFI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_CONFI=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_CONFI=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_CONFI=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\costume.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_COSTU=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_COSTU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_COSTU=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_COSTU=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_COSTU=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_COSTU=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_COSTU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_COSTU=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_COSTU=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\costume.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_COSTU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_COSTU=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\costume.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_COSTU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_COSTU=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_COSTU=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_COSTU=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gameDetector.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GAMED=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GAMED=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_GAMED=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GAMED=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_GAMED=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GAMED=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_GAMED=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GAMED=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gfx.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_GFX_C=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GFX_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_GFX_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_GFX_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_GFX_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_GFX_C=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GFX_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_GFX_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_GFX_C=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\newgui.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GFX_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_GFX_C=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\newgui.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GFX_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_GFX_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_GFX_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GFX_C=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\gui.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_GUI_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\guimaps.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GUI_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_GUI_C=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_GUI_C=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_GUI_C=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_GUI_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\guimaps.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GUI_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_GUI_C=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_GUI_C=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\guimaps.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GUI_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_GUI_C=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\guimaps.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_GUI_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_GUI_C=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_GUI_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\guimaps.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_GUI_C=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\insane.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_INSAN=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_INSAN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_INSAN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_INSAN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_INSAN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_INSAN=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_INSAN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_INSAN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_INSAN=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_INSAN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_INSAN=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_INSAN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_INSAN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_INSAN=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_INSAN=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\newgui.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_NEWGU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\ListWidget.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_NEWGU=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_NEWGU=\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui\dialog.h"\ + "..\gui\widget.h"\ + "..\guimaps.h"\ + "..\newgui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_NEWGU=\ + "..\gui\util.h"\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\object.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_OBJEC=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_OBJEC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_OBJEC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_OBJEC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_OBJEC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_OBJEC=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_OBJEC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_OBJEC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_OBJEC=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_OBJEC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_OBJEC=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_OBJEC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_OBJEC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_OBJEC=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_OBJEC=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\resource.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_RESOURC=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOURC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_RESOURC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_RESOURC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_RESOURC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_RESOURC=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOURC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_RESOURC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_RESOURC=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOURC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_RESOURC=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_RESOURC=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_RESOURC=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_RESOURC=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_RESOURC=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\saveload.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SAVEL=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SAVEL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SAVEL=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SAVEL=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SAVEL=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SAVEL=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SAVEL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SAVEL=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SAVEL=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\saveload.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SAVEL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SAVEL=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\saveload.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SAVEL=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SAVEL=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SAVEL=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SAVEL=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\scaler.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCALE=\ + "..\scaler.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCALE=\ + "..\macos.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\script.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCRIP=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIP=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCRIP=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCRIP=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCRIP=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCRIP=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIP=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCRIP=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCRIP=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIP=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCRIP=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIP=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCRIP=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCRIP=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIP=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\script_v1.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCRIPT=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCRIPT=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCRIPT=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCRIPT=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCRIPT=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCRIPT=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCRIPT=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCRIPT=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCRIPT=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCRIPT=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT=\ + "..\cdmusic.h"\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\script_v2.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCRIPT_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCRIPT_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCRIPT_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCRIPT_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCRIPT_=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCRIPT_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCRIPT_=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCRIPT_=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCRIPT_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCRIPT_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCRIPT_=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCRIPT_=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\scummvm.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCUMM=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCUMM=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCUMM=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCUMM=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCUMM=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCUMM=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCUMM=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCUMM=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCUMM=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\debug.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\newgui.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCUMM=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCUMM=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\debug.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\newgui.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SCUMM=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCUMM=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCUMM=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gameDetector.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SCUMM=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sound.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SOUND=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SOUND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SOUND=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SOUND=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SOUND=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SOUND=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SOUND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SOUND=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SOUND=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SOUND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SOUND=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\imuse.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SOUND=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SOUND=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\sound.h"\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SOUND=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SOUND=\ + "..\cdmusic.h"\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\stdafx.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STDAF=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STDAF=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STDAF=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STDAF=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STDAF=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_STDAF=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\string.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_STRIN=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_STRIN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_STRIN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_STRIN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_STRIN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_STRIN=\ + "..\actor.h"\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_STRIN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_STRIN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_STRIN=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_STRIN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_STRIN=\ + "..\actor.h"\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_STRIN=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_STRIN=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_STRIN=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_STRIN=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\sys.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SYS_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SYS_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SYS_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SYS_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SYS_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SYS_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SYS_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SYS_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SYS_C=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SYS_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SYS_C=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_SYS_C=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SYS_C=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SYS_C=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_SYS_C=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\util.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_UTIL_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\vars.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_VARS_=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VARS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_VARS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_VARS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_VARS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_VARS_=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VARS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_VARS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_VARS_=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VARS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_VARS_=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VARS_=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_VARS_=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_VARS_=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VARS_=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\verbs.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_VERBS=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VERBS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_VERBS=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_VERBS=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_VERBS=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_VERBS=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VERBS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_VERBS=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_VERBS=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VERBS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_VERBS=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\gfx.h"\ + "..\object.h"\ + "..\resource.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_VERBS=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_VERBS=\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_VERBS=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_VERBS=\ + "..\gmidi.h"\ + "..\sound.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\akos.h +# End Source File +# Begin Source File + +SOURCE=..\boxes.h +# End Source File +# Begin Source File + +SOURCE=..\bundle.h +# End Source File +# Begin Source File + +SOURCE="..\config-file.h" +# End Source File +# Begin Source File + +SOURCE=..\sound\fmopl.h +# End Source File +# Begin Source File + +SOURCE=..\gapi_keys.h +# End Source File +# Begin Source File + +SOURCE=..\gui.h +# End Source File +# Begin Source File + +SOURCE=..\guimaps.h +# End Source File +# Begin Source File + +SOURCE=..\newgui.h +# End Source File +# Begin Source File + +SOURCE=..\scaler.h +# End Source File +# Begin Source File + +SOURCE=..\scumm.h +# End Source File +# Begin Source File + +SOURCE=..\scummsys.h +# End Source File +# Begin Source File + +SOURCE=..\stdafx.h +# End Source File +# Begin Source File + +SOURCE=..\util.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\MenuTitle.bmp +# End Source File +# Begin Source File + +SOURCE=.\pocketscumm.ico +# End Source File +# End Group +# Begin Group "Port Source Files" + +# PROP Default_Filter "cpp" +# Begin Source File + +SOURCE=.\bitmaps.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_BITMA=\ + ".\screen.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\findgame.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_FINDG=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FINDG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FINDG=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FINDG=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FINDG=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_FINDG=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FINDG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FINDG=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_FINDG=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FINDG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_FINDG=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\gfx.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + +NODEP_CPP_FINDG=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_FINDG=\ + ".\SDL.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_FINDG=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\gapi_keys.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_GAPI_=\ + "..\gapi_keys.h"\ + "..\stdafx.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\gapi\inc\gx.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\gapi\inc\gx.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_GAPI_=\ + "..\gapi_keys.h"\ + "..\stdafx.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_GAPI_=\ + "..\gapi_keys.h"\ + "..\stdafx.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_GAPI_=\ + "..\gapi_keys.h"\ + "..\stdafx.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_GAPI_=\ + "..\stdafx.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_GAPI_=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\missing\missing.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_MISSI=\ + ".\missing\dirent.h"\ + ".\missing\sys\time.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\pocketpc.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_POCKE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\smush.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + ".\SDLAudio\include\begin_code.h"\ + ".\SDLAudio\include\close_code.h"\ + ".\SDLAudio\include\SDL.h"\ + ".\SDLAudio\include\SDL_active.h"\ + ".\SDLAudio\include\SDL_audio.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + ".\SDLAudio\include\SDL_cdrom.h"\ + ".\SDLAudio\include\SDL_error.h"\ + ".\SDLAudio\include\SDL_events.h"\ + ".\SDLAudio\include\SDL_getenv.h"\ + ".\SDLAudio\include\SDL_joystick.h"\ + ".\SDLAudio\include\SDL_keyboard.h"\ + ".\SDLAudio\include\SDL_keysym.h"\ + ".\SDLAudio\include\SDL_main.h"\ + ".\SDLAudio\include\SDL_mouse.h"\ + ".\SDLAudio\include\SDL_mutex.h"\ + ".\SDLAudio\include\SDL_quit.h"\ + ".\SDLAudio\include\SDL_rwops.h"\ + ".\SDLAudio\include\SDL_thread.h"\ + ".\SDLAudio\include\SDL_timer.h"\ + ".\SDLAudio\include\SDL_types.h"\ + ".\SDLAudio\include\SDL_version.h"\ + ".\SDLAudio\include\SDL_video.h"\ + +NODEP_CPP_POCKE=\ + "..\macos.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_POCKE=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_POCKE=\ + "..\sound.h"\ + ".\ipapi.h"\ + ".\screen.h"\ + ".\SDL.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_POCKE=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_POCKE=\ + ".\screen.h"\ + ".\SDL.h"\ + ".\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_POCKE=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_POCKE=\ + ".\screen.h"\ + ".\SDL.h"\ + ".\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_POCKE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\config-file.h"\ + "..\gameDetector.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\smush.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\gapi\inc\gx.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + ".\SDLAudio\include\begin_code.h"\ + ".\SDLAudio\include\close_code.h"\ + ".\SDLAudio\include\SDL.h"\ + ".\SDLAudio\include\SDL_active.h"\ + ".\SDLAudio\include\SDL_audio.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + ".\SDLAudio\include\SDL_cdrom.h"\ + ".\SDLAudio\include\SDL_error.h"\ + ".\SDLAudio\include\SDL_events.h"\ + ".\SDLAudio\include\SDL_getenv.h"\ + ".\SDLAudio\include\SDL_joystick.h"\ + ".\SDLAudio\include\SDL_keyboard.h"\ + ".\SDLAudio\include\SDL_keysym.h"\ + ".\SDLAudio\include\SDL_main.h"\ + ".\SDLAudio\include\SDL_mouse.h"\ + ".\SDLAudio\include\SDL_mutex.h"\ + ".\SDLAudio\include\SDL_quit.h"\ + ".\SDLAudio\include\SDL_rwops.h"\ + ".\SDLAudio\include\SDL_thread.h"\ + ".\SDLAudio\include\SDL_timer.h"\ + ".\SDLAudio\include\SDL_types.h"\ + ".\SDLAudio\include\SDL_version.h"\ + ".\SDLAudio\include\SDL_video.h"\ + +NODEP_CPP_POCKE=\ + "..\macos.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_POCKE=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_POCKE=\ + ".\screen.h"\ + ".\SDL.h"\ + ".\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_POCKE=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\debug.h"\ + "..\gameDetector.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\gapi\inc\gx.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + ".\SDLAudio\include\begin_code.h"\ + ".\SDLAudio\include\close_code.h"\ + ".\SDLAudio\include\SDL.h"\ + ".\SDLAudio\include\SDL_active.h"\ + ".\SDLAudio\include\SDL_audio.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + ".\SDLAudio\include\SDL_cdrom.h"\ + ".\SDLAudio\include\SDL_error.h"\ + ".\SDLAudio\include\SDL_events.h"\ + ".\SDLAudio\include\SDL_getenv.h"\ + ".\SDLAudio\include\SDL_joystick.h"\ + ".\SDLAudio\include\SDL_keyboard.h"\ + ".\SDLAudio\include\SDL_keysym.h"\ + ".\SDLAudio\include\SDL_main.h"\ + ".\SDLAudio\include\SDL_mouse.h"\ + ".\SDLAudio\include\SDL_mutex.h"\ + ".\SDLAudio\include\SDL_quit.h"\ + ".\SDLAudio\include\SDL_rwops.h"\ + ".\SDLAudio\include\SDL_thread.h"\ + ".\SDLAudio\include\SDL_timer.h"\ + ".\SDLAudio\include\SDL_types.h"\ + ".\SDLAudio\include\SDL_version.h"\ + ".\SDLAudio\include\SDL_video.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + +NODEP_CPP_POCKE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_POCKE=\ + "..\boxes.h"\ + "..\bundle.h"\ + "..\config-file.h"\ + "..\debug.h"\ + "..\gameDetector.h"\ + "..\gapi_keys.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\simon\simon.h"\ + "..\sound\mididrv.h"\ + "..\sound\mixer.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\gapi\inc\gx.h"\ + ".\mad\include\mad.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + ".\SDLAudio\include\begin_code.h"\ + ".\SDLAudio\include\close_code.h"\ + ".\SDLAudio\include\SDL.h"\ + ".\SDLAudio\include\SDL_active.h"\ + ".\SDLAudio\include\SDL_audio.h"\ + ".\SDLAudio\include\SDL_byteorder.h"\ + ".\SDLAudio\include\SDL_cdrom.h"\ + ".\SDLAudio\include\SDL_error.h"\ + ".\SDLAudio\include\SDL_events.h"\ + ".\SDLAudio\include\SDL_getenv.h"\ + ".\SDLAudio\include\SDL_joystick.h"\ + ".\SDLAudio\include\SDL_keyboard.h"\ + ".\SDLAudio\include\SDL_keysym.h"\ + ".\SDLAudio\include\SDL_main.h"\ + ".\SDLAudio\include\SDL_mouse.h"\ + ".\SDLAudio\include\SDL_mutex.h"\ + ".\SDLAudio\include\SDL_quit.h"\ + ".\SDLAudio\include\SDL_rwops.h"\ + ".\SDLAudio\include\SDL_thread.h"\ + ".\SDLAudio\include\SDL_timer.h"\ + ".\SDLAudio\include\SDL_types.h"\ + ".\SDLAudio\include\SDL_version.h"\ + ".\SDLAudio\include\SDL_video.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + +NODEP_CPP_POCKE=\ + "..\macos.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_POCKE=\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\stdafx.h"\ + ".\missing\unistd.h"\ + +NODEP_CPP_POCKE=\ + ".\screen.h"\ + ".\SDL.h"\ + ".\sound.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_POCKE=\ + "..\akos.h"\ + "..\boxes.h"\ + "..\gfx.h"\ + "..\gui.h"\ + "..\scumm.h"\ + "..\scummsys.h"\ + "..\smush.h"\ + "..\stdafx.h"\ + "..\system.h"\ + ".\gapi\inc\gx.h"\ + ".\missing\unistd.h"\ + ".\screen.h"\ + +NODEP_CPP_POCKE=\ + "..\gmidi.h"\ + "..\sound.h"\ + ".\ipapi.h"\ + ".\SDL.h"\ + ".\SDL_audio.h"\ + ".\SDL_thread.h"\ + ".\SDL_timer.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\PocketSCUMM.rc + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\screen.cpp + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +DEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +DEP_CPP_SCREE=\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +DEP_CPP_SCREE=\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +DEP_CPP_SCREE=\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +DEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +DEP_CPP_SCREE=\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +DEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\screen.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +DEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\screen.h"\ + {$(INCLUDE)}"Aygshell.h"\ + {$(INCLUDE)}"sipapi.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +DEP_CPP_SCREE=\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +DEP_CPP_SCREE=\ + ".\gapi\inc\gx.h"\ + ".\screen.h"\ + +NODEP_CPP_SCREE=\ + ".\ipapi.h"\ + ".\ygshell.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\gapi\ARM\gx.lib + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\gapi\emu\gx.lib + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\gapi\MIPS\gx.lib + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\gapi\SH\gx.lib + +!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# End Group +# Begin Group "Port Header Files" + +# PROP Default_Filter "h" +# Begin Source File + +SOURCE=.\missing\assert.h +# End Source File +# Begin Source File + +SOURCE=.\missing\conio.h +# End Source File +# Begin Source File + +SOURCE=.\missing\dir.h +# End Source File +# Begin Source File + +SOURCE=.\missing\direct.h +# End Source File +# Begin Source File + +SOURCE=.\missing\dirent.h +# End Source File +# Begin Source File + +SOURCE=.\missing\errno.h +# End Source File +# Begin Source File + +SOURCE=.\missing\fcntl.h +# End Source File +# Begin Source File + +SOURCE=.\missing\io.h +# End Source File +# Begin Source File + +SOURCE=.\newres.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\screen.h +# End Source File +# Begin Source File + +SOURCE=.\missing\signal.h +# End Source File +# Begin Source File + +SOURCE=.\missing\sys\stat.h +# End Source File +# Begin Source File + +SOURCE=.\missing\sys\time.h +# End Source File +# Begin Source File + +SOURCE=.\missing\time.h +# End Source File +# Begin Source File + +SOURCE=.\missing\sys\types.h +# End Source File +# Begin Source File + +SOURCE=.\missing\unistd.h +# End Source File +# End Group +# End Target +# End Project diff --git a/backends/wince/PocketSCUMM.vcw b/backends/wince/PocketSCUMM.vcw new file mode 100644 index 0000000000..9961cf0d39 --- /dev/null +++ b/backends/wince/PocketSCUMM.vcw @@ -0,0 +1,29 @@ +Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "PocketSCUMM"=.\PocketSCUMM.vcp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/backends/wince/bitmaps.cpp b/backends/wince/bitmaps.cpp new file mode 100644 index 0000000000..3b23330fde --- /dev/null +++ b/backends/wince/bitmaps.cpp @@ -0,0 +1,10720 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifdef _WIN32_WCE + +// Bitmaps used for WCE + +#include +#include "screen.h" + +// Loading + +unsigned char item_loading_colors[] = { + 0x04, 0x02, 0x04, + 0x21, 0x11, 0x1d, + 0x40, 0x21, 0x37, + 0x2c, 0x17, 0x26, + 0x7d, 0x41, 0x6b, + 0xf6, 0x80, 0xd3, + 0xb9, 0x60, 0x9f, + 0x90, 0x4b, 0x7c, + 0x18, 0x0c, 0x15, + 0x9b, 0x51, 0x85, + 0x5e, 0x31, 0x51, + 0xcd, 0x6b, 0xb0, + 0xe1, 0x75, 0xc1, + 0x36, 0x1c, 0x2f, + 0xc3, 0x65, 0xa7, + 0x4a, 0x27, 0x40, + 0xd8, 0x70, 0xb9, + 0x72, 0x3b, 0x62, + 0x55, 0x2c, 0x49, + 0x87, 0x46, 0x74, + 0xaf, 0x5b, 0x96, + 0xec, 0x7b, 0xca, + 0x69, 0x36, 0x5a, + 0xa5, 0x56, 0x8e + +}; +unsigned char item_loading[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x07, + 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x02, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, 0x05, 0x05, 0x05, + 0x05, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x0b, 0x05, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x0b, 0x05, 0x0c, 0x09, 0x09, 0x05, 0x06, 0x00, + 0x00, 0x07, 0x06, 0x06, 0x00, 0x00, 0x07, 0x06, 0x06, + 0x08, 0x07, 0x0c, 0x05, 0x0e, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x0b, 0x05, 0x05, 0x0b, 0x04, 0x04, 0x04, + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x0b, 0x05, 0x05, 0x0b, + 0x0b, 0x05, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x10, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x11, 0x00, 0x00, 0x00, + 0x12, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, + 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, + 0x05, 0x0b, 0x05, 0x05, 0x05, 0x05, 0x10, 0x00, 0x00, + 0x00, 0x12, 0x05, 0x05, 0x09, 0x13, 0x0c, 0x05, 0x05, + 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x12, + 0x00, 0x00, 0x04, 0x05, 0x05, 0x0a, 0x00, 0x00, 0x12, + 0x05, 0x14, 0x01, 0x08, 0x14, 0x05, 0x06, 0x00, 0x00, + 0x03, 0x05, 0x05, 0x05, 0x14, 0x04, 0x0e, 0x05, 0x05, + 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, + 0x05, 0x05, 0x05, 0x0e, 0x13, 0x0c, 0x05, 0x05, 0x03, + 0x00, 0x00, 0x0c, 0x05, 0x04, 0x00, 0x00, 0x0d, 0x05, + 0x15, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x05, 0x0b, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, + 0x00, 0x09, 0x05, 0x05, 0x16, 0x00, 0x00, 0x00, 0x13, + 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, + 0x06, 0x05, 0x05, 0x16, 0x00, 0x00, 0x13, 0x05, 0x05, + 0x02, 0x00, 0x00, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x05, + 0x13, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x11, 0x14, 0x10, 0x05, 0x06, + 0x00, 0x00, 0x0c, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, + 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x05, 0x02, 0x00, 0x00, 0x0c, 0x05, 0x04, 0x00, 0x00, + 0x0d, 0x05, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, + 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x07, 0x05, 0x05, 0x10, 0x10, 0x05, + 0x06, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, + 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x12, 0x05, 0x05, 0x13, + 0x13, 0x0c, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x05, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x05, + 0x05, 0x00, 0x00, 0x14, 0x05, 0x0b, 0x0d, 0x00, 0x04, + 0x05, 0x06, 0x00, 0x00, 0x05, 0x05, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, + 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x0f, 0x0c, 0x15, + 0x05, 0x05, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x05, + 0x05, 0x14, 0x00, 0x03, 0x05, 0x05, 0x01, 0x00, 0x00, + 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x0d, + 0x00, 0x00, 0x00, 0x13, 0x05, 0x06, 0x00, 0x00, 0x06, + 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x17, 0x05, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x05, 0x16, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x00, 0x09, 0x05, 0x05, 0x12, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x0a, 0x00, 0x02, 0x05, 0x05, 0x01, 0x00, + 0x08, 0x0b, 0x05, 0x06, 0x00, 0x00, 0x0a, 0x05, 0x05, + 0x0c, 0x11, 0x02, 0x04, 0x05, 0x05, 0x06, 0x00, 0x00, + 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x02, 0x05, 0x05, + 0x0c, 0x06, 0x04, 0x11, 0x02, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, + 0x06, 0x03, 0x00, 0x00, 0x07, 0x06, 0x06, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x06, 0x00, 0x08, 0x0c, 0x05, 0x05, 0x06, 0x10, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x05, 0x0c, + 0x06, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x0d, 0x00, 0x0b, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x00, + 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x09, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0e, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x06, 0x00, 0x00, 0x03, 0x0e, 0x05, 0x05, + 0x05, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, + 0x05, 0x05, 0x10, 0x02, 0x0c, 0x05, 0x05, 0x11, 0x00, + 0x08, 0x0e, 0x05, 0x05, 0x05, 0x10, 0x17, 0x05, 0x06, + 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, + 0x00, 0x04, 0x05, 0x0e, 0x06, 0x0b, 0x05, 0x05, 0x05, + 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x06, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x00, 0x00, 0x08, 0x02, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, + 0x03, 0x00, 0x00, 0x03, 0x02, 0x02, 0x00, 0x00, 0x03, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x08, + 0x00, 0x17, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x08, 0x00, 0x00, 0x03, 0x02, + 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x05, 0x05, 0x0d, 0x00, 0x00, 0x00, + 0x00, 0x14, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0b, 0x05, 0x05, 0x09, 0x04, + 0x13, 0x10, 0x05, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +// ************************************************************************* +// PORTRAIT +// ************************************************************************* + +unsigned char item_toolbarPortrait_colors[] = { + 0x00, 0x00, 0x00, + 0x04, 0x02, 0x04, + 0x0c, 0x02, 0x04, + 0x24, 0x06, 0x04, + 0x84, 0x16, 0x14, + 0x9c, 0x1a, 0x1c, + 0x74, 0x16, 0x14, + 0x1c, 0x06, 0x04, + 0x5c, 0x0e, 0x0c, + 0x4c, 0x0e, 0x0c, + 0x44, 0x0a, 0x0c, + 0x64, 0x12, 0x14, + 0x8c, 0x1a, 0x1c, + 0xc4, 0x22, 0x24, + 0xb4, 0x1e, 0x1c, + 0x0c, 0x06, 0x04, + 0xa4, 0x1e, 0x1c, + 0x34, 0x0a, 0x0c, + 0x14, 0x16, 0x14, + 0x64, 0x66, 0x64, + 0x1c, 0x16, 0x1c, + 0x1c, 0x1a, 0x1c, + 0x3c, 0x3e, 0x3c, + 0x34, 0x36, 0x34, + 0x34, 0x32, 0x34, + 0x6c, 0x6a, 0x6c, + 0xb4, 0xb2, 0xb4, + 0x4c, 0x4e, 0x4c, + 0x94, 0x92, 0x94, + 0x94, 0x96, 0x94, + 0x7c, 0x7e, 0x7c, + 0x9c, 0x9e, 0x9c, + 0x0c, 0x0a, 0x0c, + 0x44, 0x46, 0x44, + 0x5c, 0x5a, 0x5c, + 0x74, 0x76, 0x74, + 0xc4, 0xc2, 0xc4, + 0x84, 0x82, 0x84, + 0x9c, 0x9a, 0x9c, + 0x74, 0x72, 0x74, + 0x24, 0x26, 0x24, + 0xa4, 0xa6, 0xa4, + 0x3c, 0x3a, 0x3c, + 0x8c, 0x8e, 0x8c, + 0x2c, 0x7e, 0xb4, + 0xbc, 0xbe, 0xbc, + 0x6c, 0x6e, 0x6c, + 0x1c, 0x1e, 0x1c, + 0x2c, 0x5e, 0x7c, + 0xac, 0xaa, 0xac, + 0x5c, 0x5e, 0x5c, + 0xa4, 0xa2, 0xa4, + 0xd4, 0xd6, 0xd4, + 0xac, 0xae, 0xac, + 0xec, 0xee, 0xec, + 0xe4, 0xe6, 0xe4, + 0xfc, 0xfa, 0xfc, + 0x1c, 0x0a, 0x0c, + 0x2c, 0x0e, 0x0c, + 0x24, 0x0a, 0x0c, + 0x14, 0x06, 0x04, + 0x34, 0x0e, 0x0c, + 0xcc, 0xce, 0xcc, + 0xf4, 0xf2, 0xf4, + 0x0c, 0x0a, 0x04, + 0x24, 0x1a, 0x0c, + 0x2c, 0x1e, 0x14, + 0x24, 0x1e, 0x0c, + 0x24, 0x1e, 0x14, + 0x1c, 0x16, 0x0c, + 0x14, 0x0e, 0x04, + 0x04, 0x06, 0x04, + 0x14, 0x12, 0x0c, + 0x5c, 0x1a, 0x1c, + 0x94, 0x26, 0x24, + 0xb4, 0x2e, 0x2c, + 0xd4, 0x3a, 0x3c, + 0xcc, 0x36, 0x34, + 0xa4, 0x2e, 0x2c, + 0x54, 0x16, 0x14, + 0x4c, 0x16, 0x14, + 0x7c, 0x22, 0x24, + 0x9c, 0x2a, 0x2c, + 0xbc, 0x36, 0x34, + 0xb4, 0x32, 0x34, + 0xac, 0x2e, 0x2c, + 0x2c, 0x0a, 0x0c, + 0xa4, 0x2a, 0x2c, + 0x6c, 0x1e, 0x1c, + 0x64, 0x1e, 0x1c, + 0x94, 0x2a, 0x2c, + 0x34, 0x22, 0x24, + 0x64, 0x4a, 0x24, + 0xc4, 0x96, 0x4c, + 0xd4, 0xa2, 0x54, + 0xcc, 0x9e, 0x54, + 0x84, 0x66, 0x34, + 0x14, 0x0e, 0x0c, + 0xec, 0xb2, 0x5c, + 0xdc, 0xaa, 0x5c, + 0x94, 0x72, 0x3c, + 0xe4, 0xb2, 0x5c, + 0x4c, 0x3a, 0x1c, + 0xc4, 0x36, 0x34, + 0xbc, 0x32, 0x34, + 0xc4, 0x32, 0x34, + 0x8c, 0x26, 0x24, + 0x44, 0x12, 0x14, + 0x74, 0x1e, 0x1c, + 0x5c, 0x16, 0x14, + 0xb4, 0x86, 0x44, + 0xfc, 0xc6, 0x6c, + 0xf4, 0xbe, 0x64, + 0xf4, 0xba, 0x64, + 0xfc, 0xbe, 0x64, + 0xec, 0xb6, 0x64, + 0x2c, 0x22, 0x14, + 0xfc, 0xce, 0x6c, + 0xfc, 0xc2, 0x64, + 0xcc, 0x9a, 0x54, + 0xdc, 0xa6, 0x54, + 0xfc, 0xd2, 0x6c, + 0x5c, 0x46, 0x24, + 0xcc, 0x3a, 0x3c, + 0x84, 0x22, 0x24, + 0x84, 0x26, 0x24, + 0xdc, 0xde, 0xdc, + 0xe4, 0xe2, 0xe4, + 0x5c, 0x4a, 0x2c, + 0xec, 0xb6, 0x5c, + 0x9c, 0x7a, 0x3c, + 0xfc, 0xc6, 0x64, + 0x34, 0x26, 0x14, + 0x4c, 0x12, 0x14, + 0x64, 0x1a, 0x1c, + 0x54, 0x3e, 0x24, + 0xf4, 0xb6, 0x64, + 0x6c, 0x56, 0x2c, + 0x3c, 0x2a, 0x14, + 0x44, 0x32, 0x1c, + 0xac, 0x32, 0x34, + 0x54, 0x1a, 0x1c, + 0x3c, 0x12, 0x14, + 0xe4, 0xae, 0x5c, + 0x6c, 0x52, 0x2c, + 0x74, 0x5a, 0x34, + 0xc4, 0x9a, 0x54, + 0x7c, 0x62, 0x34, + 0x84, 0x62, 0x34, + 0xbc, 0xba, 0xbc, + 0x7c, 0x5e, 0x34, + 0x8c, 0x66, 0x34, + 0x9c, 0x76, 0x3c, + 0x94, 0x6e, 0x3c, + 0x8c, 0x6a, 0x3c, + 0x74, 0x22, 0x24, + 0xbc, 0x8e, 0x4c, + 0xb4, 0x8a, 0x4c, + 0xb4, 0x8e, 0x4c, + 0x44, 0x36, 0x1c, + 0x7c, 0x5a, 0x34, + 0x8c, 0x6a, 0x34, + 0x74, 0x56, 0x2c, + 0x5c, 0x4a, 0x24, + 0xbc, 0x92, 0x4c, + 0xe4, 0xaa, 0x5c, + 0x64, 0x4e, 0x2c, + 0x54, 0x3e, 0x1c, + 0x8c, 0x6e, 0x3c, + 0x0c, 0x06, 0x0c, + 0xa4, 0x7e, 0x44, + 0x94, 0x76, 0x3c, + 0x9c, 0x2e, 0x34, + 0x8c, 0x2a, 0x2c, + 0x8c, 0x8a, 0x8c, + 0x54, 0x42, 0x24, + 0x4c, 0x3e, 0x1c, + 0xd4, 0xa6, 0x54, + 0x1c, 0x1a, 0x0c, + 0x2c, 0x2e, 0x2c, + 0xac, 0x82, 0x44 + +}; +unsigned char item_toolbarPortrait[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x06, 0x07, 0x01, 0x01, 0x01, 0x01, 0x02, 0x08, + 0x06, 0x04, 0x05, 0x08, 0x09, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x07, 0x08, 0x04, 0x04, 0x04, 0x06, + 0x0a, 0x01, 0x0b, 0x04, 0x05, 0x04, 0x01, 0x01, 0x01, + 0x08, 0x04, 0x04, 0x05, 0x03, 0x03, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x0c, 0x04, 0x0c, 0x08, 0x03, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x04, 0x05, 0x04, 0x05, 0x0b, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, + 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0f, + 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x0d, 0x0e, 0x0d, + 0x0d, 0x10, 0x03, 0x01, 0x01, 0x01, 0x02, 0x06, 0x0d, + 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x05, 0x01, 0x04, 0x0d, + 0x0d, 0x0e, 0x01, 0x01, 0x11, 0x0d, 0x0d, 0x0d, 0x08, + 0x01, 0x03, 0x0d, 0x0e, 0x0d, 0x0d, 0x0e, 0x0d, 0x0d, + 0x0e, 0x08, 0x11, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, + 0x0d, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x11, 0x0d, 0x0d, 0x05, 0x11, + 0x0a, 0x0e, 0x0d, 0x0e, 0x08, 0x01, 0x06, 0x0e, 0x0d, + 0x0d, 0x0e, 0x04, 0x0e, 0x0e, 0x0d, 0x0d, 0x0e, 0x02, + 0x01, 0x01, 0x05, 0x0e, 0x0d, 0x0d, 0x0e, 0x05, 0x04, + 0x04, 0x04, 0x01, 0x05, 0x0e, 0x0d, 0x0d, 0x01, 0x02, + 0x0e, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x11, 0x0d, 0x0d, + 0x0d, 0x0b, 0x08, 0x08, 0x08, 0x08, 0x11, 0x02, 0x08, + 0x08, 0x08, 0x0d, 0x0d, 0x0e, 0x06, 0x08, 0x08, 0x0a, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x11, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x04, 0x0d, 0x0d, + 0x08, 0x11, 0x0d, 0x0d, 0x0d, 0x04, 0x02, 0x01, 0x01, + 0x0a, 0x0d, 0x0e, 0x0d, 0x06, 0x01, 0x08, 0x0e, 0x0d, + 0x0d, 0x06, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, + 0x0d, 0x0d, 0x0e, 0x01, 0x06, 0x0d, 0x0d, 0x0e, 0x02, + 0x01, 0x01, 0x11, 0x0e, 0x0d, 0x0d, 0x11, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0e, 0x0d, + 0x0d, 0x11, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x12, 0x12, 0x12, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x0d, 0x0d, 0x04, + 0x01, 0x03, 0x0d, 0x0d, 0x0e, 0x0a, 0x0b, 0x0d, 0x0e, + 0x0d, 0x02, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0d, + 0x0e, 0x01, 0x05, 0x0d, 0x0d, 0x10, 0x02, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0d, 0x0e, 0x08, + 0x0d, 0x0d, 0x0e, 0x03, 0x01, 0x01, 0x01, 0x11, 0x0d, + 0x0d, 0x0e, 0x05, 0x05, 0x04, 0x0c, 0x09, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x0d, 0x0d, 0x0d, 0x03, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x13, 0x13, 0x14, 0x12, 0x15, 0x16, + 0x17, 0x18, 0x12, 0x14, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x0d, 0x0e, 0x0b, 0x10, 0x0d, 0x0d, 0x0e, + 0x05, 0x01, 0x04, 0x0d, 0x0d, 0x04, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x08, 0x0e, 0x0d, 0x0d, 0x01, 0x0d, 0x0d, + 0x0e, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x04, 0x0d, 0x0d, 0x04, 0x10, 0x0d, 0x0e, 0x05, 0x01, + 0x01, 0x01, 0x01, 0x03, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, + 0x0e, 0x0d, 0x08, 0x01, 0x01, 0x01, 0x01, 0x03, 0x0e, + 0x0d, 0x0d, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x13, 0x19, 0x13, 0x1a, + 0x19, 0x1b, 0x13, 0x1c, 0x1d, 0x1e, 0x18, 0x17, 0x18, + 0x13, 0x19, 0x13, 0x19, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x0d, 0x0d, + 0x08, 0x06, 0x0e, 0x0e, 0x06, 0x02, 0x01, 0x04, 0x0d, + 0x0d, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x0d, + 0x0e, 0x0e, 0x01, 0x0e, 0x0d, 0x0d, 0x08, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0e, 0x05, + 0x0a, 0x0d, 0x0d, 0x0d, 0x0a, 0x01, 0x01, 0x01, 0x08, + 0x0d, 0x0d, 0x0d, 0x0b, 0x08, 0x08, 0x08, 0x03, 0x01, + 0x01, 0x01, 0x01, 0x11, 0x0d, 0x0d, 0x0e, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x19, + 0x19, 0x1a, 0x1f, 0x1f, 0x1e, 0x20, 0x21, 0x22, 0x23, + 0x24, 0x1a, 0x25, 0x13, 0x19, 0x1f, 0x1f, 0x1a, 0x1a, + 0x19, 0x19, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x08, 0x0d, 0x0e, 0x08, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x03, 0x01, + 0x01, 0x01, 0x02, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x05, + 0x0e, 0x0d, 0x0e, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x05, 0x0d, 0x0d, 0x04, 0x01, 0x04, 0x0d, 0x0e, + 0x0e, 0x02, 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x11, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, + 0x0d, 0x0d, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x26, 0x1a, 0x1f, 0x27, 0x27, + 0x28, 0x01, 0x18, 0x18, 0x17, 0x13, 0x1f, 0x1a, 0x29, + 0x1c, 0x2a, 0x2b, 0x1f, 0x26, 0x1a, 0x1f, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x0e, + 0x0d, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, + 0x0d, 0x0d, 0x0d, 0x0e, 0x08, 0x11, 0x09, 0x0e, 0x0d, + 0x0e, 0x0d, 0x03, 0x01, 0x08, 0x0d, 0x0d, 0x0e, 0x10, + 0x09, 0x0a, 0x03, 0x08, 0x03, 0x01, 0x0d, 0x0d, 0x0d, + 0x04, 0x01, 0x02, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x01, + 0x08, 0x0d, 0x0d, 0x0e, 0x08, 0x03, 0x11, 0x11, 0x08, + 0x01, 0x01, 0x01, 0x01, 0x08, 0x0d, 0x0d, 0x0e, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x2a, 0x1f, 0x29, 0x1c, 0x1d, 0x01, 0x01, 0x17, 0x2c, + 0x18, 0x18, 0x2d, 0x1e, 0x1a, 0x2b, 0x01, 0x29, 0x29, + 0x2b, 0x1f, 0x17, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x08, 0x0d, 0x0d, 0x08, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x0a, 0x0d, 0x0d, 0x0e, + 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, 0x09, 0x01, 0x01, + 0x01, 0x0b, 0x0d, 0x0d, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, + 0x11, 0x01, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x01, 0x08, + 0x0d, 0x0e, 0x0d, 0x08, 0x01, 0x06, 0x0e, 0x0d, 0x0d, + 0x0d, 0x0d, 0x0d, 0x0e, 0x0d, 0x01, 0x01, 0x01, 0x01, + 0x08, 0x0d, 0x0e, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x26, 0x26, + 0x1a, 0x2e, 0x2f, 0x18, 0x30, 0x17, 0x18, 0x31, 0x32, + 0x1a, 0x2b, 0x27, 0x1a, 0x1f, 0x2b, 0x1c, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, + 0x0d, 0x0e, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x06, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, + 0x04, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x05, + 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x02, 0x01, 0x0d, 0x0e, + 0x0d, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x0e, 0x0d, 0x0e, + 0x03, 0x04, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, + 0x05, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x0d, 0x0e, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x18, 0x1c, 0x1f, 0x26, 0x33, 0x16, + 0x18, 0x17, 0x1f, 0x34, 0x35, 0x1a, 0x27, 0x1a, 0x1f, + 0x2b, 0x2b, 0x18, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x03, 0x11, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x11, 0x03, 0x11, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x2e, 0x2b, 0x1c, 0x23, 0x21, 0x17, 0x1f, 0x36, 0x37, + 0x34, 0x1e, 0x1e, 0x26, 0x2b, 0x1c, 0x18, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x15, 0x1c, 0x2b, 0x2b, + 0x2b, 0x29, 0x34, 0x38, 0x36, 0x2d, 0x1d, 0x2b, 0x1c, + 0x2b, 0x2e, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x07, + 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x39, 0x39, 0x02, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3c, + 0x07, 0x3b, 0x3d, 0x3a, 0x3d, 0x3b, 0x07, 0x39, 0x01, + 0x01, 0x01, 0x07, 0x39, 0x03, 0x39, 0x3b, 0x39, 0x3c, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x3b, 0x39, 0x39, 0x03, + 0x39, 0x07, 0x0f, 0x01, 0x01, 0x02, 0x07, 0x3b, 0x39, + 0x39, 0x07, 0x3b, 0x39, 0x07, 0x02, 0x01, 0x01, 0x01, + 0x3c, 0x3b, 0x07, 0x39, 0x07, 0x3b, 0x07, 0x39, 0x03, + 0x01, 0x01, 0x01, 0x3c, 0x3b, 0x07, 0x3b, 0x39, 0x03, + 0x39, 0x39, 0x3b, 0x01, 0x01, 0x01, 0x01, 0x07, 0x39, + 0x03, 0x39, 0x2e, 0x2b, 0x1a, 0x3e, 0x3f, 0x3f, 0x38, + 0x38, 0x37, 0x3e, 0x31, 0x2b, 0x1c, 0x15, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x40, 0x41, 0x42, 0x43, 0x43, + 0x43, 0x44, 0x45, 0x01, 0x43, 0x44, 0x41, 0x43, 0x44, + 0x41, 0x43, 0x42, 0x46, 0x47, 0x01, 0x01, 0x48, 0x43, + 0x43, 0x41, 0x43, 0x44, 0x41, 0x42, 0x43, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x07, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4c, + 0x4d, 0x4b, 0x4e, 0x4f, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x3b, 0x50, 0x51, 0x52, 0x53, 0x4d, 0x4c, + 0x4d, 0x54, 0x55, 0x4e, 0x56, 0x01, 0x01, 0x54, 0x55, + 0x57, 0x4e, 0x4e, 0x4b, 0x58, 0x02, 0x01, 0x01, 0x01, + 0x59, 0x57, 0x4e, 0x55, 0x57, 0x4e, 0x57, 0x50, 0x01, + 0x01, 0x4f, 0x54, 0x57, 0x4e, 0x55, 0x57, 0x4e, 0x57, + 0x4e, 0x4f, 0x01, 0x01, 0x07, 0x5a, 0x55, 0x4e, 0x55, + 0x4e, 0x57, 0x55, 0x57, 0x55, 0x01, 0x01, 0x01, 0x58, + 0x55, 0x57, 0x4e, 0x4e, 0x4e, 0x55, 0x4e, 0x4b, 0x56, + 0x01, 0x01, 0x02, 0x55, 0x55, 0x57, 0x4e, 0x5b, 0x1c, + 0x1a, 0x36, 0x38, 0x38, 0x38, 0x38, 0x38, 0x34, 0x1a, + 0x2b, 0x27, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x5e, 0x5e, 0x60, 0x61, + 0x62, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x63, 0x64, + 0x40, 0x01, 0x01, 0x64, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5f, 0x65, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x4e, 0x4d, + 0x67, 0x67, 0x68, 0x68, 0x69, 0x68, 0x67, 0x4d, 0x6a, + 0x3c, 0x01, 0x01, 0x01, 0x01, 0x02, 0x50, 0x4e, 0x4c, + 0x4d, 0x67, 0x69, 0x68, 0x68, 0x69, 0x67, 0x67, 0x4d, + 0x6b, 0x01, 0x01, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x4d, + 0x51, 0x01, 0x01, 0x01, 0x01, 0x6c, 0x53, 0x67, 0x67, + 0x67, 0x67, 0x68, 0x6d, 0x01, 0x01, 0x58, 0x4c, 0x67, + 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x6c, 0x01, 0x01, + 0x3d, 0x67, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, + 0x4c, 0x01, 0x01, 0x01, 0x6c, 0x4c, 0x67, 0x67, 0x69, + 0x67, 0x67, 0x67, 0x4c, 0x50, 0x01, 0x01, 0x50, 0x67, + 0x67, 0x67, 0x67, 0x67, 0x2b, 0x1a, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x38, 0x34, 0x1a, 0x2b, 0x32, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x40, 0x6e, 0x6f, 0x70, 0x71, + 0x72, 0x70, 0x73, 0x74, 0x43, 0x75, 0x71, 0x70, 0x71, + 0x70, 0x72, 0x71, 0x76, 0x77, 0x48, 0x01, 0x01, 0x78, + 0x70, 0x70, 0x71, 0x72, 0x71, 0x70, 0x72, 0x79, 0x7a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x52, 0x67, 0x68, 0x68, 0x68, 0x53, 0x68, + 0x53, 0x68, 0x68, 0x7b, 0x7c, 0x3c, 0x01, 0x01, 0x01, + 0x3c, 0x7d, 0x4d, 0x67, 0x4b, 0x69, 0x68, 0x53, 0x68, + 0x53, 0x68, 0x68, 0x68, 0x67, 0x6b, 0x01, 0x3b, 0x67, + 0x68, 0x68, 0x67, 0x68, 0x7b, 0x6d, 0x01, 0x01, 0x01, + 0x01, 0x6c, 0x68, 0x67, 0x4b, 0x53, 0x68, 0x54, 0x3d, + 0x01, 0x01, 0x51, 0x67, 0x67, 0x4b, 0x68, 0x67, 0x68, + 0x53, 0x68, 0x4a, 0x01, 0x01, 0x49, 0x4c, 0x4b, 0x53, + 0x68, 0x68, 0x53, 0x68, 0x68, 0x4b, 0x01, 0x01, 0x02, + 0x4a, 0x67, 0x68, 0x67, 0x53, 0x68, 0x68, 0x68, 0x4d, + 0x49, 0x01, 0x01, 0x7c, 0x53, 0x68, 0x68, 0x53, 0x68, + 0x68, 0x26, 0x7e, 0x38, 0x38, 0x38, 0x38, 0x7f, 0x2d, + 0x1a, 0x1c, 0x80, 0x46, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x66, 0x63, 0x71, 0x81, 0x71, 0x81, 0x71, 0x82, 0x01, + 0x7a, 0x83, 0x71, 0x81, 0x71, 0x81, 0x73, 0x81, 0x71, + 0x65, 0x46, 0x01, 0x84, 0x70, 0x71, 0x81, 0x71, 0x81, + 0x71, 0x81, 0x81, 0x70, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x68, 0x68, + 0x53, 0x69, 0x68, 0x68, 0x67, 0x4d, 0x4d, 0x7b, 0x4d, + 0x6a, 0x3c, 0x01, 0x01, 0x02, 0x51, 0x4d, 0x53, 0x69, + 0x53, 0x68, 0x53, 0x69, 0x67, 0x4d, 0x7b, 0x4d, 0x4d, + 0x4c, 0x86, 0x01, 0x3d, 0x4d, 0x68, 0x53, 0x4b, 0x67, + 0x4d, 0x49, 0x01, 0x01, 0x01, 0x01, 0x7c, 0x4b, 0x67, + 0x68, 0x68, 0x69, 0x55, 0x3d, 0x01, 0x02, 0x6c, 0x4d, + 0x53, 0x68, 0x53, 0x4b, 0x67, 0x68, 0x68, 0x54, 0x01, + 0x02, 0x7d, 0x67, 0x68, 0x68, 0x68, 0x67, 0x68, 0x68, + 0x67, 0x4a, 0x01, 0x01, 0x02, 0x52, 0x67, 0x68, 0x4b, + 0x67, 0x68, 0x67, 0x68, 0x67, 0x7c, 0x0f, 0x01, 0x55, + 0x68, 0x67, 0x68, 0x68, 0x67, 0x68, 0x2b, 0x7e, 0x38, + 0x38, 0x38, 0x38, 0x34, 0x1a, 0x1d, 0x2b, 0x65, 0x87, + 0x01, 0x01, 0x01, 0x01, 0x47, 0x64, 0x72, 0x81, 0x71, + 0x81, 0x73, 0x62, 0x43, 0x01, 0x7a, 0x6f, 0x81, 0x88, + 0x81, 0x88, 0x81, 0x71, 0x81, 0x75, 0x74, 0x01, 0x89, + 0x71, 0x81, 0x88, 0x81, 0x73, 0x81, 0x71, 0x70, 0x78, + 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x58, 0x68, 0x67, 0x4b, 0x53, 0x67, 0x68, + 0x7d, 0x6d, 0x49, 0x58, 0x4a, 0x5a, 0x07, 0x01, 0x01, + 0x86, 0x4d, 0x67, 0x68, 0x68, 0x68, 0x68, 0x67, 0x54, + 0x7c, 0x86, 0x6d, 0x49, 0x6c, 0x7d, 0x4f, 0x01, 0x3d, + 0x67, 0x68, 0x68, 0x68, 0x68, 0x7b, 0x6d, 0x01, 0x01, + 0x01, 0x01, 0x55, 0x53, 0x68, 0x68, 0x53, 0x68, 0x55, + 0x3a, 0x01, 0x02, 0x51, 0x4d, 0x68, 0x69, 0x68, 0x67, + 0x68, 0x68, 0x53, 0x4b, 0x0f, 0x3c, 0x4b, 0x69, 0x68, + 0x53, 0x67, 0x4b, 0x53, 0x68, 0x67, 0x4a, 0x01, 0x01, + 0x02, 0x4a, 0x69, 0x68, 0x68, 0x67, 0x4b, 0x53, 0x68, + 0x67, 0x4a, 0x02, 0x3b, 0x68, 0x67, 0x4b, 0x68, 0x67, + 0x4b, 0x53, 0x68, 0x2d, 0x7e, 0x38, 0x38, 0x38, 0x34, + 0x1a, 0x1c, 0x73, 0x81, 0x64, 0x01, 0x01, 0x01, 0x01, + 0x8b, 0x78, 0x70, 0x88, 0x81, 0x71, 0x76, 0x60, 0x01, + 0x01, 0x7a, 0x76, 0x71, 0x81, 0x71, 0x81, 0x71, 0x81, + 0x88, 0x6f, 0x66, 0x01, 0x6e, 0x73, 0x71, 0x81, 0x71, + 0x81, 0x88, 0x81, 0x70, 0x63, 0x8a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x68, + 0x53, 0x68, 0x69, 0x4b, 0x54, 0x85, 0x01, 0x01, 0x01, + 0x3c, 0x3d, 0x02, 0x01, 0x07, 0x8c, 0x68, 0x4b, 0x67, + 0x68, 0x68, 0x67, 0x4a, 0x3d, 0x0f, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x3c, 0x01, 0x3d, 0x67, 0x68, 0x53, 0x68, + 0x67, 0x67, 0x8d, 0x01, 0x01, 0x01, 0x01, 0x57, 0x68, + 0x67, 0x68, 0x68, 0x69, 0x55, 0x8e, 0x01, 0x0f, 0x7c, + 0x67, 0x68, 0x53, 0x68, 0x4b, 0x67, 0x68, 0x68, 0x54, + 0x3d, 0x3a, 0x7b, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, + 0x68, 0x67, 0x4a, 0x01, 0x01, 0x01, 0x55, 0x67, 0x68, + 0x53, 0x68, 0x68, 0x68, 0x68, 0x67, 0x68, 0x0f, 0x86, + 0x53, 0x68, 0x53, 0x67, 0x68, 0x68, 0x68, 0x68, 0x1a, + 0x34, 0x38, 0x38, 0x38, 0x7e, 0x1a, 0x2b, 0x73, 0x81, + 0x5f, 0x01, 0x01, 0x01, 0x01, 0x60, 0x76, 0x88, 0x81, + 0x71, 0x81, 0x8f, 0x46, 0x01, 0x01, 0x90, 0x83, 0x73, + 0x81, 0x88, 0x81, 0x81, 0x73, 0x81, 0x76, 0x91, 0x46, + 0x73, 0x81, 0x88, 0x81, 0x73, 0x81, 0x71, 0x81, 0x70, + 0x63, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3d, 0x69, 0x68, 0x68, 0x53, 0x68, + 0x68, 0x4a, 0x56, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x6d, 0x4b, 0x53, 0x68, 0x53, 0x68, 0x53, 0x52, 0x07, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x6b, 0x67, 0x68, 0x68, 0x68, 0x67, 0x55, 0x09, 0x01, + 0x01, 0x01, 0x01, 0x4e, 0x67, 0x4b, 0x53, 0x68, 0x53, + 0x4e, 0x07, 0x01, 0x07, 0x5a, 0x67, 0x68, 0x68, 0x68, + 0x52, 0x68, 0x68, 0x53, 0x4b, 0x85, 0x49, 0x4d, 0x53, + 0x69, 0x4e, 0x55, 0x69, 0x68, 0x53, 0x69, 0x4a, 0x01, + 0x01, 0x3c, 0x67, 0x68, 0x68, 0x68, 0x55, 0x55, 0x67, + 0x68, 0x68, 0x4d, 0x01, 0x6a, 0x69, 0x68, 0x68, 0x54, + 0x4a, 0x69, 0x53, 0x68, 0x1a, 0x34, 0x38, 0x38, 0x7e, + 0x34, 0x1a, 0x2b, 0x81, 0x71, 0x78, 0x84, 0x01, 0x01, + 0x43, 0x92, 0x76, 0x81, 0x73, 0x81, 0x76, 0x93, 0x01, + 0x01, 0x47, 0x60, 0x72, 0x71, 0x81, 0x71, 0x5e, 0x78, + 0x71, 0x73, 0x76, 0x94, 0x66, 0x81, 0x73, 0x81, 0x65, + 0x5d, 0x71, 0x88, 0x81, 0x70, 0x78, 0x8a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x7c, 0x67, 0x68, 0x68, 0x68, 0x67, 0x67, 0x57, 0x50, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x51, 0x53, 0x69, 0x68, + 0x68, 0x68, 0x68, 0x4f, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x67, 0x68, 0x53, + 0x68, 0x67, 0x54, 0x6b, 0x01, 0x01, 0x01, 0x01, 0x57, + 0x68, 0x68, 0x69, 0x68, 0x67, 0x57, 0x0f, 0x01, 0x07, + 0x4a, 0x67, 0x68, 0x67, 0x67, 0x6a, 0x54, 0x53, 0x68, + 0x68, 0x58, 0x7d, 0x67, 0x68, 0x67, 0x6a, 0x6a, 0x67, + 0x68, 0x68, 0x67, 0x5a, 0x01, 0x01, 0x01, 0x4d, 0x67, + 0x68, 0x53, 0x57, 0x52, 0x53, 0x68, 0x53, 0x4d, 0x8e, + 0x4b, 0x53, 0x68, 0x68, 0x6a, 0x5a, 0x67, 0x68, 0x68, + 0x26, 0x95, 0x7e, 0x38, 0x7e, 0x34, 0x1a, 0x1c, 0x81, + 0x71, 0x65, 0x96, 0x01, 0x01, 0x90, 0x70, 0x81, 0x71, + 0x81, 0x71, 0x8f, 0x45, 0x01, 0x01, 0x47, 0x97, 0x76, + 0x73, 0x81, 0x70, 0x92, 0x77, 0x71, 0x81, 0x72, 0x98, + 0x99, 0x73, 0x81, 0x71, 0x8f, 0x9a, 0x76, 0x81, 0x71, + 0x71, 0x78, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x3c, 0x6a, 0x4d, 0x53, + 0x68, 0x53, 0x4b, 0x67, 0x68, 0x86, 0x01, 0x01, 0x01, + 0x01, 0x4e, 0x4b, 0x68, 0x67, 0x68, 0x53, 0x4e, 0x07, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x49, 0x67, 0x68, 0x68, 0x68, 0x68, 0x4b, 0x3d, + 0x01, 0x01, 0x01, 0x3c, 0x4e, 0x69, 0x68, 0x53, 0x68, + 0x53, 0x57, 0x3c, 0x01, 0x3b, 0x52, 0x67, 0x68, 0x68, + 0x67, 0x58, 0x4b, 0x68, 0x67, 0x4b, 0x7d, 0x4b, 0x68, + 0x68, 0x69, 0x86, 0x51, 0x4d, 0x53, 0x68, 0x68, 0x4a, + 0x01, 0x01, 0x3b, 0x4d, 0x68, 0x68, 0x67, 0x57, 0x6a, + 0x55, 0x69, 0x68, 0x67, 0x9b, 0x4b, 0x68, 0x53, 0x54, + 0x6d, 0x4a, 0x67, 0x68, 0x53, 0x2b, 0x1a, 0x7e, 0x7e, + 0x34, 0x95, 0x1d, 0x2b, 0x81, 0x71, 0x81, 0x9c, 0x01, + 0x45, 0x9d, 0x76, 0x71, 0x81, 0x71, 0x76, 0x64, 0x01, + 0x01, 0x01, 0x47, 0x82, 0x72, 0x71, 0x81, 0x70, 0x6e, + 0x9e, 0x72, 0x81, 0x70, 0x6e, 0x5f, 0x81, 0x71, 0x81, + 0x5d, 0x7a, 0x83, 0x73, 0x81, 0x70, 0x63, 0x8a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x3c, 0x51, 0x4d, 0x68, 0x67, 0x68, 0x68, + 0x67, 0x67, 0x86, 0x01, 0x01, 0x01, 0x4e, 0x68, 0x53, + 0x4b, 0x67, 0x68, 0x4e, 0x0f, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x67, 0x68, + 0x53, 0x68, 0x67, 0x54, 0x6b, 0x01, 0x01, 0x01, 0x3c, + 0x55, 0x53, 0x68, 0x68, 0x68, 0x68, 0x4e, 0x3c, 0x01, + 0x3d, 0x55, 0x69, 0x68, 0x53, 0x4d, 0x3b, 0x4b, 0x53, + 0x68, 0x53, 0x55, 0x68, 0x53, 0x69, 0x4e, 0x49, 0x7c, + 0x67, 0x68, 0x68, 0x67, 0x4a, 0x01, 0x01, 0x3d, 0x4d, + 0x53, 0x68, 0x67, 0x5a, 0x4f, 0x52, 0x67, 0x68, 0x67, + 0x55, 0x68, 0x68, 0x68, 0x4b, 0x3a, 0x69, 0x68, 0x68, + 0x69, 0x1c, 0x1d, 0x95, 0x34, 0x95, 0x1d, 0x2b, 0x1c, + 0x88, 0x81, 0x71, 0x5f, 0x46, 0x9f, 0x76, 0x71, 0x81, + 0x88, 0x81, 0x76, 0x84, 0x01, 0x01, 0x01, 0x40, 0x5d, + 0x71, 0x81, 0x71, 0x76, 0xa0, 0xa1, 0x76, 0x73, 0x71, + 0x5e, 0x81, 0x88, 0x81, 0x73, 0x99, 0xa2, 0x6f, 0x88, + 0x81, 0x70, 0x78, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, + 0x6c, 0x67, 0x68, 0x68, 0x67, 0x68, 0x68, 0x67, 0x50, + 0x01, 0x01, 0x52, 0x68, 0x69, 0x68, 0x67, 0x68, 0x55, + 0x3b, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x7d, 0x69, 0x68, 0x68, 0x68, 0x67, 0x4b, + 0x3d, 0x01, 0x01, 0x01, 0x3a, 0x4b, 0x68, 0x68, 0x69, + 0x53, 0x67, 0x4e, 0x3c, 0x01, 0x8e, 0x55, 0x67, 0x68, + 0x68, 0x4c, 0x02, 0x4e, 0x68, 0x68, 0x68, 0x68, 0x68, + 0x68, 0x67, 0x6a, 0x6b, 0x5a, 0x67, 0x68, 0x69, 0x67, + 0x58, 0x01, 0x01, 0x8e, 0x4d, 0x68, 0x68, 0x67, 0x6a, + 0x85, 0x5a, 0x67, 0x68, 0x67, 0x4b, 0x53, 0x68, 0x53, + 0x4e, 0x02, 0x4c, 0x68, 0x53, 0x1d, 0x2b, 0x2b, 0x1a, + 0x34, 0x1a, 0x2b, 0x1c, 0x35, 0x81, 0x71, 0x81, 0x63, + 0x5c, 0x9a, 0x83, 0x88, 0x81, 0x73, 0x76, 0x82, 0x0f, + 0x01, 0x01, 0x01, 0x40, 0x5d, 0x70, 0x88, 0x81, 0x6f, + 0x5c, 0x89, 0x72, 0x71, 0x81, 0x73, 0x81, 0x73, 0x81, + 0x8f, 0xa3, 0x9a, 0x76, 0x81, 0x71, 0x72, 0x9d, 0x41, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x50, 0x67, 0x68, + 0x4b, 0x67, 0x68, 0x4d, 0x4a, 0x07, 0x01, 0x6c, 0x53, + 0x68, 0x53, 0x4b, 0x67, 0x68, 0x6c, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x6a, 0x67, + 0x53, 0x69, 0x68, 0x53, 0x68, 0x6b, 0x01, 0x01, 0x01, + 0x3d, 0x54, 0x68, 0x67, 0x53, 0x4b, 0x67, 0x4a, 0x01, + 0x01, 0x3d, 0x69, 0x53, 0x68, 0x53, 0x4d, 0x3c, 0x7c, + 0x53, 0x68, 0x67, 0x53, 0x68, 0x68, 0x4d, 0x6c, 0x39, + 0x4a, 0x67, 0x68, 0x53, 0x67, 0x86, 0x01, 0x01, 0x4f, + 0x67, 0x69, 0x53, 0x69, 0x4a, 0x3d, 0x51, 0x67, 0x68, + 0x68, 0x68, 0x68, 0x69, 0x4b, 0x86, 0x3c, 0x4d, 0x67, + 0x1d, 0x1a, 0x2b, 0x1c, 0x1a, 0x95, 0x1a, 0x2b, 0x2b, + 0x1a, 0x1d, 0x81, 0x71, 0x65, 0xa4, 0x5e, 0x71, 0x81, + 0x71, 0x71, 0x70, 0x84, 0x01, 0x01, 0x01, 0x01, 0x40, + 0xa5, 0x71, 0x81, 0x71, 0x83, 0xa6, 0xa7, 0x65, 0x81, + 0x71, 0x81, 0x71, 0x81, 0x71, 0x8f, 0x46, 0xa8, 0x76, + 0x88, 0x81, 0x76, 0x9d, 0x45, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x03, 0x01, + 0x01, 0x01, 0x02, 0x7c, 0x4d, 0x53, 0x68, 0x68, 0x67, + 0x55, 0x3b, 0x01, 0x50, 0x4b, 0x68, 0x68, 0x53, 0x68, + 0x67, 0x4b, 0x6c, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x3a, 0x07, 0x01, 0x4a, 0x67, 0x4b, 0x68, 0x67, 0x68, + 0x67, 0x51, 0x01, 0x01, 0x01, 0x6a, 0x68, 0x67, 0x4b, + 0x69, 0x68, 0x53, 0x52, 0x01, 0x01, 0x4f, 0x4c, 0x68, + 0x68, 0x69, 0x4d, 0x3c, 0x49, 0x4b, 0x67, 0x4b, 0x68, + 0x68, 0x53, 0x68, 0x50, 0x3c, 0x52, 0x67, 0x68, 0x68, + 0x4d, 0x6d, 0x01, 0x01, 0x86, 0x67, 0x68, 0x68, 0x67, + 0x52, 0x39, 0x58, 0x4d, 0x53, 0x68, 0x67, 0x68, 0x53, + 0x68, 0x3d, 0x3c, 0x4c, 0x1d, 0x1a, 0x1a, 0x35, 0x2b, + 0x1d, 0x19, 0x19, 0x1c, 0x35, 0x1a, 0x1a, 0x1d, 0x81, + 0x73, 0x81, 0x73, 0x81, 0x88, 0x81, 0x83, 0x82, 0x46, + 0x01, 0x01, 0x01, 0x01, 0x46, 0x6f, 0x81, 0x71, 0x81, + 0x6f, 0x90, 0x74, 0x5e, 0x71, 0x81, 0x88, 0x81, 0x71, + 0x81, 0x6e, 0x01, 0x64, 0x76, 0x73, 0x81, 0x76, 0x6e, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x54, 0x4b, 0x68, 0x7d, 0x7c, 0x4a, 0x67, + 0x68, 0x68, 0x69, 0x53, 0x67, 0x52, 0x07, 0x01, 0x01, + 0x4e, 0x68, 0x53, 0x68, 0x68, 0x68, 0x53, 0x53, 0x4b, + 0x52, 0x7c, 0x7c, 0x55, 0x68, 0x67, 0x07, 0x01, 0x6c, + 0x67, 0x68, 0x53, 0x4b, 0x67, 0x67, 0x67, 0x4e, 0x7c, + 0x55, 0x68, 0x53, 0x67, 0x68, 0x53, 0x68, 0x68, 0x6c, + 0x01, 0x01, 0x50, 0x4d, 0x68, 0x53, 0x68, 0x67, 0x02, + 0x50, 0x68, 0x68, 0x68, 0x67, 0x68, 0x67, 0x57, 0x3a, + 0x07, 0x52, 0x67, 0x68, 0x53, 0x67, 0x86, 0x01, 0x01, + 0x86, 0x67, 0x68, 0x68, 0x67, 0x4a, 0x3c, 0x86, 0x4d, + 0x68, 0x68, 0x4b, 0x67, 0x68, 0x4b, 0x01, 0x3c, 0x1f, + 0x1a, 0x1a, 0x1d, 0x1d, 0x13, 0xa9, 0x47, 0x01, 0x13, + 0x19, 0x1a, 0x1a, 0x1a, 0x1f, 0x71, 0x81, 0x81, 0x88, + 0x81, 0x71, 0x71, 0x8a, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x46, 0x6f, 0x81, 0x88, 0x81, 0x76, 0x5c, 0x41, 0x92, + 0x70, 0x73, 0x81, 0x71, 0x81, 0x73, 0xa2, 0x01, 0x64, + 0x76, 0x81, 0x88, 0x76, 0x9d, 0x45, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x69, + 0x53, 0x69, 0x53, 0x68, 0x53, 0x68, 0x53, 0x68, 0x68, + 0x4d, 0x6c, 0x02, 0x01, 0x01, 0x8e, 0x4b, 0x69, 0x53, + 0x68, 0x67, 0x4b, 0x69, 0x68, 0x53, 0x69, 0x53, 0x68, + 0x68, 0x4d, 0x02, 0x01, 0x85, 0x67, 0x68, 0x68, 0x68, + 0x67, 0x4b, 0x68, 0x68, 0x67, 0x67, 0x68, 0x67, 0x4b, + 0x68, 0x68, 0x68, 0x55, 0x56, 0x01, 0x01, 0x86, 0x7b, + 0x68, 0x68, 0x67, 0x4e, 0x02, 0x3a, 0x68, 0x53, 0x68, + 0x68, 0x68, 0x67, 0x6a, 0x01, 0x07, 0x4a, 0x67, 0x68, + 0x68, 0x67, 0x86, 0x01, 0x01, 0x51, 0x67, 0x53, 0x68, + 0x67, 0x7c, 0x01, 0x6b, 0x4b, 0x67, 0x68, 0x53, 0x68, + 0x68, 0x7c, 0x01, 0x07, 0x1a, 0x1a, 0x13, 0x13, 0x13, + 0x50, 0x01, 0x01, 0x01, 0x47, 0x32, 0x19, 0x13, 0x1c, + 0xaa, 0x81, 0x88, 0x71, 0x81, 0x71, 0x76, 0xab, 0x46, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x84, 0x76, 0x71, 0x81, + 0x71, 0x8f, 0x66, 0x01, 0x9d, 0x72, 0x81, 0x71, 0x81, + 0x73, 0x81, 0x74, 0x0f, 0x64, 0x76, 0x71, 0x73, 0x72, + 0x6e, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x54, 0x68, 0x68, 0x68, 0x68, 0x69, + 0x68, 0x68, 0x69, 0x53, 0x67, 0x4e, 0x03, 0x01, 0x01, + 0x01, 0x01, 0x3d, 0x54, 0x4b, 0x67, 0x68, 0x68, 0x53, + 0x68, 0x68, 0x68, 0x68, 0x68, 0x67, 0x52, 0x02, 0x01, + 0x01, 0x7c, 0x67, 0x53, 0x68, 0x53, 0x68, 0x53, 0x53, + 0x68, 0x4b, 0x67, 0x68, 0x53, 0x68, 0x53, 0x4b, 0x50, + 0x01, 0x01, 0x02, 0x6c, 0x4d, 0x68, 0x68, 0x67, 0x57, + 0x02, 0x02, 0x4b, 0x68, 0x68, 0x53, 0x68, 0x67, 0x59, + 0x01, 0x56, 0x57, 0x67, 0x68, 0x68, 0x67, 0x86, 0x01, + 0x01, 0x4a, 0x69, 0x68, 0x68, 0x67, 0x7d, 0x01, 0x3d, + 0x4e, 0x69, 0x68, 0x68, 0x68, 0x67, 0x50, 0x01, 0x3b, + 0xac, 0xad, 0xae, 0xae, 0xae, 0x1e, 0x01, 0x01, 0x01, + 0x01, 0xae, 0xae, 0xae, 0x5f, 0x71, 0x81, 0x81, 0x81, + 0x73, 0x81, 0x88, 0x8b, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0xaf, 0x76, 0x88, 0x81, 0x71, 0x8f, 0xb0, 0x01, + 0x82, 0x72, 0x81, 0x71, 0x81, 0x81, 0xb1, 0x01, 0x40, + 0xaa, 0x76, 0x81, 0x81, 0x76, 0x9d, 0x45, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, + 0x69, 0x53, 0x69, 0x68, 0x68, 0x68, 0x53, 0x53, 0x4b, + 0x52, 0x56, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3c, + 0x7c, 0x54, 0x68, 0x68, 0x68, 0x68, 0x68, 0x69, 0x53, + 0x69, 0x67, 0x6a, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x54, + 0x4b, 0x68, 0x68, 0x67, 0x4b, 0x69, 0x53, 0x68, 0x53, + 0x68, 0x4b, 0x52, 0x3d, 0x01, 0x01, 0x01, 0x02, 0x7c, + 0x4d, 0x53, 0x67, 0x67, 0x57, 0x3c, 0x01, 0x54, 0x67, + 0x67, 0x68, 0x53, 0x55, 0x09, 0x01, 0x6b, 0x54, 0x67, + 0x67, 0x53, 0x67, 0x86, 0x01, 0x01, 0x55, 0x67, 0x67, + 0x67, 0x4d, 0x7c, 0x01, 0x07, 0x4e, 0x69, 0x53, 0x67, + 0x53, 0x68, 0x07, 0x01, 0x50, 0x4d, 0x53, 0x54, 0x2b, + 0x2a, 0x16, 0x01, 0x01, 0x01, 0x01, 0x2a, 0x16, 0x2a, + 0x71, 0x81, 0x71, 0x71, 0x71, 0x71, 0x83, 0xab, 0x46, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x5c, 0x76, 0x70, + 0x81, 0x70, 0x8f, 0xa7, 0x01, 0x64, 0x76, 0x71, 0x71, + 0x71, 0x71, 0xa1, 0x01, 0x48, 0x5e, 0x70, 0x71, 0x71, + 0x76, 0x9d, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x4a, 0x52, 0x4e, 0x55, + 0x4e, 0x55, 0x57, 0x6a, 0x85, 0x02, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x59, 0x4a, + 0x4e, 0x4e, 0x55, 0x4e, 0x57, 0x57, 0x4a, 0x50, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x4f, 0x7c, 0x57, 0x4e, + 0x57, 0x4e, 0x57, 0x57, 0x52, 0x6c, 0x6b, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x3c, 0x6c, 0x4e, 0x52, 0x4a, 0x4e, + 0x7c, 0x02, 0x01, 0x6c, 0x52, 0x4a, 0x4e, 0x52, 0x7c, + 0x07, 0x01, 0x3d, 0x4a, 0x52, 0x4a, 0x4e, 0x57, 0x4f, + 0x01, 0x01, 0x4e, 0x52, 0x4a, 0x52, 0x57, 0x58, 0x01, + 0x02, 0x6c, 0x4e, 0x52, 0x4a, 0x57, 0x7d, 0x01, 0x01, + 0x3d, 0xb3, 0x18, 0xb3, 0x2a, 0x18, 0x18, 0xb3, 0x01, + 0x01, 0xb3, 0x18, 0x18, 0x18, 0xb3, 0x18, 0xb3, 0x5d, + 0x5d, 0x77, 0x5d, 0x8b, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x90, 0x5f, 0x5d, 0x5d, 0x5f, 0x9c, 0x8b, + 0x01, 0x7a, 0x5d, 0x5d, 0x5d, 0x5d, 0x77, 0x9f, 0x01, + 0x46, 0xb4, 0x77, 0x5d, 0x5d, 0x5e, 0x64, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x02, 0x3c, 0x3c, 0x3c, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 0x3c, 0x3c, + 0x3c, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01 +}; + +// Keyboard + +unsigned char item_keyboardPortrait_colors[] = { + 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, + 0x39, 0x39, 0x39, + 0x31, 0x31, 0x31, + 0x29, 0x29, 0x29, + 0x21, 0x21, 0x21, + 0x42, 0x42, 0x42, + 0x63, 0x63, 0x63, + 0x7b, 0x7b, 0x7b, + 0x73, 0x73, 0x73, + 0x6b, 0x6b, 0x6b, + 0x4a, 0x4a, 0x4a, + 0x94, 0x94, 0x94, + 0x9c, 0x9c, 0x9c, + 0xa5, 0xa5, 0xa5, + 0xbd, 0xbd, 0xbd, + 0x5a, 0x5a, 0x5a, + 0x52, 0x52, 0x52, + 0x84, 0x84, 0x84, + 0xad, 0xad, 0xad, + 0xc6, 0xc6, 0xc6, + 0xb5, 0xb5, 0xb5, + 0x8c, 0x8c, 0x8c, + 0x10, 0x10, 0x10, + 0x08, 0x08, 0x08 + +}; +unsigned char item_keyboardPortrait[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x07, 0x08, 0x06, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x09, 0x08, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x08, 0x07, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x0b, 0x0c, 0x0d, 0x0d, + 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x0e, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x0f, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0d, 0x0e, + 0x0d, 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x0d, 0x0e, 0x0d, 0x11, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, + 0x0d, 0x0d, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x10, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x0d, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x0d, 0x07, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x0b, 0x0e, 0x13, 0x08, 0x08, 0x06, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x07, 0x12, + 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x08, 0x09, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x08, 0x12, 0x0f, 0x10, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x0f, + 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x10, 0x12, 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, + 0x08, 0x08, 0x0d, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x07, 0x08, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, + 0x14, 0x08, 0x12, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, 0x11, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x0d, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x0f, 0x07, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x0f, 0x07, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x06, 0x06, 0x0f, 0x07, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, + 0x06, 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x06, 0x06, 0x06, 0x06, 0x08, 0x0d, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x07, 0x14, + 0x06, 0x06, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x07, 0x0f, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, + 0x11, 0x13, 0x07, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x10, 0x0f, 0x0f, 0x14, 0x0e, 0x06, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, + 0x0e, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x11, 0x0e, 0x0f, 0x14, 0x0f, + 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x12, 0x0f, 0x0f, 0x0e, 0x13, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x14, + 0x12, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x10, 0x0f, 0x0f, 0x0f, 0x15, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, + 0x0e, 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x12, 0x0e, 0x12, 0x15, 0x0f, 0x0e, 0x06, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x15, 0x0f, + 0x0f, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x0d, 0x0f, 0x14, 0x15, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, + 0x06, 0x06, 0x09, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, 0x10, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0d, + 0x0d, 0x0f, 0x0e, 0x0e, 0x15, 0x07, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x08, 0x0d, 0x03, 0x03, 0x03, 0x00, + 0x06, 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x08, 0x0d, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x0c, 0x13, 0x06, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x11, 0x13, 0x0f, 0x07, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x07, 0x07, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0c, 0x07, 0x0a, 0x15, + 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, + 0x13, 0x13, 0x07, 0x10, 0x10, 0x0b, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, + 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x09, 0x15, 0x08, 0x07, 0x09, 0x0f, 0x0a, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x09, + 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x13, + 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x10, 0x07, 0x0f, 0x07, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x11, 0x07, 0x09, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x0c, 0x15, 0x11, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x0e, 0x15, 0x09, 0x0f, 0x0e, + 0x16, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x08, + 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x0b, 0x12, 0x12, 0x08, 0x13, + 0x16, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x07, + 0x0f, 0x06, 0x06, 0x12, 0x0d, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, + 0x08, 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0c, + 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0b, + 0x13, 0x0f, 0x0f, 0x09, 0x10, 0x11, 0x11, 0x11, 0x0b, + 0x0b, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x10, 0x12, 0x08, 0x08, 0x13, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, + 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x0b, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x0f, 0x10, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, + 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x12, 0x0e, 0x06, 0x02, 0x02, 0x0d, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x10, 0x0f, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, + 0x0e, 0x0d, 0x13, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x10, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x0d, 0x12, 0x06, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x03, + 0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x0f, 0x10, 0x11, 0x10, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x08, 0x15, 0x0d, 0x0e, 0x0d, 0x0d, + 0x0b, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x11, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x0d, + 0x13, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x0f, 0x0f, 0x13, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x10, 0x15, 0x0f, 0x0f, 0x0e, + 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, 0x0c, 0x06, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x11, + 0x0f, 0x0d, 0x0d, 0x0d, 0x14, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x14, + 0x10, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, + 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, + 0x02, 0x06, 0x02, 0x10, 0x0f, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x08, 0x0f, 0x0f, 0x0c, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x0d, 0x08, 0x02, 0x0f, + 0x10, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x08, + 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, + 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x11, 0x0d, 0x0d, 0x0d, 0x13, 0x15, 0x06, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0c, 0x0f, + 0x0f, 0x14, 0x0f, 0x0f, 0x0f, 0x0e, 0x02, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x11, 0x15, 0x0f, 0x07, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x0e, 0x02, 0x02, 0x02, + 0x16, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x06, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x08, + 0x08, 0x08, 0x08, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, + 0x02, 0x02, 0x0b, 0x13, 0x08, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x08, + 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, + 0x0f, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x13, 0x10, 0x15, 0x0c, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, + 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x0d, 0x08, 0x02, 0x14, 0x10, 0x11, 0x0f, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x11, 0x15, + 0x10, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, + 0x09, 0x13, 0x10, 0x10, 0x07, 0x13, 0x0d, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0f, 0x16, 0x10, + 0x0a, 0x15, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x06, 0x13, 0x0e, 0x10, 0x11, 0x11, 0x06, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x15, 0x0a, + 0x10, 0x0c, 0x0f, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x03, 0x0a, 0x15, 0x0a, 0x10, 0x11, 0x10, 0x02, + 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, + 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x06, 0x15, 0x13, 0x0d, 0x0f, 0x15, + 0x09, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, + 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, + 0x10, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x02, 0x02, 0x03, 0x02, 0x11, 0x14, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x06, + 0x0e, 0x0c, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x02, + 0x0f, 0x10, 0x11, 0x0f, 0x03, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x03, 0x06, 0x10, 0x10, 0x0f, 0x0a, + 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, + 0x08, 0x13, 0x10, 0x11, 0x10, 0x11, 0x02, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x03, 0x02, 0x06, 0x10, 0x10, 0x10, + 0x11, 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x02, 0x02, 0x02, 0x03, 0x08, 0x0d, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x07, 0x16, 0x10, + 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0b, 0x02, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, 0x0f, + 0x15, 0x0d, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x09, 0x0e, 0x0e, 0x0f, 0x0f, 0x08, 0x04, 0x03, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0e, + 0x0f, 0x14, 0x0f, 0x0c, 0x04, 0x04, 0x04, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0e, 0x0a, + 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0a, + 0x15, 0x0f, 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0b, 0x03, 0x03, + 0x04, 0x03, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x06, 0x09, 0x08, 0x11, 0x0d, 0x09, 0x04, 0x04, 0x04, + 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, 0x03, + 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x15, 0x0f, 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x11, 0x0f, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x09, 0x0c, 0x03, 0x03, 0x06, 0x0e, 0x09, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0f, + 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x0c, 0x09, 0x03, 0x15, 0x0b, 0x0b, 0x15, + 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x0c, 0x03, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x14, + 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, + 0x03, 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x0a, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x09, 0x0c, 0x03, 0x04, 0x04, 0x04, 0x00, 0x03, + 0x03, 0x03, 0x0b, 0x0c, 0x0f, 0x14, 0x0f, 0x15, 0x0b, + 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x0c, 0x09, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x09, 0x06, 0x03, 0x11, 0x14, 0x04, 0x04, + 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x09, 0x09, 0x09, 0x0c, 0x14, 0x06, 0x04, 0x05, + 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x15, 0x0d, + 0x09, 0x0c, 0x13, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x0c, 0x0d, 0x0d, + 0x0c, 0x02, 0x04, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x06, 0x0c, 0x0d, 0x0c, 0x06, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x06, 0x0b, 0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x10, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x06, 0x0a, 0x0d, 0x11, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, + 0x0d, 0x0d, 0x0d, 0x12, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x11, 0x0e, 0x0d, 0x0d, 0x0b, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, + 0x0e, 0x0d, 0x0d, 0x0d, 0x07, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x11, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x0b, 0x07, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x0a, 0x0b, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x13, 0x0b, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0b, + 0x06, 0x06, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x08, 0x13, 0x12, 0x08, 0x08, 0x0e, 0x0d, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, + 0x0f, 0x12, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x12, 0x13, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, + 0x13, 0x12, 0x08, 0x12, 0x13, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x0b, 0x13, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, + 0x13, 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, + 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x11, + 0x11, 0x11, 0x07, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, + 0x06, 0x06, 0x06, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x0f, 0x10, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, + 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x0b, 0x13, 0x0f, 0x08, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x12, 0x0f, 0x13, 0x06, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x08, 0x15, 0x0f, 0x0e, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x12, 0x0f, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x13, 0x0f, 0x15, + 0x11, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x12, 0x0f, 0x0f, 0x0e, 0x0e, 0x09, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x10, 0x13, + 0x14, 0x13, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x11, 0x13, 0x0f, 0x14, 0x0f, 0x13, 0x0b, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0f, 0x0f, + 0x0f, 0x0f, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x0c, 0x09, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, + 0x06, 0x06, 0x06, 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x15, 0x10, 0x06, 0x06, 0x06, 0x02, + 0x15, 0x0b, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, + 0x13, 0x0b, 0x06, 0x0b, 0x0e, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, + 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x08, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x08, + 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x07, 0x0f, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x08, + 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x12, 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, + 0x13, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x10, 0x12, 0x12, 0x12, 0x12, 0x08, 0x12, 0x08, + 0x08, 0x07, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x12, + 0x0f, 0x13, 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x09, 0x0f, 0x08, 0x07, 0x09, + 0x13, 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x12, 0x0f, 0x0d, 0x06, 0x0c, 0x0f, 0x0b, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x08, 0x07, + 0x16, 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x12, 0x13, 0x15, 0x12, 0x10, 0x0d, 0x0c, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x15, 0x07, + 0x07, 0x10, 0x16, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x11, 0x09, 0x14, 0x07, 0x10, 0x11, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, + 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x12, + 0x0d, 0x03, 0x03, 0x03, 0x00, 0x06, 0x06, 0x06, 0x0f, + 0x07, 0x06, 0x06, 0x02, 0x02, 0x0f, 0x11, 0x03, 0x03, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x13, 0x0e, 0x06, 0x0d, + 0x0e, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x12, 0x0d, 0x06, 0x06, 0x02, 0x12, 0x0d, 0x03, 0x03, + 0x03, 0x00, 0x06, 0x06, 0x06, 0x11, 0x07, 0x07, 0x07, + 0x12, 0x0f, 0x07, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x07, 0x15, 0x12, 0x03, 0x03, 0x03, + 0x00, 0x06, 0x06, 0x06, 0x11, 0x16, 0x0f, 0x12, 0x0f, + 0x12, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x0d, 0x0e, 0x0d, 0x0e, 0x15, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, + 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x06, 0x06, 0x06, 0x11, 0x0e, 0x0f, 0x0f, 0x14, 0x08, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0c, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x06, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0f, 0x14, + 0x0e, 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x15, + 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x06, 0x08, 0x13, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, + 0x02, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x15, 0x11, + 0x02, 0x02, 0x07, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x11, 0x15, 0x13, 0x08, 0x06, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x07, + 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, 0x0d, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, + 0x14, 0x0b, 0x06, 0x02, 0x13, 0x0a, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x13, 0x09, 0x06, 0x15, 0x11, + 0x0b, 0x0f, 0x06, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x0b, 0x15, 0x15, 0x15, 0x06, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, 0x0b, 0x06, + 0x02, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x07, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x12, + 0x13, 0x12, 0x08, 0x08, 0x08, 0x0b, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0a, 0x0f, + 0x07, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x0c, 0x14, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x14, 0x0f, + 0x13, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x12, 0x0f, 0x0f, 0x0f, 0x0c, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, + 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, + 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x0b, + 0x08, 0x13, 0x15, 0x12, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x10, 0x0f, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x10, + 0x0f, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x02, 0x0e, 0x16, 0x02, 0x0a, + 0x15, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x0d, 0x08, 0x02, 0x0f, 0x10, 0x10, 0x0f, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x08, 0x0f, + 0x08, 0x03, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x02, 0x13, 0x12, 0x02, 0x0a, 0x15, 0x06, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0a, + 0x0f, 0x07, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, + 0x15, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, + 0x02, 0x06, 0x02, 0x0f, 0x09, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, + 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x06, 0x02, 0x06, 0x0c, 0x0f, 0x0f, + 0x08, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, + 0x06, 0x0c, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x08, 0x14, 0x0f, + 0x0c, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x11, 0x02, 0x11, + 0x13, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, + 0x02, 0x02, 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, + 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, + 0x0a, 0x04, 0x03, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x10, 0x14, 0x02, 0x02, 0x06, 0x06, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x10, 0x14, 0x02, 0x02, 0x02, + 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x10, 0x0f, 0x06, 0x0e, 0x08, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x16, 0x11, 0x0f, + 0x09, 0x07, 0x15, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x11, 0x15, 0x12, 0x15, 0x0b, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, + 0x02, 0x0e, 0x12, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x0a, 0x0f, 0x0a, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, + 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x0c, 0x0f, 0x08, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0e, + 0x06, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x08, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x0b, 0x0d, 0x0e, 0x10, 0x07, 0x15, 0x0b, 0x04, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, + 0x10, 0x0a, 0x0f, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x03, 0x08, 0x0f, 0x0c, 0x02, 0x16, 0x0f, 0x0b, + 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x14, + 0x0a, 0x10, 0x0c, 0x14, 0x09, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, + 0x12, 0x10, 0x10, 0x11, 0x13, 0x09, 0x04, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0f, 0x07, 0x11, + 0x0e, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x11, 0x0f, 0x07, 0x0a, 0x13, 0x0f, 0x08, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x13, 0x0c, + 0x0f, 0x06, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x07, 0x15, 0x15, 0x0d, 0x0f, 0x13, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x06, 0x15, 0x12, + 0x02, 0x12, 0x15, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x03, 0x02, 0x06, 0x15, 0x0e, 0x0f, 0x06, 0x03, + 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x0f, + 0x12, 0x10, 0x11, 0x11, 0x06, 0x04, 0x04, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x10, 0x10, + 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, + 0x02, 0x02, 0x03, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, 0x13, 0x10, + 0x11, 0x10, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x03, 0x02, 0x02, 0x03, 0x02, 0x03, 0x0e, 0x08, + 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, + 0x11, 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x02, 0x02, + 0x16, 0x08, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, + 0x02, 0x02, 0x03, 0x02, 0x06, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x08, 0x0c, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x03, 0x02, 0x09, 0x0f, 0x13, 0x0d, + 0x0e, 0x15, 0x11, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, + 0x02, 0x03, 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x08, 0x15, 0x0f, 0x15, 0x08, 0x04, + 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x13, + 0x15, 0x0f, 0x15, 0x0b, 0x04, 0x03, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0d, + 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x09, + 0x0c, 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x0b, 0x13, 0x0f, 0x0f, 0x14, + 0x0d, 0x02, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x04, + 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0c, 0x0f, 0x15, + 0x08, 0x0c, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x10, 0x0f, 0x16, 0x03, 0x04, 0x03, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0e, + 0x03, 0x12, 0x0f, 0x0b, 0x04, 0x04, 0x04, 0x00, 0x03, + 0x03, 0x03, 0x09, 0x0e, 0x03, 0x03, 0x03, 0x0e, 0x0a, + 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x10, 0x13, 0x16, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, + 0x09, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x15, 0x0b, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x0f, 0x15, 0x0b, + 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x0b, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, + 0x03, 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x14, 0x15, + 0x0b, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0b, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x11, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x02, 0x09, 0x0c, 0x06, 0x02, 0x02, 0x03, 0x04, + 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x09, 0x0d, 0x02, 0x11, 0x02, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x0d, 0x09, 0x04, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0f, 0x0b, 0x03, + 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x09, + 0x0d, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x04, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x0c, 0x09, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x06, + 0x09, 0x0d, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x11, 0x09, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x09, 0x11, 0x05, 0x05, + 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x04, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x11, 0x0d, 0x0d, 0x11, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; +// ************************************************************************* +// LANDSCAPE +// ************************************************************************* + +// Panel + +unsigned char item_toolbar_colors[] = { + 0x04, 0x02, 0x04, + 0x0c, 0x02, 0x04, + 0x24, 0x06, 0x04, + 0x84, 0x16, 0x14, + 0x9c, 0x1a, 0x1c, + 0x74, 0x16, 0x14, + 0x1c, 0x06, 0x04, + 0x5c, 0x0e, 0x0c, + 0x4c, 0x0e, 0x0c, + 0x44, 0x0a, 0x0c, + 0x64, 0x12, 0x14, + 0x8c, 0x1a, 0x1c, + 0xc4, 0x22, 0x24, + 0xb4, 0x1e, 0x1c, + 0x0c, 0x06, 0x04, + 0xa4, 0x1e, 0x1c, + 0x34, 0x0a, 0x0c, + 0x14, 0x16, 0x14, + 0x64, 0x66, 0x64, + 0x1c, 0x16, 0x1c, + 0x1c, 0x1a, 0x1c, + 0x3c, 0x3e, 0x3c, + 0x34, 0x36, 0x34, + 0x34, 0x32, 0x34, + 0x6c, 0x6a, 0x6c, + 0xb4, 0xb2, 0xb4, + 0x4c, 0x4e, 0x4c, + 0x94, 0x92, 0x94, + 0x94, 0x96, 0x94, + 0x7c, 0x7e, 0x7c, + 0x9c, 0x9e, 0x9c, + 0x0c, 0x0a, 0x0c, + 0x44, 0x46, 0x44, + 0x5c, 0x5a, 0x5c, + 0x74, 0x76, 0x74, + 0xc4, 0xc2, 0xc4, + 0x84, 0x82, 0x84, + 0x9c, 0x9a, 0x9c, + 0x74, 0x72, 0x74, + 0x24, 0x26, 0x24, + 0xa4, 0xa6, 0xa4, + 0x3c, 0x3a, 0x3c, + 0x8c, 0x8e, 0x8c, + 0x2c, 0x7e, 0xb4, + 0xbc, 0xbe, 0xbc, + 0x6c, 0x6e, 0x6c, + 0x1c, 0x1e, 0x1c, + 0x2c, 0x5e, 0x7c, + 0xac, 0xaa, 0xac, + 0x5c, 0x5e, 0x5c, + 0xa4, 0xa2, 0xa4, + 0xd4, 0xd6, 0xd4, + 0xac, 0xae, 0xac, + 0xec, 0xee, 0xec, + 0xe4, 0xe6, 0xe4, + 0xfc, 0xfa, 0xfc, + 0x1c, 0x0a, 0x0c, + 0x2c, 0x0e, 0x0c, + 0x24, 0x0a, 0x0c, + 0x14, 0x06, 0x04, + 0x34, 0x0e, 0x0c, + 0xcc, 0xce, 0xcc, + 0xf4, 0xf2, 0xf4, + 0x0c, 0x0a, 0x04, + 0x24, 0x1a, 0x0c, + 0x2c, 0x1e, 0x14, + 0x24, 0x1e, 0x0c, + 0x24, 0x1e, 0x14, + 0x1c, 0x16, 0x0c, + 0x14, 0x0e, 0x04, + 0x04, 0x06, 0x04, + 0x14, 0x12, 0x0c, + 0x5c, 0x1a, 0x1c, + 0x94, 0x26, 0x24, + 0xb4, 0x2e, 0x2c, + 0xd4, 0x3a, 0x3c, + 0xcc, 0x36, 0x34, + 0xa4, 0x2e, 0x2c, + 0x54, 0x16, 0x14, + 0x4c, 0x16, 0x14, + 0x7c, 0x22, 0x24, + 0x9c, 0x2a, 0x2c, + 0xbc, 0x36, 0x34, + 0xb4, 0x32, 0x34, + 0xac, 0x2e, 0x2c, + 0x2c, 0x0a, 0x0c, + 0xa4, 0x2a, 0x2c, + 0x6c, 0x1e, 0x1c, + 0x64, 0x1e, 0x1c, + 0x94, 0x2a, 0x2c, + 0x34, 0x22, 0x24, + 0x64, 0x4a, 0x24, + 0xc4, 0x96, 0x4c, + 0xd4, 0xa2, 0x54, + 0xcc, 0x9e, 0x54, + 0x84, 0x66, 0x34, + 0x14, 0x0e, 0x0c, + 0xec, 0xb2, 0x5c, + 0xdc, 0xaa, 0x5c, + 0x94, 0x72, 0x3c, + 0xe4, 0xb2, 0x5c, + 0x4c, 0x3a, 0x1c, + 0xc4, 0x36, 0x34, + 0xbc, 0x32, 0x34, + 0xc4, 0x32, 0x34, + 0x8c, 0x26, 0x24, + 0x44, 0x12, 0x14, + 0x74, 0x1e, 0x1c, + 0x5c, 0x16, 0x14, + 0xb4, 0x86, 0x44, + 0xfc, 0xc6, 0x6c, + 0xf4, 0xbe, 0x64, + 0xf4, 0xba, 0x64, + 0xfc, 0xbe, 0x64, + 0xec, 0xb6, 0x64, + 0x2c, 0x22, 0x14, + 0xfc, 0xce, 0x6c, + 0xfc, 0xc2, 0x64, + 0xcc, 0x9a, 0x54, + 0xdc, 0xa6, 0x54, + 0xfc, 0xd2, 0x6c, + 0x5c, 0x46, 0x24, + 0xcc, 0x3a, 0x3c, + 0x84, 0x22, 0x24, + 0x84, 0x26, 0x24, + 0xdc, 0xde, 0xdc, + 0xe4, 0xe2, 0xe4, + 0x5c, 0x4a, 0x2c, + 0xec, 0xb6, 0x5c, + 0x9c, 0x7a, 0x3c, + 0xfc, 0xc6, 0x64, + 0x34, 0x26, 0x14, + 0x4c, 0x12, 0x14, + 0x64, 0x1a, 0x1c, + 0x54, 0x3e, 0x24, + 0xf4, 0xb6, 0x64, + 0x6c, 0x56, 0x2c, + 0x3c, 0x2a, 0x14, + 0x44, 0x32, 0x1c, + 0xac, 0x32, 0x34, + 0x54, 0x1a, 0x1c, + 0x3c, 0x12, 0x14, + 0xe4, 0xae, 0x5c, + 0x6c, 0x52, 0x2c, + 0x74, 0x5a, 0x34, + 0xc4, 0x9a, 0x54, + 0x7c, 0x62, 0x34, + 0x84, 0x62, 0x34, + 0xbc, 0xba, 0xbc, + 0x7c, 0x5e, 0x34, + 0x8c, 0x66, 0x34, + 0x9c, 0x76, 0x3c, + 0x94, 0x6e, 0x3c, + 0x8c, 0x6a, 0x3c, + 0x74, 0x22, 0x24, + 0xbc, 0x8e, 0x4c, + 0xb4, 0x8a, 0x4c, + 0xb4, 0x8e, 0x4c, + 0x44, 0x36, 0x1c, + 0x7c, 0x5a, 0x34, + 0x8c, 0x6a, 0x34, + 0x74, 0x56, 0x2c, + 0x5c, 0x4a, 0x24, + 0xbc, 0x92, 0x4c, + 0xe4, 0xaa, 0x5c, + 0x64, 0x4e, 0x2c, + 0x54, 0x3e, 0x1c, + 0x8c, 0x6e, 0x3c, + 0x0c, 0x06, 0x0c, + 0xa4, 0x7e, 0x44, + 0x94, 0x76, 0x3c, + 0x9c, 0x2e, 0x34, + 0x8c, 0x2a, 0x2c, + 0x8c, 0x8a, 0x8c, + 0x54, 0x42, 0x24, + 0x4c, 0x3e, 0x1c, + 0xd4, 0xa6, 0x54, + 0x1c, 0x1a, 0x0c, + 0x2c, 0x2e, 0x2c, + 0xac, 0x82, 0x44 + +}; +unsigned char item_toolbar[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, + 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x05, + 0x03, 0x04, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x07, 0x03, 0x03, 0x03, 0x05, 0x09, + 0x00, 0x0a, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x07, + 0x03, 0x03, 0x04, 0x02, 0x02, 0x04, 0x03, 0x04, 0x03, + 0x04, 0x0b, 0x03, 0x0b, 0x07, 0x02, 0x03, 0x04, 0x03, + 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x00, + 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, + 0x0f, 0x02, 0x00, 0x00, 0x00, 0x01, 0x05, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x00, 0x03, 0x0c, 0x0c, + 0x0d, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0c, 0x07, 0x00, + 0x02, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, + 0x07, 0x10, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, + 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x04, 0x10, 0x09, + 0x0d, 0x0c, 0x0d, 0x07, 0x00, 0x05, 0x0d, 0x0c, 0x0c, + 0x0d, 0x03, 0x0d, 0x0d, 0x0c, 0x0c, 0x0d, 0x01, 0x00, + 0x00, 0x04, 0x0d, 0x0c, 0x0c, 0x0d, 0x04, 0x03, 0x03, + 0x03, 0x00, 0x04, 0x0d, 0x0c, 0x0c, 0x00, 0x01, 0x0d, + 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0c, + 0x0a, 0x07, 0x07, 0x07, 0x07, 0x10, 0x01, 0x07, 0x07, + 0x07, 0x0c, 0x0c, 0x0d, 0x05, 0x07, 0x07, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x07, + 0x10, 0x0c, 0x0c, 0x0c, 0x03, 0x01, 0x00, 0x00, 0x09, + 0x0c, 0x0d, 0x0c, 0x05, 0x00, 0x07, 0x0d, 0x0c, 0x0c, + 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, + 0x0c, 0x0d, 0x00, 0x05, 0x0c, 0x0c, 0x0d, 0x01, 0x00, + 0x00, 0x10, 0x0d, 0x0c, 0x0c, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x0c, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x03, 0x00, + 0x02, 0x0c, 0x0c, 0x0d, 0x09, 0x0a, 0x0c, 0x0d, 0x0c, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x0d, + 0x00, 0x04, 0x0c, 0x0c, 0x0f, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x0d, 0x07, 0x0c, + 0x0c, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, + 0x0d, 0x04, 0x04, 0x03, 0x0b, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x12, 0x12, 0x13, 0x11, 0x14, 0x15, 0x16, + 0x17, 0x11, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x0c, 0x0d, 0x0a, 0x0f, 0x0c, 0x0c, 0x0d, 0x04, + 0x00, 0x03, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x0d, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x0d, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x0c, 0x0c, 0x03, 0x0f, 0x0c, 0x0d, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0d, + 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0d, 0x0c, + 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0x18, 0x12, 0x19, 0x18, + 0x1a, 0x12, 0x1b, 0x1c, 0x1d, 0x17, 0x16, 0x17, 0x12, + 0x18, 0x12, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x07, + 0x05, 0x0d, 0x0d, 0x05, 0x01, 0x00, 0x03, 0x0c, 0x0c, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0c, 0x0d, + 0x0d, 0x00, 0x0d, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0d, 0x04, 0x09, + 0x0c, 0x0c, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x07, 0x0c, + 0x0c, 0x0c, 0x0a, 0x07, 0x07, 0x07, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x19, 0x1e, 0x1e, 0x1d, 0x1f, 0x20, 0x21, 0x22, 0x23, + 0x19, 0x24, 0x12, 0x18, 0x1e, 0x1e, 0x19, 0x19, 0x18, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x0c, 0x0d, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x04, 0x0d, + 0x0c, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x0c, 0x0c, 0x03, 0x00, 0x03, 0x0c, 0x0d, 0x0d, + 0x01, 0x00, 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x25, 0x19, 0x1e, 0x26, 0x26, 0x27, + 0x00, 0x17, 0x17, 0x16, 0x12, 0x1e, 0x19, 0x28, 0x1b, + 0x29, 0x2a, 0x1e, 0x25, 0x19, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0d, 0x0c, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, + 0x0c, 0x0c, 0x0d, 0x07, 0x10, 0x08, 0x0d, 0x0c, 0x0d, + 0x0c, 0x02, 0x00, 0x07, 0x0c, 0x0c, 0x0d, 0x0f, 0x08, + 0x09, 0x02, 0x07, 0x02, 0x00, 0x0c, 0x0c, 0x0c, 0x03, + 0x00, 0x01, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x07, + 0x0c, 0x0c, 0x0d, 0x07, 0x02, 0x10, 0x10, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x0d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, + 0x1e, 0x28, 0x1b, 0x1c, 0x00, 0x00, 0x16, 0x2b, 0x17, + 0x17, 0x2c, 0x1d, 0x19, 0x2a, 0x00, 0x28, 0x28, 0x2a, + 0x1e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x0c, 0x0c, 0x0d, 0x0c, + 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x08, 0x00, 0x00, 0x00, + 0x0a, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x10, + 0x00, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x07, 0x0c, + 0x0d, 0x0c, 0x07, 0x00, 0x05, 0x0d, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x0c, 0x0d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x25, 0x25, 0x19, + 0x2d, 0x2e, 0x17, 0x2f, 0x16, 0x17, 0x30, 0x31, 0x19, + 0x2a, 0x26, 0x19, 0x1e, 0x2a, 0x1b, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, + 0x0d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x05, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x03, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0d, 0x01, 0x00, 0x0c, 0x0d, 0x0c, + 0x03, 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x0c, 0x0d, 0x02, + 0x03, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x0d, 0x0c, 0x0d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x1b, 0x1e, 0x25, 0x32, 0x15, 0x17, + 0x16, 0x1e, 0x33, 0x34, 0x19, 0x26, 0x19, 0x1e, 0x2a, + 0x2a, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, + 0x2a, 0x1b, 0x22, 0x20, 0x16, 0x1e, 0x35, 0x36, 0x33, + 0x1d, 0x1d, 0x25, 0x2a, 0x1b, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x14, 0x1b, 0x2a, 0x2a, 0x2a, + 0x28, 0x33, 0x37, 0x35, 0x2c, 0x1c, 0x2a, 0x1b, 0x2a, + 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, + 0x39, 0x39, 0x39, 0x3a, 0x38, 0x38, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x06, + 0x3a, 0x3c, 0x39, 0x3c, 0x3a, 0x06, 0x38, 0x00, 0x00, + 0x00, 0x06, 0x38, 0x02, 0x38, 0x3a, 0x38, 0x3b, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x3a, 0x38, 0x38, 0x02, 0x38, + 0x06, 0x0e, 0x00, 0x00, 0x01, 0x06, 0x3a, 0x38, 0x38, + 0x06, 0x3a, 0x38, 0x06, 0x01, 0x00, 0x00, 0x00, 0x3b, + 0x3a, 0x06, 0x38, 0x06, 0x3a, 0x06, 0x38, 0x02, 0x00, + 0x00, 0x00, 0x3b, 0x3a, 0x06, 0x3a, 0x38, 0x02, 0x38, + 0x38, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0x02, + 0x38, 0x2d, 0x2a, 0x19, 0x3d, 0x3e, 0x3e, 0x37, 0x37, + 0x36, 0x3d, 0x30, 0x2a, 0x1b, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0x40, 0x41, 0x42, 0x42, 0x42, + 0x43, 0x44, 0x00, 0x42, 0x43, 0x40, 0x42, 0x43, 0x40, + 0x42, 0x41, 0x45, 0x46, 0x00, 0x00, 0x47, 0x42, 0x42, + 0x40, 0x42, 0x43, 0x40, 0x41, 0x42, 0x3f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4b, 0x4c, + 0x4a, 0x4d, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3a, 0x4f, 0x50, 0x51, 0x52, 0x4c, 0x4b, 0x4c, + 0x53, 0x54, 0x4d, 0x55, 0x00, 0x00, 0x53, 0x54, 0x56, + 0x4d, 0x4d, 0x4a, 0x57, 0x01, 0x00, 0x00, 0x00, 0x58, + 0x56, 0x4d, 0x54, 0x56, 0x4d, 0x56, 0x4f, 0x00, 0x00, + 0x4e, 0x53, 0x56, 0x4d, 0x54, 0x56, 0x4d, 0x56, 0x4d, + 0x4e, 0x00, 0x00, 0x06, 0x59, 0x54, 0x4d, 0x54, 0x4d, + 0x56, 0x54, 0x56, 0x54, 0x00, 0x00, 0x00, 0x57, 0x54, + 0x56, 0x4d, 0x4d, 0x4d, 0x54, 0x4d, 0x4a, 0x55, 0x00, + 0x00, 0x01, 0x54, 0x54, 0x56, 0x4d, 0x5a, 0x1b, 0x19, + 0x35, 0x37, 0x37, 0x37, 0x37, 0x37, 0x33, 0x19, 0x2a, + 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, + 0x5c, 0x5d, 0x5d, 0x5e, 0x5d, 0x5d, 0x5f, 0x60, 0x61, + 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x62, 0x63, 0x3f, + 0x00, 0x00, 0x63, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, + 0x5e, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x4d, 0x4c, 0x66, + 0x66, 0x67, 0x67, 0x68, 0x67, 0x66, 0x4c, 0x69, 0x3b, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x4f, 0x4d, 0x4b, 0x4c, + 0x66, 0x68, 0x67, 0x67, 0x68, 0x66, 0x66, 0x4c, 0x6a, + 0x00, 0x00, 0x4c, 0x66, 0x66, 0x66, 0x66, 0x4c, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x6b, 0x52, 0x66, 0x66, 0x66, + 0x66, 0x67, 0x6c, 0x00, 0x00, 0x57, 0x4b, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x6b, 0x00, 0x00, 0x3c, + 0x66, 0x4c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x4b, + 0x00, 0x00, 0x00, 0x6b, 0x4b, 0x66, 0x66, 0x68, 0x66, + 0x66, 0x66, 0x4b, 0x4f, 0x00, 0x00, 0x4f, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x2a, 0x19, 0x37, 0x37, 0x37, 0x37, + 0x37, 0x37, 0x33, 0x19, 0x2a, 0x31, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0x6d, 0x6e, 0x6f, 0x70, 0x71, + 0x6f, 0x72, 0x73, 0x42, 0x74, 0x70, 0x6f, 0x70, 0x6f, + 0x71, 0x70, 0x75, 0x76, 0x47, 0x00, 0x00, 0x77, 0x6f, + 0x6f, 0x70, 0x71, 0x70, 0x6f, 0x71, 0x78, 0x79, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x51, 0x66, 0x67, 0x67, 0x67, 0x52, 0x67, 0x52, + 0x67, 0x67, 0x7a, 0x7b, 0x3b, 0x00, 0x00, 0x00, 0x3b, + 0x7c, 0x4c, 0x66, 0x4a, 0x68, 0x67, 0x52, 0x67, 0x52, + 0x67, 0x67, 0x67, 0x66, 0x6a, 0x00, 0x3a, 0x66, 0x67, + 0x67, 0x66, 0x67, 0x7a, 0x6c, 0x00, 0x00, 0x00, 0x00, + 0x6b, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x53, 0x3c, 0x00, + 0x00, 0x50, 0x66, 0x66, 0x4a, 0x67, 0x66, 0x67, 0x52, + 0x67, 0x49, 0x00, 0x00, 0x48, 0x4b, 0x4a, 0x52, 0x67, + 0x67, 0x52, 0x67, 0x67, 0x4a, 0x00, 0x00, 0x01, 0x49, + 0x66, 0x67, 0x66, 0x52, 0x67, 0x67, 0x67, 0x4c, 0x48, + 0x00, 0x00, 0x7b, 0x52, 0x67, 0x67, 0x52, 0x67, 0x67, + 0x25, 0x7d, 0x37, 0x37, 0x37, 0x37, 0x7e, 0x2c, 0x19, + 0x1b, 0x7f, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, + 0x62, 0x70, 0x80, 0x70, 0x80, 0x70, 0x81, 0x00, 0x79, + 0x82, 0x70, 0x80, 0x70, 0x80, 0x72, 0x80, 0x70, 0x64, + 0x45, 0x00, 0x83, 0x6f, 0x70, 0x80, 0x70, 0x80, 0x70, + 0x80, 0x80, 0x6f, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x67, 0x67, 0x52, + 0x68, 0x67, 0x67, 0x66, 0x4c, 0x4c, 0x7a, 0x4c, 0x69, + 0x3b, 0x00, 0x00, 0x01, 0x50, 0x4c, 0x52, 0x68, 0x52, + 0x67, 0x52, 0x68, 0x66, 0x4c, 0x7a, 0x4c, 0x4c, 0x4b, + 0x85, 0x00, 0x3c, 0x4c, 0x67, 0x52, 0x4a, 0x66, 0x4c, + 0x48, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x4a, 0x66, 0x67, + 0x67, 0x68, 0x54, 0x3c, 0x00, 0x01, 0x6b, 0x4c, 0x52, + 0x67, 0x52, 0x4a, 0x66, 0x67, 0x67, 0x53, 0x00, 0x01, + 0x7c, 0x66, 0x67, 0x67, 0x67, 0x66, 0x67, 0x67, 0x66, + 0x49, 0x00, 0x00, 0x01, 0x51, 0x66, 0x67, 0x4a, 0x66, + 0x67, 0x66, 0x67, 0x66, 0x7b, 0x0e, 0x00, 0x54, 0x67, + 0x66, 0x67, 0x67, 0x66, 0x67, 0x2a, 0x7d, 0x37, 0x37, + 0x37, 0x37, 0x33, 0x19, 0x1c, 0x2a, 0x64, 0x86, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x63, 0x71, 0x80, 0x70, 0x80, + 0x72, 0x61, 0x42, 0x00, 0x79, 0x6e, 0x80, 0x87, 0x80, + 0x87, 0x80, 0x70, 0x80, 0x74, 0x73, 0x00, 0x88, 0x70, + 0x80, 0x87, 0x80, 0x72, 0x80, 0x70, 0x6f, 0x77, 0x89, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x57, 0x67, 0x66, 0x4a, 0x52, 0x66, 0x67, 0x7c, + 0x6c, 0x48, 0x57, 0x49, 0x59, 0x06, 0x00, 0x00, 0x85, + 0x4c, 0x66, 0x67, 0x67, 0x67, 0x67, 0x66, 0x53, 0x7b, + 0x85, 0x6c, 0x48, 0x6b, 0x7c, 0x4e, 0x00, 0x3c, 0x66, + 0x67, 0x67, 0x67, 0x67, 0x7a, 0x6c, 0x00, 0x00, 0x00, + 0x00, 0x54, 0x52, 0x67, 0x67, 0x52, 0x67, 0x54, 0x39, + 0x00, 0x01, 0x50, 0x4c, 0x67, 0x68, 0x67, 0x66, 0x67, + 0x67, 0x52, 0x4a, 0x0e, 0x3b, 0x4a, 0x68, 0x67, 0x52, + 0x66, 0x4a, 0x52, 0x67, 0x66, 0x49, 0x00, 0x00, 0x01, + 0x49, 0x68, 0x67, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x66, + 0x49, 0x01, 0x3a, 0x67, 0x66, 0x4a, 0x67, 0x66, 0x4a, + 0x52, 0x67, 0x2c, 0x7d, 0x37, 0x37, 0x37, 0x33, 0x19, + 0x1b, 0x72, 0x80, 0x63, 0x00, 0x00, 0x00, 0x00, 0x8a, + 0x77, 0x6f, 0x87, 0x80, 0x70, 0x75, 0x5f, 0x00, 0x00, + 0x79, 0x75, 0x70, 0x80, 0x70, 0x80, 0x70, 0x80, 0x87, + 0x6e, 0x65, 0x00, 0x6d, 0x72, 0x70, 0x80, 0x70, 0x80, + 0x87, 0x80, 0x6f, 0x62, 0x89, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x67, 0x52, + 0x67, 0x68, 0x4a, 0x53, 0x84, 0x00, 0x00, 0x00, 0x3b, + 0x3c, 0x01, 0x00, 0x06, 0x8b, 0x67, 0x4a, 0x66, 0x67, + 0x67, 0x66, 0x49, 0x3c, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x3b, 0x00, 0x3c, 0x66, 0x67, 0x52, 0x67, 0x66, + 0x66, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x56, 0x67, 0x66, + 0x67, 0x67, 0x68, 0x54, 0x8d, 0x00, 0x0e, 0x7b, 0x66, + 0x67, 0x52, 0x67, 0x4a, 0x66, 0x67, 0x67, 0x53, 0x3c, + 0x39, 0x7a, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, + 0x66, 0x49, 0x00, 0x00, 0x00, 0x54, 0x66, 0x67, 0x52, + 0x67, 0x67, 0x67, 0x67, 0x66, 0x67, 0x0e, 0x85, 0x52, + 0x67, 0x52, 0x66, 0x67, 0x67, 0x67, 0x67, 0x19, 0x33, + 0x37, 0x37, 0x37, 0x7d, 0x19, 0x2a, 0x72, 0x80, 0x5e, + 0x00, 0x00, 0x00, 0x00, 0x5f, 0x75, 0x87, 0x80, 0x70, + 0x80, 0x8e, 0x45, 0x00, 0x00, 0x8f, 0x82, 0x72, 0x80, + 0x87, 0x80, 0x80, 0x72, 0x80, 0x75, 0x90, 0x45, 0x72, + 0x80, 0x87, 0x80, 0x72, 0x80, 0x70, 0x80, 0x6f, 0x62, + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x68, 0x67, 0x67, 0x52, 0x67, 0x67, + 0x49, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, + 0x4a, 0x52, 0x67, 0x52, 0x67, 0x52, 0x51, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, + 0x66, 0x67, 0x67, 0x67, 0x66, 0x54, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x4d, 0x66, 0x4a, 0x52, 0x67, 0x52, 0x4d, + 0x06, 0x00, 0x06, 0x59, 0x66, 0x67, 0x67, 0x67, 0x51, + 0x67, 0x67, 0x52, 0x4a, 0x84, 0x48, 0x4c, 0x52, 0x68, + 0x4d, 0x54, 0x68, 0x67, 0x52, 0x68, 0x49, 0x00, 0x00, + 0x3b, 0x66, 0x67, 0x67, 0x67, 0x54, 0x54, 0x66, 0x67, + 0x67, 0x4c, 0x00, 0x69, 0x68, 0x67, 0x67, 0x53, 0x49, + 0x68, 0x52, 0x67, 0x19, 0x33, 0x37, 0x37, 0x7d, 0x33, + 0x19, 0x2a, 0x80, 0x70, 0x77, 0x83, 0x00, 0x00, 0x42, + 0x91, 0x75, 0x80, 0x72, 0x80, 0x75, 0x92, 0x00, 0x00, + 0x46, 0x5f, 0x71, 0x70, 0x80, 0x70, 0x5d, 0x77, 0x70, + 0x72, 0x75, 0x93, 0x65, 0x80, 0x72, 0x80, 0x64, 0x5c, + 0x70, 0x87, 0x80, 0x6f, 0x77, 0x89, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, + 0x66, 0x67, 0x67, 0x67, 0x66, 0x66, 0x56, 0x4f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x52, 0x68, 0x67, 0x67, + 0x67, 0x67, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6c, 0x66, 0x67, 0x52, 0x67, + 0x66, 0x53, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x56, 0x67, + 0x67, 0x68, 0x67, 0x66, 0x56, 0x0e, 0x00, 0x06, 0x49, + 0x66, 0x67, 0x66, 0x66, 0x69, 0x53, 0x52, 0x67, 0x67, + 0x57, 0x7c, 0x66, 0x67, 0x66, 0x69, 0x69, 0x66, 0x67, + 0x67, 0x66, 0x59, 0x00, 0x00, 0x00, 0x4c, 0x66, 0x67, + 0x52, 0x56, 0x51, 0x52, 0x67, 0x52, 0x4c, 0x8d, 0x4a, + 0x52, 0x67, 0x67, 0x69, 0x59, 0x66, 0x67, 0x67, 0x25, + 0x94, 0x7d, 0x37, 0x7d, 0x33, 0x19, 0x1b, 0x80, 0x70, + 0x64, 0x95, 0x00, 0x00, 0x8f, 0x6f, 0x80, 0x70, 0x80, + 0x70, 0x8e, 0x44, 0x00, 0x00, 0x46, 0x96, 0x75, 0x72, + 0x80, 0x6f, 0x91, 0x76, 0x70, 0x80, 0x71, 0x97, 0x98, + 0x72, 0x80, 0x70, 0x8e, 0x99, 0x75, 0x80, 0x70, 0x70, + 0x77, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3b, 0x69, 0x4c, 0x52, 0x67, + 0x52, 0x4a, 0x66, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, + 0x4d, 0x4a, 0x67, 0x66, 0x67, 0x52, 0x4d, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x66, 0x67, 0x67, 0x67, 0x67, 0x4a, 0x3c, 0x00, + 0x00, 0x00, 0x3b, 0x4d, 0x68, 0x67, 0x52, 0x67, 0x52, + 0x56, 0x3b, 0x00, 0x3a, 0x51, 0x66, 0x67, 0x67, 0x66, + 0x57, 0x4a, 0x67, 0x66, 0x4a, 0x7c, 0x4a, 0x67, 0x67, + 0x68, 0x85, 0x50, 0x4c, 0x52, 0x67, 0x67, 0x49, 0x00, + 0x00, 0x3a, 0x4c, 0x67, 0x67, 0x66, 0x56, 0x69, 0x54, + 0x68, 0x67, 0x66, 0x9a, 0x4a, 0x67, 0x52, 0x53, 0x6c, + 0x49, 0x66, 0x67, 0x52, 0x2a, 0x19, 0x7d, 0x7d, 0x33, + 0x94, 0x1c, 0x2a, 0x80, 0x70, 0x80, 0x9b, 0x00, 0x44, + 0x9c, 0x75, 0x70, 0x80, 0x70, 0x75, 0x63, 0x00, 0x00, + 0x00, 0x46, 0x81, 0x71, 0x70, 0x80, 0x6f, 0x6d, 0x9d, + 0x71, 0x80, 0x6f, 0x6d, 0x5e, 0x80, 0x70, 0x80, 0x5c, + 0x79, 0x82, 0x72, 0x80, 0x6f, 0x62, 0x89, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3b, 0x50, 0x4c, 0x67, 0x66, 0x67, 0x67, 0x66, + 0x66, 0x85, 0x00, 0x00, 0x00, 0x4d, 0x67, 0x52, 0x4a, + 0x66, 0x67, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x66, 0x67, 0x52, + 0x67, 0x66, 0x53, 0x6a, 0x00, 0x00, 0x00, 0x3b, 0x54, + 0x52, 0x67, 0x67, 0x67, 0x67, 0x4d, 0x3b, 0x00, 0x3c, + 0x54, 0x68, 0x67, 0x52, 0x4c, 0x3a, 0x4a, 0x52, 0x67, + 0x52, 0x54, 0x67, 0x52, 0x68, 0x4d, 0x48, 0x7b, 0x66, + 0x67, 0x67, 0x66, 0x49, 0x00, 0x00, 0x3c, 0x4c, 0x52, + 0x67, 0x66, 0x59, 0x4e, 0x51, 0x66, 0x67, 0x66, 0x54, + 0x67, 0x67, 0x67, 0x4a, 0x39, 0x68, 0x67, 0x67, 0x68, + 0x1b, 0x1c, 0x94, 0x33, 0x94, 0x1c, 0x2a, 0x1b, 0x87, + 0x80, 0x70, 0x5e, 0x45, 0x9e, 0x75, 0x70, 0x80, 0x87, + 0x80, 0x75, 0x83, 0x00, 0x00, 0x00, 0x3f, 0x5c, 0x70, + 0x80, 0x70, 0x75, 0x9f, 0xa0, 0x75, 0x72, 0x70, 0x5d, + 0x80, 0x87, 0x80, 0x72, 0x98, 0xa1, 0x6e, 0x87, 0x80, + 0x6f, 0x77, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x6b, + 0x66, 0x67, 0x67, 0x66, 0x67, 0x67, 0x66, 0x4f, 0x00, + 0x00, 0x51, 0x67, 0x68, 0x67, 0x66, 0x67, 0x54, 0x3a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7c, 0x68, 0x67, 0x67, 0x67, 0x66, 0x4a, 0x3c, + 0x00, 0x00, 0x00, 0x39, 0x4a, 0x67, 0x67, 0x68, 0x52, + 0x66, 0x4d, 0x3b, 0x00, 0x8d, 0x54, 0x66, 0x67, 0x67, + 0x4b, 0x01, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, + 0x66, 0x69, 0x6a, 0x59, 0x66, 0x67, 0x68, 0x66, 0x57, + 0x00, 0x00, 0x8d, 0x4c, 0x67, 0x67, 0x66, 0x69, 0x84, + 0x59, 0x66, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x52, 0x4d, + 0x01, 0x4b, 0x67, 0x52, 0x1c, 0x2a, 0x2a, 0x19, 0x33, + 0x19, 0x2a, 0x1b, 0x34, 0x80, 0x70, 0x80, 0x62, 0x5b, + 0x99, 0x82, 0x87, 0x80, 0x72, 0x75, 0x81, 0x0e, 0x00, + 0x00, 0x00, 0x3f, 0x5c, 0x6f, 0x87, 0x80, 0x6e, 0x5b, + 0x88, 0x71, 0x70, 0x80, 0x72, 0x80, 0x72, 0x80, 0x8e, + 0xa2, 0x99, 0x75, 0x80, 0x70, 0x71, 0x9c, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x66, 0x67, 0x4a, + 0x66, 0x67, 0x4c, 0x49, 0x06, 0x00, 0x6b, 0x52, 0x67, + 0x52, 0x4a, 0x66, 0x67, 0x6b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x66, 0x52, + 0x68, 0x67, 0x52, 0x67, 0x6a, 0x00, 0x00, 0x00, 0x3c, + 0x53, 0x67, 0x66, 0x52, 0x4a, 0x66, 0x49, 0x00, 0x00, + 0x3c, 0x68, 0x52, 0x67, 0x52, 0x4c, 0x3b, 0x7b, 0x52, + 0x67, 0x66, 0x52, 0x67, 0x67, 0x4c, 0x6b, 0x38, 0x49, + 0x66, 0x67, 0x52, 0x66, 0x85, 0x00, 0x00, 0x4e, 0x66, + 0x68, 0x52, 0x68, 0x49, 0x3c, 0x50, 0x66, 0x67, 0x67, + 0x67, 0x67, 0x68, 0x4a, 0x85, 0x3b, 0x4c, 0x66, 0x1c, + 0x19, 0x2a, 0x1b, 0x19, 0x94, 0x19, 0x2a, 0x2a, 0x19, + 0x1c, 0x80, 0x70, 0x64, 0xa3, 0x5d, 0x70, 0x80, 0x70, + 0x70, 0x6f, 0x83, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xa4, + 0x70, 0x80, 0x70, 0x82, 0xa5, 0xa6, 0x64, 0x80, 0x70, + 0x80, 0x70, 0x80, 0x70, 0x8e, 0x45, 0xa7, 0x75, 0x87, + 0x80, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x4e, 0x58, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x7b, 0x4c, 0x52, 0x67, 0x67, 0x66, 0x54, + 0x3a, 0x00, 0x4f, 0x4a, 0x67, 0x67, 0x52, 0x67, 0x66, + 0x4a, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, + 0x06, 0x00, 0x49, 0x66, 0x4a, 0x67, 0x66, 0x67, 0x66, + 0x50, 0x00, 0x00, 0x00, 0x69, 0x67, 0x66, 0x4a, 0x68, + 0x67, 0x52, 0x51, 0x00, 0x00, 0x4e, 0x4b, 0x67, 0x67, + 0x68, 0x4c, 0x3b, 0x48, 0x4a, 0x66, 0x4a, 0x67, 0x67, + 0x52, 0x67, 0x4f, 0x3b, 0x51, 0x66, 0x67, 0x67, 0x4c, + 0x6c, 0x00, 0x00, 0x85, 0x66, 0x67, 0x67, 0x66, 0x51, + 0x38, 0x57, 0x4c, 0x52, 0x67, 0x66, 0x67, 0x52, 0x67, + 0x3c, 0x3b, 0x4b, 0x1c, 0x19, 0x19, 0x34, 0x2a, 0x1c, + 0x18, 0x18, 0x1b, 0x34, 0x19, 0x19, 0x1c, 0x80, 0x72, + 0x80, 0x72, 0x80, 0x87, 0x80, 0x82, 0x81, 0x45, 0x00, + 0x00, 0x00, 0x00, 0x45, 0x6e, 0x80, 0x70, 0x80, 0x6e, + 0x8f, 0x73, 0x5d, 0x70, 0x80, 0x87, 0x80, 0x70, 0x80, + 0x6d, 0x00, 0x63, 0x75, 0x72, 0x80, 0x75, 0x6d, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x53, 0x4a, 0x67, 0x7c, 0x7b, 0x49, 0x66, 0x67, + 0x67, 0x68, 0x52, 0x66, 0x51, 0x06, 0x00, 0x00, 0x4d, + 0x67, 0x52, 0x67, 0x67, 0x67, 0x52, 0x52, 0x4a, 0x51, + 0x7b, 0x7b, 0x54, 0x67, 0x66, 0x06, 0x00, 0x6b, 0x66, + 0x67, 0x52, 0x4a, 0x66, 0x66, 0x66, 0x4d, 0x7b, 0x54, + 0x67, 0x52, 0x66, 0x67, 0x52, 0x67, 0x67, 0x6b, 0x00, + 0x00, 0x4f, 0x4c, 0x67, 0x52, 0x67, 0x66, 0x01, 0x4f, + 0x67, 0x67, 0x67, 0x66, 0x67, 0x66, 0x56, 0x39, 0x06, + 0x51, 0x66, 0x67, 0x52, 0x66, 0x85, 0x00, 0x00, 0x85, + 0x66, 0x67, 0x67, 0x66, 0x49, 0x3b, 0x85, 0x4c, 0x67, + 0x67, 0x4a, 0x66, 0x67, 0x4a, 0x00, 0x3b, 0x1e, 0x19, + 0x19, 0x1c, 0x1c, 0x12, 0xa8, 0x46, 0x00, 0x12, 0x18, + 0x19, 0x19, 0x19, 0x1e, 0x70, 0x80, 0x80, 0x87, 0x80, + 0x70, 0x70, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, + 0x6e, 0x80, 0x87, 0x80, 0x75, 0x5b, 0x40, 0x91, 0x6f, + 0x72, 0x80, 0x70, 0x80, 0x72, 0xa1, 0x00, 0x63, 0x75, + 0x80, 0x87, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x4a, 0x68, 0x52, + 0x68, 0x52, 0x67, 0x52, 0x67, 0x52, 0x67, 0x67, 0x4c, + 0x6b, 0x01, 0x00, 0x00, 0x8d, 0x4a, 0x68, 0x52, 0x67, + 0x66, 0x4a, 0x68, 0x67, 0x52, 0x68, 0x52, 0x67, 0x67, + 0x4c, 0x01, 0x00, 0x84, 0x66, 0x67, 0x67, 0x67, 0x66, + 0x4a, 0x67, 0x67, 0x66, 0x66, 0x67, 0x66, 0x4a, 0x67, + 0x67, 0x67, 0x54, 0x55, 0x00, 0x00, 0x85, 0x7a, 0x67, + 0x67, 0x66, 0x4d, 0x01, 0x39, 0x67, 0x52, 0x67, 0x67, + 0x67, 0x66, 0x69, 0x00, 0x06, 0x49, 0x66, 0x67, 0x67, + 0x66, 0x85, 0x00, 0x00, 0x50, 0x66, 0x52, 0x67, 0x66, + 0x7b, 0x00, 0x6a, 0x4a, 0x66, 0x67, 0x52, 0x67, 0x67, + 0x7b, 0x00, 0x06, 0x19, 0x19, 0x12, 0x12, 0x12, 0x4f, + 0x00, 0x00, 0x00, 0x46, 0x31, 0x18, 0x12, 0x1b, 0xa9, + 0x80, 0x87, 0x70, 0x80, 0x70, 0x75, 0xaa, 0x45, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x83, 0x75, 0x70, 0x80, 0x70, + 0x8e, 0x65, 0x00, 0x9c, 0x71, 0x80, 0x70, 0x80, 0x72, + 0x80, 0x73, 0x0e, 0x63, 0x75, 0x70, 0x72, 0x71, 0x6d, + 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x53, 0x67, 0x67, 0x67, 0x67, 0x68, 0x67, + 0x67, 0x68, 0x52, 0x66, 0x4d, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x53, 0x4a, 0x66, 0x67, 0x67, 0x52, 0x67, + 0x67, 0x67, 0x67, 0x67, 0x66, 0x51, 0x01, 0x00, 0x00, + 0x7b, 0x66, 0x52, 0x67, 0x52, 0x67, 0x52, 0x52, 0x67, + 0x4a, 0x66, 0x67, 0x52, 0x67, 0x52, 0x4a, 0x4f, 0x00, + 0x00, 0x01, 0x6b, 0x4c, 0x67, 0x67, 0x66, 0x56, 0x01, + 0x01, 0x4a, 0x67, 0x67, 0x52, 0x67, 0x66, 0x58, 0x00, + 0x55, 0x56, 0x66, 0x67, 0x67, 0x66, 0x85, 0x00, 0x00, + 0x49, 0x68, 0x67, 0x67, 0x66, 0x7c, 0x00, 0x3c, 0x4d, + 0x68, 0x67, 0x67, 0x67, 0x66, 0x4f, 0x00, 0x3a, 0xab, + 0xac, 0xad, 0xad, 0xad, 0x1d, 0x00, 0x00, 0x00, 0x00, + 0xad, 0xad, 0xad, 0x5e, 0x70, 0x80, 0x80, 0x80, 0x72, + 0x80, 0x87, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xae, 0x75, 0x87, 0x80, 0x70, 0x8e, 0xaf, 0x00, 0x81, + 0x71, 0x80, 0x70, 0x80, 0x80, 0xb0, 0x00, 0x3f, 0xa9, + 0x75, 0x80, 0x80, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x4d, 0x68, + 0x52, 0x68, 0x67, 0x67, 0x67, 0x52, 0x52, 0x4a, 0x51, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x7b, + 0x53, 0x67, 0x67, 0x67, 0x67, 0x67, 0x68, 0x52, 0x68, + 0x66, 0x69, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x53, 0x4a, + 0x67, 0x67, 0x66, 0x4a, 0x68, 0x52, 0x67, 0x52, 0x67, + 0x4a, 0x51, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x7b, 0x4c, + 0x52, 0x66, 0x66, 0x56, 0x3b, 0x00, 0x53, 0x66, 0x66, + 0x67, 0x52, 0x54, 0x08, 0x00, 0x6a, 0x53, 0x66, 0x66, + 0x52, 0x66, 0x85, 0x00, 0x00, 0x54, 0x66, 0x66, 0x66, + 0x4c, 0x7b, 0x00, 0x06, 0x4d, 0x68, 0x52, 0x66, 0x52, + 0x67, 0x06, 0x00, 0x4f, 0x4c, 0x52, 0x53, 0x2a, 0x29, + 0x15, 0x00, 0x00, 0x00, 0x00, 0x29, 0x15, 0x29, 0x70, + 0x80, 0x70, 0x70, 0x70, 0x70, 0x82, 0xaa, 0x45, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x75, 0x6f, 0x80, + 0x6f, 0x8e, 0xa6, 0x00, 0x63, 0x75, 0x70, 0x70, 0x70, + 0x70, 0xa0, 0x00, 0x47, 0x5d, 0x6f, 0x70, 0x70, 0x75, + 0x9c, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x57, 0x49, 0x51, 0x4d, 0x54, 0x4d, + 0x54, 0x56, 0x69, 0x84, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x49, 0x4d, + 0x4d, 0x54, 0x4d, 0x56, 0x56, 0x49, 0x4f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x4e, 0x7b, 0x56, 0x4d, 0x56, + 0x4d, 0x56, 0x56, 0x51, 0x6b, 0x6a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3b, 0x6b, 0x4d, 0x51, 0x49, 0x4d, 0x7b, + 0x01, 0x00, 0x6b, 0x51, 0x49, 0x4d, 0x51, 0x7b, 0x06, + 0x00, 0x3c, 0x49, 0x51, 0x49, 0x4d, 0x56, 0x4e, 0x00, + 0x00, 0x4d, 0x51, 0x49, 0x51, 0x56, 0x57, 0x00, 0x01, + 0x6b, 0x4d, 0x51, 0x49, 0x56, 0x7c, 0x00, 0x00, 0x3c, + 0xb2, 0x17, 0xb2, 0x29, 0x17, 0x17, 0xb2, 0x00, 0x00, + 0xb2, 0x17, 0x17, 0x17, 0xb2, 0x17, 0xb2, 0x5c, 0x5c, + 0x76, 0x5c, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8f, 0x5e, 0x5c, 0x5c, 0x5e, 0x9b, 0x8a, 0x00, + 0x79, 0x5c, 0x5c, 0x5c, 0x5c, 0x76, 0x9e, 0x00, 0x45, + 0xb3, 0x76, 0x5c, 0x5c, 0x5d, 0x63, 0x45, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x3b, 0x3b, 0x3b, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x3b, 0x3b, 0x3b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; + +// Keyboard + +unsigned char item_keyboard_colors[] = { + 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, + 0x39, 0x39, 0x39, + 0x31, 0x31, 0x31, + 0x29, 0x29, 0x29, + 0x21, 0x21, 0x21, + 0x42, 0x42, 0x42, + 0x63, 0x63, 0x63, + 0x7b, 0x7b, 0x7b, + 0x73, 0x73, 0x73, + 0x6b, 0x6b, 0x6b, + 0x4a, 0x4a, 0x4a, + 0x94, 0x94, 0x94, + 0x9c, 0x9c, 0x9c, + 0xa5, 0xa5, 0xa5, + 0xbd, 0xbd, 0xbd, + 0x5a, 0x5a, 0x5a, + 0x52, 0x52, 0x52, + 0x84, 0x84, 0x84, + 0xad, 0xad, 0xad, + 0xc6, 0xc6, 0xc6, + 0xb5, 0xb5, 0xb5, + 0x8c, 0x8c, 0x8c, + 0x10, 0x10, 0x10, + 0x08, 0x08, 0x08 + +}; +unsigned char item_keyboard[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x07, 0x08, 0x06, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x09, 0x08, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x08, 0x07, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x0b, 0x0c, 0x0d, 0x0d, 0x0b, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x0e, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, + 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0d, 0x0e, 0x0d, + 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x0a, + 0x0d, 0x0e, 0x0d, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, + 0x0d, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x10, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x0d, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x0d, 0x07, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x0e, 0x13, 0x08, 0x08, 0x06, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, + 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x07, 0x12, 0x0b, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x0b, 0x06, 0x06, 0x08, 0x09, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x08, 0x12, 0x0f, 0x10, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x0f, 0x10, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x10, 0x12, 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x08, + 0x08, 0x0d, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x07, 0x08, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x14, + 0x08, 0x12, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x11, 0x11, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x0f, 0x07, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x0f, 0x07, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x06, 0x06, 0x0f, 0x07, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, 0x06, + 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x06, 0x06, 0x06, 0x06, 0x08, 0x0d, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x07, 0x14, 0x06, + 0x06, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x07, 0x0f, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x0b, + 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x11, + 0x13, 0x07, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x10, 0x0f, 0x0f, 0x14, 0x0e, 0x06, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0e, + 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x11, 0x0e, 0x0f, 0x14, 0x0f, 0x0c, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, + 0x0f, 0x0f, 0x0e, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x14, 0x12, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, + 0x0f, 0x0f, 0x0f, 0x15, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x0e, + 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x12, 0x0e, 0x12, 0x15, 0x0f, 0x0e, 0x06, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x15, 0x0f, 0x0f, + 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x0d, 0x0f, 0x14, 0x15, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, + 0x06, 0x09, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, 0x10, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0d, 0x0d, + 0x0f, 0x0e, 0x0e, 0x15, 0x07, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, + 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x08, 0x0d, 0x03, 0x03, 0x03, 0x00, 0x06, + 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x08, 0x0d, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, + 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x0c, 0x13, 0x06, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x11, 0x13, 0x0f, 0x07, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, + 0x07, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x12, 0x0f, 0x0c, 0x07, 0x0a, 0x15, 0x0a, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x13, + 0x13, 0x07, 0x10, 0x10, 0x0b, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x09, + 0x15, 0x08, 0x07, 0x09, 0x0f, 0x0a, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x09, 0x11, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x13, 0x09, + 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x10, 0x07, 0x0f, 0x07, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x11, + 0x07, 0x09, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x12, 0x0d, 0x06, 0x0c, 0x15, 0x11, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x0e, 0x15, 0x09, 0x0f, 0x0e, 0x16, + 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x08, 0x12, + 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x0b, 0x12, 0x12, 0x08, 0x13, 0x16, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x07, 0x0f, + 0x06, 0x06, 0x12, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x08, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x0f, + 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0b, 0x13, + 0x0f, 0x0f, 0x09, 0x10, 0x11, 0x11, 0x11, 0x0b, 0x0b, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x10, 0x12, 0x08, 0x08, 0x13, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, + 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x12, 0x13, 0x0b, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, + 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x0f, 0x10, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x12, 0x0e, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x10, 0x0f, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0e, + 0x0d, 0x13, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x10, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x0d, + 0x12, 0x06, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x0f, 0x10, 0x11, 0x10, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x08, 0x15, 0x0d, 0x0e, 0x0d, 0x0d, 0x0b, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x11, + 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x0d, 0x13, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x10, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x0f, 0x0f, 0x13, 0x06, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x10, 0x15, 0x0f, 0x0f, 0x0e, 0x0e, + 0x0d, 0x0e, 0x0d, 0x0d, 0x0c, 0x06, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x11, 0x0f, + 0x0d, 0x0d, 0x0d, 0x14, 0x09, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, + 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x14, 0x10, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, + 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, + 0x06, 0x02, 0x10, 0x0f, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x02, 0x06, 0x08, 0x0f, 0x0f, 0x0c, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, + 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x0d, 0x08, 0x02, 0x0f, 0x10, + 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x08, 0x0d, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, 0x08, + 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x11, + 0x0d, 0x0d, 0x0d, 0x13, 0x15, 0x06, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0c, 0x0f, 0x0f, + 0x14, 0x0f, 0x0f, 0x0f, 0x0e, 0x02, 0x03, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x11, 0x15, 0x0f, 0x07, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x08, 0x0e, 0x02, 0x02, 0x02, 0x16, + 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, + 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x06, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x08, 0x08, + 0x08, 0x08, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, + 0x02, 0x0b, 0x13, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x08, 0x0d, + 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, 0x0f, + 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, + 0x13, 0x10, 0x15, 0x0c, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x0d, 0x08, 0x02, 0x14, 0x10, 0x11, 0x0f, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x08, + 0x0d, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x11, 0x15, 0x10, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x09, + 0x13, 0x10, 0x10, 0x07, 0x13, 0x0d, 0x04, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x0f, 0x16, 0x10, 0x0a, + 0x15, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x06, 0x13, 0x0e, 0x10, 0x11, 0x11, 0x06, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x15, 0x0a, 0x10, + 0x0c, 0x0f, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x0a, 0x15, 0x0a, 0x10, 0x11, 0x10, 0x02, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x0f, + 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x06, 0x15, 0x13, 0x0d, 0x0f, 0x15, 0x09, + 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x0d, + 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, + 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, + 0x02, 0x03, 0x02, 0x11, 0x14, 0x03, 0x04, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x06, 0x0e, + 0x0c, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x02, 0x0f, + 0x10, 0x11, 0x0f, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x03, 0x06, 0x10, 0x10, 0x0f, 0x0a, 0x16, + 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, + 0x13, 0x10, 0x11, 0x10, 0x11, 0x02, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x03, 0x02, 0x06, 0x10, 0x10, 0x10, 0x11, + 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x02, 0x02, 0x02, 0x03, 0x08, 0x0d, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x03, 0x02, 0x07, 0x16, 0x10, 0x10, + 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x03, 0x02, 0x0b, 0x0b, 0x02, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, 0x0f, 0x15, + 0x0d, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x09, 0x0e, 0x0e, 0x0f, 0x0f, 0x08, 0x04, 0x03, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, + 0x14, 0x0f, 0x0c, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0e, 0x0a, 0x03, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0a, 0x15, + 0x0f, 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x15, 0x0b, 0x03, 0x03, 0x04, + 0x03, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, + 0x09, 0x08, 0x11, 0x0d, 0x09, 0x04, 0x04, 0x04, 0x00, + 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, 0x03, 0x0a, + 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x15, 0x0f, 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x11, + 0x0f, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x09, 0x0c, 0x03, 0x03, 0x06, 0x0e, 0x09, 0x04, 0x04, + 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0f, 0x14, + 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x0c, 0x09, 0x03, 0x15, 0x0b, 0x0b, 0x15, 0x04, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, + 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x0c, 0x03, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x14, 0x0f, + 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, + 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x0a, 0x04, 0x04, + 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x09, 0x0c, 0x03, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, + 0x03, 0x0b, 0x0c, 0x0f, 0x14, 0x0f, 0x15, 0x0b, 0x03, + 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0c, + 0x09, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x09, 0x06, 0x03, 0x11, 0x14, 0x04, 0x04, 0x05, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, + 0x09, 0x09, 0x09, 0x0c, 0x14, 0x06, 0x04, 0x05, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x15, 0x0d, 0x09, + 0x0c, 0x13, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x04, 0x0c, 0x0d, 0x0d, 0x0c, + 0x02, 0x04, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x06, 0x0c, 0x0d, 0x0c, 0x06, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, + 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, + 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, + 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, + 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, + 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, + 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x06, + 0x0b, 0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x10, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, + 0x0a, 0x0d, 0x11, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, + 0x0d, 0x0d, 0x12, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x11, 0x0e, 0x0d, 0x0d, 0x0b, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, + 0x0d, 0x0d, 0x0d, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x11, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x06, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x0b, 0x07, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x0a, 0x0b, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x02, 0x11, 0x13, 0x0b, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0b, 0x06, + 0x06, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x08, 0x13, 0x12, 0x08, 0x08, 0x0e, 0x0d, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, + 0x12, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x12, 0x13, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, + 0x12, 0x08, 0x12, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0b, + 0x13, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x13, + 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, + 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x11, 0x11, + 0x11, 0x07, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, + 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, + 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, + 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, + 0x06, 0x06, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x0f, 0x10, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, + 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x0d, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x0b, 0x0b, 0x0b, 0x0b, 0x13, 0x0f, 0x08, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x0b, 0x12, 0x0f, 0x13, 0x06, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, + 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x0b, 0x08, 0x0d, 0x08, 0x15, 0x0f, 0x0e, 0x06, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, + 0x0f, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x12, 0x13, 0x13, 0x0f, 0x15, 0x11, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, + 0x12, 0x0f, 0x0f, 0x0e, 0x0e, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x10, 0x13, 0x14, + 0x13, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, + 0x11, 0x13, 0x0f, 0x14, 0x0f, 0x13, 0x0b, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0f, 0x0f, 0x0f, + 0x0f, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x0c, 0x09, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, + 0x06, 0x06, 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x15, 0x10, 0x06, 0x06, 0x06, 0x02, 0x15, + 0x0b, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x13, + 0x0b, 0x06, 0x0b, 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x09, + 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, + 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, + 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x08, 0x0d, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, + 0x0f, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x08, 0x13, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, + 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, 0x13, + 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x10, 0x12, 0x12, 0x12, 0x12, 0x08, 0x12, 0x08, 0x08, + 0x07, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, + 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, + 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, + 0x13, 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x09, 0x0f, 0x08, 0x07, 0x09, 0x13, + 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, + 0x0f, 0x0d, 0x06, 0x0c, 0x0f, 0x0b, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x08, 0x07, 0x16, + 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, + 0x12, 0x13, 0x15, 0x12, 0x10, 0x0d, 0x0c, 0x03, 0x03, + 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x15, 0x07, 0x07, + 0x10, 0x16, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, + 0x06, 0x11, 0x09, 0x14, 0x07, 0x10, 0x11, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, + 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, + 0x06, 0x06, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x12, 0x0d, + 0x03, 0x03, 0x03, 0x00, 0x06, 0x06, 0x06, 0x0f, 0x07, + 0x06, 0x06, 0x02, 0x02, 0x0f, 0x11, 0x03, 0x03, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x13, 0x0e, 0x06, 0x0d, 0x0e, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, + 0x0d, 0x06, 0x06, 0x02, 0x12, 0x0d, 0x03, 0x03, 0x03, + 0x00, 0x06, 0x06, 0x06, 0x11, 0x07, 0x07, 0x07, 0x12, + 0x0f, 0x07, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x07, 0x15, 0x12, 0x03, 0x03, 0x03, 0x00, + 0x06, 0x06, 0x06, 0x11, 0x16, 0x0f, 0x12, 0x0f, 0x12, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, + 0x0d, 0x0e, 0x0d, 0x0e, 0x15, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, + 0x06, 0x06, 0x11, 0x0e, 0x0f, 0x0f, 0x14, 0x08, 0x02, + 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0c, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x06, 0x03, 0x04, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0f, 0x14, 0x0e, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, + 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x06, 0x06, 0x08, 0x13, 0x06, 0x02, 0x02, 0x0d, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, + 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, + 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x15, 0x11, 0x02, + 0x02, 0x07, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, + 0x06, 0x11, 0x15, 0x13, 0x08, 0x06, 0x02, 0x02, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x07, 0x0f, + 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, 0x0d, 0x08, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, + 0x0b, 0x06, 0x02, 0x13, 0x0a, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x13, 0x09, 0x06, 0x15, 0x11, 0x0b, + 0x0f, 0x06, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x0b, 0x15, 0x15, 0x15, 0x06, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, 0x0b, 0x06, 0x02, + 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x07, 0x14, 0x07, 0x02, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, + 0x12, 0x08, 0x08, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0a, 0x0f, 0x07, + 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x08, + 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, + 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x0c, + 0x14, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x14, 0x0f, 0x13, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, + 0x12, 0x0f, 0x0f, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x04, + 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x02, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x08, + 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, + 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x0b, 0x08, + 0x13, 0x15, 0x12, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, + 0x02, 0x06, 0x02, 0x10, 0x0f, 0x02, 0x02, 0x02, 0x03, + 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x10, 0x0f, + 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x0e, 0x16, 0x02, 0x0a, 0x15, + 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x0d, + 0x08, 0x02, 0x0f, 0x10, 0x10, 0x0f, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x08, 0x0f, 0x08, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x02, 0x13, 0x12, 0x02, 0x0a, 0x15, 0x06, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0a, 0x0f, + 0x07, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, + 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x02, + 0x06, 0x02, 0x0f, 0x09, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, 0x06, 0x02, 0x02, + 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, + 0x02, 0x02, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, + 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x06, 0x02, 0x06, 0x0c, 0x0f, 0x0f, 0x08, + 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x06, + 0x0c, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x03, 0x03, 0x04, + 0x00, 0x02, 0x02, 0x06, 0x02, 0x08, 0x14, 0x0f, 0x0c, + 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, + 0x02, 0x06, 0x02, 0x02, 0x06, 0x11, 0x02, 0x11, 0x13, + 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, 0x02, + 0x02, 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, + 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, + 0x04, 0x03, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x10, + 0x14, 0x02, 0x02, 0x06, 0x06, 0x03, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x02, 0x10, 0x14, 0x02, 0x02, 0x02, 0x0e, + 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x10, 0x0f, 0x06, 0x0e, 0x08, 0x03, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x0d, 0x16, 0x11, 0x0f, 0x09, + 0x07, 0x15, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x11, 0x15, 0x12, 0x15, 0x0b, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x02, + 0x0e, 0x12, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x0a, 0x0f, 0x0a, 0x02, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x08, + 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x0c, 0x0f, 0x08, 0x03, 0x03, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0e, 0x06, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, + 0x02, 0x08, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0b, + 0x0d, 0x0e, 0x10, 0x07, 0x15, 0x0b, 0x04, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, + 0x08, 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, 0x10, + 0x0a, 0x0f, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x08, 0x0f, 0x0c, 0x02, 0x16, 0x0f, 0x0b, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x14, 0x0a, + 0x10, 0x0c, 0x14, 0x09, 0x03, 0x04, 0x04, 0x00, 0x02, + 0x02, 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x12, + 0x10, 0x10, 0x11, 0x13, 0x09, 0x04, 0x04, 0x04, 0x00, + 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0f, 0x07, 0x11, 0x0e, + 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x11, + 0x0f, 0x07, 0x0a, 0x13, 0x0f, 0x08, 0x04, 0x04, 0x04, + 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x13, 0x0c, 0x0f, + 0x06, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, + 0x07, 0x15, 0x15, 0x0d, 0x0f, 0x13, 0x08, 0x03, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x03, 0x06, 0x15, 0x12, 0x02, + 0x12, 0x15, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x02, 0x06, 0x15, 0x0e, 0x0f, 0x06, 0x03, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x0f, 0x12, + 0x10, 0x11, 0x11, 0x06, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x10, 0x10, 0x11, + 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, + 0x02, 0x03, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, 0x13, 0x10, 0x11, + 0x10, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, + 0x03, 0x02, 0x02, 0x03, 0x02, 0x03, 0x0e, 0x08, 0x04, + 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x11, + 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x02, 0x02, 0x16, + 0x08, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, + 0x02, 0x03, 0x02, 0x06, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x08, 0x0c, 0x02, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x03, 0x02, 0x09, 0x0f, 0x13, 0x0d, 0x0e, + 0x15, 0x11, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, + 0x03, 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x08, 0x15, 0x0f, 0x15, 0x08, 0x04, 0x03, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x13, 0x15, + 0x0f, 0x15, 0x0b, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0d, 0x09, + 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, + 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x0b, 0x13, 0x0f, 0x0f, 0x14, 0x0d, + 0x02, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x04, 0x04, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x0c, 0x0f, 0x15, 0x08, + 0x0c, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x10, 0x0f, 0x16, 0x03, 0x04, 0x03, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0e, 0x03, + 0x12, 0x0f, 0x0b, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, + 0x03, 0x09, 0x0e, 0x03, 0x03, 0x03, 0x0e, 0x0a, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x10, + 0x13, 0x16, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x09, + 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x04, 0x04, + 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, + 0x0b, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x0f, 0x15, 0x0b, 0x04, + 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x0b, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, + 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x14, 0x15, 0x0b, + 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x0b, 0x03, 0x04, 0x04, + 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x11, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, + 0x04, 0x05, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x02, 0x09, 0x0c, 0x06, 0x02, 0x02, 0x03, 0x04, 0x04, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x09, 0x0d, 0x02, 0x11, 0x02, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x0d, 0x09, 0x04, 0x04, 0x05, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x06, 0x0f, 0x0b, 0x03, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x09, 0x0d, + 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x0c, + 0x09, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x06, 0x09, + 0x0d, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, + 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, + 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, + 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, + 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x11, 0x09, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x09, 0x11, 0x05, 0x05, 0x17, + 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x04, 0x17, 0x00, 0x01, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x11, 0x0d, 0x0d, 0x11, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, + 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, + 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, + 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, + 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, + 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, + 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, + 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, + 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; + +// ************************************************************************* +// ICONS +// ************************************************************************* + +// File + +unsigned char item_disk_colors[] = { + 0x00, 0x00, 0x00, + 0x93, 0x7d, 0x2d, + 0x7b, 0x68, 0x25, + 0xc1, 0xaf, 0x6b, + 0xa3, 0x94, 0x59, + 0x05, 0x04, 0x00, + 0x55, 0x48, 0x15, + 0xa0, 0x87, 0x2f, + 0xa3, 0x8b, 0x33, + 0xdf, 0xcc, 0x88, + 0xe4, 0xd0, 0x89, + 0xc7, 0xaf, 0x62, + 0xab, 0x9a, 0x51, + 0x16, 0x10, 0x01, + 0x0a, 0x09, 0x00, + 0x7a, 0x67, 0x24, + 0xac, 0x93, 0x3b, + 0xb0, 0x97, 0x3f, + 0xf1, 0xdc, 0x94, + 0xd9, 0xc2, 0x73, + 0xdb, 0xc3, 0x6a, + 0xca, 0xb2, 0x54, + 0xaa, 0x99, 0x4e, + 0x90, 0x79, 0x2a, + 0x9d, 0x84, 0x2d, + 0xe2, 0xcc, 0x72, + 0xf3, 0xda, 0x77, + 0xe3, 0xcc, 0x69, + 0xe3, 0xca, 0x62, + 0xdb, 0xc3, 0x64, + 0xc8, 0xad, 0x59, + 0xa1, 0x90, 0x53, + 0x75, 0x62, 0x21, + 0x8d, 0x76, 0x28, + 0x96, 0x7e, 0x2a, + 0xde, 0xc5, 0x5a, + 0xe7, 0xd1, 0x64, + 0xe5, 0xcb, 0x5e, + 0xd2, 0xb8, 0x69, + 0xbd, 0xa9, 0x62, + 0x9c, 0x8c, 0x53, + 0x8a, 0x74, 0x26, + 0x09, 0x09, 0x04, + 0xd4, 0xbb, 0x64, + 0xe0, 0xc5, 0x5e, + 0xe3, 0xc7, 0x64, + 0xd6, 0xc0, 0x67, + 0xcd, 0xb3, 0x64, + 0xbd, 0xa9, 0x5b, + 0x9d, 0x8d, 0x4e, + 0x72, 0x60, 0x1e, + 0xd0, 0xba, 0x72, + 0xd3, 0xb8, 0x51, + 0xd1, 0xb5, 0x59, + 0xe0, 0xc7, 0x6e, + 0x8f, 0x78, 0x25, + 0x88, 0x71, 0x23, + 0xc4, 0xb0, 0x65, + 0xd4, 0xba, 0x5c, + 0xc4, 0xae, 0x5b, + 0x98, 0x7f, 0x23, + 0x84, 0x6e, 0x21, + 0x8e, 0x76, 0x24, + 0x93, 0x7a, 0x24, + 0x86, 0x70, 0x21, + 0x71, 0x5e, 0x1d, + 0xba, 0xa5, 0x5d, + 0xb6, 0xa1, 0x5a, + 0xbf, 0xa8, 0x52, + 0xc3, 0xac, 0x52, + 0xc5, 0xac, 0x4b, + 0x5a, 0x4b, 0x16, + 0x75, 0x61, 0x1d, + 0x89, 0x71, 0x1d, + 0x6d, 0x61, 0x35, + 0x77, 0x69, 0x3a, + 0x83, 0x74, 0x40, + 0x94, 0x84, 0x48, + 0xb1, 0x9e, 0x53, + 0xb8, 0xa4, 0x52, + 0xc5, 0xab, 0x47, + 0x34, 0x2b, 0x0d, + 0x7a, 0x65, 0x1d, + 0x84, 0x6c, 0x1d, + 0x89, 0x70, 0x1b, + 0x8c, 0x74, 0x1e, + 0x66, 0x54, 0x18, + 0x16, 0x14, 0x0b, + 0x38, 0x31, 0x1b, + 0x63, 0x56, 0x2e, + 0x89, 0x78, 0x40, + 0xb6, 0xa1, 0x4f, + 0xbb, 0xa3, 0x4d, + 0xc1, 0xa7, 0x4a, + 0xbf, 0xa5, 0x4b, + 0xb3, 0x9c, 0x46, + 0xc2, 0xc2, 0xc2, + 0x4e, 0x4e, 0x4e, + 0x57, 0x4c, 0x23, + 0x81, 0x69, 0x15, + 0x83, 0x6d, 0x20, + 0x23, 0x1d, 0x08, + 0x3d, 0x36, 0x1a, + 0x6f, 0x62, 0x2f, + 0xac, 0x97, 0x48, + 0xa8, 0x93, 0x42, + 0xb8, 0xa1, 0x47, + 0xb8, 0xa0, 0x48, + 0xb6, 0x9f, 0x49, + 0xaf, 0x99, 0x47, + 0xff, 0xff, 0xff, + 0x85, 0x6d, 0x19, + 0x6f, 0x5c, 0x1b, + 0x11, 0x4d, 0x81, + 0x26, 0x71, 0xa5, + 0x26, 0x6e, 0xa4, + 0x1c, 0x5e, 0x94, + 0x0b, 0x3d, 0x69, + 0x45, 0x3d, 0x1d, + 0xaa, 0x95, 0x49, + 0xac, 0x97, 0x47, + 0xaa, 0x94, 0x45, + 0xa8, 0x93, 0x45, + 0x28, 0x79, 0xa9, + 0x35, 0x81, 0xb4, + 0x3e, 0x87, 0xb9, + 0x33, 0x7b, 0xaf, + 0x21, 0x65, 0x9e, + 0x21, 0x61, 0x9c, + 0x1e, 0x5b, 0x98, + 0x15, 0x4e, 0x8a, + 0x44, 0x3b, 0x1e, + 0x99, 0x84, 0x39, + 0xa2, 0x8d, 0x41, + 0x9e, 0x89, 0x3d, + 0x32, 0x29, 0x0a, + 0x81, 0x69, 0x19, + 0x2d, 0x80, 0xb0, + 0x3b, 0x89, 0xbb, + 0x65, 0xa5, 0xd0, + 0x58, 0x9d, 0xcc, + 0x4a, 0x8f, 0xc2, + 0x2f, 0x71, 0xaa, + 0x1d, 0x58, 0x96, + 0x19, 0x51, 0x82, + 0x0e, 0x42, 0x85, + 0x7a, 0x6a, 0x31, + 0x95, 0x7f, 0x35, + 0x9d, 0x87, 0x3c, + 0xa1, 0x8b, 0x40, + 0x88, 0x6f, 0x1b, + 0x59, 0x49, 0x12, + 0x7f, 0x69, 0x1e, + 0x0e, 0x62, 0x91, + 0x4b, 0x98, 0xcb, + 0xd1, 0xf0, 0xfe, + 0x93, 0xda, 0xfe, + 0x56, 0x9a, 0xd0, + 0x38, 0x78, 0xb2, + 0x28, 0x65, 0xa2, + 0x1c, 0x54, 0x94, + 0x1c, 0x55, 0x7d, + 0x2a, 0x55, 0x76, + 0x13, 0x24, 0x3e, + 0x8b, 0x75, 0x2b, + 0x99, 0x83, 0x37, + 0x95, 0x7f, 0x32, + 0x30, 0x27, 0x09, + 0x70, 0x5c, 0x16, + 0x3e, 0x89, 0xbd, + 0x52, 0x9d, 0xd1, + 0x7c, 0xc3, 0xfa, + 0x6e, 0xb2, 0xeb, + 0x51, 0x92, 0xcc, + 0x39, 0x77, 0xb2, + 0x20, 0x5e, 0x9b, + 0x1b, 0x52, 0x93, + 0x2b, 0x55, 0x70, + 0x32, 0x55, 0x67, + 0x13, 0x29, 0x4e, + 0x23, 0x1e, 0x0e, + 0x7c, 0x67, 0x1e, + 0x91, 0x7a, 0x2d, + 0x63, 0x51, 0x12, + 0x80, 0x6b, 0x23, + 0x2a, 0x77, 0xaa, + 0x45, 0x88, 0xc1, + 0x44, 0x84, 0xbf, + 0x3a, 0x78, 0xb4, + 0x2c, 0x67, 0xa4, + 0x1c, 0x53, 0x81, + 0x2f, 0x56, 0x69, + 0x31, 0x52, 0x65, + 0x11, 0x32, 0x6b, + 0x05, 0x0d, 0x1c, + 0x0e, 0x0c, 0x05, + 0x75, 0x61, 0x1a, + 0x2e, 0x25, 0x07, + 0x6e, 0x5a, 0x13, + 0x27, 0x74, 0xa7, + 0x2a, 0x6d, 0xa6, + 0x2d, 0x6c, 0xa7, + 0x21, 0x5a, 0x99, + 0x23, 0x53, 0x8c, + 0x18, 0x57, 0x77, + 0x2b, 0x54, 0x68, + 0x2f, 0x4f, 0x6d, + 0x0c, 0x34, 0x7f, + 0x7c, 0x64, 0x13, + 0x54, 0x44, 0x0d, + 0x0a, 0x55, 0x89, + 0x24, 0x6d, 0xa2, + 0x1f, 0x5d, 0x99, + 0x1c, 0x53, 0x94, + 0x16, 0x5a, 0x73, + 0x13, 0x5c, 0x6a, + 0x23, 0x4d, 0x6a, + 0x20, 0x38, 0x6a, + 0x02, 0x26, 0x70, + 0x53, 0x44, 0x13, + 0x76, 0x5f, 0x11, + 0x5d, 0x4d, 0x15, + 0x07, 0x4d, 0x84, + 0x17, 0x62, 0x84, + 0x15, 0x60, 0x7d, + 0x13, 0x63, 0x71, + 0x11, 0x5e, 0x6c, + 0x0b, 0x52, 0x6d, + 0x13, 0x43, 0x64, + 0x17, 0x33, 0x6d, + 0x1f, 0x1a, 0x09, + 0x32, 0x2a, 0x0c, + 0x6e, 0x5b, 0x18, + 0x6a, 0x55, 0x0d, + 0x44, 0x38, 0x0e, + 0x17, 0x55, 0x92, + 0x16, 0x50, 0x8f, + 0x0f, 0x51, 0x7a, + 0x0a, 0x4a, 0x75, + 0x05, 0x43, 0x6f, + 0x02, 0x32, 0x6e, + 0x05, 0x2d, 0x77, + 0x3d, 0x32, 0x0e, + 0x4d, 0x3f, 0x0f, + 0x67, 0x55, 0x14, + 0x79, 0x62, 0x13, + 0x54, 0x45, 0x12, + 0x02, 0x38, 0x77, + 0x08, 0x3c, 0x7e, + 0x03, 0x32, 0x76, + 0x02, 0x2c, 0x72, + 0x7e, 0x68, 0x19, + 0x50, 0x41, 0x0f, + 0x2d, 0x25, 0x09 + +}; +unsigned char item_disk[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x07, 0x08, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x08, 0x10, + 0x11, 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x12, 0x13, 0x14, 0x14, 0x15, 0x16, 0x0e, 0x00, + 0x00, 0x17, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x13, 0x19, 0x1a, + 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x20, 0x21, + 0x22, 0x18, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x13, 0x1b, 0x23, 0x24, 0x25, 0x24, 0x1d, + 0x26, 0x27, 0x28, 0x00, 0x00, 0x20, 0x29, 0x29, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x26, 0x2b, + 0x2c, 0x23, 0x25, 0x1c, 0x2d, 0x2e, 0x26, 0x2f, 0x30, + 0x31, 0x05, 0x00, 0x32, 0x29, 0x29, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x33, 0x2f, 0x1d, 0x34, 0x1c, 0x34, + 0x1d, 0x35, 0x36, 0x14, 0x2b, 0x0b, 0x30, 0x31, 0x00, + 0x00, 0x37, 0x22, 0x38, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x39, 0x1e, 0x3a, 0x3a, 0x35, 0x3a, 0x35, 0x15, 0x3a, + 0x35, 0x15, 0x1e, 0x3b, 0x3c, 0x00, 0x3d, 0x3e, 0x3f, + 0x3f, 0x40, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x42, 0x43, 0x42, 0x3b, 0x44, + 0x1e, 0x45, 0x45, 0x3a, 0x15, 0x34, 0x46, 0x35, 0x45, + 0x3c, 0x05, 0x47, 0x48, 0x40, 0x49, 0x3f, 0x3f, 0x3f, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x44, 0x45, 0x45, + 0x46, 0x50, 0x46, 0x46, 0x44, 0x3c, 0x05, 0x00, 0x51, + 0x52, 0x53, 0x54, 0x37, 0x55, 0x56, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x45, 0x5d, 0x5d, 0x5e, + 0x5f, 0x3c, 0x05, 0x60, 0x61, 0x00, 0x62, 0x40, 0x63, + 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x3f, 0x05, 0x6e, + 0x6e, 0x6e, 0x00, 0x6f, 0x49, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x72, 0x73, + 0x74, 0x71, 0x75, 0x00, 0x00, 0x76, 0x77, 0x78, 0x79, + 0x79, 0x7a, 0x55, 0x00, 0x6e, 0x6e, 0x60, 0x00, 0x6f, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, + 0x00, 0x00, 0x83, 0x84, 0x85, 0x85, 0x86, 0x49, 0x00, + 0x6e, 0x6e, 0x61, 0x87, 0x88, 0x32, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x8a, 0x8b, 0x8c, + 0x8d, 0x8e, 0x80, 0x8f, 0x90, 0x91, 0x00, 0x00, 0x92, + 0x93, 0x94, 0x95, 0x96, 0x00, 0x6e, 0x60, 0x00, 0x97, + 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x99, 0x7b, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, + 0xa1, 0xa2, 0xa3, 0x00, 0x62, 0xa4, 0xa5, 0xa6, 0x6f, + 0x00, 0x6e, 0x61, 0xa7, 0xa8, 0x56, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0x00, + 0xb4, 0xb5, 0xa6, 0xb6, 0x63, 0x00, 0x60, 0x00, 0xb7, + 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7b, 0xb9, 0xa9, 0xba, 0xbb, 0xbc, 0xbd, 0xa0, + 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0x21, 0xb6, + 0x63, 0x00, 0x61, 0xc5, 0xc6, 0x56, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x73, 0x73, + 0xc8, 0xc9, 0x9f, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0x00, 0x2a, 0x47, 0x38, 0x3d, 0xd0, 0x00, 0x00, 0xd1, + 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xd2, 0xd3, 0x7f, 0x80, 0xd4, 0x8f, 0xd5, + 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0x00, 0xc3, 0xdb, 0xc4, + 0x38, 0xdc, 0x00, 0xc5, 0xdd, 0x56, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, + 0x7f, 0xaf, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, + 0x00, 0x00, 0xe6, 0xe7, 0xe8, 0x88, 0xe9, 0x00, 0xea, + 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0xec, 0x82, 0xed, + 0xee, 0xef, 0xf0, 0xf1, 0x00, 0x00, 0x00, 0x00, 0xf2, + 0xf3, 0xf4, 0xf5, 0x00, 0xf6, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf7, 0xf8, 0xf9, 0xfa, 0xfa, 0xda, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0xfb, 0x06, + 0xfc, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +// Skip + +unsigned char item_skip_colors[] = { + 0x04, 0x02, 0x04, + 0xa4, 0xa6, 0xa4, + 0x1c, 0x1a, 0x1c, + 0x1c, 0x1e, 0x1c, + 0x14, 0x16, 0x14, + 0x9c, 0x9a, 0x9c, + 0x94, 0x92, 0x94, + 0x9c, 0x9e, 0x9c, + 0x94, 0x96, 0x94, + 0x8c, 0x8e, 0x8c, + 0xdc, 0xda, 0xdc, + 0xac, 0xae, 0xac, + 0xac, 0xfe, 0x04, + 0xbc, 0xba, 0xbc, + 0x3c, 0x3a, 0x3c, + 0x9c, 0xe6, 0x0c, + 0x8c, 0x8a, 0x8c, + 0x74, 0xae, 0x04, + 0x8c, 0xce, 0x0c, + 0x9c, 0xe2, 0x0c, + 0x84, 0x86, 0x84, + 0xfc, 0xd6, 0x8c, + 0xfc, 0xd2, 0x8c, + 0x74, 0xaa, 0x0c, + 0x8c, 0xc6, 0x0c, + 0x9c, 0xde, 0x0c, + 0xa4, 0xa2, 0xa4, + 0x7c, 0x7e, 0x7c, + 0x64, 0x66, 0x64, + 0xf4, 0xb2, 0x1c, + 0xf4, 0xba, 0x44, + 0x74, 0xa6, 0x0c, + 0x94, 0xd6, 0x14, + 0xfc, 0xb2, 0x24, + 0xf4, 0xaa, 0x1c, + 0xf4, 0xa6, 0x14, + 0x6c, 0x9e, 0x14, + 0x84, 0xc2, 0x04, + 0x94, 0xce, 0x14, + 0x94, 0xd2, 0x14, + 0xcc, 0xca, 0xcc, + 0xfc, 0xb6, 0x24, + 0xec, 0xa6, 0x14, + 0xdc, 0x92, 0x04, + 0xec, 0xae, 0x3c, + 0x74, 0xa2, 0x0c, + 0x84, 0xba, 0x14, + 0x8c, 0xca, 0x14, + 0xa4, 0xfa, 0x04, + 0xf4, 0xae, 0x1c, + 0xec, 0x9e, 0x0c, + 0xdc, 0x96, 0x04, + 0xec, 0xaa, 0x3c, + 0xa4, 0xee, 0x04, + 0x74, 0x72, 0x74, + 0xc4, 0xc2, 0xc4, + 0xe4, 0x9e, 0x0c, + 0xdc, 0x8e, 0x04, + 0xd4, 0x8a, 0x04, + 0xcc, 0x82, 0x04, + 0xdc, 0xa2, 0x3c, + 0xfc, 0xce, 0x84, + 0x94, 0xda, 0x04, + 0x5c, 0x5a, 0x5c, + 0xec, 0xa2, 0x0c, + 0xe4, 0x9a, 0x04, + 0xcc, 0x7e, 0x04, + 0xc4, 0x7a, 0x04, + 0xd4, 0x92, 0x24, + 0x24, 0x22, 0x24, + 0x2c, 0x2a, 0x2c, + 0xb4, 0xb2, 0xb4, + 0xd4, 0x8e, 0x04, + 0xbc, 0x76, 0x04, + 0xf4, 0xc6, 0x7c, + 0x54, 0x56, 0x54, + 0x2c, 0x2e, 0x2c, + 0x34, 0x32, 0x34, + 0xd4, 0x86, 0x04, + 0xc4, 0x7e, 0x04, + 0xbc, 0x72, 0x04, + 0xec, 0xbe, 0x6c, + 0x64, 0x9a, 0x04, + 0x6c, 0x6e, 0x6c, + 0xac, 0xaa, 0xac, + 0xcc, 0x86, 0x04, + 0xe4, 0xb2, 0x5c, + 0x4c, 0x4a, 0x4c, + 0xdc, 0xa6, 0x4c, + 0x6c, 0x6a, 0x6c, + 0x5c, 0x5e, 0x5c, + 0x0c, 0x0e, 0x0c, + 0x84, 0x82, 0x84, + 0x14, 0x12, 0x14, + 0x64, 0x62, 0x64, + 0x34, 0x36, 0x34, + 0x74, 0x76, 0x74, + 0x7c, 0x7a, 0x7c + +}; +unsigned char item_skip[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x02, 0x04, 0x05, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x02, 0x07, 0x08, 0x07, 0x09, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x04, 0x05, 0x07, + 0x05, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, + 0x04, 0x0d, 0x04, 0x0e, 0x0e, 0x07, 0x05, 0x07, 0x05, + 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x0f, 0x0c, 0x0c, 0x00, 0x00, 0x04, 0x0b, + 0x06, 0x0e, 0x0e, 0x08, 0x05, 0x05, 0x07, 0x08, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x12, 0x13, + 0x13, 0x0c, 0x0c, 0x00, 0x00, 0x07, 0x01, 0x09, 0x0e, + 0x0e, 0x09, 0x09, 0x06, 0x14, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x16, 0x00, 0x00, 0x17, 0x18, 0x19, 0x19, 0x0c, + 0x0c, 0x00, 0x00, 0x07, 0x1a, 0x14, 0x0e, 0x0e, 0x1b, + 0x1c, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x1e, 0x16, 0x16, + 0x00, 0x00, 0x1f, 0x18, 0x20, 0x20, 0x0c, 0x0c, 0x00, + 0x00, 0x08, 0x05, 0x14, 0x0e, 0x0e, 0x04, 0x03, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x21, 0x22, 0x23, 0x1e, 0x15, 0x16, 0x00, 0x00, + 0x24, 0x25, 0x26, 0x27, 0x0c, 0x0c, 0x00, 0x06, 0x08, + 0x05, 0x10, 0x04, 0x28, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x1d, 0x23, + 0x2a, 0x2b, 0x2c, 0x16, 0x15, 0x00, 0x00, 0x2d, 0x2e, + 0x2f, 0x30, 0x00, 0x1b, 0x14, 0x06, 0x07, 0x02, 0x0a, + 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x31, 0x22, 0x2a, 0x32, 0x33, 0x2b, 0x2b, + 0x34, 0x15, 0x16, 0x00, 0x00, 0x2f, 0x35, 0x00, 0x36, + 0x1b, 0x10, 0x09, 0x02, 0x04, 0x37, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x2a, + 0x32, 0x38, 0x2b, 0x2b, 0x39, 0x3a, 0x3b, 0x3c, 0x16, + 0x3d, 0x00, 0x3e, 0x00, 0x3f, 0x36, 0x1b, 0x09, 0x02, + 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2a, 0x40, 0x41, 0x41, 0x2b, 0x39, + 0x3a, 0x3b, 0x42, 0x43, 0x44, 0x3d, 0x00, 0x25, 0x00, + 0x45, 0x46, 0x1c, 0x10, 0x04, 0x47, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x33, 0x33, 0x2b, 0x39, 0x48, 0x3b, 0x42, 0x49, + 0x42, 0x4a, 0x00, 0x11, 0x00, 0x4b, 0x1c, 0x4c, 0x4d, + 0x04, 0x0b, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, + 0x48, 0x4e, 0x4f, 0x42, 0x50, 0x43, 0x51, 0x00, 0x52, + 0x00, 0x4b, 0x1c, 0x53, 0x10, 0x02, 0x04, 0x54, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x4f, 0x43, + 0x50, 0x50, 0x56, 0x00, 0x00, 0x57, 0x4b, 0x1c, 0x36, + 0x10, 0x04, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x4f, 0x50, 0x50, 0x58, 0x00, + 0x4c, 0x57, 0x3f, 0x59, 0x1b, 0x08, 0x04, 0x54, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5b, + 0x00, 0x00, 0x50, 0x44, 0x00, 0x03, 0x45, 0x57, 0x1c, + 0x5c, 0x08, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x5c, 0x1b, 0x5d, 0x5a, 0x00, 0x00, + 0x4b, 0x3f, 0x57, 0x46, 0x4d, 0x5a, 0x06, 0x04, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x5b, 0x53, 0x1c, 0x5e, 0x5e, 0x1c, 0x59, 0x53, + 0x5a, 0x5f, 0x0e, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, + 0x53, 0x53, 0x53, 0x60, 0x60, 0x1b, 0x5c, 0x5c, 0x02, + 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x60, 0x61, + 0x1b, 0x1b, 0x09, 0x09, 0x02, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5e, 0x1b, 0x08, 0x05, 0x06, + 0x04, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x53, 0x06, 0x08, 0x02, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0x02, 0x09, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +// Sound + +unsigned char item_soundOff_colors[] = { + 0x04, 0x02, 0x04, + 0xac, 0xae, 0xac, + 0xe4, 0xe2, 0xdc, + 0xe4, 0xde, 0xdc, + 0xac, 0xaa, 0xa4, + 0xf4, 0xee, 0xec, + 0xf4, 0xf6, 0xf4, + 0xec, 0xee, 0xec, + 0xdc, 0xda, 0xd4, + 0xa4, 0xa6, 0xa4, + 0xf4, 0xf2, 0xec, + 0xdc, 0xd6, 0xd4, + 0x9c, 0x9e, 0x9c, + 0xac, 0xaa, 0x9c, + 0xd4, 0xd2, 0xcc, + 0xdc, 0xde, 0xd4, + 0xcc, 0xce, 0xc4, + 0x9c, 0x9a, 0x94, + 0x74, 0x72, 0x5c, + 0xcc, 0xca, 0xc4, + 0xc4, 0xc6, 0xbc, + 0x94, 0x96, 0x94, + 0xec, 0xea, 0xe4, + 0x6c, 0x6a, 0x54, + 0xa4, 0xa2, 0x94, + 0xcc, 0xc6, 0xbc, + 0xc4, 0xc2, 0xbc, + 0xbc, 0xbe, 0xb4, + 0x94, 0x92, 0x8c, + 0x6c, 0x66, 0x54, + 0x64, 0x62, 0x54, + 0x6c, 0x62, 0x4c, + 0x9c, 0x9e, 0x8c, + 0xc4, 0xc2, 0xb4, + 0xbc, 0xba, 0xb4, + 0x8c, 0x8a, 0x84, + 0xd4, 0xd6, 0xcc, + 0x64, 0x5e, 0x4c, + 0xb4, 0xb6, 0xac, + 0x9c, 0x9a, 0x8c, + 0xbc, 0xb6, 0xac, + 0x54, 0x56, 0x44, + 0x5c, 0x56, 0x44, + 0xb4, 0xb2, 0xac, + 0x5c, 0x5a, 0x44, + 0x44, 0x46, 0x44, + 0x54, 0x52, 0x3c, + 0xbc, 0xba, 0xac, + 0x5c, 0x5a, 0x4c, + 0xac, 0xae, 0xa4, + 0xb4, 0xb2, 0xa4, + 0x4c, 0x4a, 0x4c, + 0x1c, 0x1a, 0x14, + 0x44, 0x42, 0x34, + 0xa4, 0xa2, 0x9c, + 0x54, 0x52, 0x44, + 0xb4, 0xb6, 0xb4, + 0x2c, 0x2e, 0x2c, + 0x2c, 0x2a, 0x24, + 0x84, 0x82, 0x7c, + 0x4c, 0x4a, 0x3c, + 0x54, 0x4e, 0x3c, + 0xb4, 0xae, 0xa4, + 0x74, 0x76, 0x74, + 0x3c, 0x3a, 0x2c, + 0xac, 0xa6, 0x9c, + 0x9c, 0x9e, 0x94, + 0x94, 0x92, 0x94, + 0x64, 0x5e, 0x54, + 0x4c, 0x4e, 0x44, + 0x6c, 0x66, 0x5c, + 0x94, 0x92, 0x84, + 0x6c, 0x6a, 0x64, + 0x64, 0x66, 0x64, + 0x64, 0x62, 0x5c, + 0x8c, 0x8a, 0x7c, + 0x84, 0x86, 0x84, + 0x74, 0x72, 0x6c, + 0x6c, 0x6e, 0x6c, + 0x9c, 0x96, 0x8c, + 0x84, 0x82, 0x74, + 0x7c, 0x7a, 0x7c, + 0x6c, 0x6e, 0x64, + 0xa4, 0xa6, 0x9c, + 0x84, 0x86, 0x7c, + 0x7c, 0x7a, 0x6c, + 0x5c, 0x5a, 0x54, + 0xa4, 0x9e, 0x94, + 0x74, 0x72, 0x64, + 0x54, 0x56, 0x54, + 0x3c, 0x3e, 0x3c, + 0x84, 0x7e, 0x7c, + 0xfc, 0x6a, 0x6c, + 0xbc, 0x02, 0x04, + 0xfc, 0x02, 0x04, + 0x94, 0x96, 0x8c, + 0x94, 0x8e, 0x84, + 0x8c, 0x8e, 0x84, + 0x54, 0x56, 0x4c, + 0x74, 0x76, 0x6c, + 0x34, 0x36, 0x2c + +}; +unsigned char item_soundOff[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0a, 0x0a, 0x0a, 0x02, 0x02, 0x0b, 0x0c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, 0x0d, 0x0e, + 0x0f, 0x0b, 0x02, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0a, 0x07, 0x12, 0x12, 0x0d, 0x10, 0x10, 0x0e, + 0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x05, 0x17, + 0x10, 0x17, 0x17, 0x18, 0x08, 0x13, 0x19, 0x1a, 0x1b, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x08, 0x17, 0x1d, 0x19, 0x14, 0x1e, + 0x1f, 0x20, 0x1a, 0x1a, 0x21, 0x22, 0x22, 0x23, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x13, + 0x25, 0x26, 0x25, 0x25, 0x1b, 0x1a, 0x25, 0x25, 0x27, + 0x22, 0x22, 0x28, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2a, 0x2b, 0x2b, + 0x25, 0x25, 0x1b, 0x1b, 0x2c, 0x2c, 0x28, 0x26, 0x2b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, + 0x2d, 0x00, 0x15, 0x2e, 0x29, 0x2b, 0x2f, 0x30, 0x2c, + 0x22, 0x2a, 0x28, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x34, 0x35, 0x15, + 0x36, 0x2a, 0x2a, 0x22, 0x26, 0x2a, 0x37, 0x2b, 0x32, + 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x2d, + 0x00, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x31, 0x32, 0x2a, + 0x2a, 0x26, 0x2e, 0x31, 0x3e, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3f, 0x33, 0x40, 0x35, + 0x1c, 0x36, 0x29, 0x2a, 0x26, 0x32, 0x37, 0x37, 0x41, + 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, + 0x00, 0x3f, 0x44, 0x45, 0x46, 0x3c, 0x2e, 0x3e, 0x2b, + 0x37, 0x37, 0x3e, 0x3d, 0x31, 0x42, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x48, 0x49, 0x4a, + 0x1c, 0x11, 0x3b, 0x37, 0x37, 0x32, 0x2b, 0x3d, 0x3c, + 0x41, 0x18, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x48, 0x4d, 0x4e, 0x1c, 0x42, 0x04, 0x31, + 0x4b, 0x3d, 0x3d, 0x31, 0x3c, 0x4f, 0x11, 0x50, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x49, 0x52, + 0x3b, 0x1c, 0x53, 0x0d, 0x3e, 0x3e, 0x31, 0x54, 0x3c, + 0x35, 0x27, 0x27, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x4a, 0x00, 0x56, 0x49, 0x55, 0x1c, 0x36, 0x0d, + 0x04, 0x31, 0x0d, 0x0d, 0x57, 0x55, 0x18, 0x47, 0x58, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x5a, + 0x4a, 0x5b, 0x1c, 0x11, 0x53, 0x04, 0x41, 0x53, 0x18, + 0x18, 0x27, 0x57, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, + 0x00, 0x00, 0x5c, 0x00, 0x00, 0x5a, 0x4d, 0x23, 0x57, + 0x36, 0x0d, 0x18, 0x57, 0x18, 0x57, 0x1c, 0x47, 0x4b, + 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, 0x5d, 0x5e, 0x5c, + 0x00, 0x00, 0x00, 0x46, 0x5f, 0x18, 0x18, 0x36, 0x57, + 0x42, 0x27, 0x60, 0x47, 0x4b, 0x44, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, + 0x5e, 0x5d, 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x52, 0x53, 0x18, 0x57, 0x27, 0x47, 0x61, 0x50, + 0x50, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x27, 0x20, 0x60, 0x50, 0x60, 0x50, 0x62, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5d, 0x5e, 0x5e, 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x61, 0x47, + 0x50, 0x50, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, 0x5d, + 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x55, 0x63, 0x3c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +unsigned char item_soundOn_colors[] = { + 0x04, 0x02, 0x04, + 0xac, 0xae, 0xac, + 0xe4, 0xe2, 0xdc, + 0xe4, 0xde, 0xdc, + 0xac, 0xaa, 0xa4, + 0xf4, 0xee, 0xec, + 0xf4, 0xf6, 0xf4, + 0xec, 0xee, 0xec, + 0xdc, 0xda, 0xd4, + 0xa4, 0xa6, 0xa4, + 0xf4, 0xf2, 0xec, + 0xdc, 0xd6, 0xd4, + 0x9c, 0x9e, 0x9c, + 0xac, 0xaa, 0x9c, + 0xd4, 0xd2, 0xcc, + 0xdc, 0xde, 0xd4, + 0xcc, 0xce, 0xc4, + 0x9c, 0x9a, 0x94, + 0x74, 0x72, 0x5c, + 0xcc, 0xca, 0xc4, + 0xc4, 0xc6, 0xbc, + 0x94, 0x96, 0x94, + 0xec, 0xea, 0xe4, + 0x6c, 0x6a, 0x54, + 0xa4, 0xa2, 0x94, + 0xcc, 0xc6, 0xbc, + 0xc4, 0xc2, 0xbc, + 0xbc, 0xbe, 0xb4, + 0x94, 0x92, 0x8c, + 0x6c, 0x66, 0x54, + 0x64, 0x62, 0x54, + 0x6c, 0x62, 0x4c, + 0x9c, 0x9e, 0x8c, + 0xc4, 0xc2, 0xb4, + 0xbc, 0xba, 0xb4, + 0x8c, 0x8a, 0x84, + 0xd4, 0xd6, 0xcc, + 0x64, 0x5e, 0x4c, + 0xb4, 0xb6, 0xac, + 0x9c, 0x9a, 0x8c, + 0xbc, 0xb6, 0xac, + 0x54, 0x56, 0x44, + 0x5c, 0x56, 0x44, + 0xb4, 0xb2, 0xac, + 0x5c, 0x5a, 0x44, + 0x44, 0x46, 0x44, + 0x54, 0x52, 0x3c, + 0xbc, 0xba, 0xac, + 0x5c, 0x5a, 0x4c, + 0xac, 0xae, 0xa4, + 0xb4, 0xb2, 0xa4, + 0x4c, 0x4a, 0x4c, + 0x1c, 0x1a, 0x14, + 0x44, 0x42, 0x34, + 0xa4, 0xa2, 0x9c, + 0x54, 0x52, 0x44, + 0xb4, 0xb6, 0xb4, + 0x2c, 0x2e, 0x2c, + 0x2c, 0x2a, 0x24, + 0x84, 0x82, 0x7c, + 0x4c, 0x4a, 0x3c, + 0x54, 0x4e, 0x3c, + 0xb4, 0xae, 0xa4, + 0x74, 0x76, 0x74, + 0x3c, 0x3a, 0x2c, + 0xac, 0xa6, 0x9c, + 0x9c, 0x9e, 0x94, + 0x94, 0x92, 0x94, + 0x64, 0x5e, 0x54, + 0x4c, 0x4e, 0x44, + 0x6c, 0x66, 0x5c, + 0x94, 0x92, 0x84, + 0x6c, 0x6a, 0x64, + 0x64, 0x66, 0x64, + 0x64, 0x62, 0x5c, + 0x8c, 0x8a, 0x7c, + 0x84, 0x86, 0x84, + 0x74, 0x72, 0x6c, + 0x6c, 0x6e, 0x6c, + 0x9c, 0x96, 0x8c, + 0x84, 0x82, 0x74, + 0x7c, 0x7a, 0x74, + 0x6c, 0x6e, 0x64, + 0xa4, 0xa6, 0x9c, + 0x84, 0x86, 0x7c, + 0x7c, 0x7a, 0x6c, + 0x64, 0x62, 0x64, + 0x5c, 0x5a, 0x54, + 0xa4, 0x9e, 0x94, + 0x74, 0x72, 0x64, + 0x54, 0x56, 0x54, + 0x3c, 0x3e, 0x3c, + 0x84, 0x7e, 0x7c, + 0xf4, 0xf2, 0xf4, + 0xac, 0xaa, 0xac, + 0x94, 0x96, 0x8c, + 0x94, 0x8e, 0x84, + 0x8c, 0x8e, 0x84, + 0x34, 0x32, 0x34, + 0x54, 0x56, 0x4c, + 0x74, 0x76, 0x6c, + 0x34, 0x36, 0x2c + +}; +unsigned char item_soundOn[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0a, 0x0a, 0x0a, 0x02, 0x02, 0x0b, 0x0c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, 0x0d, 0x0e, + 0x0f, 0x0b, 0x02, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0a, 0x07, 0x12, 0x12, 0x0d, 0x10, 0x10, 0x0e, + 0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x05, 0x17, + 0x10, 0x17, 0x17, 0x18, 0x08, 0x13, 0x19, 0x1a, 0x1b, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x08, 0x17, 0x1d, 0x19, 0x14, 0x1e, + 0x1f, 0x20, 0x1a, 0x1a, 0x21, 0x22, 0x22, 0x23, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x13, + 0x25, 0x26, 0x25, 0x25, 0x1b, 0x1a, 0x25, 0x25, 0x27, + 0x22, 0x22, 0x28, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2a, 0x2b, 0x2b, + 0x25, 0x25, 0x1b, 0x1b, 0x2c, 0x2c, 0x28, 0x26, 0x2b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, + 0x2d, 0x00, 0x15, 0x2e, 0x29, 0x2b, 0x2f, 0x30, 0x2c, + 0x22, 0x2a, 0x28, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x34, 0x35, 0x15, + 0x36, 0x2a, 0x2a, 0x22, 0x26, 0x2a, 0x37, 0x2b, 0x32, + 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x2d, + 0x00, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x31, 0x32, 0x2a, + 0x2a, 0x26, 0x2e, 0x31, 0x3e, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3f, 0x33, 0x40, 0x35, + 0x1c, 0x36, 0x29, 0x2a, 0x26, 0x32, 0x37, 0x37, 0x41, + 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, + 0x00, 0x3f, 0x44, 0x45, 0x46, 0x3c, 0x2e, 0x3e, 0x2b, + 0x37, 0x37, 0x3e, 0x3d, 0x31, 0x42, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x48, 0x49, 0x4a, + 0x1c, 0x11, 0x3b, 0x37, 0x37, 0x32, 0x2b, 0x3d, 0x3c, + 0x41, 0x18, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x48, 0x4d, 0x4e, 0x1c, 0x42, 0x04, 0x31, + 0x4b, 0x3d, 0x3d, 0x31, 0x3c, 0x4f, 0x11, 0x50, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x49, 0x52, + 0x3b, 0x1c, 0x53, 0x0d, 0x3e, 0x3e, 0x31, 0x54, 0x3c, + 0x35, 0x27, 0x27, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x56, 0x00, 0x57, 0x49, 0x55, 0x1c, 0x36, 0x0d, + 0x04, 0x31, 0x0d, 0x0d, 0x58, 0x55, 0x18, 0x47, 0x59, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x5b, + 0x4a, 0x5c, 0x1c, 0x11, 0x53, 0x04, 0x41, 0x53, 0x18, + 0x18, 0x27, 0x58, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, + 0x43, 0x5a, 0x5b, 0x00, 0x00, 0x5b, 0x4d, 0x23, 0x58, + 0x36, 0x0d, 0x18, 0x58, 0x18, 0x58, 0x1c, 0x47, 0x4b, + 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x4c, 0x5d, 0x5e, 0x4e, 0x5b, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x5f, 0x18, 0x18, 0x36, 0x58, + 0x42, 0x27, 0x60, 0x47, 0x4b, 0x44, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, + 0x5e, 0x5e, 0x4e, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x52, 0x53, 0x18, 0x58, 0x27, 0x47, 0x61, 0x50, + 0x50, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5a, 0x4e, 0x4e, 0x62, 0x62, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x27, 0x20, 0x60, 0x50, 0x60, 0x50, 0x63, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x5b, 0x62, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x61, 0x47, + 0x50, 0x50, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x55, 0x64, 0x3c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +// Mode + +unsigned char item_monkeyLandscape_colors[] = { + 0x00, 0x00, 0x00, + 0x0e, 0x16, 0x00, + 0x04, 0x02, 0x04, + 0x3c, 0x3a, 0x3c, + 0x9c, 0x9a, 0x9c, + 0x6c, 0x6a, 0x6c, + 0x1c, 0x0a, 0x0c, + 0x34, 0x36, 0x34, + 0x9c, 0x9e, 0x9c, + 0xb4, 0xb2, 0xb4, + 0x24, 0x06, 0x04, + 0x34, 0x32, 0x34, + 0xa4, 0xa6, 0xa4, + 0x64, 0x66, 0x64, + 0x2c, 0x2e, 0x2c, + 0x1c, 0x1a, 0x1c, + 0x6c, 0x6e, 0x6c, + 0x94, 0x92, 0x94, + 0x74, 0x72, 0x74, + 0x94, 0x96, 0x94, + 0x8c, 0x8e, 0x8c, + 0x8c, 0x8a, 0x8c, + 0x24, 0x26, 0x24, + 0x7c, 0x7e, 0x7c, + 0x74, 0x76, 0x74, + 0xa4, 0xa2, 0xa4, + 0x1c, 0x1e, 0x1c, + 0x0c, 0x0a, 0x0c, + 0xac, 0xae, 0xac, + 0xbc, 0xbe, 0xbc, + 0xdc, 0xde, 0xdc, + 0xfc, 0xfa, 0xfc, + 0xec, 0xee, 0xec, + 0xcc, 0xce, 0xcc, + 0x44, 0x46, 0x44, + 0x3c, 0x3e, 0x3c, + 0x4c, 0x4e, 0x4c, + 0x1c, 0x16, 0x1c, + 0xbc, 0xba, 0xbc, + 0xd4, 0xd6, 0xd4, + 0xf4, 0xf2, 0xf4, + 0x2c, 0x5e, 0x7c, + 0x2c, 0x7e, 0xb4, + 0x5c, 0x5a, 0x5c, + 0x14, 0x16, 0x14, + 0x0c, 0x06, 0x0c, + 0x04, 0x06, 0x04, + 0xc4, 0xc2, 0xc4, + 0xe4, 0xe6, 0xe4, + 0xac, 0xaa, 0xac, + 0xe4, 0xe2, 0xe4, + 0x5c, 0x5e, 0x5c, + 0x84, 0x82, 0x84, + 0x14, 0x0e, 0x04, + 0x34, 0x26, 0x14 + +}; +unsigned char item_monkeyLandscape[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x02, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x02, 0x02, 0x02, + 0x07, 0x08, 0x09, 0x05, 0x02, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x0a, 0x02, 0x02, 0x0b, 0x04, 0x0c, 0x08, 0x09, + 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x01, + 0x09, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x0f, 0x10, + 0x11, 0x04, 0x11, 0x12, 0x08, 0x05, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x0b, 0x01, 0x01, 0x09, 0x09, 0x13, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x10, 0x11, 0x14, 0x08, 0x09, 0x13, 0x12, + 0x08, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x01, + 0x15, 0x0d, 0x09, 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, 0x11, 0x14, 0x14, + 0x11, 0x04, 0x10, 0x02, 0x16, 0x17, 0x09, 0x0d, 0x02, + 0x00, 0x00, 0x00, 0x03, 0x14, 0x15, 0x0d, 0x13, 0x09, + 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, + 0x04, 0x09, 0x09, 0x09, 0x14, 0x18, 0x19, 0x1a, 0x02, + 0x02, 0x1b, 0x05, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x0b, + 0x03, 0x15, 0x0d, 0x13, 0x1c, 0x14, 0x14, 0x11, 0x14, + 0x04, 0x09, 0x09, 0x1d, 0x1e, 0x1e, 0x1f, 0x20, 0x21, + 0x14, 0x22, 0x23, 0x0b, 0x07, 0x0b, 0x22, 0x24, 0x25, + 0x02, 0x00, 0x00, 0x00, 0x0b, 0x23, 0x17, 0x01, 0x0d, + 0x14, 0x11, 0x14, 0x13, 0x09, 0x26, 0x27, 0x27, 0x1e, + 0x1f, 0x1f, 0x1f, 0x1f, 0x28, 0x0c, 0x07, 0x0b, 0x29, + 0x2a, 0x0b, 0x2b, 0x0d, 0x2c, 0x02, 0x00, 0x00, 0x00, + 0x0e, 0x02, 0x02, 0x01, 0x2d, 0x13, 0x09, 0x09, 0x26, + 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x28, 0x27, 0x08, 0x07, 0x07, 0x0b, 0x07, 0x18, 0x11, + 0x0f, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, + 0x2e, 0x05, 0x26, 0x27, 0x27, 0x1e, 0x1f, 0x1f, 0x1f, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x20, 0x08, + 0x0b, 0x0b, 0x0d, 0x2f, 0x13, 0x23, 0x2c, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x05, 0x09, 0x09, + 0x26, 0x27, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x1f, 0x1f, 0x20, 0x30, 0x27, 0x31, 0x1d, 0x08, 0x09, + 0x17, 0x07, 0x2c, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x02, + 0x2e, 0x0d, 0x11, 0x14, 0x14, 0x13, 0x26, 0x27, 0x27, + 0x1e, 0x27, 0x27, 0x32, 0x1f, 0x1f, 0x30, 0x1d, 0x27, + 0x1c, 0x33, 0x17, 0x09, 0x34, 0x0b, 0x0b, 0x2c, 0x00, + 0x00, 0x00, 0x0b, 0x03, 0x15, 0x33, 0x05, 0x1c, 0x14, + 0x11, 0x14, 0x13, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1d, + 0x27, 0x27, 0x21, 0x13, 0x17, 0x09, 0x09, 0x09, 0x0c, + 0x0d, 0x07, 0x2c, 0x02, 0x00, 0x00, 0x00, 0x0b, 0x23, + 0x15, 0x05, 0x09, 0x09, 0x09, 0x1c, 0x11, 0x14, 0x11, + 0x14, 0x14, 0x11, 0x13, 0x09, 0x09, 0x09, 0x31, 0x14, + 0x17, 0x12, 0x14, 0x14, 0x11, 0x05, 0x0b, 0x25, 0x02, + 0x00, 0x00, 0x00, 0x0b, 0x03, 0x15, 0x0d, 0x09, 0x09, + 0x13, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, + 0x11, 0x14, 0x14, 0x14, 0x11, 0x04, 0x09, 0x12, 0x02, + 0x03, 0x08, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, + 0x01, 0x01, 0x11, 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x33, 0x12, 0x11, + 0x14, 0x14, 0x08, 0x09, 0x0c, 0x14, 0x08, 0x05, 0x02, + 0x02, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x01, 0x01, 0x08, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x35, 0x02, 0x02, 0x0f, 0x10, 0x11, 0x14, 0x08, + 0x0c, 0x08, 0x09, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, + 0x0e, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x36, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x0b, 0x14, 0x14, 0x14, 0x04, 0x09, 0x05, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0b, + 0x11, 0x08, 0x09, 0x05, 0x02, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, 0x08, 0x05, + 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +unsigned char item_monkeyPortrait_colors[] = { + 0x00, 0x00, 0x00, + 0x04, 0x02, 0x04, + 0x14, 0x16, 0x14, + 0x64, 0x66, 0x64, + 0x1c, 0x16, 0x1c, + 0x1c, 0x1a, 0x1c, + 0x3c, 0x3e, 0x3c, + 0x34, 0x36, 0x34, + 0x34, 0x32, 0x34, + 0x6c, 0x6a, 0x6c, + 0xb4, 0xb2, 0xb4, + 0x4c, 0x4e, 0x4c, + 0x94, 0x92, 0x94, + 0x94, 0x96, 0x94, + 0x7c, 0x7e, 0x7c, + 0x9c, 0x9e, 0x9c, + 0x0c, 0x0a, 0x0c, + 0x44, 0x46, 0x44, + 0x5c, 0x5a, 0x5c, + 0x74, 0x76, 0x74, + 0xc4, 0xc2, 0xc4, + 0x84, 0x82, 0x84, + 0x9c, 0x9a, 0x9c, + 0x74, 0x72, 0x74, + 0x24, 0x26, 0x24, + 0xa4, 0xa6, 0xa4, + 0x3c, 0x3a, 0x3c, + 0x8c, 0x8e, 0x8c, + 0x2c, 0x7e, 0xb4, + 0xbc, 0xbe, 0xbc, + 0x6c, 0x6e, 0x6c, + 0x1c, 0x1e, 0x1c, + 0x2c, 0x5e, 0x7c, + 0xac, 0xaa, 0xac, + 0x5c, 0x5e, 0x5c, + 0xa4, 0xa2, 0xa4, + 0xd4, 0xd6, 0xd4, + 0xac, 0xae, 0xac, + 0xec, 0xee, 0xec, + 0xe4, 0xe6, 0xe4, + 0xfc, 0xfa, 0xfc, + 0x0e, 0x16, 0x00, + 0x1c, 0x0a, 0x0c, + 0x24, 0x06, 0x04, + 0xcc, 0xce, 0xcc, + 0xf4, 0xf2, 0xf4, + 0xdc, 0xde, 0xdc, + 0xe4, 0xe2, 0xe4, + 0x14, 0x0e, 0x04, + 0x34, 0x26, 0x14, + 0xbc, 0xba, 0xbc, + 0x0c, 0x06, 0x0c, + 0x04, 0x06, 0x04, + 0x8c, 0x8a, 0x8c, + 0x2c, 0x2e, 0x2c + +}; +unsigned char item_monkeyPortrait[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x03, 0x03, 0x04, 0x02, 0x05, 0x06, 0x07, + 0x08, 0x02, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x03, 0x09, 0x03, 0x0a, 0x09, + 0x0b, 0x03, 0x0c, 0x0d, 0x0e, 0x08, 0x07, 0x08, 0x03, + 0x09, 0x03, 0x09, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x09, 0x09, + 0x0a, 0x0f, 0x0f, 0x0e, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x0a, 0x15, 0x03, 0x09, 0x0f, 0x0f, 0x0a, 0x0a, 0x09, + 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x16, 0x0a, 0x0f, 0x17, 0x17, 0x18, + 0x01, 0x08, 0x08, 0x07, 0x03, 0x0f, 0x0a, 0x19, 0x0c, + 0x1a, 0x1b, 0x0f, 0x16, 0x0a, 0x0f, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x1a, + 0x0f, 0x19, 0x0c, 0x0d, 0x01, 0x01, 0x07, 0x1c, 0x08, + 0x08, 0x1d, 0x0e, 0x0a, 0x1b, 0x01, 0x19, 0x19, 0x1b, + 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x01, 0x07, 0x16, 0x16, 0x0a, + 0x1e, 0x1f, 0x08, 0x20, 0x07, 0x08, 0x21, 0x22, 0x0a, + 0x1b, 0x17, 0x0a, 0x0f, 0x1b, 0x0c, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x08, 0x0c, 0x0f, 0x16, 0x23, 0x06, 0x08, + 0x07, 0x0f, 0x24, 0x25, 0x0a, 0x17, 0x0a, 0x0f, 0x1b, + 0x1b, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1e, + 0x1b, 0x0c, 0x13, 0x11, 0x07, 0x0f, 0x26, 0x27, 0x24, + 0x0e, 0x0e, 0x16, 0x1b, 0x0c, 0x08, 0x01, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x05, 0x0c, 0x1b, 0x1b, 0x1b, + 0x19, 0x24, 0x28, 0x26, 0x1d, 0x0d, 0x1b, 0x0c, 0x1b, + 0x1e, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x2a, 0x2b, + 0x2a, 0x1e, 0x1b, 0x0a, 0x2c, 0x2d, 0x2d, 0x28, 0x28, + 0x27, 0x2c, 0x21, 0x1b, 0x0c, 0x05, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0c, 0x0a, + 0x26, 0x28, 0x28, 0x28, 0x28, 0x28, 0x24, 0x0a, 0x1b, + 0x17, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x1b, 0x0a, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x24, 0x0a, 0x1b, 0x22, 0x01, 0x01, 0x01, + 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x16, 0x2e, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x1d, 0x0a, + 0x0c, 0x29, 0x30, 0x01, 0x01, 0x29, 0x29, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x1b, 0x2e, 0x28, 0x28, + 0x28, 0x28, 0x24, 0x0a, 0x0d, 0x1b, 0x29, 0x29, 0x01, + 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x1d, 0x2e, 0x28, 0x28, 0x28, 0x24, 0x0a, + 0x0c, 0x29, 0x29, 0x29, 0x01, 0x29, 0x29, 0x29, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0a, 0x24, + 0x28, 0x28, 0x28, 0x2e, 0x0a, 0x1b, 0x29, 0x29, 0x29, + 0x01, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x0a, 0x24, 0x28, 0x28, 0x2e, 0x24, + 0x0a, 0x1b, 0x29, 0x29, 0x29, 0x31, 0x29, 0x29, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x16, + 0x32, 0x2e, 0x28, 0x2e, 0x24, 0x0a, 0x0c, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x1b, 0x0a, 0x2e, 0x2e, 0x24, + 0x32, 0x0d, 0x1b, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x0c, 0x0d, 0x32, 0x24, 0x32, 0x0d, 0x1b, 0x0c, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x0d, 0x1b, 0x1b, 0x0a, 0x24, + 0x0a, 0x1b, 0x0c, 0x25, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0d, + 0x0a, 0x1b, 0x0c, 0x0a, 0x32, 0x0a, 0x1b, 0x1b, 0x0a, + 0x0d, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x0d, 0x0a, 0x0a, 0x25, 0x1b, 0x0d, + 0x09, 0x09, 0x0c, 0x25, 0x0a, 0x0a, 0x0d, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0f, 0x0a, + 0x0a, 0x0d, 0x0d, 0x03, 0x33, 0x34, 0x01, 0x03, 0x09, + 0x0a, 0x0a, 0x0a, 0x0f, 0x29, 0x29, 0x29, 0x29, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, + 0x29, 0x29, 0x29, 0x0a, 0x0a, 0x03, 0x03, 0x03, 0x29, + 0x29, 0x01, 0x01, 0x34, 0x22, 0x09, 0x03, 0x0c, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x29, 0x35, 0x35, 0x35, 0x0e, 0x01, 0x01, 0x01, 0x01, + 0x35, 0x35, 0x35, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x1b, 0x1a, + 0x06, 0x01, 0x01, 0x01, 0x01, 0x1a, 0x06, 0x1a, 0x29, + 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, + 0x36, 0x08, 0x36, 0x1a, 0x08, 0x08, 0x36, 0x01, 0x01, + 0x36, 0x08, 0x08, 0x08, 0x36, 0x08, 0x36, 0x29, 0x29, + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +#endif \ No newline at end of file diff --git a/backends/wince/findgame.cpp b/backends/wince/findgame.cpp new file mode 100644 index 0000000000..3157397d54 --- /dev/null +++ b/backends/wince/findgame.cpp @@ -0,0 +1,556 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifdef _WIN32_WCE + +// Browse directories to locate SCUMM games + +#include "stdafx.h" +#include +#include +#include +#include "resource.h" +#include "scumm.h" +#include "config-file.h" + +extern Config *scummcfg; + +#define MAX_GAMES 20 + +struct ScummGame { + const char *gamename; + const char *description; + const char *directory; + const char *check_file_1; + const char *check_file_2; + const char *filename; + unsigned char next_demo; +}; + +struct InstalledScummGame { + unsigned char reference; + TCHAR directory[MAX_PATH]; +}; + +static const ScummGame GameList[] = { + { + "Simon The Sorcerer 1 (dos)", + "Completable", + "", "1631.VGA", "GAMEPC", + "simon1dos", + 0 + }, + { + "Simon The Sorcerer 1 (win)", + "Completable", + "", "SIMON.GME", "GAMEPC", + "simon1win", + 0 + }, + { + "Simon The Sorcerer 2 (win)", + "To be tested", + "", "SIMON2.GME", "GSPTR30", + "simon2win", + 0 + }, + { + "Indiana Jones 3 (new)", + "Buggy, playable a bit", + "indy3", "", "", + "indy3", + 0 + }, + { + "Zak Mc Kracken (new)", + "Completable", + "zak256", "", "", + "zak256", + 0 + }, + { + "Loom (old)", + "Not working", + "loom", "", "", + "loom", + 0 + }, + { + "Monkey Island 1 (EGA)", + "Not tested", + "monkeyEGA", "", "", + "monkeyEGA", + 0 + }, + { + "Loom (VGA)", + "Completable, MP3 audio", + "loomcd", "", "", + "loomcd", + 0 + }, + { + "Monkey Island 1 (VGA)", + "Completable, MP3 music", + "", "MONKEY.000", "MONKEY.001", + "monkey", + 0 + }, + { + "Monkey Island 2 (VGA)", + "Completable", + "", "MONKEY2.000", "MONKEY2.001", + "monkey2", + 0 + }, + { + "Indiana Jones 4", + "Completable", + "", "ATLANTIS.000", "ATLANTIS.001", + "atlantis", + 1 + }, + { + "Indiana Jones 4 demo", + "Completable", + "", "PLAYFATE.000", "PLAYFATE.001", + "playfate", + 0 + }, + { + "Day of the Tentacle", + "Completable", + "", "TENTACLE.000", "TENTACLE.001", + "tentacle", + 1 + }, + { + "Day of the Tentacle demo", + "Completable", + "", "DOTTDEMO.000", "DOTTDEMO.001", + "dottdemo", + 0 + }, + { + "Sam & Max", + "Completable, music glitches", + "", "SAMNMAX.000", "SAMNMAX.001", + "samnmax", + 1 + }, + { + "Sam & Max demo", + "Completable", + "", "SNMDEMO.000", "SNMDEMO.001", + "snmdemo", + 0 + }, + { + "Full Throttle", + "Partially working", + "", "FT.LA0", "FT.LA1", + "ft", + 0 + }, + { + "The Dig", + "Partially working", + "", "DIG.LA0", "DIG.LA1", + "dig", + 0 + }, + { + NULL, NULL, NULL, NULL, NULL, NULL, 0 + } +}; + +void findGame(TCHAR*); +int displayFoundGames(void); +void doScan(); +void startFindGame(); + +char gamesFound[MAX_GAMES]; +unsigned char listIndex[MAX_GAMES]; +InstalledScummGame gamesInstalled[MAX_GAMES]; +int installedGamesNumber; +HWND hwndDlg; +TCHAR basePath[MAX_PATH]; +TCHAR old_basePath[MAX_PATH]; +BOOL prescanning; + +BOOL isPrescanning() { + return prescanning; +} + +void setFindGameDlgHandle(HWND x) { + hwndDlg = x; +} + +bool loadGameSettings() { + int index; + int i; + const char *current; + + prescanning = FALSE; + + current = scummcfg->get("GamesInstalled", "wince"); + if (!current) + return FALSE; + index = atoi(current); + + installedGamesNumber = index; + + current = scummcfg->get("GamesReferences", "wince"); + if (!current) + return FALSE; + for (i=0; iget("BasePath", "wince"); + if (!current) + return FALSE; + MultiByteToWideChar(CP_ACP, 0, current, strlen(current) + 1, basePath, sizeof(basePath)); + + for (i=0; iget(keyName, "wince"); + if (!current) + return FALSE; + MultiByteToWideChar(CP_ACP, 0, current, strlen(current) + 1, gamesInstalled[i].directory, sizeof(gamesInstalled[i].directory)); + } + + displayFoundGames(); + + return TRUE; +} + +int countGameReferenced(int reference, int *infos) { + int i; + int number = 0; + + for (i=0; iset("GamesInstalled", index, "wince"); + + tempo[0] = '\0'; + for (i=0; iset("GamesReferences", tempo, "wince"); + + WideCharToMultiByte(CP_ACP, 0, basePath, wcslen(basePath) + 1, workdir, sizeof(workdir), NULL, NULL); + + scummcfg->set("BasePath", workdir, "wince"); + + for (i=0; iset(keyName, workdir, "wince"); + } + + scummcfg->flush(); + + SetDlgItemText(hwndDlg, IDC_FILEPATH, TEXT("Scan finished")); + +} + +void getSelectedGame(int result, char *id, TCHAR *directory) { + ScummGame game; + + game = GameList[gamesInstalled[listIndex[result]].reference]; + strcpy(id, game.filename); + wcscpy(directory, gamesInstalled[listIndex[result]].directory); +} + +void displayGameInfo() { + int item; + TCHAR work[400]; + ScummGame game; + + item = SendMessage(GetDlgItem(hwndDlg, IDC_LISTAVAILABLE), LB_GETCURSEL, 0, 0); + if (item == LB_ERR) + return; + + game = GameList[gamesInstalled[listIndex[item]].reference]; + wcscpy(work, TEXT("File path : ...")); + wcscat(work, wcsrchr(gamesInstalled[listIndex[item]].directory, '\\')); + SetDlgItemText(hwndDlg, IDC_FILEPATH, work); + MultiByteToWideChar(CP_ACP, 0, game.description, strlen(game.description) + 1, work, sizeof(work)); + SetDlgItemText(hwndDlg, IDC_GAMEDESC, work); +} + +void findGame(TCHAR *directory) { + TCHAR fileName[MAX_PATH]; + TCHAR newDirectory[MAX_PATH]; + WIN32_FIND_DATA desc; + HANDLE x; + int i; + + // Check for games in the current directory + + //MessageBox(NULL, directory, TEXT("Current"), MB_OK); + + for (i = 0 ; i < MAX_GAMES ; i++) { + ScummGame current_game; + + current_game = GameList[i]; + if (!current_game.filename) + break; + + if (strlen(current_game.directory)) { + // see if the last directory matches + TCHAR *work; + char curdir[MAX_PATH]; + + + work = wcsrchr(directory, '\\'); + WideCharToMultiByte(CP_ACP, 0, work + 1, wcslen(work + 1) + 1, curdir, sizeof(curdir), NULL, NULL); + if (stricmp(curdir, current_game.directory) == 0) { + + //MessageBox(NULL, TEXT("Match directory !"), TEXT("..."), MB_OK); + + gamesFound[i] = 1; + gamesInstalled[installedGamesNumber].reference = i; + wcscpy(gamesInstalled[installedGamesNumber].directory, directory); + installedGamesNumber++; + } + } + else + { + TCHAR work[MAX_PATH]; + TCHAR checkfile[MAX_PATH]; + + + MultiByteToWideChar(CP_ACP, 0, current_game.check_file_1, strlen(current_game.check_file_1) + 1, checkfile, sizeof(checkfile)); + wsprintf(work, TEXT("%s\\%s"), directory, checkfile); + //MessageBox(NULL, work, TEXT("Checking file"), MB_OK); + + if (GetFileAttributes(work) == 0xFFFFFFFF) + continue; + + //MessageBox(NULL, TEXT("Check OK"), TEXT("Checking file"), MB_OK); + MultiByteToWideChar(CP_ACP, 0, current_game.check_file_2, strlen(current_game.check_file_2) + 1, checkfile, sizeof(checkfile)); + wsprintf(work, TEXT("%s\\%s"), directory, checkfile); + if (GetFileAttributes(work) == 0xFFFFFFFF) + continue; + + //MessageBox(NULL, TEXT("Match file !"), TEXT("..."), MB_OK); + gamesFound[i] = 1; + gamesInstalled[installedGamesNumber].reference = i; + wcscpy(gamesInstalled[installedGamesNumber].directory, directory); + installedGamesNumber++; + + } + } + + // Recurse + + wsprintf(fileName, TEXT("%s\\*"), directory); + + x = FindFirstFile(fileName, &desc); + if (x == INVALID_HANDLE_VALUE) + return; + if (desc.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + wsprintf(newDirectory, TEXT("%s\\%s"), directory, desc.cFileName); + findGame(newDirectory); + } + while (FindNextFile(x, &desc)) + if (desc.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + wsprintf(newDirectory, TEXT("%s\\%s"), directory, desc.cFileName); + findGame(newDirectory); + } + FindClose(x); +} + +#endif \ No newline at end of file diff --git a/backends/wince/gapi_keys.cpp b/backends/wince/gapi_keys.cpp new file mode 100644 index 0000000000..a4d2677573 --- /dev/null +++ b/backends/wince/gapi_keys.cpp @@ -0,0 +1,341 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifdef _WIN32_WCE + +// Handle mapping of actions to hardware keys + +#include "stdafx.h" +#include +#include +#include +#include +#include + +#include "gapi_keys.h" + +#include "screen.h" + +struct oneAction _actions[NUMBER_ACTIONS]; +struct GXKeyList _portrait_keys; +struct GXKeyList _landscape_keys; +pAction *_action_functions; + +const char* ActionsText[] = { + "None", + "Pause", + "Save", + "Quit", + "Skip", + "Hide", + "Keyboard", + "Sound", + "Right click", + "Cursor on/off", + "Subtitles on/off", + "Boss" +}; + +bool _typeExists(int x) { + int i; + + for (i=0; i TOTAL_ACTIONS) + current = 1; + if (!_typeExists(current)) { + _actions[action].action_type = current; + return; + } + } +} + +void setPreviousType(int action) { + int start = _actions[action].action_type; + int current = start; + for (;;) { + current--; + if (current == start) + return; + if (current <= 0) + current = TOTAL_ACTIONS; + if (!_typeExists(current)) { + _actions[action].action_type = current; + return; + } + } +} + + + +void setActionKeys(int *actionKeys) { + int i; + + for (i=0; i +#include +#include +#include "sys/stat.h" +#include "sys/time.h" +#include "time.h" +#include "dirent.h" + +/* forward declaration */ +char *strdup(const char *strSource); + +/* Limited dirent implementation. Used by UI.C and DEVICES.C */ +static WIN32_FIND_DATA wfd; + +DIR* opendir(const char* fname) +{ + DIR* pdir; + char fnameMask[MAX_PATH+1]; + TCHAR fnameUnc[MAX_PATH+1]; + char nameFound[MAX_PATH+1]; + + if(fname == NULL) + return NULL; + + strcpy(fnameMask, fname); + if(!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\') + strncat(fnameMask, "\\", MAX_PATH-strlen(fnameMask)-1); + strncat(fnameMask, "*.*", MAX_PATH-strlen(fnameMask)-4); + + pdir = (DIR*)malloc(sizeof(DIR)+strlen(fname)); + pdir->dd_dir.d_ino = 0; + pdir->dd_dir.d_reclen = 0; + pdir->dd_dir.d_name = 0; + pdir->dd_dir.d_namlen = 0; + + pdir->dd_handle = 0; + pdir->dd_stat = 0; + strcpy(pdir->dd_name, fname); /* it has exactly enough space for fname and nul char */ + + MultiByteToWideChar(CP_ACP, 0, fnameMask, -1, fnameUnc, MAX_PATH); + if((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE) + { + free(pdir); + return NULL; + } + else + { + WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL); + + pdir->dd_dir.d_name = strdup(nameFound); + pdir->dd_dir.d_namlen = strlen(nameFound); + } + return pdir; +} + +struct dirent* readdir(DIR* dir) +{ + char nameFound[MAX_PATH+1]; + static struct dirent dummy; + + if(dir->dd_stat == 0) + { + dummy.d_name = "."; + dummy.d_namlen = 1; + dir->dd_stat ++; + return &dummy; + } + else if(dir->dd_stat == 1) + { + dummy.d_name = ".."; + dummy.d_namlen = 2; + dir->dd_stat ++; + return &dummy; + } + else if(dir->dd_stat == 2) + { + dir->dd_stat++; + return &dir->dd_dir; + } + else + { + if(FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0) + { + dir->dd_stat = -1; + return NULL; + } + WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL); + + if(dir->dd_dir.d_name) + free(dir->dd_dir.d_name); + + dir->dd_dir.d_name = strdup(nameFound); + dir->dd_dir.d_namlen = strlen(nameFound); + + dir->dd_stat ++; + + return &dir->dd_dir; + } +} + +int closedir(DIR* dir) +{ + if(dir == NULL) + return 0; + + if(dir->dd_handle) + FindClose((HANDLE)dir->dd_handle); + + if(dir->dd_dir.d_name) + free(dir->dd_dir.d_name); + free(dir); + return 1; +} + +/* Very limited implementation of stat. Used by UI.C, MEMORY-P.C (latter is not critical) */ +int stat(const char *fname, struct stat *ss) +{ + TCHAR fnameUnc[MAX_PATH+1]; + HANDLE handle; + int len; + + if(fname == NULL || ss == NULL) + return -1; + + /* Special case (dummy on WinCE) */ + len = strlen(fname); + if(len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' && + (len == 2 || fname[len-3] == '\\')) + { + /* That's everything implemented so far */ + memset(ss, 0, sizeof(struct stat)); + ss->st_size = 1024; + ss->st_mode |= S_IFDIR; + return 0; + } + + MultiByteToWideChar(CP_ACP, 0, fname, -1, fnameUnc, MAX_PATH); + handle = FindFirstFile(fnameUnc, &wfd); + if(handle == INVALID_HANDLE_VALUE) + return -1; + else + { + /* That's everything implemented so far */ + memset(ss, 0, sizeof(struct stat)); + ss->st_size = wfd.nFileSizeLow; + if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + ss->st_mode |= S_IFDIR; + + FindClose(handle); + } + return 0; +} + +/* Remove file by name */ +int remove(const char* path) +{ + TCHAR pathUnc[MAX_PATH+1]; + MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); + return !DeleteFile(pathUnc); +} + +/* in our case unlink is the same as remove */ +int unlink(const char* path) +{ + return remove(path); +} + +/* Make directory, Unix style */ +void mkdir(char* dirname, int mode) +{ + char path[MAX_PATH+1]; + TCHAR pathUnc[MAX_PATH+1]; + char* ptr; + strncpy(path, dirname, MAX_PATH); + if(*path == '/') + *path = '\\'; + /* Run through the string and attempt creating all subdirs on the path */ + for(ptr = path+1; *ptr; ptr ++) + { + if(*ptr == '\\' || *ptr == '/') + { + *ptr = 0; + MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); + CreateDirectory(pathUnc, 0); + *ptr = '\\'; + } + } + MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); + CreateDirectory(pathUnc, 0); +} + +/* Used in DEVICES.C and UI.C for some purpose. Not critical in this port */ +int system(const char* path) { return 0; } + + +char *tmpnam(char *string) +{ + TCHAR pTemp[MAX_PATH+1]; + static char buffer[MAX_PATH+1]; + GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp); + WideCharToMultiByte(CP_ACP, 0, pTemp, -1, buffer, MAX_PATH, NULL, NULL); + + if(string) + { + strcpy(string, buffer); + return string; + } + else + return buffer; +} + +FILE *tmpfile() +{ + TCHAR pTemp[MAX_PATH+1]; + if(!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp)) + return _wfopen(pTemp, TEXT("w+b")); + else + return 0; +} + +void rewind(FILE *stream) +{ + fseek(stream, 0, SEEK_SET); +} + + +char *strdup(const char *strSource) +{ + char* buffer; + buffer = (char*)malloc(strlen(strSource)+1); + if(buffer) + strcpy(buffer, strSource); + return buffer; +} + +/* Used in UI.C */ +char cwd[MAX_PATH+1] = ""; +char *getcwd(char *buffer, int maxlen) +{ + TCHAR fileUnc[MAX_PATH+1]; + char* plast; + + if(cwd[0] == 0) + { + GetModuleFileName(NULL, fileUnc, MAX_PATH); + WideCharToMultiByte(CP_ACP, 0, fileUnc, -1, cwd, MAX_PATH, NULL, NULL); + plast = strrchr(cwd, '\\'); + if(plast) + *plast = 0; + /* Special trick to keep start menu clean... */ + if(_stricmp(cwd, "\\windows\\start menu") == 0) + strcpy(cwd, "\\Apps"); + } + if(buffer) + strncpy(buffer, cwd, maxlen); + return cwd; +} + +/* Limited implementation of time.h. time_t formula is possibly incorrect. */ +time_t time(time_t* res) +{ + time_t t; + SYSTEMTIME st; + GetLocalTime(&st); + + t = (time_t)(((((((st.wYear-1970)*12+st.wMonth)*31+st.wDay)*7+st.wDayOfWeek)*24+st.wHour)*60+st.wMinute)*60+st.wSecond); + + if(res) + *res = t; + return t; +} + +struct tm* localtime(time_t* timer) +{ + static struct tm tmLocalTime; + unsigned long rem = *timer; + + tmLocalTime.tm_sec = (short)(rem % 60); + rem /= 60; + tmLocalTime.tm_min = (short)(rem % 60); + rem /= 60; + tmLocalTime.tm_hour = (short)(rem % 24); + rem /= 24; + tmLocalTime.tm_mday = (short)(rem % 7); + rem /= 7; + tmLocalTime.tm_mday = (short)(rem % 31); + rem /= 31; + tmLocalTime.tm_mon = (short)(rem % 12); + rem /= 12; + tmLocalTime.tm_year = (short)(rem+1970); + + return &tmLocalTime; +} + +/* Very limited implementation of sys/time.h */ +void gettimeofday(struct timeval* tp, void* dummy) +{ + DWORD dt = GetTickCount(); + tp->tv_sec = dt/1000; + tp->tv_usec = dt*1000; +} + +void usleep(long usec) +{ + long msec = usec/1000; + if(msec <= 0) + Sleep(0); + else + Sleep(msec); +} + +/* +Windows CE fopen has non-standard behavior -- not +fully qualified paths refer to root folder rather +than current folder (concept not implemented in CE). +*/ +#undef fopen + +FILE* wce_fopen(const char* fname, const char* fmode) +{ + char fullname[MAX_PATH+1]; + + if(!fname || fname[0] == '\0') + return NULL; + if(fname[0] != '\\' && fname[0] != '/') + { + getcwd(fullname, MAX_PATH); + strncat(fullname, "\\", MAX_PATH-strlen(fullname)-1); + strncat(fullname, fname, MAX_PATH-strlen(fullname)-strlen(fname)); + return fopen(fullname, fmode); + } + else + return fopen(fname, fmode); +} + +/* This may provide for better sync mechanism */ +unsigned int clock() +{ + return GetTickCount(); +} + +/* And why do people use this? */ +void abort() +{ + exit(1); +} + +/* +IMHO, no project should use this one, it is not portable at all. This implementation +at least allows some projects to work. +*/ +char* getenv(char* name) +{ + static char buffer[MAX_PATH+1]; + if(strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0) + { + getcwd(buffer, MAX_PATH); + return buffer; + } + else + return ""; +} + +void *bsearch(const void *key, const void *base, size_t nmemb, + size_t size, int (*compar)(const void *, const void *)) { + size_t i; + + for (i=0; i + +struct stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; +}; + + +#define _S_IFDIR 0040000 /* directory */ +#define S_IFDIR _S_IFDIR + +int stat(const char *, struct stat *); diff --git a/backends/wince/missing/sys/time.h b/backends/wince/missing/sys/time.h new file mode 100644 index 0000000000..ded29bb009 --- /dev/null +++ b/backends/wince/missing/sys/time.h @@ -0,0 +1,10 @@ +/* Header is not present in Windows CE SDK */ + +struct timeval +{ + int tv_sec; + int tv_usec; +}; + +void gettimeofday(struct timeval* tp, void* dummy); +void usleep(long usec); diff --git a/backends/wince/missing/sys/types.h b/backends/wince/missing/sys/types.h new file mode 100644 index 0000000000..b6c05e3958 --- /dev/null +++ b/backends/wince/missing/sys/types.h @@ -0,0 +1,5 @@ +/* Header is not present in Windows CE SDK */ + +typedef unsigned short _ino_t; +typedef unsigned int _dev_t; +typedef long _off_t; diff --git a/backends/wince/missing/time.h b/backends/wince/missing/time.h new file mode 100644 index 0000000000..40c2894dca --- /dev/null +++ b/backends/wince/missing/time.h @@ -0,0 +1,24 @@ +/* Header is not present in Windows CE SDK */ + +#ifndef A800_TIME_H +#define A800_TIME_H + +#include + +struct tm +{ + short tm_year; + short tm_mon; + short tm_mday; + short tm_wday; + short tm_hour; + short tm_min; + short tm_sec; +}; + +time_t time(time_t* dummy); +struct tm* localtime(time_t* dummy); + +unsigned int clock(); + +#endif diff --git a/backends/wince/missing/unistd.h b/backends/wince/missing/unistd.h new file mode 100644 index 0000000000..7ee9f5e5ba --- /dev/null +++ b/backends/wince/missing/unistd.h @@ -0,0 +1 @@ +/* Header is not present in Windows CE SDK */ diff --git a/backends/wince/newres.h b/backends/wince/newres.h new file mode 100644 index 0000000000..57f429fa45 --- /dev/null +++ b/backends/wince/newres.h @@ -0,0 +1,41 @@ +#ifndef __NEWRES_H__ +#define __NEWRES_H__ + +#if !defined(UNDER_CE) +#define UNDER_CE _WIN32_WCE +#endif + +#if defined(_WIN32_WCE) + #if !defined(WCEOLE_ENABLE_DIALOGEX) + #define DIALOGEX DIALOG DISCARDABLE + #endif + #include + #define SHMENUBAR RCDATA + #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300) + #include + #define AFXCE_IDR_SCRATCH_SHMENU 28700 + #else + #define I_IMAGENONE (-2) + #define NOMENU 0xFFFF + #define IDS_SHNEW 1 + + #define IDM_SHAREDNEW 10 + #define IDM_SHAREDNEWDEFAULT 11 + #endif // _WIN32_WCE_PSPC + #define AFXCE_IDD_SAVEMODIFIEDDLG 28701 +#endif // _WIN32_WCE + +#ifdef RC_INVOKED +#ifndef _INC_WINDOWS +#define _INC_WINDOWS + #include "winuser.h" // extract from windows header + #include "winver.h" +#endif +#endif + +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) + +#endif //__NEWRES_H__ diff --git a/backends/wince/pocketpc.cpp b/backends/wince/pocketpc.cpp new file mode 100644 index 0000000000..0162d14e28 --- /dev/null +++ b/backends/wince/pocketpc.cpp @@ -0,0 +1,1490 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include + +#include "scumm.h" +#include "debug.h" +#include "screen.h" +#include "gui.h" +#include "sound/mididrv.h" +#include "gameDetector.h" +#include "simon/simon.h" +#include "gapi_keys.h" +#include "config-file.h" + + +#include "commctrl.h" +#include +#include +#include +#include +#include +#include +#include "resource.h" + +#include "SDL.h" +#include "SDL_audio.h" +#include "SDL_timer.h" +#include "SDL_thread.h" + +#define MAX(a,b) (((a)<(b)) ? (b) : (a)) +#define MIN(a,b) (((a)>(b)) ? (b) : (a)) +#define POCKETSCUMM_BUILD "080502" + +#define VERSION "Build " POCKETSCUMM_BUILD " (VM " SCUMMVM_CVS ")" + +typedef int (*tTimeCallback)(int); +typedef void SoundProc(void *param, byte *buf, int len); + +GameDetector detector; +Config *scummcfg; +tTimeCallback timer_callback; +int timer_interval; + +extern void Cls(); + +extern BOOL isPrescanning(); +extern void changeScanPath(); +extern void startScan(); +extern void endScanPath(); +extern void abortScanPath(); + +void load_key_mapping(); +void keypad_init(); + +extern void Cls(); + +extern BOOL isPrescanning(); +extern void changeScanPath(); +extern void startScan(); +extern void endScanPath(); +extern void abortScanPath(); + +void keypad_init(); + +class OSystem_WINCE3 : public OSystem { +public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Add a new callback timer + void set_timer(int timer, int (*callback)(int)); + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + static OSystem *create(int gfx_mode, bool full_screen); + + // Added for hardware keys mapping + + void addEventKeyPressed(int ascii_code); + + void addEventRightButtonClicked(); + + // Mutex functions + + void* create_mutex(); + void lock_mutex(void*); + void unlock_mutex(void*); + void delete_mutex(void*); + +private: + // Windows callbacks & stuff + //bool handleMessage(); + static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + + + byte *_gfx_buf; + uint32 _start_time; + Event _event; + HMODULE hInst; + HWND hWnd; + bool _display_cursor; + + enum { + DF_FORCE_FULL_ON_PALETTE = 1, + DF_WANT_RECT_OPTIM = 2, + DF_2xSAI = 4, + DF_SEPARATE_HWSCREEN = 8, + DF_UPDATE_EXPAND_1_PIXEL = 16, + }; + + int _mode; + bool _full_screen; + bool _mouse_visible; + bool _mouse_drawn; + uint32 _mode_flags; + + byte _internal_scaling; + + bool force_full; //Force full redraw on next update_screen + bool cksum_valid; + + enum { + NUM_DIRTY_RECT = 100, + SCREEN_WIDTH = 320, + SCREEN_HEIGHT = 200, + CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)), + + MAX_MOUSE_W = 40, + MAX_MOUSE_H = 40, + MAX_SCALING = 3, + + TMP_SCREEN_OFFS = 320*2 + 8, + }; + + /* CD Audio */ + int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; + Uint32 cd_end_time, cd_stop_time, cd_next_second; + + struct MousePos { + int16 x,y,w,h; + }; + + byte *_ms_buf; + byte *_ms_backup; + MousePos _ms_cur; + MousePos _ms_old; + int16 _ms_hotspot_x; + int16 _ms_hotspot_y; + int _current_shake_pos; + + + static void fill_sound(void *userdata, Uint8 * stream, int len); + + + void draw_mouse(); + void undraw_mouse(); + + void load_gfx_mode(); + void unload_gfx_mode(); + + void hotswap_gfx_mode(); + + void get_320x200_image(byte *buf); +}; + +/************* WinCE Specifics *****************/ +byte veryFastMode; + +bool sound_activated, terminated; +HWND hWnd_MainMenu; +HWND hWnd_Window; + +void drawAllToolbar(bool); +void redrawSoundItem(); +ToolbarSelected getToolbarSelection(int, int); + +extern bool toolbar_drawn; +extern bool draw_keyboard; +bool hide_toolbar; +bool hide_cursor; + +bool get_key_mapping; +static char _directory[MAX_PATH]; + +SoundProc *real_soundproc; + +const char KEYBOARD_MAPPING_ALPHA_HIGH[] = {"ABCDEFGHIJKLM"}; +const char KEYBOARD_MAPPING_NUMERIC_HIGH[] = {"12345"}; +const char KEYBOARD_MAPPING_ALPHA_LOW[] = {"NOPQRSTUVWXYZ"}; +const char KEYBOARD_MAPPING_NUMERIC_LOW[] = {"67890"}; + +extern void startFindGame(); +extern void displayGameInfo(); +extern bool loadGameSettings(void); +extern void setFindGameDlgHandle(HWND); +extern void getSelectedGame(int, char*, TCHAR*); + +extern void palette_update(); + +extern void own_soundProc(void *buffer, byte *samples, int len); + +//#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU) + +/* Monkey2 keyboard stuff */ +bool monkey2_keyboard; + +void do_quit() { + scummcfg->set("Sound", sound_activated, "wince"); + scummcfg->set("DisplayMode", GetScreenMode(), "wince"); + scummcfg->flush(); + GXCloseInput(); + GXCloseDisplay(); + SDL_AudioQuit(); + exit(1); +} + +void Error(LPCTSTR msg) +{ + OutputDebugString(msg); + MessageBox(HWND_DESKTOP, msg, TEXT("Error"), MB_ICONSTOP); + exit(1); +} + +void Warning(LPCTSTR msg) +{ + OutputDebugString(msg); + MessageBox(HWND_DESKTOP, msg, TEXT("Error"), MB_ICONSTOP); +} + +int mapKey(int key) { + if (key>=VK_F1 && key<=VK_F9) { + return key - VK_F1 + 315; + } + return key; +} + +BOOL CALLBACK SelectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + { + TCHAR work[1024]; + RECT rc; GetWindowRect(hwndDlg, &rc); + MoveWindow(hwndDlg, + (GetSystemMetrics(SM_CXSCREEN)-rc.right+rc.left)/2, + (GetSystemMetrics(SM_CYSCREEN)-rc.bottom+rc.top)/2, + rc.right-rc.left, rc.bottom-rc.top, TRUE); + BringWindowToTop(hwndDlg); + setFindGameDlgHandle(hwndDlg); + MultiByteToWideChar(CP_ACP, 0, VERSION, strlen(VERSION) + 1, work, sizeof(work)); + SetDlgItemText(hwndDlg, IDC_GAMEDESC, work); + loadGameSettings(); + } + return TRUE; + + case WM_COMMAND: + + if (LOWORD(wParam) == IDC_LISTAVAILABLE && HIWORD(wParam) == LBN_SELCHANGE) { + if (!isPrescanning()) + displayGameInfo(); + else + changeScanPath(); + } + + if (wParam == IDC_SCAN) { + if (!isPrescanning()) + startScan(); + else + endScanPath(); + } + + if (wParam == IDC_PLAY) { + int item; + + item = SendMessage(GetDlgItem(hwndDlg, IDC_LISTAVAILABLE), LB_GETCURSEL, 0, 0); + if (item == LB_ERR) { + MessageBox(hwndDlg, TEXT("Please select a game"), TEXT("Error"), MB_OK); + } + else + EndDialog(hwndDlg, item + 1000); + } + + if (wParam == IDC_EXIT) { + if (!isPrescanning()) + EndDialog(hwndDlg, 0); + else + abortScanPath(); + } + return TRUE; + default: + return FALSE; + } +} + +char* GameSelector() +{ + TCHAR directory[MAX_PATH]; + static char id[100]; + + DWORD result = DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_GAMESELECT), HWND_DESKTOP, SelectDlgProc); + if (result < 1000) + return NULL; + result -= 1000; + + getSelectedGame(result, id, directory); + + WideCharToMultiByte(CP_ACP, 0, directory, wcslen(directory) + 1, _directory, sizeof(_directory), NULL, NULL); + + strcat(_directory, "\\"); + + return id; + +} + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) +{ + + int argc = 3; + char* argv[3]; + char argdir[MAX_PATH]; + char *game_name; + const char *sound; + + hide_toolbar = false; + + scummcfg = new Config("scummvm.ini", "scummvm"); + scummcfg->set_writing(true); + + sound = scummcfg->get("Sound", "wince"); + if (sound) + sound_activated = (atoi(sound) == 1); + else + sound_activated = true; + + game_name = GameSelector(); + if (!game_name) + return 0; + + argv[0] = NULL; + sprintf(argdir, "-p%s", _directory); + argv[1] = argdir; + argv[2] = game_name; + + if (!argv[2]) + return 0; + + // No default toolbar for zak256 + /* + if (strcmp(game_name, "zak256") == 0) + hide_toolbar = true; + */ + + // Keyboard activated for Monkey Island 2 + if (strcmp(game_name, "monkey2") == 0) { + draw_keyboard = true; + monkey2_keyboard = true; + } + + if (detector.detectMain(argc, argv)) + return (-1); + + OSystem *system = detector.createSystem(); + + // Create the game engine + Engine *engine = Engine::createFromDetector(&detector, system); + + keypad_init(); + load_key_mapping(); + + hide_cursor = TRUE; + if (detector._gameId == GID_SAMNMAX || detector._gameId == GID_FT || detector._gameId == GID_DIG) + hide_cursor = FALSE; + + // Run the game engine + engine->go(); + + return 0; +} + + + +LRESULT CALLBACK OSystem_WINCE3::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + static SHACTIVATEINFO sai; + + OSystem_WINCE3 *wm = (OSystem_WINCE3*)GetWindowLong(hWnd, GWL_USERDATA); + + if (monkey2_keyboard && g_scumm->_vars[g_scumm->VAR_ROOM] != 108) { + monkey2_keyboard = false; + draw_keyboard = false; + toolbar_drawn = false; + } + + switch (message) + { + case WM_CREATE: + memset(&sai, 0, sizeof(sai)); + SHSipPreference(hWnd, SIP_FORCEDOWN); +// SHSipPreference(hWnd, SIP_INPUTDIALOG); + + return 0; + + case WM_DESTROY: + case WM_CLOSE: + GraphicsOff(); + PostQuitMessage(0); + break; + + case WM_ERASEBKGND: + { + + RECT rc; + HDC hDC; + if (!GetScreenMode()) { + GetClientRect(hWnd, &rc); + rc.top = 200; + hDC = GetDC(hWnd); + if(rc.top < rc.bottom) + FillRect(hDC, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH)); + ReleaseDC(hWnd, hDC); + } + } + return 1; + + case WM_PAINT: + { + HDC hDC; + PAINTSTRUCT ps; + hDC = BeginPaint (hWnd, &ps); + EndPaint (hWnd, &ps); + if (!hide_toolbar) + toolbar_drawn = false; + + /* + if(!GetScreenMode()) { + SHSipPreference(hWnd, SIP_UP); + } else { + SHSipPreference(hWnd, SIP_FORCEDOWN); + } + */ + SHSipPreference(hWnd, SIP_FORCEDOWN); + } +// SHSipPreference(hWnd, SIP_UP); /* Hack! */ + /* It does not happen often but I don't want to see tooltip traces */ + wm->update_screen(); + return 0; + + case WM_ACTIVATE: + case WM_SETFOCUS: + GraphicsResume(); + if (!hide_toolbar) + toolbar_drawn = false; +// SHHandleWMActivate(hWnd, wParam, lParam, &sai, SHA_INPUTDIALOG); + + SHSipPreference(hWnd, SIP_FORCEDOWN); + SHFullScreen(hWnd, SHFS_HIDETASKBAR); + MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); + SetCapture(hWnd); + + /* + if (LOWORD(wParam) == WA_ACTIVE) { + if (GetScreenMode()) { + SHSipPreference(hWnd, SIP_FORCEDOWN); + SHFullScreen(hWnd, SHFS_HIDETASKBAR); + MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); + SetCapture(hWnd); + } + else { + SHFullScreen(hWnd, SHFS_SHOWTASKBAR); + MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CYSCREEN), GetSystemMetrics(SM_CXSCREEN), TRUE); + } + } + */ + + return 0; + + case WM_HIBERNATE: + case WM_KILLFOCUS: + GraphicsSuspend(); + if (!hide_toolbar) + toolbar_drawn = false; + return 0; + + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &sai); + if (!hide_toolbar) + toolbar_drawn = false; + return 0; + + + case WM_COMMAND: + /* + switch(wParam) + { + case IDC_OPTIONS: + wm->_event.kbd.ascii = KEY_SET_OPTIONS; + wm->_event.event_code = EVENT_KEYDOWN; + break; + case IDC_EXIT: + DestroyWindow(hWnd); + do_quit(); + break; + case IDC_SKIP: + if (detector._gameId >= GID_SIMON_FIRST && + detector._gameId <= GID_SIMON_LAST) { + g_simon->_exit_cutscene = true; + break; + } + if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) + wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]; + else + wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]; + break; + case IDC_LOADSAVE: + if (detector._gameId >= GID_SIMON_FIRST && + detector._gameId <= GID_SIMON_LAST) { + break; + } + if (GetScreenMode()) { + draw_keyboard = true; + if (!hide_toolbar) + toolbar_drawn = false; + } + wm->_event.kbd.ascii = mapKey(VK_F5); + wm->_event.event_code = EVENT_KEYDOWN; + break; + + case IDC_SOUND: + sound_activated = !sound_activated; + CheckMenuItem ( + SHMenuBar_GetMenu (hWnd_MainMenu, IDM_POCKETSCUMM), + IDC_SOUND, + MF_BYCOMMAND | (sound_activated ? MF_CHECKED : MF_UNCHECKED)); + if (detector._gameId >= GID_SIMON_FIRST && + detector._gameId <= GID_SIMON_LAST) { + g_mixer->pause(!sound_activated); + } + else + g_scumm->pauseSounds(!sound_activated); + + break; + + break; + + case IDC_LANDSCAPE: + //HWND taskbar; + //SHFullScreen (hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); + //InvalidateRect(HWND_DESKTOP, NULL, TRUE); + SetScreenMode(!GetScreenMode()); + //SHSipPreference(hWnd,SIP_FORCEDOWN); + //MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); + //SetCapture(hWnd); // to prevent input panel from getting taps + /*taskbar = FindWindow(TEXT("HHTaskBar"), NULL); + if (taskbar) + ShowWindow(taskbar, SW_HIDE);*/ + /*SHSipPreference(hWnd, SIP_FORCEDOWN); + SHFullScreen(hWnd, SHFS_HIDETASKBAR);*/ + /* + SetForegroundWindow(hWnd); + MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); + SetCapture(hWnd); + UpdateWindow(hWnd); + if (!hide_toolbar) + toolbar_drawn = false; + break; + + } + */ + + return 0; + + case WM_KEYDOWN: + if(wParam && wParam != 0x84) { // WHAT THE ??? + + /* + unsigned char GAPI_key; + + GAPI_key = getGAPIKeyMapping((short)wParam); + if (GAPI_key) { + */ + if (get_key_mapping) { + wm->_event.kbd.ascii = GAPI_KEY_BASE + GAPIKeysTranslate((int)wParam); + wm->_event.event_code = EVENT_KEYDOWN; + break; + } + /* + else + processAction((short)wParam); + */ + /*}*/ + if (!processAction(GAPIKeysTranslate((int)wParam))) + /*else*/ { + wm->_event.kbd.ascii = mapKey(wParam); + wm->_event.event_code = EVENT_KEYDOWN; + } + } + + break; + + case WM_KEYUP: + break; + + case WM_MOUSEMOVE: + { + int x = ((int16*)&lParam)[0]; + int y = ((int16*)&lParam)[1]; + Translate(&x, &y); + wm->_event.event_code = EVENT_MOUSEMOVE; + wm->_event.mouse.x = x; + wm->_event.mouse.y = y; + } + break; + case WM_LBUTTONDOWN: + { + ToolbarSelected toolbar_selection; + int x = ((int16*)&lParam)[0]; + int y = ((int16*)&lParam)[1]; + + //FILE *toto; + + Translate(&x, &y); + + /* + fprintf(toto, "Non translated %d %d Translated %d %d\n", + ((int16*)&lParam)[0], ((int16*)&lParam)[1], + x, y); + fclose(toto); + */ + + + if (draw_keyboard) { + // Handle keyboard selection + int offset_y; + int saved_x = x; + int saved_y = y; + + /* + if (!GetScreenMode()) { + x = ((int16*)&lParam)[0]; + y = ((int16*)&lParam)[1]; + } + */ + + offset_y = (GetScreenMode() ? 0 : 40 + 22); + + if (x<185 && y>=(200 + offset_y)) { + //Alpha selection + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = + (y <= (220 + offset_y)? KEYBOARD_MAPPING_ALPHA_HIGH[((x + 10) / 14) - 1] : + KEYBOARD_MAPPING_ALPHA_LOW[((x + 10) / 14) - 1]); + break; + } + else + if (x>=186 && y>=(200 + offset_y) && x<=255) { + // Numeric selection + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = + (y <= (220 + offset_y) ? KEYBOARD_MAPPING_NUMERIC_HIGH[((x - 187 + 10) / 14) - 1] : + KEYBOARD_MAPPING_NUMERIC_LOW[((x - 187 + 10) / 14) - 1]); + break; + } + else + if (x>=302 && x <= 316 && y >= (200 + offset_y) && y <= (220 + offset_y)) { + // Backspace + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = mapKey(VK_BACK); + break; + } + else + if (x>=302 && x<= 316 && y >= (220 + offset_y)) { + // Enter + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = mapKey(VK_RETURN); + break; + } + + x = saved_x; + y = saved_y; + + wm->_event.event_code = EVENT_LBUTTONDOWN; + wm->_event.mouse.x = x; + wm->_event.mouse.y = y; + break; + + } + + + toolbar_selection = (hide_toolbar || get_key_mapping ? ToolbarNone : + getToolbarSelection( + (GetScreenMode() ? x : ((int16*)&lParam)[0]), + (GetScreenMode() ? y : ((int16*)&lParam)[1]))); + if (toolbar_selection == ToolbarNone) { + wm->_event.event_code = EVENT_LBUTTONDOWN; + wm->_event.mouse.x = x; + wm->_event.mouse.y = y; + + /* + if(y > 200 && !hide_toolbar) + { + if(x<160) { + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = mapKey(VK_ESCAPE); + } + else + { + HDC hDC; + PAINTSTRUCT ps; + + SetScreenMode(0); // restore normal tap logic + //SHSipPreference(hWnd,SIP_UP); + ReleaseCapture(); + //InvalidateRect(HWND_DESKTOP, NULL, TRUE); + SHFullScreen(hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); + MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CYSCREEN), GetSystemMetrics(SM_CXSCREEN), TRUE); + SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + SetForegroundWindow(hWnd); + hDC = BeginPaint (hWnd, &ps); + EndPaint (hWnd, &ps); + } + } + */ + } + else { + switch(toolbar_selection) { + case ToolbarSaveLoad: + if (detector._gameId >= GID_SIMON_FIRST && + detector._gameId <= GID_SIMON_LAST) { + break; + } + /*if (GetScreenMode()) {*/ + /* + draw_keyboard = true; + if (!hide_toolbar) + toolbar_drawn = false; + */ + /*}*/ + wm->_event.event_code = EVENT_KEYDOWN; + wm->_event.kbd.ascii = mapKey(VK_F5); + break; + case ToolbarMode: + SetScreenMode(!GetScreenMode()); + if (!hide_toolbar) + toolbar_drawn = false; + break; + case ToolbarSkip: + if (detector._gameId >= GID_SIMON_FIRST && + detector._gameId <= GID_SIMON_LAST) { + // Fake a right click to abort the current cut scene + wm->_event.event_code = EVENT_RBUTTONDOWN; + wm->_event.mouse.x = x; + wm->_event.mouse.y = y; + break; + } + wm->_event.event_code = EVENT_KEYDOWN; + if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) + wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]; + else + wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]; + break; + case ToolbarSound: + sound_activated = !sound_activated; + redrawSoundItem(); + break; + default: + break; + } + } + } + break; + case WM_LBUTTONUP: + { + // pinched from the SDL code. Distinguishes between taps and not + int x = ((int16*)&lParam)[0]; + int y = ((int16*)&lParam)[1]; + Translate(&x, &y); + wm->_event.event_code = EVENT_LBUTTONUP; + wm->_event.mouse.x = x; + wm->_event.mouse.y = y; + } + break; + case WM_LBUTTONDBLCLK: // doesn't seem to work right now + //wm->_scumm->_rightBtnPressed |= msClicked | msDown; + break; + case WM_TIMER: + timer_callback(timer_interval); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +/*************** Specific config support ***********/ + +void load_key_mapping() { + unsigned char actions[NUMBER_ACTIONS]; + int actions_keys[NUMBER_ACTIONS]; + const char *current; + const char *version; + int i; + + memset(actions_keys, 0, sizeof(actions_keys)); + + version = scummcfg->get("KeysVersion", "wince"); + + current = scummcfg->get("ActionKeys", "wince"); + if (current && version) { + for (i=0; iget("ActionTypes", "wince"); + if (current && version) { + for (i=0; iset("KeysVersion", "2", "wince"); + scummcfg->flush(); + } +} + +void save_key_mapping() { + char tempo[1024]; + const int *work_keys; + const unsigned char *work; + int i; + + tempo[0] = '\0'; + work_keys = getActionKeys(); + for (i=0; iset("ActionKeys", tempo, "wince"); + tempo[0] = '\0'; + work = getActionTypes(); + for (i=0; iset("ActionTypes", tempo, "wince"); + + scummcfg->flush(); +} + +/*************** Hardware keys support ***********/ + +void OSystem_WINCE3::addEventKeyPressed(int ascii_code) { + _event.event_code = EVENT_KEYDOWN; + _event.kbd.ascii = ascii_code; +} + +void OSystem_WINCE3::addEventRightButtonClicked() { + OSystem_WINCE3* system; + system = (OSystem_WINCE3*)g_scumm->_system; + + system->addEventKeyPressed(9); +} + +void action_right_click() { + OSystem_WINCE3* system; + system = (OSystem_WINCE3*)g_scumm->_system; + + system->addEventRightButtonClicked(); +} + +void action_pause() { + OSystem_WINCE3* system; + system = (OSystem_WINCE3*)g_scumm->_system; + + system->addEventKeyPressed(mapKey(VK_SPACE)); +} + +void action_save() { + OSystem_WINCE3* system; + system = (OSystem_WINCE3*)g_scumm->_system; + + /*if (GetScreenMode()) {*/ + /* + draw_keyboard = true; + if (!hide_toolbar) + toolbar_drawn = false; + */ + /*}*/ + + system->addEventKeyPressed(mapKey(VK_F5)); +} + +void action_quit() { + do_quit(); +} + +void action_boss() { + SHELLEXECUTEINFO se; + + scummcfg->set("Sound", sound_activated, "wince"); + scummcfg->set("DisplayMode", GetScreenMode(), "wince"); + scummcfg->flush(); + sound_activated = false; + toolbar_drawn = false; + hide_toolbar = true; + Cls(); + g_scumm->_saveLoadSlot = 0; + g_scumm->_saveLoadCompatible = false; + g_scumm->_saveLoadFlag = 1; + strcpy(g_scumm->_saveLoadName, "BOSS"); + g_scumm->saveState(g_scumm->_saveLoadSlot, g_scumm->_saveLoadCompatible); + GXCloseInput(); + GXCloseDisplay(); + SDL_AudioQuit(); + memset(&se, 0, sizeof(se)); + se.cbSize = sizeof(se); + se.hwnd = NULL; + se.lpFile = TEXT("tasks.exe"); + se.lpVerb = TEXT("open"); + se.lpDirectory = TEXT("\\windows"); + ShellExecuteEx(&se); + exit(1); +} + +void action_skip() { + OSystem_WINCE3* system; + system = (OSystem_WINCE3*)g_scumm->_system; + + if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) + system->addEventKeyPressed(g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]); + else + system->addEventKeyPressed(g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]); +} + +void do_hide(bool hide_state) { + hide_toolbar = hide_state; + if (hide_toolbar) + RestoreScreenGeometry(); + else + LimitScreenGeometry(); + Cls(); + toolbar_drawn = hide_toolbar; + g_scumm->_system->update_screen(); +} + +void action_hide() { + do_hide(!hide_toolbar); +} + +void action_keyboard() { + /*if (GetScreenMode()) {*/ + draw_keyboard = !draw_keyboard; + if (!hide_toolbar) + toolbar_drawn = false; + /*}*/ +} + +void action_sound() { + sound_activated = !sound_activated; +} + +void action_cursoronoff() { + hide_cursor = !hide_cursor; +} + +void action_subtitleonoff() { + g_scumm->_noSubtitles = !g_scumm->_noSubtitles; +} + +void keypad_init() { + static pAction actions[TOTAL_ACTIONS] = + { action_pause, action_save, action_quit, action_skip, action_hide, + action_keyboard, action_sound, action_right_click, action_cursoronoff, + action_subtitleonoff, action_boss + }; + + GAPIKeysInit(actions); + +} + +void keypad_close() { + GXCloseInput(); +} + + +/************* OSystem Main **********************/ +OSystem *OSystem_WINCE3::create(int gfx_mode, bool full_screen) { + const char *display_mode; + OSystem_WINCE3 *syst = new OSystem_WINCE3(); + syst->_mode = gfx_mode; + syst->_full_screen = full_screen; + syst->_event.event_code = -1; + syst->_start_time = GetTickCount(); + + /* Retrieve the handle of this module */ + syst->hInst = GetModuleHandle(NULL); + + /* Register the window class */ + WNDCLASS wcex; + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = (WNDPROC)WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = syst->hInst; + wcex.hIcon = 0; + wcex.hCursor = NULL; + wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + wcex.lpszMenuName = 0; + wcex.lpszClassName = TEXT("ScummVM"); + if (!RegisterClass(&wcex)) + Error(TEXT("Cannot register window class!")); + + syst->hWnd = CreateWindow(TEXT("ScummVM"), TEXT("ScummVM"), WS_VISIBLE, + 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, syst->hInst, NULL); + hWnd_Window = syst->hWnd; + SetWindowLong(syst->hWnd, GWL_USERDATA, (long)syst); + + ShowWindow(syst->hWnd, SW_SHOW); + UpdateWindow(syst->hWnd); + + /* + SHMENUBARINFO smbi; + smbi.cbSize = sizeof(smbi); + smbi.hwndParent = syst->hWnd; + smbi.dwFlags = 0; + smbi.nToolBarId = IDM_MENU; + smbi.hInstRes = GetModuleHandle(NULL); + smbi.nBmpId = 0; + smbi.cBmpImages = 0; + smbi.hwndMB = NULL; + BOOL res = SHCreateMenuBar(&smbi); + hWnd_MainMenu = smbi.hwndMB; + */ + + /* Sound is activated on default - initialize it in the menu */ + /* + CheckMenuItem((HMENU)SHMenuBar_GetMenu (hWnd_MainMenu, IDM_POCKETSCUMM), + IDC_SOUND, MF_BYCOMMAND | MF_CHECKED); + */ + + GraphicsOn(syst->hWnd); + + SetWindowPos(syst->hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + SetForegroundWindow(syst->hWnd); + SHFullScreen(syst->hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); + + + // Mini SDL init + + if (SDL_Init(SDL_INIT_AUDIO)==-1) { + exit(1); + } + + Cls(); + drawWait(); + + // Set mode, portrait or landscape + display_mode = scummcfg->get("DisplayMode", "wince"); + if (display_mode) + SetScreenMode(atoi(display_mode)); + + return syst; +} + +OSystem *OSystem_WINCE3_create() { + return OSystem_WINCE3::create(0, 0); +} + +void OSystem_WINCE3::set_timer(int timer, int (*callback)(int)) { + SetTimer(hWnd, 1, timer, NULL); + timer_interval = timer; + timer_callback = callback; +} + +void OSystem_WINCE3::set_palette(const byte *colors, uint start, uint num) { + const byte *b = colors; + uint i; + for(i=0;i!=num;i++) { + SetPalEntry(i + start, b[0], b[1], b[2]); + b += 4; + } + + palette_update(); +} + +void OSystem_WINCE3::load_gfx_mode() { + force_full = true; + + _gfx_buf = (byte*)malloc((320 * 240) * sizeof(byte)); + _ms_backup = (byte*)malloc((40 * 40 * 3) * sizeof(byte)); +} + +void OSystem_WINCE3::unload_gfx_mode() { + // FIXME: Free the _gfx_buf here +} + +void OSystem_WINCE3::init_size(uint w, uint h) { + load_gfx_mode(); + SetScreenGeometry(w, h); +} + +void OSystem_WINCE3::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { + byte *dst; + + if (!hide_cursor && _mouse_drawn) + undraw_mouse(); + + dst = _gfx_buf + y * 320 + x; + do { + memcpy(dst, buf, w); + dst += 320; + buf += pitch; + } while (--h); +} + +void OSystem_WINCE3::update_screen() { + + if (!hide_cursor) + draw_mouse(); + + Blt(_gfx_buf); +} + +bool OSystem_WINCE3::show_mouse(bool visible) { + if (_mouse_visible == visible) + return visible; + + bool last = _mouse_visible; + _mouse_visible = visible; + + return last; +} + +// From X11 port + +void OSystem_WINCE3::draw_mouse() { + if (_mouse_drawn || !_mouse_visible) + return; + _mouse_drawn = true; + + int xdraw = _ms_cur.x - _ms_hotspot_x; + int ydraw = _ms_cur.y - _ms_hotspot_y; + int w = _ms_cur.w; + int h = _ms_cur.h; + int real_w; + int real_h; + int real_h_2; + + byte *dst; + byte *dst2; + const byte *buf = _ms_buf; + byte *bak = _ms_backup; + + assert(w <= 40 && h <= 40); + + if (ydraw < 0) { + real_h = h + ydraw; + buf += (-ydraw) * w; + ydraw = 0; + } else { + real_h = (ydraw + h) > 200 ? (200 - ydraw) : h; + } + if (xdraw < 0) { + real_w = w + xdraw; + buf += (-xdraw); + xdraw = 0; + } else { + real_w = (xdraw + w) > 320 ? (320 - xdraw) : w; + } + + dst = _gfx_buf + (ydraw * 320) + xdraw; + dst2 = dst; + + if ((real_h == 0) || (real_w == 0)) { + _mouse_drawn = false; + return; + } + + _ms_old.x = xdraw; + _ms_old.y = ydraw; + _ms_old.w = real_w; + _ms_old.h = real_h; + + real_h_2 = real_h; + while (real_h_2 > 0) { + memcpy(bak, dst, real_w); + bak += 40; + dst += 320; + real_h_2--; + } + while (real_h > 0) { + int width = real_w; + while (width > 0) { + byte color = *buf; + if (color != 0xFF) { + *dst2 = color; + } + buf++; + dst2++; + width--; + } + buf += w - real_w; + dst2 += 320 - real_w; + real_h--; + } +} + +void OSystem_WINCE3::undraw_mouse() { + if (!_mouse_drawn) + return; + _mouse_drawn = false; + + int old_h = _ms_old.h; + + byte *dst = _gfx_buf + (_ms_old.y * 320) + _ms_old.x; + byte *bak = _ms_backup; + + while (old_h > 0) { + memcpy(dst, bak, _ms_old.w); + bak += 40; + dst += 320; + old_h--; + } +} + + +void OSystem_WINCE3::set_mouse_pos(int x, int y) { + if (x != _ms_cur.x || y != _ms_cur.y) { + _ms_cur.x = x; + _ms_cur.y = y; + } +} + +void OSystem_WINCE3::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { + _ms_cur.w = w; + _ms_cur.h = h; + + _ms_hotspot_x = hotspot_x; + _ms_hotspot_y = hotspot_y; + + _ms_buf = (byte*)buf; + + // Refresh mouse cursor + + if (!hide_cursor) { + undraw_mouse(); + draw_mouse(); + } +} + +void OSystem_WINCE3::set_shake_pos(int shake_pos) {;} + +uint32 OSystem_WINCE3::get_msecs() { + return GetTickCount() - _start_time; +} + +void OSystem_WINCE3::delay_msecs(uint msecs) { + //handleMessage(); + Sleep(msecs); +} + +void *OSystem_WINCE3::create_thread(ThreadProc *proc, void *param) { + // needed for emulated MIDI support (Sam'n'Max) + return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)proc, param, 0, NULL); +} + +int mapKey(int key, byte mod) +{ + if (key>=VK_F1 && key<=VK_F9) { + return key - VK_F1 + 315; + } + return key; +} + +bool OSystem_WINCE3::poll_event(Event *event) { + + for (;;) { + MSG msg; + + _event.event_code = -1; + + if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + return false; + + if (msg.message==WM_QUIT) { + terminated=true; + do_quit(); + return false; + } + + TranslateMessage(&msg); + DispatchMessage(&msg); + + *event = _event; + + return true; + } + + return false; +} + +void own_soundProc(void *buffer, byte *samples, int len) { + + (*real_soundproc)(buffer, samples, len); + + if (!sound_activated) + memset(samples, 0, len); +} + +bool OSystem_WINCE3::set_sound_proc(void *param, SoundProc *proc, byte format) { + SDL_AudioSpec desired; + + /* only one format supported at the moment */ + + real_soundproc = proc; + desired.freq = SAMPLES_PER_SEC; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 128; + desired.callback = own_soundProc; + desired.userdata = param; + if (SDL_OpenAudio(&desired, NULL) != 0) { + return false; + } + SDL_PauseAudio(0); + return true; +} + +/* Hotswap graphics modes */ +void OSystem_WINCE3::get_320x200_image(byte *buf) {;} +void OSystem_WINCE3::hotswap_gfx_mode() {;} +uint32 OSystem_WINCE3::property(int param, Property *value) { + switch(param) { + + case PROP_TOGGLE_FULLSCREEN: + return 1; + + case PROP_SET_WINDOW_CAPTION: + return 1; + + case PROP_OPEN_CD: + break; + + case PROP_SET_GFX_MODE: + return 1; + + case PROP_SHOW_DEFAULT_CURSOR: + break; + + case PROP_GET_SAMPLE_RATE: + return SAMPLES_PER_SEC; + } + + return 0; +} + +void OSystem_WINCE3::quit() { + unload_gfx_mode(); + exit(1); +} + +/* CDRom Audio */ +void OSystem_WINCE3::stop_cdrom() {;} +void OSystem_WINCE3::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { + /* Reset sync count */ + g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0; +} + +bool OSystem_WINCE3::poll_cdrom() {return 0;} +void OSystem_WINCE3::update_cdrom() {;} + +void ScummDebugger::attach(Scumm *s) {;} + +/* Mutex stuff */ +void* OSystem_WINCE3::create_mutex() { + return (void*)CreateMutex(NULL, FALSE, NULL); +} +void OSystem_WINCE3::lock_mutex(void *handle) { + WaitForSingleObject((HANDLE)handle, INFINITE); +} + +void OSystem_WINCE3::unlock_mutex(void *handle) { + ReleaseMutex((HANDLE)handle); +} + +void OSystem_WINCE3::delete_mutex(void *handle) { + CloseHandle((HANDLE)handle); +} \ No newline at end of file diff --git a/backends/wince/pocketscumm.ico b/backends/wince/pocketscumm.ico new file mode 100644 index 0000000000..1bc0dae683 Binary files /dev/null and b/backends/wince/pocketscumm.ico differ diff --git a/backends/wince/resource.h b/backends/wince/resource.h new file mode 100644 index 0000000000..d0099cbc86 --- /dev/null +++ b/backends/wince/resource.h @@ -0,0 +1,58 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by PocketSCUMM.rc +// +#define IDD_GAMESELECT 105 +#define IDD_SOUND_DIALOG 106 +#define IDB_SKIP 113 +#define IDB_DISK 115 +#define IDB_EXIT 116 +#define IDB_SOUND_ON 117 +#define IDB_SOUND_OFF 118 +#define IDB_PANEL 119 +#define IDI_POCKETSCUMM 127 +#define IDB_KEYBOARD 129 +#define IDL_POCKETSCUMM 130 +#define IDB_MENUTITLE 133 +#define IDD_DIALOG1 134 +#define IDM_MENU 1000 +#define IDC_ABOUT 1000 +#define IDC_MONKEY 1000 +#define IDC_OPTIONS 1000 +#define IDC_EXIT 1001 +#define IDC_MONKEY2 1001 +#define IDD_SLIDERMUSIC 1001 +#define IDC_ATLANTIS 1002 +#define IDD_SLIDERSFX 1002 +#define IDC_PLAYFATE 1003 +#define IDC_TENTACLE 1004 +#define IDC_DOTTDEMO 1005 +#define IDC_SAMNMAX 1006 +#define IDC_SNMDEMO 1007 +#define IDC_DISABLE_SOUND 1008 +#define IDC_SLOW_SOUND 1009 +#define IDC_FT 1010 +#define IDC_LISTAVAILABLE 1011 +#define IDC_GAMEDESC 1014 +#define IDC_PLAY 1015 +#define IDC_FILEPATH 1016 +#define IDC_SCAN 1018 +#define ID_POCKETSCUMM 40005 +#define IDS_CAP_POCKETSCUMM 40006 +#define IDC_LANDSCAPE 40007 +#define IDC_SKIP 40008 +#define IDC_LOADSAVE 40009 +#define IDC_SOUND 40011 +#define IDC_SOUNDVOL 40012 +#define IDM_POCKETSCUMM 40013 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 135 +#define _APS_NEXT_COMMAND_VALUE 40014 +#define _APS_NEXT_CONTROL_VALUE 1016 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/backends/wince/screen.cpp b/backends/wince/screen.cpp new file mode 100644 index 0000000000..7dac8759ba --- /dev/null +++ b/backends/wince/screen.cpp @@ -0,0 +1,1588 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifdef _WIN32_WCE + +/* Original GFX code by Vasyl Tsvirkunov */ + +#include +#include +#include "gx.h" +#include "screen.h" +#include "resource.h" + +#define COLORCONV565(r,g,b) \ +(((r&0xf8)<<(11-3))|((g&0xfc)<<(5-2))|((b&0xf8)>>3)) +#define COLORCONV555(r,g,b) \ +(((r&0xf8)<<(10-3))|((g&0xf8)<<(5-2))|((b&0xf8)>>3)) +#define COLORCONVMONO(r,g,b) ((((3*r>>3)+(g>>1)+(b>>3))>>colorscale)^invert) + +#define MAX_CLR 0x100 +static UBYTE palRed[MAX_CLR]; +static UBYTE palGreen[MAX_CLR]; +static UBYTE palBlue[MAX_CLR]; +static unsigned short pal[MAX_CLR]; + /* First 10 and last 10 colors on palettized devices require special treatment */ +static UBYTE staticTranslate[20]; +static UBYTE invert = 0; +static int colorscale = 0; + +extern UBYTE item_toolbar[]; +extern UBYTE item_toolbar_colors[]; +extern UBYTE item_toolbarPortrait[]; +extern UBYTE item_toolbarPortrait_colors[]; +extern UBYTE item_keyboard[]; +extern UBYTE item_keyboard_colors[]; +extern UBYTE item_keyboardPortrait[]; +extern UBYTE item_keyboardPortrait_colors[]; +extern UBYTE item_disk[]; +extern UBYTE item_disk_colors[]; +extern UBYTE item_skip[]; +extern UBYTE item_skip_colors[]; +extern UBYTE item_soundOn[]; +extern UBYTE item_soundOn_colors[]; +extern UBYTE item_soundOff[]; +extern UBYTE item_soundOff_colors[]; +extern UBYTE item_monkeyLandscape[]; +extern UBYTE item_monkeyLandscape_colors[]; +extern UBYTE item_monkeyPortrait[]; +extern UBYTE item_monkeyPortrait_colors[]; +extern UBYTE item_loading[]; +extern UBYTE item_loading_colors[]; + + +extern bool sound_activated; +extern bool hide_toolbar; +bool toolbar_drawn; +bool draw_keyboard; + +GXDisplayProperties gxdp; +int active; + +struct tScreenGeometry +{ + long width; + long height; + long startoffset; + long sourceoffset; + long linestep; + long pixelstep; + long xSkipMask; + long xLimit; + long lineLimit; +}; + + +tScreenGeometry geom[3]; + +int currentScreenMode = 0; +int useMode = 0; +int maxMode = 2; +int filter_available; +int smooth_filter; +int toolbar_available; + +UBYTE *toolbar = NULL; + +/* Using vectorized function to save on branches */ +typedef void (*tCls)(); +typedef void (*tBlt)(UBYTE*); +typedef void (*tBlt_part)(UBYTE*,int, int, int, int, UBYTE*); + +void mono_Cls(); +void mono_Blt(UBYTE*); +void mono_Blt_part(UBYTE*, int, int, int, int, UBYTE*); + +void palette_Cls(); +void palette_Blt(UBYTE*); +void palette_Blt_part(UBYTE*, int, int, int, int, UBYTE*); + +void hicolor_Cls(); +void hicolor555_Blt(UBYTE*); +void hicolor555_Blt_part(UBYTE*, int, int, int, int, UBYTE*); +void hicolor565_Blt(UBYTE*); +void hicolor565_Blt_part(UBYTE*, int, int, int, int, UBYTE*); + +void palette_update(); + +static tCls pCls = NULL; +static tBlt pBlt = NULL; +static tBlt_part pBlt_part = NULL; + +static int _geometry_w; +static int _geometry_h; +static int _saved_geometry_h; + +HWND hWndMain; + + +void SetScreenMode(int mode) +{ + currentScreenMode = mode; + if(currentScreenMode > maxMode) + currentScreenMode = 0; +} + +int GetScreenMode() +{ + return currentScreenMode; +} + +void GraphicsSuspend() +{ + if(active) + { + active = 0; + GXSuspend(); + } +} + +void GraphicsResume() +{ + if(!active) + { + active = 1; + GXResume(); + } + + palette_update(); +} + +void GraphicsOff(void) +{ + GXCloseDisplay(); + active = 0; +} + +void SetScreenGeometry(int w, int h) { + // Complain (loudly) if w > 320 and h > 240 ... + if (w != 320 || h > 240) { + MessageBox(NULL, TEXT("Unsupported screen geometry !"), TEXT("Error"), MB_OK); + exit(1); + } + + _geometry_w = w; + _geometry_h = h; + _saved_geometry_h = h; + RestoreScreenGeometry(); +} + +void LimitScreenGeometry() { + + if (_geometry_h > 200) { + geom[0].lineLimit = _geometry_w*200; + geom[1].lineLimit = _geometry_w*200; + geom[1].lineLimit = _geometry_w*200; + _geometry_h = 200; + } +} + +void RestoreScreenGeometry() { + _geometry_h = _saved_geometry_h; + geom[0].lineLimit = _geometry_w * _geometry_h; + geom[1].lineLimit = _geometry_w * _geometry_h; + geom[2].lineLimit = _geometry_w * _geometry_h; +} + +int GraphicsOn(HWND hWndMain_param) +{ + hWndMain = hWndMain_param; + GXOpenDisplay(hWndMain, GX_FULLSCREEN); + + gxdp = GXGetDisplayProperties(); + + if(gxdp.ffFormat & kfDirect565) + { + pCls = hicolor_Cls; + pBlt = hicolor565_Blt; + pBlt_part = hicolor565_Blt_part; + filter_available = 1; + smooth_filter = 1; + toolbar_available = 1; + } + else if(gxdp.ffFormat & kfDirect555) + { + pCls = hicolor_Cls; + pBlt = hicolor555_Blt; + pBlt_part = hicolor555_Blt_part; + filter_available = 1; + smooth_filter = 1; + toolbar_available = 1; + } + else if((gxdp.ffFormat & kfDirect) && (gxdp.cBPP <= 8)) + { + pCls = mono_Cls; + pBlt = mono_Blt; + pBlt_part = mono_Blt_part; + + if(gxdp.ffFormat & kfDirectInverted) + invert = (1<= 4) + filter_available = 1; + + toolbar_available = 1; + } + else if(gxdp.ffFormat & kfPalette) + { + pCls = palette_Cls; + pBlt = palette_Blt; + pBlt_part = palette_Blt_part; + + toolbar_available = 1; + } + + + if(!pCls || !pBlt || gxdp.cxWidth < 240 || gxdp.cyHeight < +240) + { + // I don't believe there are devices that end up here + GraphicsOff(); + return 1; + } + + // portrait + geom[0].width = gxdp.cxWidth; // 240 + geom[0].height = gxdp.cyHeight; // 320 + geom[0].startoffset = 0; + geom[0].sourceoffset = 0; + geom[0].linestep = gxdp.cbyPitch; + geom[0].pixelstep = gxdp.cbxPitch; + geom[0].xSkipMask = gxdp.cxWidth < 320 ? 0x00000003 : 0xffffffff; + geom[0].xLimit = 320; // skip 1/4 + geom[0].lineLimit = 320*200; + + // left handed landscape + geom[1].width = gxdp.cyHeight; // 320 + geom[1].height = gxdp.cxWidth; // 240 + geom[1].startoffset = gxdp.cbyPitch*(gxdp.cyHeight-1); + geom[1].sourceoffset = 0; + geom[1].linestep = gxdp.cbxPitch; + geom[1].pixelstep = -gxdp.cbyPitch; + geom[1].xSkipMask = 0xffffffff; + geom[1].xLimit = 320; // no skip + geom[1].lineLimit = 320*200; + + // right handed landscape + geom[2].width = gxdp.cyHeight; // 320 + geom[2].height = gxdp.cxWidth; // 240 + geom[2].startoffset = gxdp.cbxPitch*(gxdp.cxWidth-1); + geom[2].sourceoffset = 0; + geom[2].linestep = -gxdp.cbxPitch; + geom[2].pixelstep = gxdp.cbyPitch; + geom[2].xSkipMask = 0xffffffff; + geom[2].xLimit = 320; // no skip + geom[2].lineLimit = 320*200; + + if(gxdp.cyHeight < 320) + maxMode = 0; // portrait only! + + /* + for(int i = 0; i < MAX_CLR; i++) + { + SetPalEntry(i, (colortable[i] >> 16) & 0xff, + (colortable[i] >> 8) & 0xff, + (colortable[i]) & 0xff); + } + */ + + //palette_update(); + + active = 1; + return 0; +} + +/* Find the best color match in the palette (limited to 'limit' entries) */ + UBYTE best_match(UBYTE r, UBYTE g, UBYTE b, int limit) + { + UBYTE best = 0; + int distance = 768; + int i, d; + for(i=0; ipalVersion = 0x300; + ple->palNumEntries = 256; + for(int i=0; i<236; i++) // first 10 and last ten belong to the system! + { + ple->palPalEntry[i+10].peBlue = palBlue[i]; + ple->palPalEntry[i+10].peGreen = palGreen[i]; + ple->palPalEntry[i+10].peRed = palRed[i]; + ple->palPalEntry[i+10].peFlags = PC_RESERVED; + } + HDC hDC = GetDC(hWndMain); + GetSystemPaletteEntries(hDC, 0, 10, &(ple->palPalEntry[0])); + GetSystemPaletteEntries(hDC, 246, 10, &(ple->palPalEntry[246])); + HPALETTE hpal = CreatePalette(ple); + SelectPalette(hDC, hpal, FALSE); + RealizePalette(hDC); + DeleteObject((HGDIOBJ)hpal); + ReleaseDC(hWndMain, hDC); + free((void*)ple); + + for(i=0; i<20; i++) + staticTranslate[i] = best_match(palRed[i+236], palGreen[i+236], palBlue[i+236], 236)+10; + + } +} + +void SetPalEntry(int ent, UBYTE r, UBYTE g, UBYTE b) +{ + if (ent >= MAX_CLR) + return; + + palRed[ent] = r; + palGreen[ent] = g; + palBlue[ent] = b; + + if(gxdp.ffFormat & kfDirect565) + pal[ent] = COLORCONV565(r,g,b); + else if(gxdp.ffFormat & kfDirect555) + pal[ent] = COLORCONV555(r,g,b); + else if(gxdp.ffFormat & kfDirect) + pal[ent] = COLORCONVMONO(r,g,b); +} + +/* *************** CLS IMPLEMENTATIONS ****************** */ + +void mono_Cls() +{ + int x, y; + UBYTE* dst; + UBYTE *scraddr; + int linestep, pixelstep; + UBYTE fillcolor; + + fillcolor = (gxdp.ffFormat & kfDirectInverted) ? 0xff : 0x00; + + pixelstep = geom[0].pixelstep; + if(pixelstep == 0) + return; + linestep = (pixelstep > 0) ? -1 : 1; + + scraddr = (UBYTE*)GXBeginDraw(); + if(scraddr) + { + for(y=0; y= x1 && y >= y1) && (x <= x2 && y <= y2)); +} + +ToolbarSelected getToolbarSelection (int x, int y) { + int test_x, test_y; + + /* + if (!currentScreenMode) + return ToolbarNone; + */ + + if (!(x >= 10 && y >= 204)) + return ToolbarNone; + + test_x = 10; + test_y = (currentScreenMode ? 204 : 240); + if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) + return ToolbarSaveLoad; + test_x += 40; + if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) + return ToolbarSkip; + test_x += 40; + if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) + return ToolbarSound; + test_x += 40; + if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) + return ToolbarMode; + return ToolbarNone; +} + +/* ************************** BLT IMPLEMENTATION **************************** */ + +void Blt(UBYTE * scr_ptr) +{ + pBlt(scr_ptr); + + //if (toolbar_available && currentScreenMode && !toolbar_drawn) + if (toolbar_available && !toolbar_drawn && !hide_toolbar) + drawAllToolbar(); + +} + + +#define ADVANCE_PARTIAL(address, step) \ + bitshift += gxdp.cBPP; \ + if(bitshift >= 8) \ + { \ + bitshift = 0; \ + bitmask = (1<>= gxdp.cBPP; + + +void mono_Blt(UBYTE *src_ptr) { + mono_Blt_part(src_ptr, 0, 0, _geometry_w, _geometry_h, NULL); +} + + +void mono_Blt_part(UBYTE * scr_ptr, int x, int y, int width, int height, + UBYTE * own_palette) +{ +// Mono blit routines contain good deal of voodoo + static UBYTE *src; + static UBYTE *dst; + static UBYTE *scraddr; + static UBYTE *scr_ptr_limit; + static UBYTE *src_limit; + static long pixelstep; + static long linestep; + static long skipmask; + +// Special code is used to deal with packed pixels in monochrome mode + static UBYTE bitmask; + static int bitshift; + + if(!active) + { + Sleep(100); + return; + } + + /* Update screen mode, also thread protection by doing this */ + if(useMode != currentScreenMode) + { + useMode = currentScreenMode; + pCls(); + } + + pixelstep = geom[useMode].pixelstep; + linestep = geom[useMode].linestep; + skipmask = geom[useMode].xSkipMask; + + scraddr = (UBYTE*)GXBeginDraw(); + + if(pixelstep) + { + // this will work on mono iPAQ and @migo, don't know about any others + linestep = (pixelstep > 0) ? -1 : 1; + + bitshift = 0; + bitmask = (1<= 4) + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + while(src < src_limit) + { + UBYTE r, g, b; + + if (!own_palette) { + r = (3*palRed[*(src+0)] + palRed[*(src+1)])>>2; + g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; + b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; + } else { + r = (3 * own_palette[3 * *(src + 0)] + + own_palette[3 * *(src + 1)]) >> 2; + g = (3 * own_palette[3 * *(src + 0) + 1] + + own_palette[3 * *(src + 1) + 1]) >> 2; + b = (3 * own_palette[3 * *(src + 0) + 2] + + own_palette[3 * *(src + 1) + 2]) >> 2; + } + + + *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)<>1; + g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; + b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; + } + else { + r = (own_palette[3 * *(src + 1)] + + own_palette[3 * *(src + 2)]) >> 2; + g = (own_palette[3 * *(src + 1) + 1] + + own_palette[3 * *(src + 2) + 1]) >> 2; + b = (own_palette[3 * *(src + 1) + 2] + + own_palette[3 * *(src + 2) + 2]) >> 2; + } + + *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)<>2; + g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; + b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; + } + else { + r = (own_palette[3 * *(src + 2)] + + 3 * own_palette[3 * *(src + 3)]) >> 2; + g = (own_palette[3 * *(src + 2) + 1] + + 3 * own_palette[3 * *(src + 3) + 1]) >> 2; + b = (own_palette[3 * *(src + 2) + 2] + + 3 * own_palette[3 * *(src + 3) + 2]) >> 2; + + } + + *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)< 0) ? 1 : -1; + + if(scraddr) + { + + scraddr += geom[useMode].startoffset; + scr_ptr += geom[useMode].sourceoffset; + //scr_ptr_limit = scr_ptr + geom[useMode].lineLimit; + //src_limit = scr_ptr + geom[useMode].xLimit; + + /* Update offsets to the current line */ + scraddr += y * linestep; + scr_ptr_limit = scr_ptr + width * height; + src_limit = scr_ptr + width; + + if(skipmask != 0xffffffff) + { + if(pixelstep > 0) + { + bitshift = 8-gxdp.cBPP; + bitmask = ((1< 0) + { + bitshift = 8-gxdp.cBPP; + bitmask = ((1<>2; + g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; + b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; + } else { + r = (3 * own_palette[3 * *(src + 0)] + + own_palette[3 * *(src + 1)]) >> 2; + g = (3 * own_palette[3 * *(src + 0) + 1] + + own_palette[3 * *(src + 1) + 1]) >> 2; + b = (3 * own_palette[3 * *(src + 0) + 2] + + own_palette[3 * *(src + 1) + 2]) >> 2; + } + + *(unsigned short*)dst = COLORCONV555(r,g,b); + + dst += pixelstep; + + if (!own_palette) { + r = (palRed[*(src+1)] + palRed[*(src+2)])>>1; + g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; + b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; + } + else { + r = (own_palette[3 * *(src + 1)] + + own_palette[3 * *(src + 2)]) >> 2; + g = (own_palette[3 * *(src + 1) + 1] + + own_palette[3 * *(src + 2) + 1]) >> 2; + b = (own_palette[3 * *(src + 1) + 2] + + own_palette[3 * *(src + 2) + 2]) >> 2; + } + + *(unsigned short*)dst = COLORCONV555(r,g,b); + + dst += pixelstep; + + if (!own_palette) { + r = (palRed[*(src+2)] + 3*palRed[*(src+3)])>>2; + g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; + b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; + } + else { + r = (own_palette[3 * *(src + 2)] + + 3 * own_palette[3 * *(src + 3)]) >> 2; + g = (own_palette[3 * *(src + 2) + 1] + + 3 * own_palette[3 * *(src + 3) + 1]) >> 2; + b = (own_palette[3 * *(src + 2) + 2] + + 3 * own_palette[3 * *(src + 3) + 2]) >> 2; + + } + + *(unsigned short*)dst = COLORCONV555(r,g,b); + + dst += pixelstep; + + src += 4; + } + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + else if(skipmask != 0xffffffff) + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + + while(src < src_limit) + { + if((long)src & skipmask) + { + if (!own_palette) + *(unsigned short*)dst = pal[*src]; + else + *(unsigned short*)dst = + COLORCONV555(own_palette[3 * *src], + own_palette[(3 * *src) + 1], + own_palette[(3 * *src) + 2]); + dst += pixelstep; + } + src ++; + } + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + else + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + + while(src < src_limit) + { + if (!own_palette) + *(unsigned short*)dst = pal[*src]; + else + *(unsigned short*)dst = + COLORCONV565(own_palette[3 * *src], + own_palette[(3 * *src) + 1], + own_palette[(3 * *src) + 2]); + dst += pixelstep; + src ++; + } + + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + + GXEndDraw(); + } +} + +void hicolor565_Blt(UBYTE *src_ptr) { + hicolor565_Blt_part(src_ptr, 0, 0, _geometry_w, _geometry_h, NULL); +} + +void hicolor565_Blt_part(UBYTE * scr_ptr, int x, int y, int width, int height, + UBYTE * own_palette) +{ + static UBYTE *src; + static UBYTE *dst; + static UBYTE *scraddr; + static UBYTE *scr_ptr_limit; + static UBYTE *src_limit; + static long pixelstep; + static long linestep; + static long skipmask; + + if(!active) + { + Sleep(100); + return; + } + + /* Update screen mode, also thread protection by doing this */ + if(useMode != currentScreenMode) + { + useMode = currentScreenMode; + pCls(); + } + + pixelstep = geom[useMode].pixelstep; + linestep = geom[useMode].linestep; + skipmask = geom[useMode].xSkipMask; + + scraddr = (UBYTE*)GXBeginDraw(); + if(scraddr) + { + + scraddr += geom[useMode].startoffset; + scr_ptr += geom[useMode].sourceoffset; + //scr_ptr_limit = scr_ptr + geom[useMode].lineLimit; + //src_limit = scr_ptr + geom[useMode].xLimit; + + /* Update offsets to the current line */ + scraddr += y * linestep; + scr_ptr_limit = scr_ptr + width * height; + src_limit = scr_ptr + width; + + /* Internal pixel loops */ + if(skipmask == 3 && smooth_filter) + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + while(src < src_limit) + { + UBYTE r, g, b; + if (!own_palette) { + r = (3*palRed[*(src+0)] + palRed[*(src+1)])>>2; + g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; + b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; + } else { + r = (3 * own_palette[3 * *(src + 0)] + + own_palette[3 * *(src + 1)]) >> 2; + g = (3 * own_palette[3 * *(src + 0) + 1] + + own_palette[3 * *(src + 1) + 1]) >> 2; + b = (3 * own_palette[3 * *(src + 0) + 2] + + own_palette[3 * *(src + 1) + 2]) >> 2; + } + + *(unsigned short*)dst = COLORCONV565(r,g,b); + + dst += pixelstep; + + if (!own_palette) { + r = (palRed[*(src+1)] + palRed[*(src+2)])>>1; + g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; + b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; + } + else { + r = (own_palette[3 * *(src + 1)] + + own_palette[3 * *(src + 2)]) >> 1; + g = (own_palette[3 * *(src + 1) + 1] + + own_palette[3 * *(src + 2) + 1]) >> 1; + b = (own_palette[3 * *(src + 1) + 2] + + own_palette[3 * *(src + 2) + 2]) >> 1; + } + + *(unsigned short*)dst = COLORCONV565(r,g,b); + + dst += pixelstep; + + if (!own_palette) { + r = (palRed[*(src+2)] + 3*palRed[*(src+3)])>>2; + g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; + b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; + } + else { + r = (own_palette[3 * *(src + 2)] + + 3 * own_palette[3 * *(src + 3)]) >> 2; + g = (own_palette[3 * *(src + 2) + 1] + + 3 * own_palette[3 * *(src + 3) + 1]) >> 2; + b = (own_palette[3 * *(src + 2) + 2] + + 3 * own_palette[3 * *(src + 3) + 2]) >> 2; + + } + + *(unsigned short*)dst = COLORCONV565(r,g,b); + + dst += pixelstep; + + src += 4; + } + + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + else if(skipmask != 0xffffffff) + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + while(src < src_limit) + { + if((long)src & skipmask) + { + if (!own_palette) + *(unsigned short*)dst = pal[*src]; + else + *(unsigned short*)dst = + COLORCONV565(own_palette[3 * *src], + own_palette[(3 * *src) + 1], + own_palette[(3 * *src) + 2]); + dst += pixelstep; + } + src ++; + } + + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + else + { + while(scr_ptr < scr_ptr_limit) + { + int i; + + src = scr_ptr; + dst = scraddr; + + /* skip non updated pixels for this line */ + for (i=0; i < x; i++) + dst += pixelstep; + + while(src < src_limit) + { + if (!own_palette) + *(unsigned short*)dst = pal[*src]; + else + *(unsigned short*)dst = + COLORCONV565(own_palette[3 * *src], + own_palette[(3 * *src) + 1], + own_palette[(3 * *src) + 2]); + dst += pixelstep; + src ++; + } + + scraddr += linestep; + scr_ptr += width; + src_limit += width; + } + } + + GXEndDraw(); + } +} + + +void Translate(int* px, int* py) +{ + int x, y; + + switch(currentScreenMode) + { + case 0: /* portrait */ + *px = *px*4/3; + break; + case 1: /* landscape left */ + x = 320 - *py; + y = *px; + *px = x; + *py = y; + break; + case 2: /* landscape right */ + x = *py; + y = 240 - *px; + *px = x; + *py = y; + break; + } +} + +#endif diff --git a/backends/wince/screen.h b/backends/wince/screen.h new file mode 100644 index 0000000000..c7eb2b3af5 --- /dev/null +++ b/backends/wince/screen.h @@ -0,0 +1,58 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +/* Original code by Vasyl Tsvirkunov */ + +#ifndef SCREEN_H +#define SCREEN_H + +#ifndef UBYTE +#define UBYTE unsigned char +#endif + +void SetScreenGeometry(int w, int h); +void LimitScreenGeometry(); +void RestoreScreenGeometry(); +int GraphicsOn(HWND hWndMain); +void GraphicsOff(); +void GraphicsSuspend(); +void GraphicsResume(); + +void SetPalEntry(int ent, UBYTE r, UBYTE g, UBYTE b); +void Blt(UBYTE * scr_ptr); + +/* meaning: 0 - portrait, 1 - left hand landscape, 2 - right hand landscape */ +void SetScreenMode(int mode); +int GetScreenMode(); +void drawWait(); + +void Translate(int* x, int* y); + +typedef enum ToolbarSelected { + ToolbarNone, + ToolbarSaveLoad, + ToolbarMode, + ToolbarSkip, + ToolbarSound +} ToolbarSelected; + + +#endif diff --git a/backends/x11/x11.cpp b/backends/x11/x11.cpp new file mode 100644 index 0000000000..2ebbe96193 --- /dev/null +++ b/backends/x11/x11.cpp @@ -0,0 +1,990 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +/* The bare pure X11 port done by Lionel 'BBrox' Ulmer */ + +#include "stdafx.h" +#include "scumm.h" +#include "mididrv.h" +#include "gameDetector.h" + +#include +#include + +#include +#include + +#include +#include +#include +#ifdef USE_XV_SCALING +#include +#include +#endif +#include + +#include +#include + +#include +#include +#include +#include + +class OSystem_X11:public OSystem { +public: + // Set colors of the palette + void set_palette(const byte *colors, uint start, uint num); + + // Set the size of the video bitmap. + // Typically, 320x200 + void init_size(uint w, uint h); + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); + + // Update the dirty areas of the screen + void update_screen(); + + // Either show or hide the mouse cursor + bool show_mouse(bool visible); + + // Set the position of the mouse cursor + void set_mouse_pos(int x, int y); + + // Set the bitmap that's used when drawing the cursor. + void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + + // Shaking is used in SCUMM. Set current shake position. + void set_shake_pos(int shake_pos); + + // Get the number of milliseconds since the program was started. + uint32 get_msecs(); + + // Delay for a specified amount of milliseconds + void delay_msecs(uint msecs); + + // Create a thread + void *create_thread(ThreadProc *proc, void *param); + + // Get the next event. + // Returns true if an event was retrieved. + bool poll_event(Event *event); + + // Set function that generates samples + bool set_sound_proc(void *param, SoundProc *proc, byte sound); + + // Poll cdrom status + // Returns true if cd audio is playing + bool poll_cdrom(); + + // Play cdrom audio track + void play_cdrom(int track, int num_loops, int start_frame, int end_frame); + + // Stop cdrom audio track + void stop_cdrom(); + + // Update cdrom audio status + void update_cdrom(); + + // Quit + void quit(); + + // Set a parameter + uint32 property(int param, Property *value); + + // Add a callback timer + void set_timer(int timer, int (*callback) (int)); + + // Mutex handling + void *create_mutex(void); + void lock_mutex(void *mutex); + void unlock_mutex(void *mutex); + void delete_mutex(void *mutex); + + static OSystem *create(int gfx_mode, bool full_screen); + +private: + OSystem_X11(); + + typedef struct { + int x, y, w, h; + } dirty_square; + + void create_empty_cursor(); + void undraw_mouse(); + void draw_mouse(); + void update_screen_helper(const dirty_square * d, dirty_square * dout); + + unsigned char *local_fb; + + int window_width, window_height; + int fb_width, fb_height; + int scumm_x, scumm_y; + +#ifdef USE_XV_SCALING + unsigned int *palette; +#else + unsigned short *palette; +#endif + bool _palette_changed; + Display *display; + int screen; + Window window; + GC black_gc; +#ifdef USE_XV_SCALING + XvImage *image; +#else + XImage *image; +#endif + pthread_t sound_thread; + + int fake_right_mouse; + int report_presses; + int current_shake_pos; + int new_shake_pos; + struct timeval start_time; + + enum { + MAX_NUMBER_OF_DIRTY_SQUARES = 32, + BAK_WIDTH = 40, + BAK_HEIGHT = 40 + }; + dirty_square ds[MAX_NUMBER_OF_DIRTY_SQUARES]; + int num_of_dirty_square; + + typedef struct { + int x, y; + int w, h; + int hot_x, hot_y; + } mouse_state; + mouse_state old_state, cur_state; + const byte *_ms_buf; + byte _ms_backup[BAK_WIDTH * BAK_HEIGHT]; + bool _mouse_drawn; + bool _mouse_visible; + + unsigned int _timer_duration, _timer_next_expiry; + bool _timer_active; + int (*_timer_callback) (int); +}; + +typedef struct { + OSystem::SoundProc *sound_proc; + void *param; + byte format; +} THREAD_PARAM; + +#undef CAPTURE_SOUND + +#define FRAG_SIZE 4096 +static void *sound_and_music_thread(void *params) +{ + /* Init sound */ + int sound_fd, param, frag_size; + unsigned char sound_buffer[FRAG_SIZE]; + OSystem::SoundProc *sound_proc = ((THREAD_PARAM *) params)->sound_proc; + void *proc_param = ((THREAD_PARAM *) params)->param; + +#ifdef CAPTURE_SOUND + FILE *f = fopen("sound.raw", "wb"); +#endif + + sound_fd = open("/dev/dsp", O_WRONLY); + audio_buf_info info; + if (sound_fd < 0) { + error("Error opening sound device !\n"); + exit(1); + } + param = 0; + frag_size = FRAG_SIZE /* audio fragment size */ ; + while (frag_size) { + frag_size >>= 1; + param++; + } + param--; + param |= /* audio_fragment_num */ 3 << 16; + if (ioctl(sound_fd, SNDCTL_DSP_SETFRAGMENT, ¶m) != 0) { + error("Error in the SNDCTL_DSP_SETFRAGMENT ioctl !\n"); + exit(1); + } + param = AFMT_S16_LE; + if (ioctl(sound_fd, SNDCTL_DSP_SETFMT, ¶m) == -1) { + perror("Error in the SNDCTL_DSP_SETFMT ioctl !\n"); + exit(1); + } + if (param != AFMT_S16_LE) { + error("AFMT_S16_LE not supported !\n"); + exit(1); + } + param = 2; + if (ioctl(sound_fd, SNDCTL_DSP_CHANNELS, ¶m) == -1) { + error("Error in the SNDCTL_DSP_CHANNELS ioctl !\n"); + exit(1); + } + if (param != 2) { + error("Stereo mode not supported !\n"); + exit(1); + } + param = 22050; + if (ioctl(sound_fd, SNDCTL_DSP_SPEED, ¶m) == -1) { + perror("Error in the SNDCTL_DSP_SPEED ioctl !\n"); + exit(1); + } + if (param != 22050) { + error("22050 kHz not supported !\n"); + exit(1); + } + if (ioctl(sound_fd, SNDCTL_DSP_GETOSPACE, &info) != 0) { + perror("SNDCTL_DSP_GETOSPACE"); + exit(-1); + } + + sched_yield(); + while (1) { + unsigned char *buf = (unsigned char *)sound_buffer; + int size, written; + + sound_proc(proc_param, (byte *)sound_buffer, FRAG_SIZE); +#ifdef CAPTURE_SOUND + fwrite(buf, 2, FRAG_SIZE >> 1, f); + fflush(f); +#endif + size = FRAG_SIZE; + while (size > 0) { + written = write(sound_fd, buf, size); + buf += written; + size -= written; + } + } + + return NULL; +} + +/* Function used to hide the mouse cursor */ +void OSystem_X11::create_empty_cursor() +{ + XColor bg; + Pixmap pixmapBits; + Cursor cursor = None; + static const char data[] = { 0 }; + + bg.red = bg.green = bg.blue = 0x0000; + pixmapBits = XCreateBitmapFromData(display, XRootWindow(display, screen), data, 1, 1); + if (pixmapBits) { + cursor = XCreatePixmapCursor(display, pixmapBits, pixmapBits, &bg, &bg, 0, 0); + XFreePixmap(display, pixmapBits); + } + XDefineCursor(display, window, cursor); +} + +OSystem *OSystem_X11_create(void) +{ + return OSystem_X11::create(0, 0); +} + +OSystem *OSystem_X11::create(int gfx_mode, bool full_screen) +{ + OSystem_X11 *syst = new OSystem_X11(); + return syst; +} + +OSystem_X11::OSystem_X11() +{ + char buf[512]; + XWMHints *wm_hints; + XGCValues values; + XTextProperty window_name; + char *name = (char *)&buf; + + /* Some members initialization */ + fake_right_mouse = 0; + report_presses = 1; + current_shake_pos = 0; + new_shake_pos = 0; + _palette_changed = false; + num_of_dirty_square = MAX_NUMBER_OF_DIRTY_SQUARES; + + /* For the window title */ + sprintf(buf, "ScummVM"); + + display = XOpenDisplay(NULL); + if (display == NULL) { + error("Could not open display !\n"); + exit(1); + } + screen = DefaultScreen(display); + + window_width = 320; + window_height = 200; + scumm_x = 0; + scumm_y = 0; + window = XCreateSimpleWindow(display, XRootWindow(display, screen), 0, 0, 320, 200, 0, 0, 0); + wm_hints = XAllocWMHints(); + if (wm_hints == NULL) { + error("Not enough memory to allocate Hints !\n"); + exit(1); + } + wm_hints->flags = InputHint | StateHint; + wm_hints->input = True; + wm_hints->initial_state = NormalState; + XStringListToTextProperty(&name, 1, &window_name); + XSetWMProperties(display, window, &window_name, &window_name, + NULL /* argv */ , 0 /* argc */ , NULL /* size hints */ , + wm_hints, NULL /* class hints */ ); + XFree(wm_hints); + + XSelectInput(display, window, + ExposureMask | KeyPressMask | KeyReleaseMask | + PointerMotionMask | ButtonPressMask | ButtonReleaseMask | StructureNotifyMask); + + values.foreground = BlackPixel(display, screen); + black_gc = XCreateGC(display, window, GCForeground, &values); + + XMapWindow(display, window); + XFlush(display); + + while (1) { + XEvent event; + XNextEvent(display, &event); + switch (event.type) { + case Expose: + goto out_of_loop; + } + } +out_of_loop: + create_empty_cursor(); + + /* Initialize the timer routines */ + _timer_active = false; + + /* And finally start the local timer */ + gettimeofday(&start_time, NULL); +} + +uint32 OSystem_X11::get_msecs() +{ + struct timeval current_time; + gettimeofday(¤t_time, NULL); + return (uint32)(((current_time.tv_sec - start_time.tv_sec) * 1000) + + ((current_time.tv_usec - start_time.tv_usec) / 1000)); +} + +void OSystem_X11::init_size(uint w, uint h) +{ + static XShmSegmentInfo shminfo; + + fb_width = w; + fb_height = h; + + if ((fb_width != 320) || (fb_height != 200)) { + /* We need to change the size of the X11 window */ + XWindowChanges new_values; + + new_values.width = fb_width; + new_values.height = fb_height; + + XConfigureWindow(display, window, CWWidth | CWHeight, &new_values); + } +#ifdef USE_XV_SCALING + image = XvShmCreateImage(display, 65, 0x03, 0, fb_width, fb_height, &shminfo); + shminfo.shmid = shmget(IPC_PRIVATE, image->data_size, IPC_CREAT | 0700); +#else + image = + XShmCreateImage(display, DefaultVisual(display, screen), 16, ZPixmap, NULL, &shminfo, fb_width, + fb_height); + shminfo.shmid = shmget(IPC_PRIVATE, fb_width * fb_height * 2, IPC_CREAT | 0700); +#endif + shminfo.shmaddr = (char *)shmat(shminfo.shmid, 0, 0); + image->data = shminfo.shmaddr; + shminfo.readOnly = False; + if (XShmAttach(display, &shminfo) == 0) { + error("Could not attach shared memory segment !\n"); + exit(1); + } + shmctl(shminfo.shmid, IPC_RMID, 0); + + /* Initialize the 'local' frame buffer and the palette */ + local_fb = (unsigned char *)calloc(fb_width * fb_height, sizeof(unsigned char)); +#ifdef USE_XV_SCALING + palette = (unsigned int *)calloc(256, sizeof(unsigned int)); +#else + palette = (unsigned short *)calloc(256, sizeof(unsigned short)); +#endif +} + +bool OSystem_X11::set_sound_proc(void *param, SoundProc *proc, byte format) +{ + static THREAD_PARAM thread_param; + + /* And finally start the music thread */ + thread_param.param = param; + thread_param.sound_proc = proc; + thread_param.format = format; + + if (format == SOUND_16BIT) + pthread_create(&sound_thread, NULL, sound_and_music_thread, (void *)&thread_param); + else + warning("Only support 16 bit sound for now. Disabling sound "); + + return true; +} + +void OSystem_X11::set_palette(const byte *colors, uint start, uint num) +{ + const byte *data = colors; +#ifdef USE_XV_SCALING + unsigned int *pal = &(palette[start]); +#else + unsigned short *pal = &(palette[start]); +#endif + + do { +#ifdef USE_XV_SCALING + *pal++ = (data[0] << 16) | (data[1] << 8) | data[2]; +#else + *pal++ = ((data[0] & 0xF8) << 8) | ((data[1] & 0xFC) << 3) | (data[2] >> 3); +#endif + data += 4; + num--; + } while (num > 0); + + _palette_changed = true; +} + +#define AddDirtyRec(xi,yi,wi,hi) \ + if (num_of_dirty_square < MAX_NUMBER_OF_DIRTY_SQUARES) { \ + ds[num_of_dirty_square].x = xi; \ + ds[num_of_dirty_square].y = yi; \ + ds[num_of_dirty_square].w = wi; \ + ds[num_of_dirty_square].h = hi; \ + num_of_dirty_square++; \ + } + +void OSystem_X11::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) +{ + unsigned char *dst; + + if (y < 0) { + h += y; + buf -= y * pitch; + y = 0; + } + if (h > (fb_height - y)) { + h = fb_height - y; + } + + dst = local_fb + fb_width * y + x; + + if (h <= 0) + return; + + if (_mouse_drawn) + undraw_mouse(); + + AddDirtyRec(x, y, w, h); + while (h-- > 0) { + memcpy(dst, buf, w); + dst += fb_width; + buf += pitch; + } +} + +void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * dout) +{ + int x, y; + unsigned char *ptr_src = local_fb + (fb_width * d->y) + d->x; +#ifdef USE_XV_SCALING + unsigned int *ptr_dst = ((unsigned int *)image->data) + (fb_width * d->y) + d->x; +#else + unsigned short *ptr_dst = ((unsigned short *)image->data) + (fb_width * d->y) + d->x; +#endif + + for (y = 0; y < d->h; y++) { + for (x = 0; x < d->w; x++) { + *ptr_dst++ = palette[*ptr_src++]; + } + ptr_dst += fb_width - d->w; + ptr_src += fb_width - d->w; + } + if (d->x < dout->x) + dout->x = d->x; + if (d->y < dout->y) + dout->y = d->y; + if ((d->x + d->w) > dout->w) + dout->w = d->x + d->w; + if ((d->y + d->h) > dout->h) + dout->h = d->y + d->h; +} + +void OSystem_X11::update_screen() +{ + bool full_redraw = false; + bool need_redraw = false; + static const dirty_square ds_full = { 0, 0, fb_width, fb_height }; + dirty_square dout = { fb_width, fb_height, 0, 0 }; + + /* First make sure the mouse is drawn, if it should be drawn. */ + draw_mouse(); + + if (_palette_changed) { + full_redraw = true; + num_of_dirty_square = 0; + _palette_changed = false; + } else if (num_of_dirty_square >= MAX_NUMBER_OF_DIRTY_SQUARES) { + full_redraw = true; + num_of_dirty_square = 0; + } + + if (full_redraw) { + update_screen_helper(&ds_full, &dout); + need_redraw = true; + } else if (num_of_dirty_square > 0) { + need_redraw = true; + while (num_of_dirty_square > 0) { + num_of_dirty_square--; + update_screen_helper(&(ds[num_of_dirty_square]), &dout); + } + } + + if (current_shake_pos != new_shake_pos) { + /* Redraw first the 'black borders' in case of resize */ + if (current_shake_pos < new_shake_pos) + XFillRectangle(display, window, black_gc, 0, current_shake_pos, window_width, new_shake_pos); + else + XFillRectangle(display, window, black_gc, 0, window_height - current_shake_pos, + window_width, window_height - new_shake_pos); +#ifndef USE_XV_SCALING + XShmPutImage(display, window, DefaultGC(display, screen), image, + 0, 0, scumm_x, scumm_y + new_shake_pos, fb_width, fb_height, 0); +#endif + current_shake_pos = new_shake_pos; + } else if (need_redraw == true) { +#ifdef USE_XV_SCALING + XvShmPutImage(display, 65, window, DefaultGC(display, screen), image, + 0, 0, fb_width, fb_height, 0, 0, window_width, window_height, 0); +#else + XShmPutImage(display, window, DefaultGC(display, screen), image, + dout.x, dout.y, scumm_x + dout.x, scumm_y + dout.y + current_shake_pos, + dout.w - dout.x, dout.h - dout.y, 0); +#endif + XFlush(display); + } +} + +bool OSystem_X11::show_mouse(bool visible) +{ + if (_mouse_visible == visible) + return visible; + + bool last = _mouse_visible; + _mouse_visible = visible; + + if (visible) + draw_mouse(); + else + undraw_mouse(); + + return last; +} + +void OSystem_X11::quit() +{ + exit(1); +} + +void OSystem_X11::draw_mouse() +{ + if (_mouse_drawn || !_mouse_visible) + return; + _mouse_drawn = true; + + int xdraw = cur_state.x - cur_state.hot_x; + int ydraw = cur_state.y - cur_state.hot_y; + int w = cur_state.w; + int h = cur_state.h; + int real_w; + int real_h; + int real_h_2; + + byte *dst; + byte *dst2; + const byte *buf = _ms_buf; + byte *bak = _ms_backup; + + assert(w <= BAK_WIDTH && h <= BAK_HEIGHT); + + if (ydraw < 0) { + real_h = h + ydraw; + buf += (-ydraw) * w; + ydraw = 0; + } else { + real_h = (ydraw + h) > fb_height ? (fb_height - ydraw) : h; + } + if (xdraw < 0) { + real_w = w + xdraw; + buf += (-xdraw); + xdraw = 0; + } else { + real_w = (xdraw + w) > fb_width ? (fb_width - xdraw) : w; + } + + dst = local_fb + (ydraw * fb_width) + xdraw; + dst2 = dst; + + if ((real_h == 0) || (real_w == 0)) { + _mouse_drawn = false; + return; + } + + AddDirtyRec(xdraw, ydraw, real_w, real_h); + old_state.x = xdraw; + old_state.y = ydraw; + old_state.w = real_w; + old_state.h = real_h; + + real_h_2 = real_h; + while (real_h_2 > 0) { + memcpy(bak, dst, real_w); + bak += BAK_WIDTH; + dst += fb_width; + real_h_2--; + } + while (real_h > 0) { + int width = real_w; + while (width > 0) { + byte color = *buf; + if (color != 0xFF) { + *dst2 = color; + } + buf++; + dst2++; + width--; + } + buf += w - real_w; + dst2 += fb_width - real_w; + real_h--; + } +} + +void OSystem_X11::undraw_mouse() +{ + if (!_mouse_drawn) + return; + _mouse_drawn = false; + + int old_h = old_state.h; + + AddDirtyRec(old_state.x, old_state.y, old_state.w, old_state.h); + + byte *dst = local_fb + (old_state.y * fb_width) + old_state.x; + byte *bak = _ms_backup; + + while (old_h > 0) { + memcpy(dst, bak, old_state.w); + bak += BAK_WIDTH; + dst += fb_width; + old_h--; + } +} + +void OSystem_X11::set_mouse_pos(int x, int y) +{ + if ((x != cur_state.x) || (y != cur_state.y)) { + cur_state.x = x; + cur_state.y = y; + undraw_mouse(); + } +} + +void OSystem_X11::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) +{ + cur_state.w = w; + cur_state.h = h; + cur_state.hot_x = hotspot_x; + cur_state.hot_y = hotspot_y; + _ms_buf = (byte *)buf; + + undraw_mouse(); +} + +void OSystem_X11::set_shake_pos(int shake_pos) +{ + new_shake_pos = shake_pos; +} + +void *OSystem_X11::create_thread(ThreadProc *proc, void *param) +{ + pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); + if (pthread_create(thread, NULL, (void *(*)(void *))proc, param)) + return NULL; + else + return thread; +} + +uint32 OSystem_X11::property(int param, Property *value) +{ + switch (param) { + case PROP_GET_SAMPLE_RATE: + return 22050; + case PROP_GET_FULLSCREEN: + return 0; + } + warning("Property not implemented yet (%d) ", param); + return 0; +} + +bool OSystem_X11::poll_cdrom() +{ + return false; +} + +void OSystem_X11::play_cdrom(int track, int num_loops, int start_frame, int end_frame) +{ +} + +void OSystem_X11::stop_cdrom() +{ +} + +void OSystem_X11::update_cdrom() +{ +} + +void OSystem_X11::delay_msecs(uint msecs) +{ + usleep(msecs * 1000); +} + +bool OSystem_X11::poll_event(Event *scumm_event) +{ + /* First, handle timers */ + uint32 current_msecs = get_msecs(); + + if (_timer_active && (current_msecs >= _timer_next_expiry)) { + _timer_duration = _timer_callback(_timer_duration); + _timer_next_expiry = current_msecs + _timer_duration; + } + + while (XPending(display)) { + XEvent event; + + XNextEvent(display, &event); + switch (event.type) { + case Expose:{ + int real_w, real_h; + int real_x, real_y; + real_x = event.xexpose.x; + real_y = event.xexpose.y; + real_w = event.xexpose.width; + real_h = event.xexpose.height; + if (real_x < scumm_x) { + real_w -= scumm_x - real_x; + real_x = 0; + } else { + real_x -= scumm_x; + } + if (real_y < scumm_y) { + real_h -= scumm_y - real_y; + real_y = 0; + } else { + real_y -= scumm_y; + } + if ((real_h <= 0) || (real_w <= 0)) + break; + if ((real_x >= fb_width) || (real_y >= fb_height)) + break; + + if ((real_x + real_w) >= fb_width) { + real_w = fb_width - real_x; + } + if ((real_y + real_h) >= fb_height) { + real_h = fb_height - real_y; + } + + /* Compute the intersection of the expose event with the real ScummVM display zone */ + AddDirtyRec(real_x, real_y, real_w, real_h); + } + break; + + case KeyPress: + switch (event.xkey.keycode) { + case 132: + report_presses = 0; + break; + + case 133: + fake_right_mouse = 1; + break; + } + break; + + case KeyRelease:{ + /* I am using keycodes here and NOT keysyms to be sure that even if the user + remaps his iPAQ's keyboard, it will still work. + */ + int keycode = -1; + int ascii = -1; + byte mode = 0; + + if (event.xkey.state & 0x01) + mode |= KBD_SHIFT; + if (event.xkey.state & 0x04) + mode |= KBD_CTRL; + if (event.xkey.state & 0x08) + mode |= KBD_ALT; + switch (event.xkey.keycode) { + case 9: /* Escape on my PC */ + case 130: /* Calendar on the iPAQ */ + keycode = 27; + break; + + case 71: /* F5 on my PC */ + case 128: /* Record on the iPAQ */ + keycode = 319; + break; + + case 65: /* Space on my PC */ + case 131: /* Schedule on the iPAQ */ + keycode = 32; + break; + + case 132: /* 'Q' on the iPAQ */ + report_presses = 1; + break; + + case 133: /* Arrow on the iPAQ */ + fake_right_mouse = 0; + break; + + default:{ + KeySym xsym; + xsym = XKeycodeToKeysym(display, event.xkey.keycode, 0); + keycode = xsym; + if ((xsym >= 'a') && (xsym <= 'z') && (event.xkey.state & 0x01)) + xsym &= ~0x20; /* Handle shifted keys */ + ascii = xsym; + } + } + if (keycode != -1) { + scumm_event->event_code = EVENT_KEYDOWN; + scumm_event->kbd.keycode = keycode; + scumm_event->kbd.ascii = (ascii != -1 ? ascii : keycode); + scumm_event->kbd.flags = mode; + return true; + } + } + break; + + case ButtonPress: + if (report_presses != 0) { + if (event.xbutton.button == 1) { + if (fake_right_mouse == 0) { + scumm_event->event_code = EVENT_LBUTTONDOWN; + } else { + scumm_event->event_code = EVENT_RBUTTONDOWN; + } + } else if (event.xbutton.button == 3) + scumm_event->event_code = EVENT_RBUTTONDOWN; + scumm_event->mouse.x = event.xbutton.x - scumm_x; + scumm_event->mouse.y = event.xbutton.y - scumm_y; + return true; + } + break; + + case ButtonRelease: + if (report_presses != 0) { + if (event.xbutton.button == 1) { + if (fake_right_mouse == 0) { + scumm_event->event_code = EVENT_LBUTTONUP; + } else { + scumm_event->event_code = EVENT_RBUTTONUP; + } + } else if (event.xbutton.button == 3) + scumm_event->event_code = EVENT_RBUTTONUP; + scumm_event->mouse.x = event.xbutton.x - scumm_x; + scumm_event->mouse.y = event.xbutton.y - scumm_y; + return true; + } + break; + + case MotionNotify: + scumm_event->event_code = EVENT_MOUSEMOVE; + scumm_event->mouse.x = event.xmotion.x - scumm_x; + scumm_event->mouse.y = event.xmotion.y - scumm_y; + return true; + + case ConfigureNotify:{ + if ((window_width != event.xconfigure.width) || (window_height != event.xconfigure.height)) { + window_width = event.xconfigure.width; + window_height = event.xconfigure.height; + scumm_x = (window_width - fb_width) / 2; + scumm_y = (window_height - fb_height) / 2; + XFillRectangle(display, window, black_gc, 0, 0, window_width, window_height); + } + } + break; + + default: + printf("Unhandled event : %d\n", event.type); + break; + } + } + + return false; +} + +void OSystem_X11::set_timer(int timer, int (*callback) (int)) +{ + if (callback != NULL) { + _timer_duration = timer; + _timer_next_expiry = get_msecs() + timer; + _timer_callback = callback; + _timer_active = true; + } else { + _timer_active = false; + } +} + +void *OSystem_X11::create_mutex(void) +{ + pthread_mutex_t *mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); + pthread_mutex_init(mutex, NULL); + return (void *)mutex; +} + +void OSystem_X11::lock_mutex(void *mutex) +{ + pthread_mutex_lock((pthread_mutex_t *) mutex); +} + +void OSystem_X11::unlock_mutex(void *mutex) +{ + pthread_mutex_unlock((pthread_mutex_t *) mutex); +} + +void OSystem_X11::delete_mutex(void *mutex) +{ + pthread_mutex_destroy((pthread_mutex_t *) mutex); + free(mutex); +} diff --git a/boxes.cpp b/boxes.cpp deleted file mode 100644 index f8d68dca98..0000000000 --- a/boxes.cpp +++ /dev/null @@ -1,1039 +0,0 @@ - /* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" - -#include - -#if !defined(__GNUC__) - #pragma START_PACK_STRUCTS -#endif - -struct Box { /* Internal walkbox file format */ - int16 ulx, uly; - int16 urx, ury; - int16 lrx, lry; - int16 llx, lly; - byte mask; - byte flags; - uint16 scale; -} GCC_PACK; - -#if !defined(__GNUC__) - #pragma END_PACK_STRUCTS -#endif - -struct PathNode { /* Linked list of walkpath nodes */ - uint index; - struct PathNode *left, *right; -}; - -struct PathVertex { /* Linked list of walkpath nodes */ - PathNode *left; - PathNode *right; -}; - -#define BOX_MATRIX_SIZE 2000 - - -PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node); - - -byte Scumm::getMaskFromBox(int box) -{ - Box *ptr = getBoxBaseAddr(box); - if (!ptr) - return 0; - - return ptr->mask; -} - -void Scumm::setBoxFlags(int box, int val) -{ - debug(2, "setBoxFlags(%d, 0x%02x)", box, val); - - /* FULL_THROTTLE stuff */ - if (val & 0xC000) { - assert(box >= 0 && box < 65); - _extraBoxFlags[box] = val; - } else { - Box *b = getBoxBaseAddr(box); - b->flags = val; - } -} - -byte Scumm::getBoxFlags(int box) -{ - Box *ptr = getBoxBaseAddr(box); - if (!ptr) - return 0; - return ptr->flags; -} - -void Scumm::setBoxScale(int box, int scale) -{ - Box *b = getBoxBaseAddr(box); - b->scale = scale; -} - -int Scumm::getBoxScale(int box) -{ - if (_features & GF_NO_SCALLING) - return (255); - Box *ptr = getBoxBaseAddr(box); - if (!ptr) - return 255; - return FROM_LE_16(ptr->scale); -} - -byte Scumm::getNumBoxes() -{ - byte *ptr = getResourceAddress(rtMatrix, 2); - if (!ptr) - return 0; - return ptr[0]; -} - -Box *Scumm::getBoxBaseAddr(int box) -{ - byte *ptr = getResourceAddress(rtMatrix, 2); - if (!ptr) - return NULL; - checkRange(ptr[0] - 1, 0, box, "Illegal box %d"); - if (_features & GF_SMALL_HEADER) { - if (_features & GF_OLD256) - return (Box *)(ptr + box * (SIZEOF_BOX - 2) + 1); - else - return (Box *)(ptr + box * SIZEOF_BOX + 1); - } else - return (Box *)(ptr + box * SIZEOF_BOX + 2); -} - -int Scumm::getSpecialBox(int param1, int param2) -{ - int i; - int numOfBoxes; - byte flag; - - numOfBoxes = getNumBoxes() - 1; - - for (i = numOfBoxes; i >= 0; i--) { - flag = getBoxFlags(i); - - if (!(flag & kBoxInvisible) && (flag & kBoxPlayerOnly)) - return (-1); - - if (checkXYInBoxBounds(i, param1, param2)) - return (i); - } - - return (-1); -} - -bool Scumm::checkXYInBoxBounds(int b, int x, int y) -{ - BoxCoords box; - - if (b == 0 && (!(_features & GF_SMALL_HEADER))) - return false; - - getBoxCoordinates(b, &box); - - if (x < box.ul.x && x < box.ur.x && x < box.lr.x && x < box.ll.x) - return false; - - if (x > box.ul.x && x > box.ur.x && x > box.lr.x && x > box.ll.x) - return false; - - if (y < box.ul.y && y < box.ur.y && y < box.lr.y && y < box.ll.y) - return false; - - if (y > box.ul.y && y > box.ur.y && y > box.lr.y && y > box.ll.y) - return false; - - if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y || - box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) { - - ScummPoint pt; - pt = closestPtOnLine(box.ul.x, box.ul.y, box.lr.x, box.lr.y, x, y); - if (distanceFromPt(x, y, pt.x, pt.y) <= 4) - return true; - } - - if (!compareSlope(box.ul.x, box.ul.y, box.ur.x, box.ur.y, x, y)) - return false; - - if (!compareSlope(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y)) - return false; - - if (!compareSlope(box.ll.x, box.ll.y, x, y, box.lr.x, box.lr.y)) - return false; - - if (!compareSlope(box.ul.x, box.ul.y, x, y, box.ll.x, box.ll.y)) - return false; - - return true; -} - -void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) -{ - Box *bp = getBoxBaseAddr(boxnum); - - box->ul.x = (int16)FROM_LE_16(bp->ulx); - box->ul.y = (int16)FROM_LE_16(bp->uly); - box->ur.x = (int16)FROM_LE_16(bp->urx); - box->ur.y = (int16)FROM_LE_16(bp->ury); - - box->ll.x = (int16)FROM_LE_16(bp->llx); - box->ll.y = (int16)FROM_LE_16(bp->lly); - box->lr.x = (int16)FROM_LE_16(bp->lrx); - box->lr.y = (int16)FROM_LE_16(bp->lry); -} - -uint Scumm::distanceFromPt(int x, int y, int ptx, int pty) -{ - int diffx, diffy; - - diffx = abs(ptx - x); - - if (diffx >= 0x100) - return 0xFFFF; - - diffy = abs(pty - y); - - if (diffy >= 0x100) - return 0xFFFF; - diffx *= diffx; - diffy *= diffy; - return diffx + diffy; -} - -ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) -{ - int lydiff, lxdiff; - int32 dist, a, b, c; - int x2, y2; - ScummPoint pt; - - if (llx == ulx) { // Vertical line? - x2 = ulx; - y2 = y; - } else if (lly == uly) { // Horizontal line? - x2 = x; - y2 = uly; - } else { - lydiff = lly - uly; - - lxdiff = llx - ulx; - - if (abs(lxdiff) > abs(lydiff)) { - dist = lxdiff * lxdiff + lydiff * lydiff; - - a = ulx * lydiff / lxdiff; - b = x * lxdiff / lydiff; - - c = (a + b - uly + y) * lydiff * lxdiff / dist; - - x2 = c; - y2 = c * lydiff / lxdiff - a + uly; - } else { - dist = lydiff * lydiff + lxdiff * lxdiff; - - a = uly * lxdiff / lydiff; - b = y * lydiff / lxdiff; - - c = (a + b - ulx + x) * lydiff * lxdiff / dist; - - y2 = c; - x2 = c * lxdiff / lydiff - a + ulx; - } - } - - lxdiff = llx - ulx; - lydiff = lly - uly; - - if (abs(lydiff) < abs(lxdiff)) { - if (lxdiff > 0) { - if (x2 < ulx) { - type1:; - x2 = ulx; - y2 = uly; - } else if (x2 > llx) { - type2:; - x2 = llx; - y2 = lly; - } - } else { - if (x2 > ulx) - goto type1; - if (x2 < llx) - goto type2; - } - } else { - if (lydiff > 0) { - if (y2 < uly) - goto type1; - if (y2 > lly) - goto type2; - } else { - if (y2 > uly) - goto type1; - if (y2 < lly) - goto type2; - } - } - - pt.x = x2; - pt.y = y2; - return pt; -} - -bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) -{ - int t; - BoxCoords box; - - getBoxCoordinates(b, &box); - - if (threshold == 0) - return true; - - t = x - threshold; - if (t > box.ul.x && t > box.ur.x && t > box.lr.x && t > box.ll.x) - return false; - - t = x + threshold; - if (t < box.ul.x && t < box.ur.x && t < box.lr.x && t < box.ll.x) - return false; - - t = y - threshold; - if (t > box.ul.y && t > box.ur.y && t > box.lr.y && t > box.ll.y) - return false; - - t = y + threshold; - if (t < box.ul.y && t < box.ur.y && t < box.lr.y && t < box.ll.y) - return false; - - return true; -} - -AdjustBoxResult Scumm::getClosestPtOnBox(int b, int x, int y) -{ - ScummPoint pt; - AdjustBoxResult best; - uint dist; - uint bestdist = (uint) 0xFFFF; - BoxCoords box; - - getBoxCoordinates(b, &box); - - pt = closestPtOnLine(box.ul.x, box.ul.y, box.ur.x, box.ur.y, x, y); - dist = distanceFromPt(x, y, pt.x, pt.y); - if (dist < bestdist) { - bestdist = dist; - best.x = pt.x; - best.y = pt.y; - } - - pt = closestPtOnLine(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y); - dist = distanceFromPt(x, y, pt.x, pt.y); - if (dist < bestdist) { - bestdist = dist; - best.x = pt.x; - best.y = pt.y; - } - - pt = closestPtOnLine(box.lr.x, box.lr.y, box.ll.x, box.ll.y, x, y); - dist = distanceFromPt(x, y, pt.x, pt.y); - if (dist < bestdist) { - bestdist = dist; - best.x = pt.x; - best.y = pt.y; - } - - pt = closestPtOnLine(box.ll.x, box.ll.y, box.ul.x, box.ul.y, x, y); - dist = distanceFromPt(x, y, pt.x, pt.y); - if (dist < bestdist) { - bestdist = dist; - best.x = pt.x; - best.y = pt.y; - } - - best.dist = bestdist; - return best; -} - -byte *Scumm::getBoxMatrixBaseAddr() -{ - byte *ptr = getResourceAddress(rtMatrix, 1); - if (*ptr == 0xFF) - ptr++; - return ptr; -} - -/* - * Compute if there is a way that connects box 'from' with box 'to'. - * Returns the number of a box adjactant to 'from' that is the next on the - * way to 'to' (this can be 'to' itself or a third box). - * If there is no connection -1 is return. - */ -int Scumm::getPathToDestBox(byte from, byte to) -{ - byte *boxm; - byte i; - int dest = -1; - - if (from == to) - return to; - - boxm = getBoxMatrixBaseAddr(); - - i = 0; - while (i != from) { - while (*boxm != 0xFF) - boxm += 3; - i++; - boxm++; - } - - while (boxm[0] != 0xFF) { - if (boxm[0] <= to && boxm[1] >= to) - dest = boxm[2]; - boxm += 3; - } - return dest; -} - -/* - * Computes the next point actor a has to walk towards in a straight - * line in order to get from box1 to box3 via box2. - */ -bool Scumm::findPathTowards(Actor *a, byte box1nr, byte box2nr, byte box3nr, int16 &foundPathX, int16 &foundPathY) -{ - BoxCoords box1; - BoxCoords box2; - ScummPoint tmp; - int i, j; - int flag; - int q, pos; - - getBoxCoordinates(box1nr, &box1); - getBoxCoordinates(box2nr, &box2); - - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - if (box1.ul.x == box1.ur.x && box1.ul.x == box2.ul.x && box1.ul.x == box2.ur.x) { - flag = 0; - if (box1.ul.y > box1.ur.y) { - SWAP(box1.ul.y, box1.ur.y); - flag |= 1; - } - - if (box2.ul.y > box2.ur.y) { - SWAP(box2.ul.y, box2.ur.y); - flag |= 2; - } - - if (box1.ul.y > box2.ur.y || box2.ul.y > box1.ur.y || - (box1.ur.y == box2.ul.y || box2.ur.y == box1.ul.y) && - box1.ul.y != box1.ur.y && box2.ul.y != box2.ur.y) { - if (flag & 1) - SWAP(box1.ul.y, box1.ur.y); - if (flag & 2) - SWAP(box2.ul.y, box2.ur.y); - } else { - pos = a->y; - if (box2nr == box3nr) { - int diffX = a->walkdata.destx - a->x; - int diffY = a->walkdata.desty - a->y; - int boxDiffX = box1.ul.x - a->x; - - if (diffX != 0) { - int t; - - diffY *= boxDiffX; - t = diffY / diffX; - if (t == 0 && (diffY <= 0 || diffX <= 0) - && (diffY >= 0 || diffX >= 0)) - t = -1; - pos = a->y + t; - } - } - - q = pos; - if (q < box2.ul.y) - q = box2.ul.y; - if (q > box2.ur.y) - q = box2.ur.y; - if (q < box1.ul.y) - q = box1.ul.y; - if (q > box1.ur.y) - q = box1.ur.y; - if (q == pos && box2nr == box3nr) - return true; - foundPathY = q; - foundPathX = box1.ul.x; - return false; - } - } - - if (box1.ul.y == box1.ur.y && box1.ul.y == box2.ul.y && box1.ul.y == box2.ur.y) { - flag = 0; - if (box1.ul.x > box1.ur.x) { - SWAP(box1.ul.x, box1.ur.x); - flag |= 1; - } - - if (box2.ul.x > box2.ur.x) { - SWAP(box2.ul.x, box2.ur.x); - flag |= 2; - } - - if (box1.ul.x > box2.ur.x || box2.ul.x > box1.ur.x || - (box1.ur.x == box2.ul.x || box2.ur.x == box1.ul.x) && - box1.ul.x != box1.ur.x && box2.ul.x != box2.ur.x) { - if (flag & 1) - SWAP(box1.ul.x, box1.ur.x); - if (flag & 2) - SWAP(box2.ul.x, box2.ur.x); - } else { - - if (box2nr == box3nr) { - int diffX = a->walkdata.destx - a->x; - int diffY = a->walkdata.desty - a->y; - int boxDiffY = box1.ul.y - a->y; - - pos = a->x; - if (diffY != 0) { - pos += diffX * boxDiffY / diffY; - } - } else { - pos = a->x; - } - - q = pos; - if (q < box2.ul.x) - q = box2.ul.x; - if (q > box2.ur.x) - q = box2.ur.x; - if (q < box1.ul.x) - q = box1.ul.x; - if (q > box1.ur.x) - q = box1.ur.x; - if (q == pos && box2nr == box3nr) - return true; - foundPathX = q; - foundPathY = box1.ul.y; - return false; - } - } - tmp = box1.ul; - box1.ul = box1.ur; - box1.ur = box1.lr; - box1.lr = box1.ll; - box1.ll = tmp; - } - tmp = box2.ul; - box2.ul = box2.ur; - box2.ur = box2.lr; - box2.lr = box2.ll; - box2.ll = tmp; - } - return false; -} - -void Scumm::createBoxMatrix() -{ - byte *matrix_ptr; - int num, i, j; - byte flags; - int table_1[66], table_2[66]; - int counter, val; - int code; - - PathVertex *vtx; - PathNode *node, *node2 = NULL; - - _maxBoxVertexHeap = 1000; - - createResource(rtMatrix, 4, 1000); - createResource(rtMatrix, 3, 4160); //65 items of something of size 64 - createResource(rtMatrix, 1, BOX_MATRIX_SIZE); - - matrix_ptr = getResourceAddress(rtMatrix, 1); - - _boxMatrixPtr4 = getResourceAddress(rtMatrix, 4); - _boxMatrixPtr1 = getResourceAddress(rtMatrix, 1); - _boxMatrixPtr3 = getResourceAddress(rtMatrix, 3); - - _boxPathVertexHeapIndex = _boxMatrixItem = 0; - - num = getNumBoxes(); - - for (i = 0; i < num; i++) { - for (j = 0; j < num; j++) { - if (i == j) { - _boxMatrixPtr3[i * 64 + j] = 0; - } else if (areBoxesNeighbours(i, j)) { - _boxMatrixPtr3[i * 64 + j] = 1; - } else { - _boxMatrixPtr3[i * 64 + j] = 250; - } - } - } - - for (j = 0; j < num; j++) { - flags = getBoxFlags(j); - if (flags & kBoxInvisible) { - addToBoxMatrix(0xFF); - addToBoxMatrix(j); - addToBoxMatrix(j); - addToBoxMatrix(j); - } else { - vtx = addPathVertex(); - for (i = 0; i < num; i++) { - flags = getBoxFlags(j); - if (!(flags & kBoxInvisible)) { - node = unkMatrixProc2(vtx, i); - if (i == j) - node2 = node; - } - } - table_1[j] = 0; - table_2[j] = j; - vtx = unkMatrixProc1(vtx, node2); - node = vtx ? vtx->left : NULL; - - counter = 250; - while (node) { - val = _boxMatrixPtr3[j * 64 + node->index]; - table_1[node->index] = val; - if (val < counter) - counter = val; - - if (table_1[node->index] != 250) - table_2[node->index] = node->index; - else - table_2[node->index] = -1; - - node = node->left; - } - - while (vtx) { - counter = 250; - node2 = node = vtx->left; - - while (node) { - if (table_1[node->index] < counter) { - counter = table_1[node->index]; - node2 = node; - } - node = node->left; - } - vtx = unkMatrixProc1(vtx, node2); - node = vtx ? vtx->left : NULL; - while (node) { - code = _boxMatrixPtr3[node2->index * 64 + node->index]; - code += table_1[node2->index]; - if (code < table_1[node->index]) { - table_1[node->index] = code; - table_2[node->index] = table_2[node2->index]; - } - node = node->left; - } - } - - addToBoxMatrix(0xFF); - for (i = 1; i < num;) { - if (table_2[i - 1] != -1) { - addToBoxMatrix(i - 1); /* lo */ - if (table_2[i - 1] != table_2[i]) { - addToBoxMatrix(i - 1); /* hi */ - addToBoxMatrix(table_2[i - 1]); /* dst */ - } else { - while (table_2[i - 1] == table_2[i]) { - if (++i == num) - break; - } - addToBoxMatrix(i - 1); /* hi */ - addToBoxMatrix(table_2[i - 1]); /* dst */ - } - } - if (++i == num && table_2[i - 1] != -1) { - addToBoxMatrix(i - 1); /* lo */ - addToBoxMatrix(i - 1); /* hi */ - addToBoxMatrix(table_2[i - 1]); /* dest */ - } - } - } - } - - addToBoxMatrix(0xFF); - nukeResource(rtMatrix, 4); - nukeResource(rtMatrix, 3); -} - -PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node) -{ - if (node == NULL || vtx == NULL) - return NULL; - - if (!node->right) { - vtx->left = node->left; - } else { - node->right->left = node->left; - } - - if (!node->left) { - vtx->right = node->right; - } else { - node->left->right = node->right; - } - - if (vtx->left) - return vtx; - - return NULL; -} - -PathNode *Scumm::unkMatrixProc2(PathVertex *vtx, int i) -{ - PathNode *node; - - if (vtx == NULL) - return NULL; - - if (!vtx->right) { - node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode)); - vtx->left = vtx->right = node; - - node->index = i; - node->left = 0; - node->right = 0; - } else { - node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode)); - vtx->right->left = node; - - node->right = vtx->right; - node->index = i; - node->left = 0; - - vtx->right = node; - } - - return vtx->right; -} - -/* Check if two boxes are neighbours */ -bool Scumm::areBoxesNeighbours(int box1nr, int box2nr) -{ - int j, k, m, n; - int tmp_x, tmp_y; - bool result; - BoxCoords box; - BoxCoords box2; - - if (getBoxFlags(box1nr) & kBoxInvisible || getBoxFlags(box2nr) & kBoxInvisible) - return false; - - getBoxCoordinates(box1nr, &box2); - getBoxCoordinates(box2nr, &box); - - result = false; - j = 4; - - do { - k = 4; - do { - if (box2.ur.x == box2.ul.x && box.ul.x == box2.ul.x && box.ur.x == box2.ur.x) { - n = m = 0; - if (box2.ur.y < box2.ul.y) { - n = 1; - SWAP(box2.ur.y, box2.ul.y); - } - if (box.ur.y < box.ul.y) { - m = 1; - SWAP(box.ur.y, box.ul.y); - } - if (box.ur.y < box2.ul.y || - box.ul.y > box2.ur.y || - (box.ul.y == box2.ur.y || - box.ur.y == box2.ul.y) && box2.ur.y != box2.ul.y && box.ul.y != box.ur.y) { - if (n) { - SWAP(box2.ur.y, box2.ul.y); - } - if (m) { - SWAP(box.ur.y, box.ul.y); - } - } else { - if (n) { - SWAP(box2.ur.y, box2.ul.y); - } - if (m) { - SWAP(box.ur.y, box.ul.y); - } - result = true; - } - } - - if (box2.ur.y == box2.ul.y && box.ul.y == box2.ul.y && box.ur.y == box2.ur.y) { - n = m = 0; - if (box2.ur.x < box2.ul.x) { - n = 1; - SWAP(box2.ur.x, box2.ul.x); - } - if (box.ur.x < box.ul.x) { - m = 1; - SWAP(box.ur.x, box.ul.x); - } - if (box.ur.x < box2.ul.x || - box.ul.x > box2.ur.x || - (box.ul.x == box2.ur.x || - box.ur.x == box2.ul.x) && box2.ur.x != box2.ul.x && box.ul.x != box.ur.x) { - - if (n) { - SWAP(box2.ur.x, box2.ul.x); - } - if (m) { - SWAP(box.ur.x, box.ul.x); - } - } else { - if (n) { - SWAP(box2.ur.x, box2.ul.x); - } - if (m) { - SWAP(box.ur.x, box.ul.x); - } - result = true; - } - } - - tmp_x = box2.ul.x; - tmp_y = box2.ul.y; - box2.ul.x = box2.ur.x; - box2.ul.y = box2.ur.y; - box2.ur.x = box2.lr.x; - box2.ur.y = box2.lr.y; - box2.lr.x = box2.ll.x; - box2.lr.y = box2.ll.y; - box2.ll.x = tmp_x; - box2.ll.y = tmp_y; - } while (--k); - - tmp_x = box.ul.x; - tmp_y = box.ul.y; - box.ul.x = box.ur.x; - box.ul.y = box.ur.y; - box.ur.x = box.lr.x; - box.ur.y = box.lr.y; - box.lr.x = box.ll.x; - box.lr.y = box.ll.y; - box.ll.x = tmp_x; - box.ll.y = tmp_y; - } while (--j); - - return result; -} - -void Scumm::addToBoxMatrix(byte b) -{ - if (++_boxMatrixItem > BOX_MATRIX_SIZE) - error("Box matrix overflow"); - *_boxMatrixPtr1++ = b; -} - -void *Scumm::addToBoxVertexHeap(int size) -{ - byte *ptr = _boxMatrixPtr4; - - _boxMatrixPtr4 += size; - _boxPathVertexHeapIndex += size; - - if (_boxPathVertexHeapIndex >= _maxBoxVertexHeap) - error("Box path vertex heap overflow"); - - return ptr; -} - -PathVertex *Scumm::addPathVertex() -{ - _boxMatrixPtr4 = getResourceAddress(rtMatrix, 4); - _boxPathVertexHeapIndex = 0; - - return (PathVertex *)addToBoxVertexHeap(sizeof(PathVertex)); -} - -void Scumm::findPathTowardsOld(Actor *actor, byte trap1, byte trap2, byte final_trap, ScummPoint gateLoc[5]) -{ - ScummPoint pt; - ScummPoint gateA[2]; - ScummPoint gateB[2]; - - getGates(trap1, trap2, gateA, gateB); - - gateLoc[1].x = actor->x; - gateLoc[1].y = actor->y; - gateLoc[2].x = 32000; - gateLoc[3].x = 32000; - gateLoc[4].x = 32000; - - if (trap2 == final_trap) { /* next = final box? */ - gateLoc[4].x = actor->walkdata.destx; - gateLoc[4].y = actor->walkdata.desty; - - if (getMaskFromBox(trap1) == getMaskFromBox(trap2) || 1) { - if (compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateA[0].x, gateA[0].y) != - compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateB[0].x, gateB[0].y) && - compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateA[1].x, gateA[1].y) != - compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateB[1].x, gateB[1].y)) { - return; /* same zplane and between both gates? */ - } - } - } - - pt = closestPtOnLine(gateA[1].x, gateA[1].y, gateB[1].x, gateB[1].y, gateLoc[1].x, gateLoc[1].y); - gateLoc[3].x = pt.x; - gateLoc[3].y = pt.y; - - if (compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gateA[0].x, gateA[0].y) == - compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gateB[0].x, gateB[0].y)) { - closestPtOnLine(gateA[0].x, gateA[0].y, gateB[0].x, gateB[0].y, gateLoc[1].x, gateLoc[1].y); - gateLoc[2].x = pt.x; /* if point 2 between gates, ignore! */ - gateLoc[2].y = pt.y; - } - - return; -} - -void Scumm::getGates(int trap1, int trap2, ScummPoint gateA[2], ScummPoint gateB[2]) -{ - int i, j; - int Dist[8]; - int MinDist[3]; - int Closest[3]; - int Box[3]; - BoxCoords box; - ScummPoint Clo[8]; - ScummPoint poly[8]; - AdjustBoxResult abr; - int line1, line2; - - // For all corner coordinates of the first box, compute the point cloest - // to them on the second box (and also compute the distance of these points). - getBoxCoordinates(trap1, &box); - poly[0] = box.ul; - poly[1] = box.ur; - poly[2] = box.lr; - poly[3] = box.ll; - for (i = 0; i < 4; i++) { - abr = getClosestPtOnBox(trap2, poly[i].x, poly[i].y); - Dist[i] = abr.dist; - Clo[i].x = abr.x; - Clo[i].y = abr.y; - } - - // Now do the same but with the roles of the first and second box swapped. - getBoxCoordinates(trap2, &box); - poly[4] = box.ul; - poly[5] = box.ur; - poly[6] = box.lr; - poly[7] = box.ll; - for (i = 4; i < 8; i++) { - abr = getClosestPtOnBox(trap1, poly[i].x, poly[i].y); - Dist[i] = abr.dist; - Clo[i].x = abr.x; - Clo[i].y = abr.y; - } - - // Find the three closest "close" points between the two boxes. - for (j = 0; j < 3; j++) { - MinDist[j] = 0xFFFF; - for (i = 0; i < 8; i++) { - if (Dist[i] < MinDist[j]) { - MinDist[j] = Dist[i]; - Closest[j] = i; - } - } - Dist[Closest[j]] = 0xFFFF; - MinDist[j] = (int)sqrt((double)MinDist[j]); - Box[j] = (Closest[j] > 3); // Is the poin on the first or on the second box? - } - - - // Finally, compute the "gate". That's a pair of two points that are - // in the same box (actually, on the border of that box), which both have - // "minimal" distance to the other box in a certain sense. - - if (Box[0] == Box[1] && abs(MinDist[0] - MinDist[1]) < 4) { - line1 = Closest[0]; - line2 = Closest[1]; - - } else if (Box[0] == Box[1] && MinDist[0] == MinDist[1]) { /* parallel */ - line1 = Closest[0]; - line2 = Closest[1]; - } else if (Box[0] == Box[2] && MinDist[0] == MinDist[2]) { /* parallel */ - line1 = Closest[0]; - line2 = Closest[2]; - } else if (Box[1] == Box[2] && MinDist[1] == MinDist[2]) { /* parallel */ - line1 = Closest[1]; - line2 = Closest[2]; - - } else if (Box[0] == Box[2] && abs(MinDist[0] - MinDist[2]) < 4) { - line1 = Closest[0]; - line2 = Closest[2]; - } else if (abs(MinDist[0] - MinDist[2]) < 4) { /* if 1 close to 3 then use 2-3 */ - line1 = Closest[1]; - line2 = Closest[2]; - } else if (abs(MinDist[0] - MinDist[1]) < 4) { - line1 = Closest[0]; - line2 = Closest[1]; - } else { - line1 = Closest[0]; - line2 = Closest[0]; - } - - // Set the gate - if (line1 < 4) { /* from box 1 to box 2 */ - gateA[0] = poly[line1]; - gateA[1] = Clo[line1]; - - } else { - gateA[1] = poly[line1]; - gateA[0] = Clo[line1]; - } - - if (line2 < 4) { /* from box */ - gateB[0] = poly[line2]; - gateB[1] = Clo[line2]; - - } else { - gateB[1] = poly[line2]; - gateB[0] = Clo[line2]; - } -} - -bool Scumm::compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3) -{ - return (Y2 - Y1) * (X3 - X1) <= (Y3 - Y1) * (X2 - X1); -} diff --git a/boxes.h b/boxes.h deleted file mode 100644 index cc04d2398d..0000000000 --- a/boxes.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef BOXES_H -#define BOXES_H - -#define SIZEOF_BOX 20 - -typedef enum { - kBoxXFlip = 0x08, - kBoxYFlip = 0x10, - kBoxPlayerOnly = 0x20, - kBoxLocked = 0x40, - kBoxInvisible = 0x80, -} BoxFlags; - -struct AdjustBoxResult { /* Result type of AdjustBox functions */ - int16 x, y; - uint16 dist; -}; - -struct BoxCoords { /* Box coordinates */ - ScummPoint ul; - ScummPoint ur; - ScummPoint ll; - ScummPoint lr; -}; - -struct Box; -struct PathNode; -struct PathVertex; - -#endif diff --git a/bundle.cpp b/bundle.cpp deleted file mode 100644 index 14486838b5..0000000000 --- a/bundle.cpp +++ /dev/null @@ -1,660 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" -#include "scummsys.h" -#include "bundle.h" - -Bundle::Bundle(Scumm *parent) -{ - _voiceFile = NULL; - _musicFile = NULL; - _scumm = parent; - _lastSong = -1; -} - -Bundle::~Bundle() -{ - if (_voiceFile != NULL) - fclose(_voiceFile); - - if (_musicFile != NULL) - fclose(_musicFile); -} - -bool Bundle::openVoiceFile(char *filename) -{ - int32 tag, offset; - - if (_voiceFile != NULL) { - return false; - } - - _voiceFile = fopen(filename, "rb"); - if (_voiceFile == NULL) { - printf("Bundle: Can't open voice bundle file: %s\n", filename); - return false; - } - - tag = _scumm->fileReadDwordBE(_voiceFile); - offset = _scumm->fileReadDwordBE(_voiceFile); - _numVoiceFiles = _scumm->fileReadDwordBE(_voiceFile); - - _bundleVoiceTable = (BundleAudioTable *) malloc(_numVoiceFiles * sizeof(BundleAudioTable)); - - _scumm->fileSeek(_voiceFile, offset, SEEK_SET); - - for (int32 i = 0; i < _numVoiceFiles; i++) { - char name[13], c; - int32 z = 0; - int32 z2; - - for (z2 = 0; z2 < 8; z2++) - if ((c = _scumm->fileReadByte(_voiceFile)) != 0) - name[z++] = c; - name[z++] = '.'; - for (z2 = 0; z2 < 4; z2++) - if ((c = _scumm->fileReadByte(_voiceFile)) != 0) - name[z++] = c; - name[z] = '\0'; - strcpy(_bundleVoiceTable[i].filename, name); - _bundleVoiceTable[i].offset = _scumm->fileReadDwordBE(_voiceFile); - _bundleVoiceTable[i].size = _scumm->fileReadDwordBE(_voiceFile); - } - - return true; -} - -bool Bundle::openMusicFile(char *filename) -{ - int32 tag, offset; - - if (_musicFile != NULL) { - return false; - } - - _musicFile = fopen(filename, "rb"); - if (_musicFile == NULL) { - printf("Bundle: Can't open music bundle file: %s\n", filename); - return false; - } - - tag = _scumm->fileReadDwordBE(_musicFile); - offset = _scumm->fileReadDwordBE(_musicFile); - _numMusicFiles = _scumm->fileReadDwordBE(_musicFile); - - _bundleMusicTable = (BundleAudioTable *) malloc(_numMusicFiles * sizeof(BundleAudioTable)); - - _scumm->fileSeek(_musicFile, offset, SEEK_SET); - - for (int32 i = 0; i < _numMusicFiles; i++) { - char name[13], c; - int z = 0; - int z2; - - for (z2 = 0; z2 < 8; z2++) - if ((c = _scumm->fileReadByte(_musicFile)) != 0) - name[z++] = c; - name[z++] = '.'; - for (z2 = 0; z2 < 4; z2++) - if ((c = _scumm->fileReadByte(_musicFile)) != 0) - name[z++] = c; - name[z] = '\0'; - strcpy(_bundleMusicTable[i].filename, name); - _bundleMusicTable[i].offset = _scumm->fileReadDwordBE(_musicFile); - _bundleMusicTable[i].size = _scumm->fileReadDwordBE(_musicFile); - } - - return true; -} - -int32 Bundle::decompressVoiceSampleByIndex(int32 index, byte *comp_final) -{ - int32 i, tag, num, final_size, output_size; - byte *comp_input, *comp_output; - - if (_voiceFile == NULL) { - printf("Bundle: voice file is not open !\n"); - return 0; - } - - _scumm->fileSeek(_voiceFile, _bundleVoiceTable[index].offset, SEEK_SET); - tag = _scumm->fileReadDwordBE(_voiceFile); - num = _scumm->fileReadDwordBE(_voiceFile); - _scumm->fileReadDwordBE(_voiceFile); - _scumm->fileReadDwordBE(_voiceFile); - - if (tag != MKID_BE('COMP')) { - warning("Bundle: Compressed sound %d invalid (%c%c%c%c)", index, tag >> 24, tag >> 16, tag >> 8, - tag); - return 0; - } - - for (i = 0; i < num; i++) { - _compVoiceTable[i].offset = _scumm->fileReadDwordBE(_voiceFile); - _compVoiceTable[i].size = _scumm->fileReadDwordBE(_voiceFile); - _compVoiceTable[i].codec = _scumm->fileReadDwordBE(_voiceFile); - _scumm->fileReadDwordBE(_voiceFile); - } - - final_size = 0; - - comp_output = (byte *)malloc(10000); - for (i = 0; i < num; i++) { - comp_input = (byte *)malloc(_compVoiceTable[i].size); - - _scumm->fileSeek(_voiceFile, _bundleVoiceTable[index].offset + _compVoiceTable[i].offset, SEEK_SET); - _scumm->fileRead(_voiceFile, comp_input, _compVoiceTable[i].size); - - output_size = - decompressCodec(_compVoiceTable[i].codec, comp_input, comp_output, _compVoiceTable[i].size); - memcpy((byte *)&comp_final[final_size], comp_output, output_size); - final_size += output_size; - - free(comp_input); - } - free(comp_output); - - return final_size; -} - -int32 Bundle::decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final) -{ - int32 i, tag, num, final_size; - byte *comp_input; - - if (_musicFile == NULL) { - printf("Bundle: music file is not open !\n"); - return 0; - } - - if (_lastSong != index) { - _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset, SEEK_SET); - tag = _scumm->fileReadDwordBE(_musicFile); - num = _scumm->fileReadDwordBE(_musicFile); - _scumm->fileReadDwordBE(_musicFile); - _scumm->fileReadDwordBE(_musicFile); - - if (tag != MKID_BE('COMP')) { - warning("Bundle: Compressed sound %d invalid (%c%c%c%c)", index, tag >> 24, tag >> 16, tag >> 8, - tag); - return 0; - } - - for (i = 0; i < num; i++) { - _compMusicTable[i].offset = _scumm->fileReadDwordBE(_musicFile); - _compMusicTable[i].size = _scumm->fileReadDwordBE(_musicFile); - _compMusicTable[i].codec = _scumm->fileReadDwordBE(_musicFile); - _scumm->fileReadDwordBE(_musicFile); - } - } - - comp_input = (byte *)malloc(_compMusicTable[number].size); - - _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset + _compMusicTable[number].offset, - SEEK_SET); - _scumm->fileRead(_musicFile, comp_input, _compMusicTable[number].size); - final_size = - decompressCodec(_compMusicTable[number].codec, comp_input, comp_final, _compMusicTable[number].size); - - free(comp_input); - - _lastSong = index; - - return final_size; -} - - -int32 Bundle::decompressVoiceSampleByName(char *name, byte *comp_final) -{ - int32 final_size = 0, i; - - if (_voiceFile == NULL) { - printf("Bundle: voice file is not open !\n"); - return 0; - } - - for (i = 0; i < _numVoiceFiles; i++) { - if (!scumm_stricmp(name, _bundleVoiceTable[i].filename)) { - final_size = decompressVoiceSampleByIndex(i, comp_final); - return final_size; - } - } - return final_size; -} - -int32 Bundle::decompressMusicSampleByName(char *name, int32 number, byte *comp_final) -{ - int32 final_size = 0, i; - - if (_voiceFile == NULL) { - printf("Bundle: voice file is not open !\n"); - return 0; - } - - for (i = 0; i < _numMusicFiles; i++) { - if (!scumm_stricmp(name, _bundleMusicTable[i].filename)) { - final_size = decompressMusicSampleByIndex(i, number, comp_final); - return final_size; - } - } - return final_size; -} - -int32 Bundle::getNumberOfMusicSamplesByIndex(int32 index) -{ - if (_musicFile == NULL) { - printf("Bundle: music file is not open !\n"); - return 0; - } - - _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset, SEEK_SET); - _scumm->fileReadDwordBE(_musicFile); - return _scumm->fileReadDwordBE(_musicFile); -} - -int32 Bundle::getNumberOfMusicSamplesByName(char *name) -{ - int32 number = 0, i; - - if (_musicFile == NULL) { - printf("Bundle: music file is not open !\n"); - return 0; - } - - for (i = 0; i < _numMusicFiles; i++) { - if (!scumm_stricmp(name, _bundleMusicTable[i].filename)) { - number = getNumberOfMusicSamplesByIndex(i); - return number; - } - } - return number; -} - -#define NextBit bit = mask & 1; mask >>= 1; if (!--bitsleft) {mask = READ_LE_UINT16(srcptr); srcptr += 2; bitsleft=16;} - -int32 Bundle::compDecode(byte *src, byte *dst) -{ - byte *result, *srcptr = src, *dstptr = dst; - int data, size, bit, bitsleft = 16, mask = READ_LE_UINT16(srcptr); - srcptr += 2; - - while (1) { - NextBit if (bit) { - *dstptr++ = *srcptr++; - } else { - NextBit if (!bit) { - NextBit size = bit << 1; - NextBit size = (size | bit) + 3; - data = *srcptr++ | 0xffffff00; - } else { - data = *srcptr++; - size = *srcptr++; - - data |= 0xfffff000 + ((size & 0xf0) << 4); - size = (size & 0x0f) + 3; - - if (size == 3) - if (((*srcptr++) + 1) == 1) - return dstptr - dst; - } - result = dstptr + data; - while (size--) - *dstptr++ = *result++; - } - } -} -#undef NextBit - -int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 input_size) -{ - int32 output_size = input_size; - int32 offset1, offset2, offset3, length, k, c, s, j, r, t, z; - byte *src, *t_table, *p, *ptr; - byte t_tmp1, t_tmp2; - - switch (codec) { - case 0: - memcpy(comp_output, comp_input, output_size); - break; - - case 1: - output_size = compDecode(comp_input, comp_output); - break; - - case 2: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - break; - - case 3: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - break; - - case 4: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memset(t_table, 0, output_size); - - src = comp_output; - length = (output_size * 8) / 12; - k = 0; - if (length > 0) { - c = -12; - s = 0; - j = 0; - do { - ptr = src + length + (k / 2); - if (k & 1) { - r = c / 8; - *(t_table + r + 2) = ((*(src + j) & 0x0f) << 4) | ((*(ptr + 1) & 0xf0) >> 4); - *(t_table + r + 1) = (*(src + j) & 0xf0) | (*(t_table + r + 1)); - } else { - r = s / 8; - *(t_table + r + 0) = ((*(src + j) & 0x0f) << 4) | (*ptr & 0x0f); - *(t_table + r + 1) = (*(src + j) & 0xf0) >> 4; - } - s += 12; - k++; - j++; - c += 12; - } while (k < length); - } - offset1 = ((length - 1) * 3) / 2; - *(t_table + offset1 + 1) = (*(t_table + offset1 + 1)) | *(src + length - 1) & 0xf0; - memcpy(src, t_table, output_size); - free(t_table); - break; - - case 5: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memset(t_table, 0, output_size); - - src = comp_output; - length = (output_size * 8) / 12; - k = 1; - c = 0; - s = 12; - *t_table = (*(src + length)) >> 4; - t = length + k; - j = 1; - if (t > k) { - do { - ptr = src + length + (k / 2); - if (k & 1) { - r = c / 8; - *(t_table + r + 0) = (*(src + j - 1) & 0xf0) | (*(t_table + r)); - *(t_table + r + 1) = ((*(src + j - 1) & 0x0f) << 4) | (*ptr & 0x0f); - } else { - r = s / 8; - *(t_table + r + 0) = (*(src + j - 1) & 0xf0) >> 4; - *(t_table + r - 1) = ((*(src + j - 1) & 0x0f) << 4) | ((*ptr & 0xf0) >> 4); - } - s += 12; - k++; - j++; - c += 12; - } while (k < t); - } - memcpy(src, t_table, output_size); - free(t_table); - break; - - case 6: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memset(t_table, 0, output_size); - - src = comp_output; - length = (output_size * 8) / 12; - k = 0; - c = 0; - j = 0; - s = -12; - *t_table = *(output_size + src - 1); - *(t_table + output_size - 1) = *(src + length - 1); - t = length - 1; - if (t > 0) { - do { - ptr = src + length + (k / 2); - if (k & 1) { - r = s / 8; - *(t_table + r + 2) = (*(src + j) & 0xf0) | *(t_table + r + 2); - *(t_table + r + 3) = ((*(src + j) & 0x0f) << 4) | ((*ptr & 0xf0) >> 4); - } else { - r = c / 8; - *(t_table + r + 2) = (*(src + j) & 0xf0) >> 4; - *(t_table + r + 1) = ((*(src + j) & 0x0f) << 4) | (*ptr & 0x0f); - } - s += 12; - k++; - j++; - c += 12; - } while (k < t); - } - memcpy(src, t_table, output_size); - free(t_table); - break; - - case 10: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memcpy(t_table, p, output_size); - - offset1 = output_size / 3; - offset2 = offset1 * 2; - offset3 = offset2; - src = comp_output; - do { - if (offset1 == 0) - break; - offset1--; - offset2 -= 2; - offset3--; - *(t_table + offset2 + 0) = *(src + offset1); - *(t_table + offset2 + 1) = *(src + offset3); - } while (1); - - src = comp_output; - length = (output_size * 8) / 12; - k = 0; - if (length > 0) { - c = -12; - s = 0; - do { - j = length + (k / 2); - if (k & 1) { - r = c / 8; - t_tmp1 = *(t_table + k); - t_tmp2 = *(t_table + j + 1); - *(src + r + 2) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); - *(src + r + 1) = (*(src + r + 1)) | (t_tmp1 & 0xf0); - } else { - r = s / 8; - t_tmp1 = *(t_table + k); - t_tmp2 = *(t_table + j); - *(src + r + 0) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); - *(src + r + 1) = ((t_tmp1 & 0xf0) >> 4); - } - s += 12; - k++; - c += 12; - } while (k < length); - } - offset1 = ((length - 1) * 3) / 2; - *(src + offset1 + 1) = (*(t_table + length) & 0xf0) | *(src + offset1 + 1); - free(t_table); - break; - - case 11: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memcpy(t_table, p, output_size); - - offset1 = output_size / 3; - offset2 = offset1 * 2; - offset3 = offset2; - src = comp_output; - do { - if (offset1 == 0) - break; - offset1--; - offset2 -= 2; - offset3--; - *(t_table + offset2 + 0) = *(src + offset1); - *(t_table + offset2 + 1) = *(src + offset3); - } while (1); - - src = comp_output; - length = (output_size * 8) / 12; - k = 1; - c = 0; - s = 12; - t_tmp1 = (*(t_table + length)) >> 4; - *(src) = t_tmp1; - t = length + k; - if (t > k) { - do { - j = length + (k / 2); - if (k & 1) { - r = c / 8; - t_tmp1 = *(t_table + k - 1); - t_tmp2 = *(t_table + j); - *(src + r + 0) = (*(src + r)) | (t_tmp1 & 0xf0); - *(src + r + 1) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); - } else { - r = s / 8; - t_tmp1 = *(t_table + k - 1); - t_tmp2 = *(t_table + j); - *(src + r + 0) = (t_tmp1 & 0xf0) >> 4; - *(src + r - 1) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); - } - s += 12; - k++; - c += 12; - } while (k < t); - } - free(t_table); - break; - - case 12: - output_size = compDecode(comp_input, comp_output); - p = comp_output; - for (z = 2; z < output_size; z++) - p[z] += p[z - 1]; - for (z = 1; z < output_size; z++) - p[z] += p[z - 1]; - - t_table = (byte *)malloc(output_size); - memcpy(t_table, p, output_size); - - offset1 = output_size / 3; - offset2 = offset1 * 2; - offset3 = offset2; - src = comp_output; - do { - if (offset1 == 0) - break; - offset1--; - offset2 -= 2; - offset3--; - *(t_table + offset2 + 0) = *(src + offset1); - *(t_table + offset2 + 1) = *(src + offset3); - } while (1); - - src = comp_output; - length = (output_size * 8) / 12; - k = 0; - c = 0; - s = -12; - *(src) = *(output_size + t_table - 1); - *(src + output_size - 1) = *(t_table + length - 1); - t = length - 1; - if (t > 0) { - do { - j = length + (k / 2); - if (k & 1) { - r = s / 8; - t_tmp1 = *(t_table + k); - t_tmp2 = *(t_table + j); - *(src + r + 2) = (*(src + r + 2)) | (t_tmp1 & 0xf0); - *(src + r + 3) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); - } else { - r = c / 8; - t_tmp1 = *(t_table + k); - t_tmp2 = *(t_table + j); - *(src + r + 2) = (t_tmp1 & 0xf0) >> 4; - *(src + r + 1) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); - } - s += 12; - k++; - c += 12; - } while (k < t); - } - free(t_table); - break; - - default: - printf("Bundle: Unknown codec %d!\n", (int)codec); - output_size = 0; - break; - } - - return output_size; -} diff --git a/bundle.h b/bundle.h deleted file mode 100644 index c95cc853cd..0000000000 --- a/bundle.h +++ /dev/null @@ -1,71 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef BUNDLE_H -#define BUNDLE_H - -#include "scummsys.h" - -class Scumm; - -class Bundle { - -private: - -struct CompTable { - int32 offset; - int32 size; - int32 codec; -}; - -struct BundleAudioTable { - char filename[13]; - int32 size; - int32 offset; -}; - - int32 compDecode(byte *src, byte *dst); - int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size); - CompTable _compVoiceTable[50]; - CompTable _compMusicTable[2500]; - FILE *_voiceFile; - FILE *_musicFile; - BundleAudioTable *_bundleVoiceTable; - BundleAudioTable *_bundleMusicTable; - int32 _numVoiceFiles; - int32 _numMusicFiles; - Scumm *_scumm; - int32 _lastSong; - -public: - Bundle(Scumm *parent); - ~Bundle(); - - bool openVoiceFile(char *filename); - bool openMusicFile(char *filename); - int32 decompressVoiceSampleByName(char *name, byte *comp_final); - int32 decompressVoiceSampleByIndex(int32 index, byte *comp_final); - int32 decompressMusicSampleByName(char *name, int32 number, byte *comp_final); - int32 decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final); - int32 getNumberOfMusicSamplesByIndex(int32 index); - int32 getNumberOfMusicSamplesByName(char *name); -}; - -#endif diff --git a/common/config-file.cpp b/common/config-file.cpp new file mode 100644 index 0000000000..b56630f5c5 --- /dev/null +++ b/common/config-file.cpp @@ -0,0 +1,386 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include +#include +#include "stdafx.h" +#include "config-file.h" +#include "scumm.h" + +#define MAXLINELEN 256 + +#define xfree(p) {if (p) free(p);} + + +static char *ltrim(char *t) +{ + for (; *t && (*t == ' '); t++); + return t; +} + +static char *rtrim(char *t) +{ + int l; + + for (l = strlen(t) - 1; l; l--) { + if (t[l] == ' ') { + *t = 0; + } else { + return t; + } + } + return t; +} + +class hashconfig { +public: + hashconfig (const char *); + ~hashconfig (); + bool is_domain(const char *) const; + const char *get(const char *) const; + const char *set(const char *, const char *); + const char *getdomain() const; + void flush(FILE *) const; + void rename(const char *); + void merge(const hashconfig *); +private: + char *domain; + char **keys, **values; + int nkeys; +}; + +hashconfig::hashconfig (const char *dom):domain(dom ? strdup(dom) : 0), +keys(0), values(0), nkeys(0) +{ +} + +hashconfig::~hashconfig () { + xfree(domain); +} + +bool hashconfig::is_domain(const char *d) const +{ + return d && domain && !strcmp(d, domain); +} + +const char *hashconfig::get(const char *key) const +{ + int i; + + for (i = 0; i < nkeys; i++) { + if (!strcmp(key, keys[i])) { + return values[i]; + } + } + + return 0; +} + +const char *hashconfig::set(const char *key, const char *value) +{ + int i; + + for (i = 0; i < nkeys; i++) { + if (!strcmp(key, keys[i])) { + xfree(values[i]); + return values[i] = value ? strdup(value) : 0; + } + } + + nkeys++; + keys = (char **)realloc(keys, nkeys * sizeof(char *)); + values = (char **)realloc(values, nkeys * sizeof(char *)); + keys[nkeys - 1] = strdup(key); + return values[nkeys - 1] = value ? strdup(value) : 0; +} + +const char *hashconfig::getdomain() const +{ + return domain; +} + +void hashconfig::flush(FILE *cfg_file) const +{ + int i; + + if (!domain) + return; + + fprintf(cfg_file, "[%s]\n", domain); + + for (i = 0; i < nkeys; i++) { + if (values[i]) { + fprintf(cfg_file, "%s=%s\n", keys[i], values[i]); + } + } + fprintf(cfg_file, "\n"); +} + +void hashconfig::rename(const char *d) +{ + xfree(domain); + domain = d ? strdup(d) : 0; +} + +void hashconfig::merge(const hashconfig *h) +{ + int i; + + for (i = 0; i < h->nkeys; i++) { + set(h->keys[i], h->values[i]); + } +} + +// The config-class itself. + +Config::Config (const char *cfg, const char *d) +: filename(strdup(cfg)), domain(d ? strdup(d) : 0), hash(0), ndomains(0), willwrite(false) +{ + FILE *cfg_file; + char t[MAXLINELEN]; + + if (!(cfg_file = fopen(cfg, "r"))) { + debug(1, "Unable to open configuration file: %s.\n", filename); + } else { + while (!feof(cfg_file)) { + if (!fgets(t, MAXLINELEN, cfg_file)) + continue; + if (t[0] != '#') { + if (t[0] == '[') { + // It's a new domain which begins here. + char *p = strchr(t, ']'); + if (!p) { + debug(1, "Config file buggy: no ] at the end of the domain name.\n"); + } else { + *p = 0; + set_domain(t + 1); + } + } else { + // It's a new key in the domain. + if (!domain) { + debug(1, "Config file buggy: we have a key without a domain first.\n"); + } + char *p = strchr(t, '\n'); + if (p) + *p = 0; + p = strchr(t, '\r'); + if (p) + *p = 0; + + if (!(p = strchr(t, '='))) { + if (strlen(t)) + debug(1, "Config file buggy: there is junk: %s\n", t); + } else { + char *key, *value; + *p = 0; + key = ltrim(rtrim(t)); + value = ltrim(p + 1); + set(key, value); + } + } + } + } + set_domain(d); + fclose(cfg_file); + } +} + +Config::~Config () { + int i; + + xfree(filename); + xfree(domain); + + for (i = 0; i < ndomains; i++) { + delete hash[i]; + } + xfree(hash); +} + +const char *Config::get(const char *key, const char *d) const +{ + int i; + + if (!d) + d = domain; + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(d)) { + return hash[i]->get(key); + } + } + + return 0; +} + +const int Config::getInt(const char *key, int def, const char *d) const +{ + const char *value = get(key, d); + + if (value) + return atoi(value); + return def; +} + +const bool Config::getBool(const char *key, bool def, const char *d) const +{ + const char *value = get(key, d); + + if (value) + return !scumm_stricmp(value, "true"); + return def; +} + +const char *Config::set(const char *key, const char *value, const char *d) +{ + int i; + + if (!d) + d = domain; + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(d)) { + return hash[i]->set(key, value); + } + } + + ndomains++; + hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); + hash[ndomains - 1] = new hashconfig (d); + + return hash[ndomains - 1]->set(key, value); +} + +const char *Config::set(const char *key, int value_i, const char *d) +{ + char value[MAXLINELEN]; + sprintf(value, "%i", value_i); + return set(key, value, d); +} + +const char *Config::set(const char *key, bool value_b, const char *d) +{ + const char *value = value_b ? "true" : "false"; + return set(key, value, d); +} + +void Config::set_domain(const char *d) +{ + int i; + xfree(domain); + domain = d ? strdup(d) : 0; + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(domain)) + return; + } + ndomains++; + hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); + hash[ndomains - 1] = new hashconfig (domain); +} + +void Config::flush() const +{ + FILE *cfg_file; + int i; + + if (!willwrite) + return; + + if (!(cfg_file = fopen(filename, "w"))) { + debug(1, "Unable to write configuration file: %s.\n", filename); + } else { + for (i = 0; i < ndomains; i++) { + hash[i]->flush(cfg_file); + } + fclose(cfg_file); + } +} + +void Config::rename_domain(const char *d) +{ + int i, index = -1; + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(d)) { + index = i; + } + } + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(domain)) { + if (index >= 0) { + hash[i]->merge(hash[index]); + hash[index]->rename(0); + rename_domain(d); + } else { + hash[i]->rename(d); + set_domain(d); + } + } + } +} + +void Config::delete_domain(const char *d) +{ + int i; + + for (i = 0; i < ndomains; i++) { + if (hash[i]->is_domain(d)) { + hash[i]->rename(0); + } + } +} + +void Config::change_filename(const char *f) +{ + xfree(filename); + filename = f ? strdup(f) : 0; +} + +void Config::merge_config(const Config *c) +{ + int i, j; + bool found; + + for (i = 0; i < c->ndomains; i++) { + found = false; + for (j = 0; j < ndomains; j++) { + if (hash[j]->is_domain(c->hash[i]->getdomain())) { + hash[j]->merge(c->hash[i]); + found = true; + break; + } + } + if (!found) { + ndomains++; + hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); + hash[ndomains - 1] = new hashconfig (domain); + hash[ndomains - 1]->merge(c->hash[i]); + } + } +} + +void Config::set_writing(bool w) +{ + willwrite = w; +} diff --git a/common/config-file.h b/common/config-file.h new file mode 100644 index 0000000000..eee4cfde59 --- /dev/null +++ b/common/config-file.h @@ -0,0 +1,57 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef CONFIG_FILE_H +#define CONFIG_FILE_H + +class hashconfig; + +class Config { +public: + Config (const char * = "config.cfg", const char * = "default"); + ~Config (); + const char *get(const char *key, const char *dom = 0) const; + const int getInt(const char *key, int def = 0, const char *dom = 0) const; + const bool getBool(const char *key, bool def = false, const char *dom = 0) const; + + const char *set(const char *key, const char *value, const char *dom = 0); + const char *set(const char *key, int value, const char *dom = 0); + const char *set(const char *key, bool value, const char *dom = 0); + + void set_domain(const char *); + void flush() const; + void rename_domain(const char *); + void delete_domain(const char *); + void change_filename(const char *); + void merge_config(const Config *); + void set_writing(bool); +private: + char *filename, *domain; + hashconfig **hash; + int ndomains; + bool willwrite; +}; + +// The global config object +extern Config *scummcfg; + +#endif diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp new file mode 100644 index 0000000000..421dfd782e --- /dev/null +++ b/common/gameDetector.cpp @@ -0,0 +1,632 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + +#include "stdafx.h" +#include "scumm/scumm.h" +#include "sound/mididrv.h" +#include "scumm/imuse.h" +#include "common/gameDetector.h" +#include "common/config-file.h" + + +#define CHECK_OPTION() if ((current_option != NULL) || (*s != '\0')) goto ShowHelpAndExit +#define HANDLE_OPTION() if ((*s == '\0') && (current_option == NULL)) goto ShowHelpAndExit; \ + if ((*s != '\0') && (current_option != NULL)) goto ShowHelpAndExit; \ + option = (*s == '\0' ? current_option : s); \ + current_option = NULL +#define HANDLE_OPT_OPTION() if ((*s != '\0') && (current_option != NULL)) goto ShowHelpAndExit; \ + if ((*s == '\0') && (current_option == NULL)) option = NULL; \ + else option = (*s == '\0' ? current_option : s); \ + current_option = NULL + +static const char USAGE_STRING[] = + "ScummVM - Scumm Interpreter\n" + "Syntax:\n" + "\tscummvm [-v] [-d[]] [-n] [-b] [-t] [-s] [-p] [-m] [-f] game\n" + "Flags:\n" + "\t-a - specify game is amiga version\n" + "\t-b - start in room \n" + "\t-c - use cdrom for cd audio\n" + "\t-d[] - enable debug output (debug level [1])\n" + "\t-e - set music engine (see readme.txt for details)\n" + "\t-f - fullscreen mode\n" + "\t-g - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n" + "\t-l - load config file instead of default\n" + "\t-m - set music volume to (0-100)\n" + "\t-n - no subtitles for speech\n" + "\t-p - look for game in \n" + "\t-s - set sfx volume to (0-255)\n" + "\t-t - set music tempo (default- adlib: 0x1F0000, midi: 0x460000)\n" + "\t-v - show version info and exit\n" +#if defined(UNIX) + "\t-w[] - write to config file [~/.scummvmrc]\n" +#else + "\t-w[] - write to config file [scummvm.ini]\n" +#endif + "\t-x[] - save game slot to load (default: autosave)\n" + "\t-y - set text speed (default: 60)\n" +; + +void GameDetector::updateconfig() +{ + const char * val; + + _amiga = scummcfg->getBool("amiga", _amiga); + + _save_slot = scummcfg->getInt("save_slot", _save_slot); + + _cdrom = scummcfg->getInt("cdrom", _cdrom); + + if ((val = scummcfg->get("music_driver"))) + if (!parseMusicDriver(val)) { + printf("Error in the config file: invalid music_driver.\n"); + printf(USAGE_STRING); + exit(-1); + } + + _fullScreen = scummcfg->getBool("fullscreen", _fullScreen); + + if ((val = scummcfg->get("gfx_mode"))) + if ((_gfx_mode = parseGraphicsMode(val)) == -1) { + printf("Error in the config file: invalid gfx_mode.\n"); + printf(USAGE_STRING); + exit(-1); + } + + _music_volume = scummcfg->getInt("music_volume", _music_volume); + + _noSubtitles = scummcfg->getBool("nosubtitles", _noSubtitles); + + if ((val = scummcfg->get("path"))) + _gameDataPath = strdup(val); + + _sfx_volume = scummcfg->getInt("sfx_volume", _sfx_volume); + + // We use strtol for the tempo to allow it to be specified in hex. + if ((val = scummcfg->get("tempo"))) + _gameTempo = strtol(val, NULL, 0); + + _talkSpeed = scummcfg->getInt("talkspeed", _talkSpeed); +} + +void GameDetector::parseCommandLine(int argc, char **argv) +{ + int i; + char *s; + char *current_option = NULL; + char *option = NULL; + char c; + _save_slot = -1; + + // check for arguments + if (argc < 2) { + printf(USAGE_STRING); + //exit(1); + } + + scummcfg->set_domain("game-specific"); + /* Parse the arguments */ + for (i = argc - 1; i >= 1; i--) { + s = argv[i]; + + if (s[0] == '-') { + s++; + c = *s++; + switch (tolower(c)) { + case 'a': + CHECK_OPTION(); + _amiga = (c == 'a'); + scummcfg->set("amiga", _amiga); + break; + case 'b': + HANDLE_OPTION(); + _bootParam = atoi(option); + break; + case 'c': + HANDLE_OPTION(); + _cdrom = atoi(option); + scummcfg->set("cdrom", _cdrom); + break; + case 'd': + _debugMode = true; + HANDLE_OPT_OPTION(); + if (option != NULL) + _debugLevel = atoi(option); + debug(1,"Debugmode (level %d) on", _debugLevel); + break; + case 'e': + HANDLE_OPTION(); + if (!parseMusicDriver(option)) + goto ShowHelpAndExit; + scummcfg->set("music_driver", option); + break; + case 'f': + CHECK_OPTION(); + _fullScreen = (c == 'f'); + scummcfg->set("fullscreen", _fullScreen, "scummvm"); + break; + case 'g': + HANDLE_OPTION(); + _gfx_mode = parseGraphicsMode(option); + if (_gfx_mode == -1) + goto ShowHelpAndExit; + scummcfg->set("gfx_mode", option, "scummvm"); + break; + case 'l': + HANDLE_OPTION(); + { + Config * newconfig = new Config(option, "scummvm"); + scummcfg->merge_config(newconfig); + delete newconfig; + updateconfig(); + break; + } + break; + case 'm': + HANDLE_OPTION(); + _music_volume = atoi(option); + scummcfg->set("music_volume", _music_volume); + break; + case 'n': + CHECK_OPTION(); + _noSubtitles = (c == 'n'); + scummcfg->set("nosubtitles", _noSubtitles); + break; + case 'p': + HANDLE_OPTION(); + _gameDataPath = option; + scummcfg->set("path", _gameDataPath); + break; + case 'r': + HANDLE_OPTION(); + // Ignore -r for now, to ensure backward compatibility. + break; + case 's': + HANDLE_OPTION(); + _sfx_volume = atoi(option); + scummcfg->set("sfx_volume", _sfx_volume); + break; + case 't': + HANDLE_OPTION(); + _gameTempo = strtol(option, 0, 0); + scummcfg->set("tempo", option); + break; + case 'v': + CHECK_OPTION(); + printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " " + __TIME__ "\n"); +#ifdef SCUMMVM_PLATFORM_VERSION + printf(" " SCUMMVM_PLATFORM_VERSION "\n"); +#endif + exit(1); + case 'w': + _saveconfig = true; + scummcfg->set_writing(true); + HANDLE_OPT_OPTION(); + if (option != NULL) + scummcfg->change_filename(option); + break; + case 'x': + _save_slot = 0; + HANDLE_OPT_OPTION(); + if (option != NULL) { + _save_slot = atoi(option); + scummcfg->set("save_slot", _save_slot); + } + break; + case 'y': + HANDLE_OPTION(); + _talkSpeed = atoi(option); + scummcfg->set("talkspeed", _talkSpeed); + break; + default: + goto ShowHelpAndExit; + } + } else { + if (i == (argc - 1)) { + _exe_name = s; + scummcfg->set_domain(s); + scummcfg->rename_domain("game-specific"); + scummcfg->rename_domain(s); + updateconfig(); + } else { + if (current_option == NULL) + current_option = s; + else + goto ShowHelpAndExit; + } + } + } + + if (_exe_name) + scummcfg->flush(); + + return; + + ShowHelpAndExit: + printf(USAGE_STRING); + exit(1); +} + +int GameDetector::parseGraphicsMode(const char *s) { + struct GraphicsModes { + const char *name; + int id; + }; + + const struct GraphicsModes gfx_modes[] = { + {"normal",GFX_NORMAL}, + {"1x",GFX_NORMAL}, + {"2x",GFX_DOUBLESIZE}, + {"3x",GFX_TRIPLESIZE}, + {"2xsai",GFX_2XSAI}, + {"super2xsai",GFX_SUPER2XSAI}, + {"supereagle",GFX_SUPEREAGLE}, + {"advmame2x",GFX_ADVMAME2X} + }; + + const GraphicsModes *gm = gfx_modes; + int i; + for(i=0; i!=ARRAYSIZE(gfx_modes); i++,gm++) { + if (!scumm_stricmp(gm->name, s)) + return gm->id; + } + + return -1; +} + +bool GameDetector::parseMusicDriver(const char *s) { + struct MusicDrivers { + const char *name; + int id; + }; + + const struct MusicDrivers music_drivers[] = { + {"auto",MD_AUTO}, + {"null",MD_NULL}, + {"windows",MD_WINDOWS}, + {"seq",MD_SEQ}, + {"qt",MD_QTMUSIC}, + {"core",MD_COREAUDIO}, + {"amidi",MD_AMIDI}, + {"midiemu",MD_MIDIEMU}, + {"alsa", MD_ALSA}, + {"adlib",-1}, + }; + + const MusicDrivers *md = music_drivers; + int i; + + _use_adlib = false; + + for(i=0; i!=ARRAYSIZE(music_drivers); i++,md++) { + if (!scumm_stricmp(md->name, s)) { + if (md->id == -1) { + _use_adlib = true; + } + _midi_driver = md->id; + return true; + } + } + + return false; +} + + +struct VersionSettings { + const char *filename; + const char *gamename; + byte id, major, middle, minor; + uint32 features; +}; + +/* + This is a list of all known SCUMM games. Commented games are not + supported at this time */ + +static const VersionSettings version_settings[] = { + /* Scumm Version 1 */ +// {"maniac", "Maniac Mansion (C64)", GID_MANIAC64, 1, 0, 0,}, +// {"zak", "Zak McKracken and the Alien Mindbenders (C64)", GID_ZAK64, 1, 0, 0,}, + + /* Scumm Version 2 */ +// {"maniac", "Maniac Mansion", GID_MANIAC, 2, 0, 0,}, +// {"zak", "Zak McKracken and the Alien Mindbenders", GID_ZAK, 2, 0, 0,}, +// {"indy3", "Indiana Jones and the Last Crusade", GID_INDY3, 2, 0, 0,}, + + /* Scumm Version 3 */ + {"indy3", "Indiana Jones and the Last Crusade (256)", GID_INDY3_256, 3, 0, 22, + GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD256 | GF_NO_SCALLING}, + {"zak256", "Zak McKracken and the Alien Mindbenders (256)", GID_ZAK256, 3, 0, 0, + GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD256 | GF_AUDIOTRACKS | GF_NO_SCALLING}, + {"loom", "Loom", GID_LOOM, 3, 5, 40, + GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD_BUNDLE | GF_16COLOR | GF_NO_SCALLING}, + + /* Scumm Version 4 */ + {"monkeyEGA", "Monkey Island 1 (EGA)", GID_MONKEY_EGA, 4, 0, 67, + GF_SMALL_HEADER | GF_USE_KEY | GF_16COLOR}, // EGA version + + /* Scumm version 5 */ + {"monkeyVGA", "Monkey Island 1 (256 color Floppy version)", GID_MONKEY_VGA, 5, 0, 16, + GF_SMALL_HEADER | GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, + {"loomcd", "Loom (256 color CD version)", GID_LOOM256, 5, 1, 42, + GF_SMALL_HEADER | GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, + {"monkey", "Monkey Island 1", GID_MONKEY, 5, 2, 2, + GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, + {"monkey1", "Monkey Island 1 (alt)", GID_MONKEY, 5, 2, 2, + GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, + {"monkey2", "Monkey Island 2: LeChuck's revenge", GID_MONKEY2, 5, 2, 2, + GF_USE_KEY | GF_ADLIB_DEFAULT}, + {"atlantis", "Indiana Jones and the Fate of Atlantis", GID_INDY4, 5, 5, 0, + GF_USE_KEY | GF_ADLIB_DEFAULT}, + {"playfate", "Indiana Jones and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0, + GF_USE_KEY | GF_ADLIB_DEFAULT}, + {"fate", "Indiana Jones and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0, + GF_USE_KEY | GF_ADLIB_DEFAULT}, + + /* Scumm Version 6 */ + {"tentacle", "Day Of The Tentacle", GID_TENTACLE, 6, 4, 2, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT}, + {"dottdemo", "Day Of The Tentacle (Demo)", GID_TENTACLE, 6, 3, 2, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT}, + {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER}, + {"samdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER | GF_ADLIB_DEFAULT}, + {"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER | GF_ADLIB_DEFAULT}, + + {"puttdemo", "Putt Putt joins the parade (demo)", GID_SAMNMAX, 6, 3, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT | GF_HUMONGOUS}, + {"moondemo", "Putt Putt goes to the moon (demo)", GID_SAMNMAX, 6, 3, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT | GF_HUMONGOUS}, + + {"test", "Test demo game", GID_SAMNMAX, 6, 6, 6, GF_NEW_OPCODES | GF_AFTER_V6}, + + /* Scumm Version 7 */ + {"ft", "Full Throttle", GID_FT, 7, 3, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7}, + {"dig", "The Dig", GID_DIG, 7, 5, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7}, + + /* Simon the Sorcerer 1 & 2 (not SCUMM games) */ + {"simon1dos", "Simon the Sorcerer 1 for DOS", GID_SIMON_FIRST+0, 99, 99, 99, 0}, + {"simon2dos", "Simon the Sorcerer 2 for DOS", GID_SIMON_FIRST+1, 99, 99, 99, 0}, + {"simon1win", "Simon the Sorcerer 1 for Windows", GID_SIMON_FIRST+2, 99, 99, 99, 0}, + {"simon2win", "Simon the Sorcerer 2 for Windows", GID_SIMON_FIRST+3, 99, 99, 99, 0}, + + /* Scumm Version 8 */ + {"comi", "The Curse of Monkey Island", GID_CMI, 8, 1, 0, + GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7 | GF_AFTER_V8}, + + {NULL, NULL} +}; + +bool GameDetector::detectGame() +{ + const VersionSettings *gnl = version_settings; + + _gameId = 0; + _gameText = NULL; + do { + if (!scumm_stricmp(_exe_name, gnl->filename)) { + _gameId = gnl->id; + _scummVersion = gnl->major; + + _features = gnl->features; + _gameText = gnl->gamename; + debug(1, "Detected game '%s', version %d.%d.%d", + gnl->gamename, gnl->major, gnl->middle, gnl->minor); + return true; + } + } while ((++gnl)->filename); + + debug(1, "Failed game detection"); + + return true; +} + +char *GameDetector::getGameName() +{ + if (_gameText == NULL) { + char buf[256]; + sprintf(buf, "Unknown game: \"%s\"", _exe_name); + return strdup(buf); + } + return strdup(_gameText); +} + +int GameDetector::detectMain(int argc, char **argv) +{ + _debugMode = 0; // off by default... + + _noSubtitles = 0; // use by default - should this depend on soundtrack? + + _talkSpeed = 60; + +#ifndef _WIN32_WCE + _gfx_mode = GFX_DOUBLESIZE; +#else + _gfx_mode = GFX_NORMAL; +#endif + _sfx_volume = kDefaultSFXVolume; + _music_volume = kDefaultMusicVolume; + +#if defined(USE_NULL_DRIVER) + _gfx_driver = GD_NULL; +#elif defined(__DC__) + _gfx_driver = GD_DC; +#elif defined(X11_BACKEND) + _gfx_driver = GD_X; +#elif defined(__MORPHOS__) + _gfx_driver = GD_MORPHOS; +#elif defined(_WIN32_WCE) + _gfx_driver = GD_WINCE; +#elif defined(MACOS_CARBON) + _gfx_driver = GD_MAC; +#else + /* SDL is the default driver for now */ + _gfx_driver = GD_SDL; +#endif + + _gameDataPath = NULL; + _gameTempo = 0; + _soundCardType = 3; + + + + _midi_driver = MD_AUTO; + +#if defined(__DC__) + extern int dc_setup(GameDetector &detector); + dc_setup(*this); +#elif defined(MACOS_CARBON) + extern char* SelectGame(); + char *game_name = SelectGame(); + printf(game_name); +#else + _saveconfig = false; + updateconfig(); + parseCommandLine(argc, argv); +#endif + + if (_exe_name == NULL) { + //launcherLoop(); + //setWindowName(this); + warning("No game was specified..."); + return (-1); + } + + + if (!detectGame()) { + warning("Game detection failed. Using default settings"); + _features = GF_DEFAULT; + _gameText = "Please choose a game"; + } + + /* Use the adlib sound driver if auto mode is selected, + * and the game is one of those that want adlib as + * default */ + if (_midi_driver == MD_AUTO && _features&GF_ADLIB_DEFAULT) { + _use_adlib = true; + } + + if (!_gameDataPath) { + warning("No path was provided. Assuming the data files are in the current directory"); + _gameDataPath = strdup(""); + } else if (_gameDataPath[strlen(_gameDataPath)-1] != '/' +#ifdef __MORPHOS__ + && _gameDataPath[strlen(_gameDataPath)-1] != ':' +#endif + && _gameDataPath[strlen(_gameDataPath)-1] != '\\') { + char slashless[1024]; /* Append slash to path */ + strcpy(slashless, _gameDataPath); + _gameDataPath = (char *)malloc((strlen(slashless) + 1) * sizeof(char)); + sprintf(_gameDataPath, "%s/", slashless); + } + + if (_amiga) + _features = _features | GF_AMIGA; + + return (0); +} + +OSystem *GameDetector::createSystem() { + /* auto is to use SDL */ + switch(_gfx_driver) { +#if defined(X11_BACKEND) + case GD_X: + return OSystem_X11_create(); +#elif defined(__DC__) + case GD_DC: + return OSystem_Dreamcast_create(); +#elif defined(_WIN32_WCE) + case GD_WINCE: + return OSystem_WINCE3_create(); +#elif defined(__MORPHOS__) + case GD_MORPHOS: + return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen); +#elif defined(MACOS_CARBON) + case GD_MAC: + return OSystem_MAC_create(_gfx_mode, _fullScreen); +#elif defined(USE_NULL_DRIVER) + case GD_NULL: + return OSystem_NULL_create(); +#else + case GD_SDL: + return OSystem_SDL_create(_gfx_mode, _fullScreen); +#endif + } + + error("Invalid graphics driver"); + return NULL; +} + +MidiDriver *GameDetector::createMidi() { + int drv = _midi_driver; + +#if defined (_WIN32_WCE) + /* Always use MIDI emulation on CE devices */ + if (drv == MD_AUTO) drv = MD_MIDIEMU; +#endif + +#if defined (WIN32) && !defined(_WIN32_WCE) + /* MD_WINDOWS is default MidiDriver on windows targets */ + if (drv == MD_AUTO) drv = MD_WINDOWS; +#elif defined(__APPLE__) || defined(macintosh) + /* MD_QTMUSIC is default MidiDriver on MacOS targets */ + if (drv == MD_AUTO) drv = MD_QTMUSIC; +#elif defined(UNIX) || defined(X11_BACKEND) + /* MD_MIDIEMU is default MidiDriver on UNIX targets. */ + /* FIXME: Attempt to detect if sequencer is available, + and use it in preference. */ + if (drv == MD_AUTO) drv = MD_MIDIEMU; +#endif + + switch(drv) { + case MD_AUTO: + case MD_NULL: return MidiDriver_NULL_create(); + case MD_MIDIEMU: return MidiDriver_MIDIEMU_create(); +#if defined(WIN32) && !defined(_WIN32_WCE) + case MD_WINDOWS: return MidiDriver_WIN_create(); +#endif +#if defined(__MORPHOS__) + case MD_AMIDI: return MidiDriver_AMIDI_create(); +#endif +#if defined(UNIX) && !defined(__BEOS__) + case MD_SEQ: return MidiDriver_SEQ_create(); +#endif +#if defined(__APPLE__) || defined(macintosh) + case MD_QTMUSIC: return MidiDriver_QT_create(); +#endif +#if defined(MACOSX) + case MD_COREAUDIO: return MidiDriver_CORE_create(); +#endif +#if defined(UNIX) && defined(USE_ALSA) + case MD_ALSA: return MidiDriver_ALSA_create(); +#endif + } + + error("Invalid midi driver selected"); + return NULL; +} diff --git a/common/gameDetector.h b/common/gameDetector.h new file mode 100644 index 0000000000..4cbfa3453f --- /dev/null +++ b/common/gameDetector.h @@ -0,0 +1,79 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef GAMEDETECTOR_H +#define GAMEDETECTOR_H + +class OSystem; +class MidiDriver; + +class GameDetector { +public: + int detectMain(int argc, char **argv); + void parseCommandLine(int argc, char **argv); + bool detectGame(void); + char *getGameName(void); + + bool _fullScreen; + byte _gameId; + bool _simon; + + bool _use_adlib; + + int _music_volume; + int _sfx_volume; + bool _amiga; + + uint16 _talkSpeed; + uint16 _debugMode; + uint16 _noSubtitles; + uint16 _bootParam; + uint16 _soundCardType; + + char *_gameDataPath; + int _gameTempo; + int _midi_driver; + char *_exe_name; + const char *_gameText; + uint32 _features; + + int _gfx_driver; + int _gfx_mode; + + int _scummVersion; + int _cdrom; + int _save_slot; + + bool _saveconfig; + + int parseGraphicsMode(const char *s); + + bool parseMusicDriver(const char *s); + + void updateconfig(); + +public: + OSystem *createSystem(); + MidiDriver *createMidi(); +}; + +#endif diff --git a/common/main.cpp b/common/main.cpp new file mode 100644 index 0000000000..43fd2e4563 --- /dev/null +++ b/common/main.cpp @@ -0,0 +1,150 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "engine.h" +#include "scumm.h" +#include "sound/mididrv.h" +#include "gameDetector.h" +#include "simon/simon.h" +#include "config-file.h" + +GameDetector detector; + +Config *scummcfg = 0; + + +#if defined(QTOPIA) +// FIXME - why exactly is this needed? +extern "C" int main(int argc, char *argv[]); +#endif + +#if defined(MACOSX) || defined(QTOPIA) +#include +#elif !defined(__MORPHOS__) +#undef main +#endif + +#if defined(UNIX) +#include +#ifndef MAXPATHLEN +#define MAXPATHLEN 256 +#endif +#define DEFAULT_CONFIG_FILE ".scummvmrc" +#else +#define DEFAULT_CONFIG_FILE "scummvm.ini" +#endif + +#if defined(UNIX) +#include + +#ifndef SCUMM_NEED_ALIGNMENT +static void handle_errors(int sig_num) { + error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); +} +#endif + +/* This function is here to test if the endianness / alignement compiled it is matching + with the one at run-time. */ +static void do_memory_test(void) { + unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }; + unsigned int value; + /* First test endianness */ +#ifdef SCUMM_LITTLE_ENDIAN + if (*((int *) test) != 0x44332211) { + error("Compiled as LITTLE_ENDIAN on a big endian system. Please rebuild "); + } + value = 0x55443322; +#else + if (*((int *) test) != 0x11223344) { + error("Compiled as BIG_ENDIAN on a little endian system. Please rebuild "); + } + value = 0x22334455; +#endif + /* Then check if one really supports unaligned memory accesses */ +#ifndef SCUMM_NEED_ALIGNMENT + signal(SIGBUS, handle_errors); + signal(SIGABRT, handle_errors); + signal(SIGSEGV, handle_errors); + if (*((unsigned int *) ((char *) test + 1)) != value) { + error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); + } + signal(SIGBUS, SIG_DFL); + signal(SIGABRT, SIG_DFL); + signal(SIGSEGV, SIG_DFL); +#endif +} + +#endif + +int main(int argc, char *argv[]) +{ +#ifdef __DC__ + extern void dc_init_hardware(); + dc_init_hardware(); +#endif + +#if defined(UNIX) + /* On Unix, do a quick endian / alignement check before starting */ + do_memory_test(); + + char scummhome[MAXPATHLEN]; + if(getenv("HOME") != NULL) + sprintf(scummhome,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE); + else strcpy(scummhome,DEFAULT_CONFIG_FILE); +#else + char scummhome[255]; + #if defined (WIN32) && !defined(_WIN32_WCE) + GetWindowsDirectory(scummhome, 255); + strcat(scummhome, "\\"); + strcat(scummhome, DEFAULT_CONFIG_FILE); + #else + strcpy(scummhome,DEFAULT_CONFIG_FILE); + #endif +#endif + + scummcfg = new Config(scummhome, "scummvm"); + scummcfg->set("versioninfo", SCUMMVM_VERSION); + if (detector.detectMain(argc, argv)) + return (-1); + + OSystem *system = detector.createSystem(); + + { + char *s = detector.getGameName(); + OSystem::Property prop; + + prop.caption = s; + system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop); + free(s); + } + + // Create the game engine + Engine *engine = Engine::createFromDetector(&detector, system); + + // Run the game engine + engine->go(); + + delete scummcfg; + + return 0; +} diff --git a/common/scummsys.h b/common/scummsys.h new file mode 100644 index 0000000000..74fcfbcb84 --- /dev/null +++ b/common/scummsys.h @@ -0,0 +1,366 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ +#ifndef __SCUMMSYS_H_ +#define __SCUMMSYS_H_ + +#include + +#if defined(HAVE_NO_BOOL) +typedef int bool; +const bool true(1), false(0); +#endif /* HAVE_NO_BOOL */ + +#if defined(_MSC_VER) + +//#pragma warning (disable: 4244) +//#pragma warning (disable: 4101) + +#define scumm_stricmp stricmp + +#if defined(CHECK_HEAP) +#undef CHECK_HEAP +#define CHECK_HEAP checkHeap(); +#else +#define CHECK_HEAP +#endif + +#define SCUMM_LITTLE_ENDIAN + +#define FORCEINLINE __forceinline +#define NORETURN _declspec(noreturn) + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#define START_PACK_STRUCTS pack (push,1) +#define END_PACK_STRUCTS pack(pop) +#define GCC_PACK + +#elif defined(__MINGW32__) + +#define scumm_stricmp stricmp +#define CHECK_HEAP +#define SCUMM_LITTLE_ENDIAN + +#define FORCEINLINE inline +#define NORETURN __attribute__((__noreturn__)) +#define GCC_PACK __attribute__((packed)) +#define _HEAPOK 0 + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#define START_PACK_STRUCTS pack (push,1) +#define END_PACK_STRUCTS pack(pop) + +#elif defined(UNIX) || defined(__APPLE__) + +#define scumm_stricmp strcasecmp + +#define CHECK_HEAP + +#ifdef X11_BACKEND + +/* You need to set those manually */ +#define SCUMM_LITTLE_ENDIAN +/* #define SCUMM_NEED_ALIGNMENT */ + +#else +/* need this for the SDL_BYTEORDER define */ +#include + +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SCUMM_LITTLE_ENDIAN +#elif SDL_BYTEORDER == SDL_BIG_ENDIAN +#define SCUMM_BIG_ENDIAN +#define SCUMM_NEED_ALIGNMENT +#else +#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set. +#endif +#endif + +#define FORCEINLINE inline +#define CDECL + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; + +# if defined(__DECCXX) // Assume alpha architecture + +# define INVERSE_MKID +# define SCUMM_NEED_ALIGNMENT + +typedef unsigned int uint32; +typedef signed int int32; + +# else + +typedef unsigned long uint32; +typedef signed long int32; + +# endif + + +#if defined(__GNUC__) +#define START_PACK_STRUCTS +#define END_PACK_STRUCTS +#define GCC_PACK __attribute__((packed)) +#define NORETURN __attribute__((__noreturn__)) +#else +#define START_PACK_STRUCTS pack (1) +#define END_PACK_STRUCTS pack () +#define GCC_PACK +#define NORETURN +#endif + +#elif defined(macintosh) +#include + +#include "macos.h" + +#define scumm_stricmp strcmp +inline char* strdup(char *buf) {return (char*)buf;}; + +#define CHECK_HEAP +#define SCUMM_BIG_ENDIAN + +#define FORCEINLINE inline +#define CDECL + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#define START_PACK_STRUCTS pack (1) +#define END_PACK_STRUCTS pack () +#define GCC_PACK +#define NORETURN +#define USE_QTMUSIC +#define NEED_STRDUP + +#elif defined(__MORPHOS__) +#define scumm_stricmp stricmp +#define CHECK_HEAP + +#define SCUMM_BIG_ENDIAN +#define SCUMM_NEED_ALIGNMENT + +#define FORCEINLINE inline +#define CDECL + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#if defined(__GNUC__) + #define START_PACK_STRUCTS + #define END_PACK_STRUCTS + #define GCC_PACK __attribute__((packed)) + #define NORETURN __attribute__((__noreturn__)) +#else + #define START_PACK_STRUCTS pack (1) + #define END_PACK_STRUCTS pack () + #define GCC_PACK + #define NORETURN +#endif +#define main morphos_main +#elif defined(__DC__) + +#define scumm_stricmp strcasecmp +#define CHECK_HEAP +#define SCUMM_LITTLE_ENDIAN +#define SCUMM_NEED_ALIGNMENT + +#define FORCEINLINE inline +#define NORETURN __attribute__((__noreturn__)) +#define GCC_PACK __attribute__((packed)) +#define CDECL + +typedef unsigned char byte; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; +typedef unsigned int uint; +typedef signed char int8; +typedef signed short int16; +typedef signed long int32; + +#define START_PACK_STRUCTS pack (push,1) +#define END_PACK_STRUCTS pack(pop) + +#else +#error No system type defined +#endif + + +#if defined(SCUMM_LITTLE_ENDIAN) + +//#if defined(SCUMM_NEED_ALIGNMENT) +//#error Little endian processors that need alignment is not implemented +//#endif + + +#define PROTO_MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) +#define PROTO_MKID_BE(a) (a & 0xffffffff) + +#if defined(INVERSE_MKID) +# define MKID(a) PROTO_MKID_BE(a) +# define MKID_BE(a) PROTO_MKID(a) +#else +# define MKID(a) PROTO_MKID(a) +# define MKID_BE(a) PROTO_MKID_BE(a) +#endif + + +#if defined(SCUMM_NEED_ALIGNMENT) + FORCEINLINE uint READ_LE_UINT16(void *ptr) { + return (((byte*)ptr)[1]<<8)|((byte*)ptr)[0]; + } +#else + FORCEINLINE uint READ_LE_UINT16(void *ptr) { + return *(uint16*)(ptr); + } +#endif + +FORCEINLINE uint READ_BE_UINT16(void *ptr) { + return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; +} + +#if defined(SCUMM_NEED_ALIGNMENT) + FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); + } +#else + FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { + return *(uint32*)(ptr); + } +#endif + +FORCEINLINE uint32 READ_BE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); +} + +#define READ_BE_UINT32_UNALIGNED READ_BE_UINT32 +#define READ_BE_UINT16_UNALIGNED READ_BE_UINT16 + +#define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a) + +#define FROM_LE_32(__a__) __a__ +#define FROM_LE_16(__a__) __a__ + +#define TO_LE_32(__a__) __a__ +#define TO_LE_16(__a__) __a__ + +#define TO_BE_32(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) + +uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } + +#elif defined(SCUMM_BIG_ENDIAN) + +#define MKID(a) (a) +#define MKID_BE(a) (a) +//#define MKID_BE(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) + +uint32 FORCEINLINE FROM_LE_32(uint32 a) { + return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000); +} + +uint16 FORCEINLINE FROM_LE_16(uint16 a) { + return ((a>>8)&0xFF) + ((a<<8)&0xFF00); +} + +#define TO_LE_32 FROM_LE_32 +#define TO_LE_16 FROM_LE_16 + +uint32 FORCEINLINE READ_LE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); +} + +uint32 FORCEINLINE READ_BE_UINT32(void *ptr) { + return *(uint32*)(ptr); +} + +uint FORCEINLINE READ_LE_UINT16(void *ptr) { + byte *b = (byte*)ptr; + return (b[1]<<8) + b[0]; +} + +uint FORCEINLINE READ_BE_UINT16(void *ptr) { + return *(uint16*)(ptr); +} + +uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) { + return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; +} + +uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) { + byte *b = (byte*)ptr; + return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); +} + +#define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED + +#define TO_BE_32(a) (a) +#define TO_BE_16(a) (a) +#else + +#error No endianness defined + +#endif + + +#ifdef NEED_STRDUP +char *strdup(const char *s); +#endif + +/* Initialized operator new */ +void * operator new(size_t size); + +#endif diff --git a/common/stdafx.cpp b/common/stdafx.cpp new file mode 100644 index 0000000000..fd4f341c7b --- /dev/null +++ b/common/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/common/stdafx.h b/common/stdafx.h new file mode 100644 index 0000000000..de4f0156ce --- /dev/null +++ b/common/stdafx.h @@ -0,0 +1,169 @@ +/* + * $Id$ + * + * $Log$ + * Revision 1.1 2002/08/21 16:07:23 fingolfin + * Initial revision + * + * Revision 1.18 2002/07/08 13:33:10 fingolfin + * two more small QNX fixes + * + * Revision 1.17 2002/06/02 20:28:09 bbrox + * Small warning fix + double inclusion protection (can always be useful + * :) ). + * + * Revision 1.16 2002/05/05 20:04:25 fingolfin + * cleaning up the mess drigo left... + * + * Revision 1.15 2002/05/05 19:06:51 drigo + * Fixed some things for Macintosh ports + * + * Revision 1.14 2002/04/18 21:40:23 tomjoad + * Reenable MorphOS Midi driver, small updates to CD open code (only when CD audio is requested) and start options + * + * Revision 1.13 2002/04/12 21:26:34 strigeus + * new video engine (expect broken non-sdl builds), + * simon the sorcerer 1 & 2 support (non SCUMM games) + * + * Revision 1.12 2002/03/14 22:45:22 arisme + * Minor changes to compile WinCE port + * + * Revision 1.11 2002/03/09 13:48:53 drigo + * Support for MacOS classic port + * + * Revision 1.10 2002/03/08 17:05:09 mutle + * Some changes, need to be done to get the Mac Port running. For example Point is now called ScummPoint, as the name Point is already in use by Apple. + * + * Revision 1.9 2002/03/06 12:24:56 ender + * Applied cleanup and scaling patch by Rob. + * + * Revision 1.8 2001/11/20 07:13:01 vasyl + * Added ability for ports to override all includes in stdafx.h. To use this feature + * port must define symbol NONSTANDARD_PORT. Port must also provide + * port-specific portdefs.h with all includes, symbol defines and everything else + * port needs. + * + * Revision 1.7 2001/11/11 16:54:45 strigeus + * implemented some sam&max specific features, + * fixed some bugs + * + * Revision 1.6 2001/11/06 22:59:59 cmatsuoka + * Re-added changes to allow cygwin and beos cross-compilation. + * + */ + +#ifndef _STDAFX_H +#define _STDAFX_H + +#if defined(NONSTANDARD_PORT) + +#include + +#elif defined(WIN32) + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +#if !defined(_WIN32_WCE) + + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define NOGDICAPMASKS +#define OEMRESOURCE +#define NONLS +#define NOICONS +#define NOMCX +#define NOPROFILER +#define NOKANJI +#define NOSERVICE +#define NOMETAFILE +#define NOCOMM +#define NOCRYPT +#define NOIME +#define NOATOM +#define NOCTLMGR +#define NOCLIPBOARD +#define NOMEMMGR +#define NOSYSMETRICS +#define NOMENUS +#define NOOPENFILE +#define NOWH +#define NOSOUND +#define NODRAWTEXT + + +#endif + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#else + +#if defined(__MORPHOS__) +#include +#undef CMD_INVALID +#endif +#if !defined(macintosh) +#include +#include +#endif +#if !defined (__BEOS__) +#include +#endif +#if defined(__QNXNTO__) +#include /* For strcasecmp */ +#endif +#include +#include +#include +#include +#include +#include +#include + + +#endif + + +/* Semi-Platform-specific version info */ +#ifdef ALLOW_GDI +/* Assume Win32 GDI is used, then... */ +#define SCUMMVM_PLATFORM_VERSION "Win32 GDI version" + +#else +#ifdef ALLOW_X11 +/* Assume pure X11 is used, then... */ +#define SCUMMVM_PLATFORM_VERSION "X11 version" + +#else + +#ifdef MACOS_CARBON +#define SCUMMVM_PLATFORM_VERSION "Macintosh version" +#else + +#ifdef SDL_COMPILEDVERSION +#define SCUMMVM_PLATFORM_VERSION "SDL version" +//SDL_COMPILEDVERSION is a number... :( +//SDL_Linked_Version returns an SDL_Version structure... + +#endif +#endif +#endif +#endif + +#endif diff --git a/common/system.h b/common/system.h new file mode 100644 index 0000000000..b8255eff48 --- /dev/null +++ b/common/system.h @@ -0,0 +1,199 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef _SYSTEM_H +#define _SYSTEM_H + +/* Interface to what's below ScummVM */ + +class OSystem { +public: + typedef int ThreadProc(void *param); + typedef void SoundProc(void *param, byte *buf, int len); + + struct Event { + int event_code; + struct { + uint16 ascii; + byte flags; + int keycode; + } kbd; + struct { + int x,y; + } mouse; + }; + + enum { + EVENT_KEYDOWN = 1, + EVENT_KEYUP = 2, + EVENT_MOUSEMOVE = 3, + EVENT_LBUTTONDOWN = 4, + EVENT_LBUTTONUP = 5, + EVENT_RBUTTONDOWN = 6, + EVENT_RBUTTONUP = 7, + }; + + enum { + KBD_CTRL = 1, + KBD_ALT = 2, + KBD_SHIFT = 4, + }; + + enum { + PROP_TOGGLE_FULLSCREEN = 1, + PROP_SET_WINDOW_CAPTION = 2, + PROP_OPEN_CD = 3, + PROP_SET_GFX_MODE = 4, + PROP_SHOW_DEFAULT_CURSOR = 5, + PROP_GET_SAMPLE_RATE = 6, + PROP_GET_FULLSCREEN = 7 + }; + union Property { + char *caption; + int cd_num; + int gfx_mode; + bool show_cursor; + }; + + enum { + SOUND_8BIT = 0, + SOUND_16BIT = 1, + }; + + // Set colors of the palette + virtual void set_palette(const byte *colors, uint start, uint num) = 0; + + // Set the size of the video bitmap. + // Typically, 320x200 + virtual void init_size(uint w, uint h) = 0; + + // Draw a bitmap to screen. + // The screen will not be updated to reflect the new bitmap + virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) = 0; + + // Update the dirty areas of the screen + virtual void update_screen() = 0; + + // Either show or hide the mouse cursor + virtual bool show_mouse(bool visible) = 0; + + // Set the position of the mouse cursor + virtual void set_mouse_pos(int x, int y) = 0; + + // Set the bitmap that's used when drawing the cursor. + virtual void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) = 0; + + // Shaking is used in SCUMM. Set current shake position. + virtual void set_shake_pos(int shake_pos) = 0; + + // Get the number of milliseconds since the program was started. + virtual uint32 get_msecs() = 0; + + // Delay for a specified amount of milliseconds + virtual void delay_msecs(uint msecs) = 0; + + // Create a thread + virtual void *create_thread(ThreadProc *proc, void *param) = 0; + + // Get the next event. + // Returns true if an event was retrieved. + virtual bool poll_event(Event *event) = 0; + + // Set the function to be invoked whenever samples need to be generated + // Format is the sample type format. + // Only 16-bit signed mode is needed for simon & scumm + virtual bool set_sound_proc(void *param, SoundProc *proc, byte format) = 0; + + // Get or set a property + virtual uint32 property(int param, Property *value) = 0; + + // Poll cdrom status + // Returns true if cd audio is playing + virtual bool poll_cdrom() = 0; + + // Play cdrom audio track + virtual void play_cdrom(int track, int num_loops, int start_frame, int end_frame) = 0; + + // Stop cdrom audio track + virtual void stop_cdrom() = 0; + + // Update cdrom audio status + virtual void update_cdrom() = 0; + + // Add a new callback timer + virtual void set_timer(int timer, int (*callback)(int)) = 0; + + // Mutex handling + virtual void *create_mutex(void) = 0; + virtual void lock_mutex(void *mutex) = 0; + virtual void unlock_mutex(void *mutex) = 0; + virtual void delete_mutex(void *mutex) = 0; + + // Quit + virtual void quit() = 0; +}; + + +/* Factory functions. This means we don't have to include the + * OSystem_SDL header file. (which in turn would require the SDL headers) + */ + +/* OSystem_SDL */ +extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen); +extern OSystem *OSystem_NULL_create(); +extern OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen); +extern OSystem *OSystem_Dreamcast_create(); +extern OSystem *OSystem_WINCE3_create(); +extern OSystem *OSystem_X11_create(); +extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen); + +enum { + GFX_NORMAL = 0, + GFX_DOUBLESIZE = 1, + GFX_TRIPLESIZE = 2, + GFX_2XSAI = 3, + GFX_SUPER2XSAI = 4, + GFX_SUPEREAGLE = 5, + GFX_ADVMAME2X = 6 +}; + + +/* Graphics drivers */ +enum { + GD_NULL = 0, + GD_SDL, + GD_X, + GD_MORPHOS, + GD_WINCE, + GD_MAC, + GD_DC +}; + +enum { +#ifdef _WIN32_WCE + SAMPLES_PER_SEC = 11025 +#else + SAMPLES_PER_SEC = 22050 +#endif +}; + +#endif diff --git a/common/timer.cpp b/common/timer.cpp new file mode 100644 index 0000000000..2a3fc74024 --- /dev/null +++ b/common/timer.cpp @@ -0,0 +1,157 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" +#include "scummsys.h" +#include "timer.h" + +static Scumm * scumm; + +Timer::Timer(Scumm * parent) { + _initialized = false; + _timerRunning = false; + scumm = _scumm = parent; +} + +Timer::~Timer() { + release (); +} + +static int timer_handler (int t) +{ + scumm->_timer->handler (&t); + return t; +} + +int Timer::handler(int * t) { + uint32 interval, l; + + if (_timerRunning) { + _lastTime = _thisTime; + _thisTime = _osystem->get_msecs(); + interval = _thisTime - _lastTime; + + for (l = 0; l < MAX_TIMERS; l++) { + if ((_timerSlots[l].procedure) && (_timerSlots[l].interval > 0)) { + _timerSlots[l].counter -= interval; + if (_timerSlots[l].counter <= 0) { + _timerSlots[l].counter += _timerSlots[l].interval; + _timerSlots[l].procedure (_scumm); + } + } + } + } + + return *t; +} + +bool Timer::init() { + int32 l; + + _osystem = _scumm->_system; + if (_osystem == NULL) { + printf("Timer: OSystem not initialized !\n"); + return false; + } + + if (_initialized == true) + return true; + + for (l = 0; l < MAX_TIMERS; l++) { + _timerSlots[l].procedure = NULL; + _timerSlots[l].interval = 0; + _timerSlots[l].counter = 0; + } + + _thisTime = _osystem->get_msecs(); + _osystem->set_timer (10, &timer_handler); + + _timerRunning = true; + _initialized = true; + return true; +} + +void Timer::release() { + int32 l; + + if (_initialized == false) + return; + + _timerRunning = false; + _osystem->set_timer (0, NULL); + _initialized = false; + + for (l = 0; l < MAX_TIMERS; l++) { + _timerSlots[l].procedure = NULL; + _timerSlots[l].interval = 0; + _timerSlots[l].counter = 0; + } +} + +bool Timer::installProcedure (TimerProc procedure, int32 interval) { + int32 l; + bool found = false; + + if (_initialized == false) { + printf ("Timer: is not initialized !"); + return false; + } + + _timerRunning = false; + for (l = 0; l < MAX_TIMERS; l++) { + if (!_timerSlots[l].procedure) { + _timerSlots[l].procedure = procedure; + _timerSlots[l].interval = interval; + _timerSlots[l].counter = interval; + found = true; + break; + } + } + + _timerRunning = true; + if (!found) { + printf ("Can't find free slot !"); + return false; + } + + return true; +} + +void Timer::releaseProcedure (TimerProc procedure) { + int32 l; + + if (_initialized == false) { + printf ("Timer: is not initialized !"); + return; + } + + _timerRunning = false; + for (l = 0; l < MAX_TIMERS; l++) { + if (_timerSlots[l].procedure == procedure) { + _timerSlots[l].procedure = 0; + _timerSlots[l].interval = 0; + _timerSlots[l].counter = 0; + } + } + _timerRunning = true; +} + + diff --git a/common/timer.h b/common/timer.h new file mode 100644 index 0000000000..a4f4c7080d --- /dev/null +++ b/common/timer.h @@ -0,0 +1,66 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef TIMER_H +#define TIMER_H + +#include "scummsys.h" + +#define MAX_TIMERS 5 + +typedef void (*TimerProc)(Scumm *); + +#ifdef __MORPHOS__ +#include "morphos/morphos_timer.h" +#else + +class OSystem; + +class Timer { + +private: + OSystem *_osystem; + Scumm *_scumm; + bool _initialized; + bool _timerRunning; + void *_timerHandler; + int32 _thisTime; + int32 _lastTime; + + struct TimerSlots { + TimerProc procedure; + int32 interval; + int32 counter; + } _timerSlots[MAX_TIMERS]; + +public: + Timer(Scumm *system); + ~Timer(); + + int handler(int *t); + bool init(); + void release(); + bool installProcedure(TimerProc procedure, int32 interval); + void releaseProcedure(TimerProc procedure); +}; + +#endif + +#endif diff --git a/common/util.cpp b/common/util.cpp new file mode 100644 index 0000000000..4a5d50e369 --- /dev/null +++ b/common/util.cpp @@ -0,0 +1,312 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "util.h" + +// 8-bit alpha blending routines +int BlendCache[256][256]; + +int RGBMatch(byte *palette, int r, int g, int b) +{ + int i, bestidx = 0, besterr = 0xFFFFFF; + int error = 0; + + for (i = 0;i < 256;i++) { + byte *pal = palette + (i * 3); + int r_diff = r - (int)*pal++; + int g_diff = g - (int)*pal++; + int b_diff = b - (int)*pal++; + r_diff *= r_diff; g_diff *= g_diff; b_diff *= b_diff; + + error = r_diff + g_diff + b_diff; + if (error < besterr) { + besterr = error; + bestidx = i; + } + } + return bestidx; +} + +int Blend(int src, int dst, byte *palette) +{ + int r, g, b; + int alpha = 128; // Level of transparency [0-256] + byte *srcpal = palette + (dst * 3); + byte *dstpal = palette + (src * 3); + + if (BlendCache[dst][src] > -1) + return BlendCache[dst][src]; + + r = (*srcpal++ * alpha); + r += (*dstpal++ * (256-alpha)); + r /= 256; + + g = (*srcpal++ * alpha); + g += (*dstpal++ * (256-alpha)); + g /= 256; + + b = (*srcpal++ * alpha); + b += (*dstpal++ * (256-alpha)); + b /= 256; + + return (BlendCache[dst][src] = RGBMatch(palette, r , g , b )); +} + +void ClearBlendCache(byte *palette, int weight) +{ + for (int i = 0; i < 256; i++) + for (int j = 0 ; j < 256 ; j++) +// BlendCache[i][j] = i; // No alphablending +// BlendCache[i][j] = j; // 100% translucent + BlendCache[i][j] = -1; // Enable alphablending +} + + +#pragma mark - + +/* + * Print hexdump of the data passed in, 8 bytes a row + */ +void hexdump(const byte * data, int len) +{ + int i; + byte c; + while (len >= 8) { + for (i = 0; i < 8; i++) + printf("%02x ", data[i]); + printf(" |"); + for (i = 0; i < 8; i++) { + c = data[i]; + if (c < 32 || c > 127) + c = '.'; + printf("%c", c); + } + printf("|\n"); + data += 8; + len -= 8; + } + + if (len <= 0) + return; + + for (i = 0; i < len; i++) + printf("%02x ", data[i]); + for (; i < 8; i++) + printf(" "); + printf(" |"); + for (i = 0; i < len; i++) { + c = data[i]; + if (c < 32 || c > 127) + c = '.'; + printf("%c", c); + } + for (; i < 8; i++) + printf(" "); + printf("|\n"); +} + + +#pragma mark - + + +namespace ScummVM { + +String::String(const char *str) +{ + _refCount = new int(1); + _capacity = _len = strlen(str); + _str = (char *)calloc(1, _capacity+1); + memcpy(_str, str, _len+1); +} + +String::String(const String &str) +{ + ++(*str._refCount); + + _refCount = str._refCount; + _capacity = str._capacity; + _len = str._capacity; + _str = str._str; +} + +String::~String() +{ + decRefCount(); +} + +void String::decRefCount() +{ + --(*_refCount); + if (*_refCount <= 0) { + delete _refCount; + if (_str) + free(_str); + } +} + +String& String::operator =(const char* str) +{ + int len = strlen(str); + if (len > 0) { + ensureCapacity(len, false); + + _len = len; + memcpy(_str, str, _len + 1); + } else if (_len > 0) { + decRefCount(); + + _refCount = new int(1); + _capacity = 0; + _len = 0; + _str = 0; + } + return *this; +} + +String& String::operator =(const String& str) +{ + ++(*str._refCount); + + decRefCount(); + + _refCount = str._refCount; + _capacity = str._capacity; + _len = str._len; + _str = str._str; + + return *this; +} + +String& String::operator +=(const char* str) +{ + int len = strlen(str); + if (len > 0) { + ensureCapacity(_len + len, true); + + memcpy(_str + _len, str, len + 1); + _len += len; + } + return *this; +} + +String& String::operator +=(const String& str) +{ + int len = str._len; + if (len > 0) { + ensureCapacity(_len + len, true); + + memcpy(_str + _len, str._str, len + 1); + _len += len; + } + return *this; +} + +String& String::operator +=(char c) +{ + ensureCapacity(_len + 1, true); + + _str[_len++] = c; + _str[_len] = 0; + + return *this; +} + +bool String::operator ==(const String& x) +{ + return (_len == x._len) && ((_len == 0) || (0 == strcmp(_str, x._str))); +} + +bool String::operator ==(const char* x) +{ + if (_str == 0) + return (x == 0) || (*x == 0); + if (x == 0) + return (_len == 0); + return (0 != strcmp(_str, x)); +} + +bool String::operator !=(const String& x) +{ + return (_len != x._len) || ((_len != 0) && (0 != strcmp(_str, x._str))); +} + +bool String::operator !=(const char* x) +{ + if (_str == 0) + return (x != 0) && (*x != 0); + if (x == 0) + return (_len != 0); + return (0 == strcmp(_str, x)); +} + + +void String::deleteLastChar() { + if (_len > 0) { + ensureCapacity(_len - 1, true); + _str[--_len] = 0; + } +} + +void String::clear() +{ + if (_capacity) { + decRefCount(); + + _refCount = new int(1); + _capacity = 0; + _len = 0; + _str = 0; + } +} + +void String::ensureCapacity(int new_len, bool keep_old) +{ + // If there is not enough space, or if we are not the only owner + // of the current data, then we have to reallocate it. + if (new_len <= _capacity && *_refCount == 1) + return; + + int newCapacity = (new_len <= _capacity) ? _capacity : new_len + 32; + char *newStr = (char *)calloc(1, newCapacity+1); + + if (keep_old && _str) + memcpy(newStr, _str, _len + 1); + else + _len = 0; + + decRefCount(); + + _refCount = new int(1); + _capacity = newCapacity; + _str = newStr; +} + +bool operator == (const char* y, const String& x) +{ + return x == y; +} + +bool operator != (const char* y, const String& x) +{ + return x != y; +} + +}; // End of namespace ScummVM diff --git a/common/util.h b/common/util.h new file mode 100644 index 0000000000..0f74ede00f --- /dev/null +++ b/common/util.h @@ -0,0 +1,183 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef UTIL_H +#define UTIL_H + +#include "scummsys.h" + +int RGBMatch(byte *palette, int r, int g, int b); +int Blend(int src, int dst, byte *palette); +void ClearBlendCache(byte *palette, int weight); + +/* + * Print hexdump of the data passed in, 8 bytes a row + */ +void hexdump(const byte * data, int len); + + +namespace ScummVM { + +template +class List { +protected: + int _capacity; + int _size; + T *_data; + +public: + List() : _capacity(0), _size(0), _data(0) {} + List(const List& list) : _capacity(0), _size(0), _data(0) + { + _size = list._size; + _capacity = _size + 32; + _data = new T[_capacity]; + for (int i = 0; i < _size; i++) + _data[i] = list._data[i]; + } + + ~List() + { + if (_data) + delete [] _data; + } + + void push_back(const T& str) + { + ensureCapacity(_size + 1); + _data[_size++] = str; + } + + // TODO: insert, remove, ... + + T& operator [](int idx) + { + assert(idx >= 0 && idx < _size); + return _data[idx]; + } + + const T& operator [](int idx) const + { + assert(idx >= 0 && idx < _size); + return _data[idx]; + } + + List& operator =(const List& list) + { + if (_data) + delete [] _data; + _size = list._size; + _capacity = _size + 32; + _data = new T[_capacity]; + for (int i = 0; i < _size; i++) + _data[i] = list._data[i]; + + return *this; + } + + int size() const { return _size; } + + void clear() + { + if (_data) { + delete [] _data; + _data = 0; + } + _size = 0; + _capacity = 0; + } + + bool isEmpty() const { return (_size == 0); } + +protected: + void ensureCapacity(int new_len) + { + if (new_len <= _capacity) + return; + + T *old_data = _data; + _capacity = new_len + 32; + _data = new T[_capacity]; + + if (old_data) { + // Copy old data + for (int i = 0; i < _size; i++) + _data[i] = old_data[i]; + delete [] old_data; + } + } +}; + + +class String { +protected: + int *_refCount; + int _capacity; + int _len; + char *_str; +public: + String() : _capacity(0), _len(0), _str(0) { _refCount = new int(1); } + String(const char *str); + String(const String &str); + ~String(); + + String& operator =(const char* str); + String& operator =(const String& str); + String& operator +=(const char* str); + String& operator +=(const String& str); + String& operator +=(char c); + + bool operator ==(const String& x); + bool operator ==(const char* x); + bool operator !=(const String& x); + bool operator !=(const char* x); + +// operator char *() { return _str; } + operator const char *() const { return _str; } + const char *c_str() const { return _str; } + int size() const { return _len; } + + void deleteLastChar(); + void clear(); + + bool isEmpty() const { return (_len == 0); } + +protected: + void ensureCapacity(int new_len, bool keep_old); + void decRefCount(); +}; + +// Some useful additional comparision operators for Strings +bool operator == (const char* x, const String& y); +bool operator != (const char* x, const String& y); + +class StringList : public List { +public: + void push_back(const char* str) + { + ensureCapacity(_size + 1); + _data[_size] = str; + _size++; + } +}; + +}; // End of namespace ScummVM + +#endif diff --git a/config-file.cpp b/config-file.cpp deleted file mode 100644 index b56630f5c5..0000000000 --- a/config-file.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include -#include -#include "stdafx.h" -#include "config-file.h" -#include "scumm.h" - -#define MAXLINELEN 256 - -#define xfree(p) {if (p) free(p);} - - -static char *ltrim(char *t) -{ - for (; *t && (*t == ' '); t++); - return t; -} - -static char *rtrim(char *t) -{ - int l; - - for (l = strlen(t) - 1; l; l--) { - if (t[l] == ' ') { - *t = 0; - } else { - return t; - } - } - return t; -} - -class hashconfig { -public: - hashconfig (const char *); - ~hashconfig (); - bool is_domain(const char *) const; - const char *get(const char *) const; - const char *set(const char *, const char *); - const char *getdomain() const; - void flush(FILE *) const; - void rename(const char *); - void merge(const hashconfig *); -private: - char *domain; - char **keys, **values; - int nkeys; -}; - -hashconfig::hashconfig (const char *dom):domain(dom ? strdup(dom) : 0), -keys(0), values(0), nkeys(0) -{ -} - -hashconfig::~hashconfig () { - xfree(domain); -} - -bool hashconfig::is_domain(const char *d) const -{ - return d && domain && !strcmp(d, domain); -} - -const char *hashconfig::get(const char *key) const -{ - int i; - - for (i = 0; i < nkeys; i++) { - if (!strcmp(key, keys[i])) { - return values[i]; - } - } - - return 0; -} - -const char *hashconfig::set(const char *key, const char *value) -{ - int i; - - for (i = 0; i < nkeys; i++) { - if (!strcmp(key, keys[i])) { - xfree(values[i]); - return values[i] = value ? strdup(value) : 0; - } - } - - nkeys++; - keys = (char **)realloc(keys, nkeys * sizeof(char *)); - values = (char **)realloc(values, nkeys * sizeof(char *)); - keys[nkeys - 1] = strdup(key); - return values[nkeys - 1] = value ? strdup(value) : 0; -} - -const char *hashconfig::getdomain() const -{ - return domain; -} - -void hashconfig::flush(FILE *cfg_file) const -{ - int i; - - if (!domain) - return; - - fprintf(cfg_file, "[%s]\n", domain); - - for (i = 0; i < nkeys; i++) { - if (values[i]) { - fprintf(cfg_file, "%s=%s\n", keys[i], values[i]); - } - } - fprintf(cfg_file, "\n"); -} - -void hashconfig::rename(const char *d) -{ - xfree(domain); - domain = d ? strdup(d) : 0; -} - -void hashconfig::merge(const hashconfig *h) -{ - int i; - - for (i = 0; i < h->nkeys; i++) { - set(h->keys[i], h->values[i]); - } -} - -// The config-class itself. - -Config::Config (const char *cfg, const char *d) -: filename(strdup(cfg)), domain(d ? strdup(d) : 0), hash(0), ndomains(0), willwrite(false) -{ - FILE *cfg_file; - char t[MAXLINELEN]; - - if (!(cfg_file = fopen(cfg, "r"))) { - debug(1, "Unable to open configuration file: %s.\n", filename); - } else { - while (!feof(cfg_file)) { - if (!fgets(t, MAXLINELEN, cfg_file)) - continue; - if (t[0] != '#') { - if (t[0] == '[') { - // It's a new domain which begins here. - char *p = strchr(t, ']'); - if (!p) { - debug(1, "Config file buggy: no ] at the end of the domain name.\n"); - } else { - *p = 0; - set_domain(t + 1); - } - } else { - // It's a new key in the domain. - if (!domain) { - debug(1, "Config file buggy: we have a key without a domain first.\n"); - } - char *p = strchr(t, '\n'); - if (p) - *p = 0; - p = strchr(t, '\r'); - if (p) - *p = 0; - - if (!(p = strchr(t, '='))) { - if (strlen(t)) - debug(1, "Config file buggy: there is junk: %s\n", t); - } else { - char *key, *value; - *p = 0; - key = ltrim(rtrim(t)); - value = ltrim(p + 1); - set(key, value); - } - } - } - } - set_domain(d); - fclose(cfg_file); - } -} - -Config::~Config () { - int i; - - xfree(filename); - xfree(domain); - - for (i = 0; i < ndomains; i++) { - delete hash[i]; - } - xfree(hash); -} - -const char *Config::get(const char *key, const char *d) const -{ - int i; - - if (!d) - d = domain; - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(d)) { - return hash[i]->get(key); - } - } - - return 0; -} - -const int Config::getInt(const char *key, int def, const char *d) const -{ - const char *value = get(key, d); - - if (value) - return atoi(value); - return def; -} - -const bool Config::getBool(const char *key, bool def, const char *d) const -{ - const char *value = get(key, d); - - if (value) - return !scumm_stricmp(value, "true"); - return def; -} - -const char *Config::set(const char *key, const char *value, const char *d) -{ - int i; - - if (!d) - d = domain; - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(d)) { - return hash[i]->set(key, value); - } - } - - ndomains++; - hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); - hash[ndomains - 1] = new hashconfig (d); - - return hash[ndomains - 1]->set(key, value); -} - -const char *Config::set(const char *key, int value_i, const char *d) -{ - char value[MAXLINELEN]; - sprintf(value, "%i", value_i); - return set(key, value, d); -} - -const char *Config::set(const char *key, bool value_b, const char *d) -{ - const char *value = value_b ? "true" : "false"; - return set(key, value, d); -} - -void Config::set_domain(const char *d) -{ - int i; - xfree(domain); - domain = d ? strdup(d) : 0; - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(domain)) - return; - } - ndomains++; - hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); - hash[ndomains - 1] = new hashconfig (domain); -} - -void Config::flush() const -{ - FILE *cfg_file; - int i; - - if (!willwrite) - return; - - if (!(cfg_file = fopen(filename, "w"))) { - debug(1, "Unable to write configuration file: %s.\n", filename); - } else { - for (i = 0; i < ndomains; i++) { - hash[i]->flush(cfg_file); - } - fclose(cfg_file); - } -} - -void Config::rename_domain(const char *d) -{ - int i, index = -1; - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(d)) { - index = i; - } - } - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(domain)) { - if (index >= 0) { - hash[i]->merge(hash[index]); - hash[index]->rename(0); - rename_domain(d); - } else { - hash[i]->rename(d); - set_domain(d); - } - } - } -} - -void Config::delete_domain(const char *d) -{ - int i; - - for (i = 0; i < ndomains; i++) { - if (hash[i]->is_domain(d)) { - hash[i]->rename(0); - } - } -} - -void Config::change_filename(const char *f) -{ - xfree(filename); - filename = f ? strdup(f) : 0; -} - -void Config::merge_config(const Config *c) -{ - int i, j; - bool found; - - for (i = 0; i < c->ndomains; i++) { - found = false; - for (j = 0; j < ndomains; j++) { - if (hash[j]->is_domain(c->hash[i]->getdomain())) { - hash[j]->merge(c->hash[i]); - found = true; - break; - } - } - if (!found) { - ndomains++; - hash = (hashconfig **)realloc(hash, ndomains * sizeof(hashconfig *)); - hash[ndomains - 1] = new hashconfig (domain); - hash[ndomains - 1]->merge(c->hash[i]); - } - } -} - -void Config::set_writing(bool w) -{ - willwrite = w; -} diff --git a/config-file.h b/config-file.h deleted file mode 100644 index eee4cfde59..0000000000 --- a/config-file.h +++ /dev/null @@ -1,57 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef CONFIG_FILE_H -#define CONFIG_FILE_H - -class hashconfig; - -class Config { -public: - Config (const char * = "config.cfg", const char * = "default"); - ~Config (); - const char *get(const char *key, const char *dom = 0) const; - const int getInt(const char *key, int def = 0, const char *dom = 0) const; - const bool getBool(const char *key, bool def = false, const char *dom = 0) const; - - const char *set(const char *key, const char *value, const char *dom = 0); - const char *set(const char *key, int value, const char *dom = 0); - const char *set(const char *key, bool value, const char *dom = 0); - - void set_domain(const char *); - void flush() const; - void rename_domain(const char *); - void delete_domain(const char *); - void change_filename(const char *); - void merge_config(const Config *); - void set_writing(bool); -private: - char *filename, *domain; - hashconfig **hash; - int ndomains; - bool willwrite; -}; - -// The global config object -extern Config *scummcfg; - -#endif diff --git a/copying.txt b/copying.txt deleted file mode 100644 index bf35a23684..0000000000 --- a/copying.txt +++ /dev/null @@ -1,341 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/costume.cpp b/costume.cpp deleted file mode 100644 index 1996613929..0000000000 --- a/costume.cpp +++ /dev/null @@ -1,1447 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "costume.h" - -const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; - -void CostumeRenderer::ignorePakCols(int a) -{ - int n; - - n = _height; - if (a > 1) - n *= a; - - do { - _repcolor = *_srcptr++; - _replen = _repcolor & _maskval; - if (_replen == 0) { - _replen = *_srcptr++; - } - do { - if (!--n) { - _repcolor >>= _shrval; - return; - } - } while (--_replen); - } while (1); -} - -const byte cost_scaleTable[256] = { - 255, 253, 125, 189, 61, 221, 93, 157, 29, 237, - 109, 173, 45, 205, 77, 141, 13, 245, 117, 181, - 53, 213, 85, 149, 21, 229, 101, 165, 37, 197, 69, - 133, 5, 249, 121, 185, 57, 217, 89, 153, 25, 233, - 105, 169, 41, 201, 73, 137, 9, 241, 113, 177, 49, - 209, 81, 145, 17, 225, 97, 161, 33, 193, 65, 129, - 1, 251, 123, 187, 59, 219, 91, 155, 27, 235, 107, - 171, 43, 203, 75, 139, 11, 243, 115, 179, 51, 211, - 83, 147, 19, 227, 99, 163, 35, 195, 67, 131, 3, - 247, 119, 183, 55, 215, 87, 151, 23, 231, 103, - 167, 39, 199, 71, 135, 7, 239, 111, 175, 47, 207, - 79, 143, 15, 223, 95, 159, 31, 191, 63, 127, 0, - 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, - 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, - 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, - 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, - 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, - 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, - 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, - 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, - 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, - 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, - 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, - 238, 30, 158, 94, 222, 62, 190, 126, 254 -}; - -byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame) -{ - int xmove, ymove, i, b, s; - uint scal; - byte scaling; - byte charsetmask, masking; - byte unk19; - byte newAmiCost; - int ex1, ex2; - - newAmiCost = (_vm->_gameId == GID_MONKEY2 || _vm->_gameId == GID_INDY4) && (_vm->_features & GF_AMIGA); - - CHECK_HEAP _maskval = 0xF; - _shrval = 4; - if (_loaded._numColors == 32) { - _maskval = 7; - _shrval = 3; - } - - _width2 = _srcptr[0]; - _width = _width2; - _height2 = _srcptr[2]; - _height = _height2; - xmove = (int16)READ_LE_UINT16(_srcptr + 4) + _xmove; - ymove = (int16)READ_LE_UINT16(_srcptr + 6) + _ymove; - _xmove += (int16)READ_LE_UINT16(_srcptr + 8); - _ymove -= (int16)READ_LE_UINT16(_srcptr + 10); - _srcptr += 12; - - switch (_loaded._ptr[7] & 0x7F) { - case 0x60: - case 0x61: - ex1 = _srcptr[0]; - ex2 = _srcptr[1]; - _srcptr += 2; - if (ex1 != 0xFF || ex2 != 0xFF) { - ex1 = READ_LE_UINT16(_loaded._ptr + _loaded._numColors + 10 + ex1 * 2); - _srcptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + ex1 + ex2 * 2) + 14; - } - } - - _xpos = _actorX; - _ypos = _actorY; - - scaling = _scaleX == 255 && _scaleY == 255 ? 0 : 1; - s = 0; - - if (scaling) { - _scaleIndexXStep = -1; - if (xmove < 0) { - xmove = -xmove; - _scaleIndexXStep = 1; - } - - if (_mirror) { - unk19 = _scaleIndexX = 128 - xmove; - for (i = 0; i < xmove; i++) { - scal = cost_scaleTable[_scaleIndexX++]; - if (scal < _scaleX) - _xpos -= _scaleIndexXStep; - } - _right = _left = _xpos; - _scaleIndexX = unk19; - for (i = 0; i < _width; i++) { - if (_right < 0) { - s++; - unk19 = _scaleIndexX; - } - scal = cost_scaleTable[_scaleIndexX++]; - if (scal < _scaleX) - _right++; - } - } else { - unk19 = _scaleIndexX = xmove + 128; - for (i = 0; i < xmove; i++) { - scal = cost_scaleTable[_scaleIndexX--]; - if (scal < _scaleX) - _xpos += _scaleIndexXStep; - } - _right = _left = _xpos; - _scaleIndexX = unk19; - for (i = 0; i < _width; i++) { - if (_left > 319) { - s++; - unk19 = _scaleIndexX; - } - scal = cost_scaleTable[_scaleIndexX--]; - if (scal < _scaleX) - _left--; - } - } - _scaleIndexX = unk19; - if (s) - s--; - _scaleIndexYStep = -1; - if (ymove < 0) { - ymove = -ymove; - _scaleIndexYStep = 1; - } - _scaleIndexY = 128 - ymove; - for (i = 0; i < ymove; i++) { - scal = cost_scaleTable[_scaleIndexY++]; - if (scal < _scaleY) - _ypos -= _scaleIndexYStep; - } - _top = _bottom = _ypos; - _scaleIndexY = 128 - ymove; - for (i = 0; i < _height; i++) { - scal = cost_scaleTable[_scaleIndexY++]; - if (scal < _scaleY) - _bottom++; - } - _scaleIndexY = _scaleIndexYTop = 128 - ymove; - } else { - if (_mirror == 0) - xmove = -xmove; - _xpos += xmove; - _ypos += ymove; - if (_mirror) { - _left = _xpos; - _right = _xpos + _width; - } else { - _left = _xpos - _width; - _right = _xpos; - } - _top = _ypos; - _bottom = _top + _height; - } - - _scaleIndexXStep = -1; - if (_mirror) - _scaleIndexXStep = 1; - _ypostop = _ypos; - - _vm->updateDirtyRect(0, _left, _right + 1, _top, _bottom, 1 << a->number); - - if (_top >= (int)_outheight || _bottom <= 0) - return 0; - - _ypitch = _height * 320; - _docontinue = 0; - b = 1; - if (_left > 319 || _right <= 0) - return 1; - if (_mirror) { - _ypitch--; - if (scaling == 0) { - s = -_xpos; - } - if (s > 0) { - if (!newAmiCost) { - _width2 -= s; - ignorePakCols(s); - _xpos = 0; - _docontinue = 1; - } - } else { - s = _right - 320; - if (s <= 0) { - b = 2; - } else { - _width2 -= s; - } - } - } else { - _ypitch++; - if (scaling == 0) - s = _right - 320; - if (s > 0) { - if (!newAmiCost) { - _width2 -= s; - ignorePakCols(s); - _xpos = 319; - _docontinue = 1; - } - } else { - s = -1 - _left; - if (s <= 0) - b = 2; - else - _width2 -= s; - } - } - - if (_width2 == 0) - return 0; - - if ((uint) _top > (uint) _outheight) - _top = 0; - - if (_left < 0) - _left = 0; - - if ((uint) _bottom > _outheight) - _bottom = _outheight; - - if (a->top > _top) - a->top = _top; - - if (a->bottom < _bottom) - a->bottom = _bottom; - - if (_height2 + _top >= 256) { - CHECK_HEAP return 2; - } - - _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos; - _backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos; - charsetmask = - _vm->hasCharsetMask(_left, _top + _vm->virtscr[0].topline, _right, - _vm->virtscr[0].topline + _bottom); - masking = 0; - - if (_vm->_features & GF_SMALL_HEADER) - masking = (_zbuf != 0); - else - masking = - _vm->isMaskActiveAt(_left, _top, _right, _bottom, - _vm->getResourceAddress(rtBuffer, 9) + - _vm->gdi._imgBufOffs[_zbuf] + - _vm->_screenStartStrip); - - if (masking || charsetmask) { - _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + _ypos * 40 + _vm->_screenStartStrip; - _imgbufoffs = _vm->gdi._imgBufOffs[_zbuf]; - if (!charsetmask && _zbuf != 0) - _mask_ptr += _imgbufoffs; - _mask_ptr_dest = _mask_ptr + _xpos / 8; - } - - CHECK_HEAP if (a->shadow_mode) { - proc_special(a, (masking << 1) + charsetmask); - return b; - } - - switch ((newAmiCost << 3) | (scaling << 2) | (masking << 1) | charsetmask) { - case 0: - proc6(); // no scaling, no masking, no charsetmask - break; - case 1: - case 2: - proc5(); // no scaling, masking or charsetmask - break; - case 3: - proc4(); // no scaling, masking and charsetmask - break; - case 4: - proc1(); // scaling, no masking, no charsetmask - break; - case 5: - case 6: - proc2(); // scaling, masking or charsetmask - break; - case 7: - proc3(); // scaling, masking and charsetmask - break; - case 8: - proc6_ami(); // no scaling, no masking, no charsetmask (Amiga) - break; - case 9: - case 10: - proc5_ami(); // no scaling, masking or charsetmask (Amiga) - break; - case 11: - proc4_ami(); // no scaling, masking and charsetmask (Amiga) - break; - case 12: - proc1_ami(); // scaling, no masking, no charsetmask (Amiga) - break; - case 13: - case 14: - proc2_ami(); // scaling, masking or charsetmask (Amiga) - break; - case 15: - proc3_ami(); // scaling, masking and charsetmask (Amiga) - break; - } - - CHECK_HEAP return b; -} - -void CostumeRenderer::proc6() -{ - byte *src, *dst; - byte len, height, pcolor, width; - uint y; - int color; - uint scrheight; - - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - scrheight = _outheight; - width = _width2; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && y < scrheight) { - pcolor = _palette[color]; - if (pcolor == 13) { - pcolor = _shadow_table[*dst]; - } - *dst = pcolor; - } - - dst += 320; - y++; - if (!--height) { - if (!--width) - return; - height = _height; - dst -= _ypitch; - y = _ypostop; - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc5() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor; - uint y, scrheight; - int color; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - scrheight = _outheight; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && y < scrheight && !(*mask & maskbit)) { - pcolor = _palette[color]; - if (pcolor == 13) - pcolor = _shadow_table[*dst]; - *dst = pcolor; - } - dst += 320; - y++; - mask += 40; - if (!--height) { - if (!--_width2) - return; - height = _height; - dst -= _ypitch; - y = _ypostop; - if (_scaleIndexXStep != 1) { - maskbit <<= 1; - if (!maskbit) { - maskbit = 1; - _mask_ptr--; - } - } else { - maskbit >>= 1; - if (!maskbit) { - maskbit = 0x80; - _mask_ptr++; - } - } - mask = _mask_ptr; - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc4() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor; - uint y, scrheight; - int color; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - scrheight = _outheight; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && y < scrheight && !((*mask | mask[_imgbufoffs]) & maskbit)) { - pcolor = _palette[color]; - if (pcolor == 13) - pcolor = _shadow_table[*dst]; - *dst = pcolor; - } - dst += 320; - y++; - mask += 40; - if (!--height) { - if (!--_width2) - return; - height = _height; - dst -= _ypitch; - y = _ypostop; - if (_scaleIndexXStep != 1) { - maskbit <<= 1; - if (!maskbit) { - maskbit = 1; - _mask_ptr--; - } - } else { - maskbit >>= 1; - if (!maskbit) { - maskbit = 0x80; - _mask_ptr++; - } - } - mask = _mask_ptr; - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc3() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor, width; - int color, t; - uint y; - - mask = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - width = _width2; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (cost_scaleTable[_scaleIndexY++] < _scaleY) { - if (color && y < _outheight && !((*mask | mask[_imgbufoffs]) & maskbit)) { - pcolor = _palette[color]; - if (pcolor == 13) - pcolor = _shadow_table[*dst]; - *dst = pcolor; - } - dst += 320; - mask += 40; - y++; - } - if (!--height) { - if (!--width) - return; - height = _height; - y = _ypostop; - _scaleIndexY = _scaleIndexYTop; - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - if (_xpos >= 320) - return; - maskbit = revBitMask[_xpos & 7]; - _backbuff_ptr += _scaleIndexXStep; - } - dst = _backbuff_ptr; - mask = _mask_ptr + (_xpos >> 3); - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc2() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor, width; - int color, t; - uint y; - - mask = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - width = _width2; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (cost_scaleTable[_scaleIndexY++] < _scaleY) { - if (color && y < _outheight && !(*mask & maskbit)) { - pcolor = _palette[color]; - if (pcolor == 13) - pcolor = _shadow_table[*dst]; - *dst = pcolor; - } - dst += 320; - mask += 40; - y++; - } - if (!--height) { - if (!--width) - return; - height = _height; - y = _ypostop; - _scaleIndexY = _scaleIndexYTop; - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - if (_xpos >= 320) - return; - maskbit = revBitMask[_xpos & 7]; - _backbuff_ptr += _scaleIndexXStep; - } - dst = _backbuff_ptr; - mask = _mask_ptr + (_xpos >> 3); - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc1() -{ - byte *mask, *src, *dst, *dstorg; - byte maskbit, len, height, pcolor, width; - int color, t; - uint y; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - src = _srcptr; - dstorg = dst = _backbuff_ptr; - len = _replen; - color = _repcolor; - height = _height2; - width = _width2; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (cost_scaleTable[_scaleIndexY++] < _scaleY) { - if (color && y < _outheight) { - pcolor = _palette[color]; - if (pcolor == 13) - pcolor = _shadow_table[*dst]; - *dst = pcolor; - } - dst += 320; - y++; - } - if (!--height) { - if (!--width) - return; - height = _height; - y = _ypostop; - _scaleIndexY = _scaleIndexYTop; - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - if (_xpos >= 320) - return; - _backbuff_ptr += _scaleIndexXStep; - } - dst = _backbuff_ptr; - } - StartPos:; - } while (--len); - } while (1); -} - -void CostumeRenderer::proc6_ami() -{ - byte len; - byte *src, *dst; - byte width, height, pcolor; - int color; - int step = _scaleIndexXStep; - uint x; - uint y; - uint scrheight; - - x = _xpos; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - scrheight = _outheight; - width = _width; - height = _height2; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && x >= 0 && x < 320) { - pcolor = _palette[color]; -/* if (pcolor == 13) { - pcolor = _shadow_table[*dst]; - }*/ - *dst = pcolor; - } - - dst += step; - x += step; - if (!--width) { - if (!--height) - return; - width = _width; - dst += 320-step*_width; - x = _xpos; - y++; - if (y >= scrheight) - return; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc5_ami() -{ - byte *mask, *src, *dst; - byte maskbit, len, width, height, pcolor; - uint y, scrheight; - int color, x; - int step = _scaleIndexXStep; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - x = _xpos; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - scrheight = _outheight; - width = _width; - height = _height2; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && x >=0 && x < 320 && !(*mask & maskbit)) { - pcolor = _palette[color]; -/* if (pcolor == 13) - pcolor = _shadow_table[*dst];*/ - *dst = pcolor; - } - dst += step; - x += step; - if (step != 1) { - maskbit <<= 1; - if (!maskbit) - { - maskbit = 1; - mask--; - } - } else { - maskbit >>= 1; - if (!maskbit) - { - maskbit = 0x80; - mask++; - } - } - if (!--width) { - if (!--height) - return; - width = _width; - x = _xpos; - y++; - dst += 320-step*_width; - _mask_ptr+=40; - mask = _mask_ptr; - maskbit = revBitMask[_xpos & 7]; - if (y >= scrheight) - return; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc4_ami() -{ - byte *mask, *src, *dst; - byte maskbit, len, width, height, pcolor; - uint y, scrheight; - int color, x; - int step = _scaleIndexXStep; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - x = _xpos; - y = _ypos; - src = _srcptr; - dst = _backbuff_ptr; - scrheight = _outheight; - height = _height2; - width = _width; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (color && x >= 0 && x < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) { - pcolor = _palette[color]; -/* if (pcolor == 13) - pcolor = _shadow_table[*dst];*/ - *dst = pcolor; - } - dst += step; - x += step; - if (step != 1) { - maskbit <<= 1; - if (!maskbit) { - maskbit = 1; - mask--; - } - } else { - maskbit >>= 1; - if (!maskbit) { - maskbit = 0x80; - mask++; - } - } - if (!--width) { - if (!--height) - return; - width = _width; - y++; - x = _xpos; - dst += 320-step*_width; - _mask_ptr+= 40; - mask = _mask_ptr; - maskbit = revBitMask[_xpos & 7]; - if (y >= scrheight) - return; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc3_ami() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor, width; - int color, t; - uint y; - uint oldXpos, oldScaleIndexX; - - mask = _mask_ptr_dest; - dst = _backbuff_ptr; - height = _height2; - width = _width; - src = _srcptr; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - oldXpos = _xpos; - oldScaleIndexX = _scaleIndexX; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - do { - if (cost_scaleTable[_scaleIndexY] < _scaleY) { - if (color && _xpos >= 0 && _xpos < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) { - pcolor = _palette[color]; -/* if (pcolor == 13) - pcolor = _shadow_table[*dst];*/ - *dst = pcolor; - } - - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - dst += _scaleIndexXStep; - maskbit = revBitMask[_xpos & 7]; - } - mask = _mask_ptr + (_xpos >> 3); - } - if (!--width) { - if (!--height) - return; - - if (y >= _outheight) - return; - - if (_xpos != oldXpos) { - dst += 320-(_xpos-oldXpos); - _mask_ptr += 40; - mask = _mask_ptr; - y++; - } - width = _width; - _xpos = oldXpos; - _scaleIndexX = oldScaleIndexX; - _scaleIndexY++; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc2_ami() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor, width; - int color, t; - uint y; - uint oldXpos, oldScaleIndexX; - - mask = _mask_ptr_dest; - dst = _backbuff_ptr; - height = _height2; - width = _width; - src = _srcptr; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - - oldXpos = _xpos; - oldScaleIndexX = _scaleIndexX; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - do { - if (cost_scaleTable[_scaleIndexY] < _scaleY) { - if (color && _xpos >= 0 && _xpos < 320 && !(*mask & maskbit)) { - pcolor = _palette[color]; -/* if (pcolor == 13) - pcolor = _shadow_table[*dst];*/ - *dst = pcolor; - } - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - dst += _scaleIndexXStep; - maskbit = revBitMask[_xpos & 7]; - _backbuff_ptr += _scaleIndexXStep; - } - mask = _mask_ptr + (_xpos >> 3); - } - if (!--width) { - if (!--height) - return; - - if (y >= _outheight) - return; - - if (_xpos != oldXpos) { - dst += 320-(_xpos-oldXpos); - _mask_ptr += 40; - mask = _mask_ptr; - y++; - } - width = _width; - _xpos = oldXpos; - _scaleIndexX = oldScaleIndexX; - _scaleIndexY++; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc1_ami() -{ - byte *mask, *src, *dst; - byte maskbit, len, height, pcolor, width; - uint y; - int color; - int t, x; - uint oldXpos, oldScaleIndexX; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - x = _xpos; - y = _ypos; - - dst = _backbuff_ptr; - height = _height2; - width = _width; - src = _srcptr; - - oldXpos = _xpos; - oldScaleIndexX = _scaleIndexX; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { - if (cost_scaleTable[_scaleIndexY] < _scaleY) { - if (color && _xpos >= 0 && _xpos < 320) { - pcolor = _palette[color]; -/* if (pcolor == 13) - pcolor = _shadow_table[*dst];*/ - *dst = pcolor; - } - - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - dst += _scaleIndexXStep; - } - } - if (!--width) { - if (!--height) - return; - - if (y >= _outheight) - return; - - if (_xpos != oldXpos) { - dst += 320-(_xpos-oldXpos); - y++; - } - width = _width; - _xpos = oldXpos; - _scaleIndexX = oldScaleIndexX; - _scaleIndexY++; - } - } while (--len); - } while (1); -} - -void CostumeRenderer::proc_special(Actor *a, byte mask2) -{ - byte *mask, *src, *dst, *dstorg; - byte maskbit, len, height, pcolor, width; - uint y; - int color; - int t; - - byte shadow1; - byte shadow2; - byte shadow3; - byte shadow4; - byte shadow5; - - shadow1 = a->shadow_mode & 0x80; - shadow2 = a->shadow_mode & 0x40; - shadow3 = a->shadow_mode & 0x20; - shadow4 = a->shadow_mode & 0x10; - shadow5 = a->shadow_mode & 0x0F; - - mask = _mask_ptr = _mask_ptr_dest; - maskbit = revBitMask[_xpos & 7]; - y = _ypos; - - mask = _mask_ptr_dest; - dstorg = dst = _backbuff_ptr; - height = _height2; - width = _width2; - len = _replen; - color = _repcolor; - src = _srcptr; - - if (_mirror == 0) - shadow5 = -shadow5; - - maskbit = revBitMask[_xpos & 7]; - - dst = _backbuff_ptr; - - if (mask2 != 0 && mask2 < 3) - _imgbufoffs = 0; - - if (_docontinue) - goto StartPos; - - do { - len = *src++; - color = len >> _shrval; - len &= _maskval; - if (!len) - len = *src++; - - do { // ok - if (cost_scaleTable[_scaleIndexY++] < _scaleY) { - if (color && y < _outheight) { - if (!mask2 || (mask2 && !((*mask | mask[_imgbufoffs]) & maskbit))) { - if (shadow3 == 0) { - pcolor = _palette[color]; - if (pcolor != 13) - goto proc_special_end; - - } - if (shadow2 != 0) { - warning("proc_special: shadow2 unimplemented"); - pcolor = 0; - } else // we don't need all the random stuff, just the background copy - { - pcolor = _vm->_proc_special_palette[*dst]; - } - proc_special_end:; - *dst = pcolor; - } - } - dst += 320; - mask += 40; - y++; - } - if (!--height) { - if (!--width) - return; - height = _height; - y = _ypostop; - _scaleIndexY = _scaleIndexYTop; - t = _scaleIndexX; - _scaleIndexX = t + _scaleIndexXStep; - if (cost_scaleTable[t] < _scaleX) { - _xpos += _scaleIndexXStep; - if (_xpos >= 320) - return; - maskbit = revBitMask[_xpos & 7]; - _backbuff_ptr += _scaleIndexXStep; - } - dst = _backbuff_ptr; - mask = _mask_ptr + (_xpos >> 3); - } - StartPos:; - } while (--len); - } while (1); - -} - -void LoadedCostume::loadCostume(int id) -{ - _ptr = _vm->getResourceAddress(rtCostume, id); - - if (_vm->_features & GF_AFTER_V6) { - _ptr += 8; - } else if (!(_vm->_features & GF_SMALL_HEADER)) { - _ptr += 2; - } - - switch (_ptr[7] & 0x7F) { - case 0x58: - _numColors = 16; - break; - case 0x59: - _numColors = 32; - break; - case 0x60: /* New since version 6 */ - _numColors = 16; - break; - case 0x61: /* New since version 6 */ - _numColors = 32; - break; - default: - error("Costume %d is invalid", id); - } - - _dataptr = _ptr + READ_LE_UINT16(_ptr + _numColors + 8); -} - -byte CostumeRenderer::drawOneSlot(Actor *a, int slot) -{ - - if (!(_vm->_features & GF_AFTER_V7)) { - int i; - int code; - CostumeData *cd = &a->cost; - - if (cd->curpos[slot] == 0xFFFF || cd->stopped & (1 << slot)) - return 0; - - i = cd->curpos[slot] & 0x7FFF; - - _frameptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + _loaded._numColors + slot * 2 + 10); - - code = _loaded._dataptr[i] & 0x7F; - - _srcptr = _loaded._ptr + READ_LE_UINT16(_frameptr + code * 2); - - if (code != 0x7B) { - if (!(_vm->_features & GF_OLD256) || code < 0x79) - return mainRoutine(a, slot, code); - } - } - - return 0; - -} - -byte CostumeRenderer::drawCostume(Actor *a) -{ - int i; - byte r = 0; - - _xmove = _ymove = 0; - for (i = 0; i != 16; i++) - r |= drawOneSlot(a, i); - return r; -} - -int Scumm::cost_frameToAnim(Actor *a, int frame) -{ - return newDirToOldDir(a->facing) + frame * 4; -} - -void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) -{ - byte *p, *r; - uint mask, j; - int i; - byte extra, cmd; - byte *dataptr; - int anim; - LoadedCostume lc(this); - - lc.loadCostume(a->costume); - - anim = cost_frameToAnim(a, frame); - - p = lc._ptr; - if (anim > p[6]) { - return; - } - - r = p + READ_LE_UINT16(p + anim * 2 + lc._numColors + 42); - if (r == p) { - return; - } - - if (_features & GF_OLD256) - dataptr = p + *(p + lc._numColors + 8); - else - dataptr = p + READ_LE_UINT16(p + lc._numColors + 8); - - mask = READ_LE_UINT16(r); - r += 2; - i = 0; - do { - if (mask & 0x8000) { - if (_features & GF_OLD256) { - j = 0; - j = *(r); - r++; - if (j == 0xFF) - j = 0xFFFF; - } else { - j = READ_LE_UINT16(r); - r += 2; - } - if (usemask & 0x8000) { - if (j == 0xFFFF) { - a->cost.curpos[i] = 0xFFFF; - a->cost.start[i] = 0; - a->cost.frame[i] = frame; - } else { - extra = *r++; - cmd = dataptr[j]; - if (cmd == 0x7A) { - a->cost.stopped &= ~(1 << i); - } else if (cmd == 0x79) { - a->cost.stopped |= (1 << i); - } else { - a->cost.curpos[i] = a->cost.start[i] = j; - a->cost.end[i] = j + (extra & 0x7F); - if (extra & 0x80) - a->cost.curpos[i] |= 0x8000; - a->cost.frame[i] = frame; - } - } - } else { - if (j != 0xFFFF) - r++; - } - } - i++; - usemask <<= 1; - mask <<= 1; - } while ((uint16)mask); -} - -void CostumeRenderer::setPalette(byte *palette) -{ - int i; - byte color; - - for (i = 0; i < _loaded._numColors; i++) { - if ((_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_actor_color) || (_vm->_features & GF_AFTER_V6)) { - color = palette[i]; - if (color == 255) - color = _loaded._ptr[8 + i]; - } else { - color = (i == 12) ? 0 : 8; - } - _palette[i] = color; - } -} - -void CostumeRenderer::setFacing(uint16 facing) -{ - _mirror = newDirToOldDir(facing) != 0 || (_loaded._ptr[7] & 0x80); -} - -void CostumeRenderer::setCostume(int costume) -{ - _loaded.loadCostume(costume); -} - -byte LoadedCostume::increaseAnims(Actor *a) -{ - int i; - byte r = 0; - - for (i = 0; i != 16; i++) { - if (a->cost.curpos[i] != 0xFFFF) - r += increaseAnim(a, i); - } - return r; -} - -byte LoadedCostume::increaseAnim(Actor *a, int slot) -{ - int highflag; - int i, end; - byte code, nc; - - if (a->cost.curpos[slot] == 0xFFFF) - return 0; - - highflag = a->cost.curpos[slot] & 0x8000; - i = a->cost.curpos[slot] & 0x7FFF; - end = a->cost.end[slot]; - code = _dataptr[i] & 0x7F; - - do { - if (!highflag) { - if (i++ >= end) - i = a->cost.start[slot]; - } else { - if (i != end) - i++; - } - nc = _dataptr[i]; - - if (nc == 0x7C) { - a->cost.animCounter1++; - if (a->cost.start[slot] != end) - continue; - } else { - if (_vm->_features & GF_AFTER_V6) { - if (nc >= 0x71 && nc <= 0x78) { - _vm->_sound->addSoundToQueue2(a->sound[nc - 0x71]); - if (a->cost.start[slot] != end) - continue; - } - } else { - if (nc == 0x78) { - a->cost.animCounter2++; - if (a->cost.start[slot] != end) - continue; - } - } - } - - a->cost.curpos[slot] = i | highflag; - return (_dataptr[i] & 0x7F) != code; - } while (1); -} - -bool Scumm::isCostumeInUse(int cost) -{ - int i; - Actor *a; - - if (_roomResource != 0) - for (i = 1; i < NUM_ACTORS; i++) { - a = derefActor(i); - if (a->isInCurrentRoom() && a->costume == cost) - return true; - } - - return false; -} diff --git a/costume.h b/costume.h deleted file mode 100644 index fa7264f1c0..0000000000 --- a/costume.h +++ /dev/null @@ -1,112 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef COSTUME_H -#define COSTUME_H - - -class LoadedCostume { -protected: - Scumm *_vm; - -public: - byte *_ptr; - byte *_dataptr; - byte _numColors; - - LoadedCostume(Scumm *vm) : _vm(vm), _ptr(0), _dataptr(0), _numColors(0) {} - - void loadCostume(int id); - byte increaseAnims(Actor *a); - -protected: - byte increaseAnim(Actor *a, int slot); -}; - - -class CostumeRenderer { -protected: - Scumm *_vm; - - LoadedCostume _loaded; - -public: - byte *_shadow_table; - - byte *_frameptr; - byte *_srcptr; - byte *_bgbak_ptr, *_backbuff_ptr, *_mask_ptr, *_mask_ptr_dest; - int _actorX, _actorY; - byte _zbuf; - uint _scaleX, _scaleY; - int _xmove, _ymove; - bool _mirror; - byte _maskval; - byte _shrval; - byte _width2; - int _width; - byte _height2; - int _height; - int _xpos, _ypos; - - uint _outheight; - int _scaleIndexXStep; - int _scaleIndexYStep; - byte _scaleIndexX; /* must wrap at 256 */ - byte _scaleIndexY, _scaleIndexYTop; - int _left, _right; - int _dir2; - int _top, _bottom; - int _ypostop; - int _ypitch; - byte _docontinue; - int _imgbufoffs; - byte _repcolor; - byte _replen; - byte _palette[32]; - - void proc6(); - void proc5(); - void proc4(); - void proc3(); - void proc2(); - void proc1(); - void proc6_ami(); - void proc5_ami(); - void proc4_ami(); - void proc3_ami(); - void proc2_ami(); - void proc1_ami(); - void proc_special(Actor *a, byte mask); - byte mainRoutine(Actor *a, int slot, int frame); - void ignorePakCols(int num); - - byte drawOneSlot(Actor *a, int slot); - byte drawCostume(Actor *a); - - void setPalette(byte *palette); - void setFacing(uint16 facing); - void setCostume(int costume); - -public: - CostumeRenderer(Scumm *vm) : _vm(vm), _loaded(vm) {} -}; - -#endif diff --git a/dc/.cvsignore b/dc/.cvsignore deleted file mode 100644 index ed6bd2b99e..0000000000 --- a/dc/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -scummvm -sound -v3 -v4 -simon diff --git a/dc/Makefile b/dc/Makefile deleted file mode 100644 index 18ba20d6fc..0000000000 --- a/dc/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# $Header$ - -ronindir = /usr/local/ronin - -VPATH = .. - -CC = sh-elf-g++ -ml -m4-single-only -CFLAGS = -O1 -Wno-multichar -DEFINES = -D__DC__ -DNONSTANDARD_PORT -DNONSTANDARD_SAVE -LDFLAGS := -Wl,-Ttext,0x8c010000 -nostartfiles ronin/crt0.o -INCLUDES:= -I./ -I../ -I../sound -CPPFLAGS= $(DEFINES) $(INCLUDES) -LIBS = ronin/libronin.a ronin/libz.a -lm -EXEEXT = - -OBJS = dcmain.o display.o audio.o input.o selector.o icon.o \ - label.o vmsave.o - -include ../Makefile.common - -INCS += portdefs.h dc.h - -$(OBJS): Makefile sound/.create simon/.create v3/.create v4/.create ronin - -sound/.create: - mkdir sound && touch $@ - -simon/.create: - mkdir simon && touch $@ - -v3/.create: - mkdir v3 && touch $@ - -v4/.create: - mkdir v4 && touch $@ - -ronin: - ln -s $(ronindir) $@ - diff --git a/dc/README b/dc/README deleted file mode 100644 index d4bf04c5bd..0000000000 --- a/dc/README +++ /dev/null @@ -1,20 +0,0 @@ -Compiling ScummVM for SEGA Dreamcast -==================================== - -If you want to compile ScummVM for your Dreamcast, -you'll need the following: - -* gcc-3.0.x configured as a cross-compiler for `sh-elf' - (including corresponding binutils) - -* newlib for sh-elf : - -* libronin-0.3 : - -* GNU make - - -Edit the Makefile to contain the path to libronin if you installed it -somewhere other than /usr/local/ronin, then run `make', and you should -get an ELF binary with the name `scummvm'. - diff --git a/dc/audio.cpp b/dc/audio.cpp deleted file mode 100644 index 863c1e97ac..0000000000 --- a/dc/audio.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "dc.h" - -EXTERN_C void *memcpy4(void *s1, const void *s2, unsigned int n); - -void initSound() -{ - stop_sound(); - do_sound_command(CMD_SET_FREQ_EXP(FREQ_22050_EXP)); - do_sound_command(CMD_SET_BUFFER(3)); -} - -bool OSystem_Dreamcast::set_sound_proc(void *param, SoundProc *proc, - byte format) -{ -#if SAMPLE_MODE == 0 - assert(format == SOUND_16BIT); -#elif SAMPLE_MODE == 1 - assert(format == SOUND_8BIT); -#else -#error Invalid SAMPLE_MODE -#endif - _sound_proc_param = param; - _sound_proc = proc; - - return true; -} - -void OSystem_Dreamcast::checkSound() -{ - int n; - int curr_ring_buffer_samples; - - if(read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY) - start_sound(); - - curr_ring_buffer_samples = read_sound_int(&SOUNDSTATUS->ring_length); - - n = read_sound_int(&SOUNDSTATUS->samplepos); - - if((n-=fillpos)<0) - n += curr_ring_buffer_samples; - - n = ADJUST_BUFFER_SIZE(n-10); - - if(n<100) - return; - - _sound_proc(_sound_proc_param, (byte*)temp_sound_buffer, - SAMPLES_TO_BYTES(n)); - - if(fillpos+n > curr_ring_buffer_samples) { - int r = curr_ring_buffer_samples - fillpos; - memcpy4(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r)); - fillpos = 0; - n -= r; - memcpy4(RING_BUF, temp_sound_buffer+r, SAMPLES_TO_BYTES(n)); - } else { - memcpy4(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n)); - } - if((fillpos += n) >= curr_ring_buffer_samples) - fillpos = 0; -} diff --git a/dc/dc.h b/dc/dc.h deleted file mode 100644 index 4a2b78cfb7..0000000000 --- a/dc/dc.h +++ /dev/null @@ -1,102 +0,0 @@ -#include - -#define NUM_BUFFERS 4 - -class OSystem_Dreamcast : public OSystem { - - public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - static OSystem *create(); - - - private: - - int _ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_old_x, _ms_old_y; - int _ms_hotspot_x, _ms_hotspot_y, _ms_visible, _devpoll; - int _current_shake_pos, _screen_h; - unsigned char *_ms_buf; - SoundProc *_sound_proc; - void *_sound_proc_param; - - unsigned char *screen; - unsigned short *mouse; - void *screen_tx[NUM_BUFFERS]; - void *mouse_tx[NUM_BUFFERS]; - int current_buffer; - unsigned short palette[256]; - - short temp_sound_buffer[RING_BUFFER_SAMPLES]; - - void checkSound(); - - void drawMouse(int xdraw, int ydraw, int w, int h, - unsigned char *buf, bool visible); - -}; - -extern int handleInput(struct mapledev *pad, - int &mouse_x, int &mouse_y, - byte &shiftFlags); -extern void initSound(); -extern bool selectGame(GameDetector *d, char *&, char *&, class Icon &); - diff --git a/dc/dcmain.cpp b/dc/dcmain.cpp deleted file mode 100644 index a64643a004..0000000000 --- a/dc/dcmain.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "mididrv.h" -#include "gameDetector.h" -#include "dc.h" -#include "icon.h" - - -Icon icon; - - -OSystem *OSystem_Dreamcast_create() { - return OSystem_Dreamcast::create(); -} - -OSystem *OSystem_Dreamcast::create() { - OSystem_Dreamcast *syst = new OSystem_Dreamcast(); - return syst; -} - -/* CD Audio */ -static bool find_track(int track, int &first_sec, int &last_sec) -{ - struct TOC *toc = cdfs_gettoc(); - if(!toc) - return false; - int i, first, last; - first = TOC_TRACK(toc->first); - last = TOC_TRACK(toc->last); - if(first < 1 || last > 99 || first > last) - return false; - for(i=last; i>=first; --i) - if(!(TOC_CTRL(toc->entry[i-1])&4)) - if(track==1) { - first_sec = TOC_LBA(toc->entry[i-1]); - last_sec = TOC_LBA(toc->entry[i]); - return true; - } else - --track; - return false; -} - -void OSystem_Dreamcast::play_cdrom(int track, int num_loops, - int start_frame, int end_frame) -{ - int first_sec, last_sec; -#if 1 - if(num_loops) - --num_loops; -#endif - if(num_loops>14) num_loops=14; - else if(num_loops<0) num_loops=15; // infinity - if(!find_track(track, first_sec, last_sec)) - return; - if(end_frame) - last_sec = first_sec + start_frame + end_frame; - first_sec += start_frame; - play_cdda_sectors(first_sec, last_sec, num_loops); -} - -void OSystem_Dreamcast::stop_cdrom() -{ - stop_cdda(); -} - -bool OSystem_Dreamcast::poll_cdrom() -{ - extern int getCdState(); - return getCdState() == 3; -} - -void OSystem_Dreamcast::update_cdrom() -{ - // Dummy. The CD drive takes care of itself. -} - -uint32 OSystem_Dreamcast::property(int param, Property *value) -{ - switch(param) { - - case PROP_GET_SAMPLE_RATE: - return 22050; - - } - - return 0; -} - -void OSystem_Dreamcast::quit() { - exit(0); -} - -void *OSystem_Dreamcast::create_thread(ThreadProc *proc, void *param) { - warning("Creating a thread! (not supported.)\n"); -} - -uint32 OSystem_Dreamcast::get_msecs() -{ - static uint32 msecs=0; - static unsigned int t0=0; - - unsigned int t = Timer(); - unsigned int dm, dt = t - t0; - - t0 = t; - dm = (dt << 6)/3125U; - dt -= (dm * 3125U)>>6; - t0 -= dt; - - return msecs += dm; -} - -void OSystem_Dreamcast::delay_msecs(uint msecs) -{ - get_msecs(); - unsigned int t, start = Timer(); - int time = (((unsigned int)msecs)*100000U)>>11; - while(((int)((t = Timer())-start))mouse.x, oldmousey = s->mouse.y; - time = (((unsigned int)time)*100000U)>>11; - int mask = getimask(); - while(((int)((t = Timer())-start))0) { - setimask(15); - checkSound(); - handleInput(locked_get_pads(), s->mouse.x, s->mouse.y, - s->_leftBtnPressed, s->_rightBtnPressed, s->_keyPressed); - setimask(mask); - devpoll += USEC_TO_TIMER(17000); - if(s->mouse.x != oldmousex || s->mouse.y != oldmousey) { - extern void updateScreen(Scumm *s); - updateScreen(s); - oldmousex = s->mouse.x; - oldmousey = s->mouse.y; - } - } -} -*/ - -void dc_init_hardware(void) -{ -#ifndef NOSERIAL - serial_init(57600); - usleep(2000000); - printf("Serial OK\r\n"); -#endif - - cdfs_init(); - maple_init(); - dc_setup_ta(); - init_arm(); -} - -int dc_setup(GameDetector &detector) -{ - static char *argv[] = { "scummvm", NULL, NULL, NULL }; - static int argc = 3; - - initSound(); - - if(!selectGame(&detector, argv[2], argv[1], icon)) - exit(0); - - detector.parseCommandLine(argc, argv); - - return 0; -} diff --git a/dc/display.cpp b/dc/display.cpp deleted file mode 100644 index 97c7f2aed5..0000000000 --- a/dc/display.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "dc.h" - -#define SCREEN_W 320 -#define SCREEN_H 240 -#define MOUSE_W 64 -#define MOUSE_H 64 - -#define TOP_OFFSET (240.0-_screen_h) - -#define QACR0 (*(volatile unsigned int *)(void *)0xff000038) -#define QACR1 (*(volatile unsigned int *)(void *)0xff00003c) - - -#define COPYPIXEL(n) do { \ - unsigned short _tmp = pal[*s++]; \ - d[n] = _tmp|(pal[*s++]<<16); \ -} while(0) - -static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short *pal) -{ - unsigned char *s = (unsigned char *)src; - unsigned int *d = (unsigned int *)(void *) - (0xe0000000 | (((unsigned long)dest) & 0x03ffffc0)); - QACR0 = ((0xa4000000>>26)<<2)&0x1c; - QACR1 = ((0xa4000000>>26)<<2)&0x1c; - while(cnt--) { - COPYPIXEL(0); - COPYPIXEL(1); - COPYPIXEL(2); - COPYPIXEL(3); - asm("pref @%0" : : "r" (s+4*16)); - COPYPIXEL(4); - COPYPIXEL(5); - COPYPIXEL(6); - COPYPIXEL(7); - asm("pref @%0" : : "r" (d)); - d += 8; - COPYPIXEL(0); - COPYPIXEL(1); - COPYPIXEL(2); - COPYPIXEL(3); - asm("pref @%0" : : "r" (s+4*16)); - COPYPIXEL(4); - COPYPIXEL(5); - COPYPIXEL(6); - COPYPIXEL(7); - asm("pref @%0" : : "r" (d)); - d += 8; - } -} - -void commit_dummy_transpoly() -{ - struct polygon_list mypoly; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| - TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA; - mypoly.texture = 0; - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - ta_commit_list(&mypoly); -} - - -void OSystem_Dreamcast::set_palette(const byte *colors, uint start, uint num) -{ - unsigned short *dst = palette + start; - if(num>0) - while( num-- ) { - *dst++ = ((colors[0]<<7)&0x7c00)| - ((colors[1]<<2)&0x03e0)| - ((colors[2]>>3)&0x001f); - colors += 4; - } -} - -void OSystem_Dreamcast::init_size(uint w, uint h) -{ - assert(w == SCREEN_W && h <= SCREEN_H); - - _screen_h = h; - ta_sync(); - if(!screen) - screen = new unsigned char[SCREEN_W*SCREEN_H]; - for(int i=0; i>5, palette ); - src += SCREEN_W; - dst += SCREEN_W; - } - - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x00ff00; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_REPLACE| - TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512; - mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED| - TA_TEXTUREMODE_STRIDE|TA_TEXTUREMODE_ADDRESS(screen_tx[current_buffer]); - - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - - ta_begin_frame(); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0000ff; - ta_commit_list(&mypoly); - - myvertex.cmd = TA_CMD_VERTEX; - myvertex.ocolour = 0; - myvertex.colour = 0; - myvertex.z = 0.5; - myvertex.u = 0.0; - myvertex.v = 0.0; - - myvertex.x = 0.0; - myvertex.y = _current_shake_pos*2.0+TOP_OFFSET; - ta_commit_list(&myvertex); - - myvertex.x = SCREEN_W*2.0; - myvertex.u = SCREEN_W/512.0; - ta_commit_list(&myvertex); - - myvertex.x = 0.0; - myvertex.y += _screen_h*2.0; - myvertex.u = 0.0; - myvertex.v = _screen_h*(1/512.0); - ta_commit_list(&myvertex); - - myvertex.x = SCREEN_W*2.0; - myvertex.u = SCREEN_W/512.0; - myvertex.cmd |= TA_CMD_VERTEX_EOS; - ta_commit_list(&myvertex); - - ta_commit_end(); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0xffff00; - drawMouse(_ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_buf, _ms_visible); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0xff00ff; - ta_commit_frame(); - - current_buffer++; - current_buffer &= NUM_BUFFERS-1; - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0; -} - -void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h, - unsigned char *buf, bool visible) -{ - struct polygon_list mypoly; - struct packed_colour_vertex_list myvertex; - - unsigned short *dst = (unsigned short *)mouse_tx[current_buffer]; - int y=0; - - if(visible && w<=MOUSE_W && h<=MOUSE_H) - for(int y=0; y -#include - -#include "icon.h" - -void Icon::create_vmicon(void *buffer) -{ - unsigned short *pal = (unsigned short *)buffer; - unsigned char *pix = ((unsigned char *)buffer)+32; - - for(int n = 0; n<16; n++) { - int p = palette[n]; - pal[n] = - ((p>>16)&0xf000)| - ((p>>12)&0x0f00)| - ((p>> 8)&0x00f0)| - ((p>> 4)&0x000f); - } - - for(int line = 0; line < 32; line++) { - memcpy(pix, &bitmap[32/2*(31-line)], 32/2); - pix += 32/2; - } -} - -void Icon::create_texture() -{ - static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21, - 64, 65, 68, 69, 80, 81, 84, 85 }; - unsigned short *tex = (unsigned short *)ta_txalloc(512); - unsigned short *linebase; - unsigned char *src = bitmap+sizeof(bitmap)-17; - for(int y=0; y<16; y++) { - linebase = tex + (tt[y]<<1); - for(int x=0; x<16; x++, --src) - linebase[tt[x]] = src[16]|(src[0]<<8); - src -= 16; - } - texture = tex; -} - -void Icon::set_palette(int pal) -{ - unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000; - for(int n = 0; n<16; n++) - (*hwpal)[pal][n] = palette[n]; -} - -void Icon::draw(float x1, float y1, float x2, float y2, int pal, - unsigned int argb) -{ - struct polygon_list mypoly; - struct packed_colour_vertex_list myvertex; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| - TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA| - TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_U_SIZE_32| - TA_POLYMODE2_V_SIZE_32; - mypoly.texture = TA_TEXTUREMODE_CLUT4|TA_TEXTUREMODE_CLUTBANK4(pal)| - TA_TEXTUREMODE_ADDRESS(texture); - - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - - ta_commit_list(&mypoly); - - myvertex.cmd = TA_CMD_VERTEX; - myvertex.ocolour = 0; - myvertex.colour = argb; - myvertex.z = 0.5; - myvertex.u = 0.0; - myvertex.v = 1.0; - - myvertex.x = x1; - myvertex.y = y1; - ta_commit_list(&myvertex); - - myvertex.x = x2; - myvertex.v = 0.0; - ta_commit_list(&myvertex); - - myvertex.x = x1; - myvertex.y = y2; - myvertex.u = 1.0; - myvertex.v = 1.0; - ta_commit_list(&myvertex); - - myvertex.x = x2; - myvertex.v = 0.0; - myvertex.cmd |= TA_CMD_VERTEX_EOS; - ta_commit_list(&myvertex); -} - -int Icon::find_unused_pixel() -{ - int use[16]; - memset(use, 0, sizeof(use)); - for(int n=0; n<32*32/2; n++) { - unsigned char pix = bitmap[n]; - use[pix&0xf]++; - use[pix>>4]++; - } - for(int i=0; i<16; i++) - if(!use[i]) - return i; - return -1; -} - -bool Icon::load_image2(void *data, int len) -{ - struct { - int size, w, h; - short pla, bitcnt; - int comp, sizeimg, xres, yres, used, imp; - } hdr; - if(len < 40) - return false; - memcpy(&hdr, data, 40); - if(hdr.size != 40 || hdr.sizeimg<=0 || hdr.w<0 || hdr.h<0 || - hdr.bitcnt<0 || hdr.used<0) - return false; - if(!hdr.used) - hdr.used = 1<>= 1; - if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len || - hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3)) - return false; - if(hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16) - return false; - memcpy(palette, ((char *)data)+hdr.size, hdr.used<<2); - memcpy(bitmap, ((char *)data)+hdr.size+(hdr.used<<2), 32*32/2); - for(int i=0; i<16; i++) - palette[i] |= 0xff000000; - for(int i=hdr.used; i<16; i++) - palette[i] = 0; - int unused = find_unused_pixel(); - if(unused >= 0) { - unsigned char *mask = - ((unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2; - unsigned char *pix = bitmap; - for(int y=0; y<32; y++) - for(int x=0; x<32/8; x++) { - unsigned char mbits = *mask++; - for(int z=0; z<4; z++) { - unsigned char pbits = *pix; - if(mbits & 64) pbits = (pbits & ~0xf) | unused; - if(mbits & 128) pbits = (pbits & 0xf) | (unused << 4); - *pix++ = pbits; - mbits <<= 2; - } - } - palette[unused] = 0; - } - return true; -} - -bool Icon::load_image1(void *data, int len, int offs) -{ - struct { - char w, h, colors, rsrv; - short pla, bitcnt; - int bytes, offs; - } hdr; - if(len < offs+16) - return false; - memcpy(&hdr, ((char *)data)+offs, 16); - if(hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len) - return load_image2(((char *)data)+hdr.offs, hdr.bytes); - else - return false; -} - -bool Icon::load(void *data, int len, int offs) -{ - struct { short rsrv, type, cnt; } hdr; - memset(bitmap, 0, sizeof(bitmap)); - memset(palette, 0, sizeof(palette)); - texture = NULL; - if(len < offs+6) - return false; - memcpy(&hdr, ((char *)data)+offs, 6); - if(hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len) - return false; - for(int i=0; i=0) { - int sz; - sz = read(fd, buf, sizeof(buf)); - close(fd); - if(sz>0) - return load(buf, sz); - } - return false; -} diff --git a/dc/icon.h b/dc/icon.h deleted file mode 100644 index b9cf344bab..0000000000 --- a/dc/icon.h +++ /dev/null @@ -1,21 +0,0 @@ - -class Icon -{ - private: - unsigned char bitmap[32*32/2]; - unsigned int palette[16]; - void *texture; - - int find_unused_pixel(); - bool load_image1(void *data, int len, int offs); - bool load_image2(void *data, int len); - - public: - bool load(void *data, int len, int offs = 0); - bool load(const char *filename); - void create_texture(); - void set_palette(int pal); - void draw(float x1, float y1, float x2, float y2, int pal, - unsigned argb = 0xffffffff); - void create_vmicon(void *buffer); -}; diff --git a/dc/input.cpp b/dc/input.cpp deleted file mode 100644 index ed7289e463..0000000000 --- a/dc/input.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "dc.h" - -int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, - byte &shiftFlags) -{ - int lmb=0, rmb=0, newkey=0; - static int lastkey = 0; - static byte lastlmb = 0, lastrmb = 0; - shiftFlags = 0; - for(int i=0; i<4; i++, pad++) - if(pad->func & MAPLE_FUNC_CONTROLLER) { - int buttons = pad->cond.controller.buttons; - - if(!(buttons & 0x060e)) exit(0); - - if(!(buttons & 4)) lmb++; - if(!(buttons & 2)) rmb++; - - if(!(buttons & 8)) newkey = 319; - else if(!(buttons & 512)) newkey = ' '; - else if(!(buttons & 1024)) newkey = '0'; - - if(!(buttons & 128)) mouse_x++; - if(!(buttons & 64)) mouse_x--; - if(!(buttons & 32)) mouse_y++; - if(!(buttons & 16)) mouse_y--; - - mouse_x += ((int)pad->cond.controller.joyx-128)>>4; - mouse_y += ((int)pad->cond.controller.joyy-128)>>4; - } else if(pad->func & MAPLE_FUNC_MOUSE) { - int buttons = pad->cond.mouse.buttons; - - if(!(buttons & 4)) lmb++; - if(!(buttons & 2)) rmb++; - - if(!(buttons & 8)) newkey = 319; - - mouse_x += pad->cond.mouse.axis1; - mouse_y += pad->cond.mouse.axis2; - pad->cond.mouse.axis1 = 0; - pad->cond.mouse.axis2 = 0; - } else if(pad->func & MAPLE_FUNC_KEYBOARD) { - for(int p=0; p<6; p++) { - int shift = pad->cond.kbd.shift; - int key = pad->cond.kbd.key[p]; - if(shift & 0x08) lmb++; - if(shift & 0x80) rmb++; - if(shift & 0x11) shiftFlags |= OSystem::KBD_CTRL; - if(shift & 0x44) shiftFlags |= OSystem::KBD_ALT; - if(shift & 0x22) shiftFlags |= OSystem::KBD_SHIFT; - if(key >= 4 && key <= 0x1d) - newkey = key+('a'-4); - else if(key >= 0x1e && key <= 0x26) - newkey = key+((shift & 0x22)? ('!'-0x1e) : ('1'-0x1e)); - else if(key >= 0x59 && key <= 0x61) - newkey = key+('1'-0x59); - else if(key >= 0x3a && key <= 0x43) - newkey = key+(315-0x3a); - else switch(key) { - case 0x27: case 0x62: - newkey = ((shift & 0x22)? '~' : '0'); break; - case 0x28: case 0x58: - newkey = 13; break; - case 0x29: - newkey = 27; break; - case 0x2a: - newkey = 8; break; - case 0x2b: - newkey = 9; break; - case 0x2c: - newkey = ' '; break; - case 0x4c: - if((shift & 0x11) && (shift & 0x44)) - exit(0); - break; - case 0x4f: - mouse_x++; break; - case 0x50: - mouse_x--; break; - case 0x51: - mouse_y++; break; - case 0x52: - mouse_y--; break; - } - } - } - - if(lmb && !lastlmb) { - lastlmb = 1; - return -OSystem::EVENT_LBUTTONDOWN; - } else if(lastlmb && !lmb) { - lastlmb = 0; - return -OSystem::EVENT_LBUTTONUP; - } - if(rmb && !lastrmb) { - lastrmb = 1; - return -OSystem::EVENT_RBUTTONDOWN; - } else if(lastrmb && !rmb) { - lastrmb = 0; - return -OSystem::EVENT_RBUTTONUP; - } - - if(!newkey) - lastkey = 0; - else if(newkey != lastkey) - return lastkey = newkey; - - return 0; -} - -bool OSystem_Dreamcast::poll_event(Event *event) -{ - unsigned int t = Timer(); - if(((int)(t-_devpoll))<0) - return false; - _devpoll += USEC_TO_TIMER(17000); - int mask = getimask(); - setimask(15); - checkSound(); - int e = handleInput(locked_get_pads(), _ms_cur_x, _ms_cur_y, - event->kbd.flags); - setimask(mask); - if (_ms_cur_x<0) _ms_cur_x=0; - if (_ms_cur_x>319) _ms_cur_x=319; - if (_ms_cur_y<0) _ms_cur_y=0; - if (_ms_cur_y>=_screen_h) _ms_cur_y=_screen_h-1; - event->mouse.x = _ms_cur_x; - event->mouse.y = _ms_cur_y; - event->kbd.ascii = event->kbd.keycode = 0; - if(e<0) { - event->event_code = -e; - return true; - } else if(e>0) { - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = e; - event->kbd.ascii = (e>='a' && e<='z' && (event->kbd.flags & KBD_SHIFT)? - e &~ 0x20 : e); - return true; - } else if(_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) { - event->event_code = EVENT_MOUSEMOVE; - _ms_old_x = _ms_cur_x; - _ms_old_y = _ms_cur_y; - return true; - } else { - event->event_code = 0; - return false; - } -} - diff --git a/dc/label.cpp b/dc/label.cpp deleted file mode 100644 index 8f263eec0a..0000000000 --- a/dc/label.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include -#include - -#include "label.h" - -static void *get_romfont_address() -{ - void *ret; - __asm__("jsr @%1; mov #0,r1; mov r0,%0" : - "=r" (ret) : "r" (*(void **)0x8c0000b4) : - "pr", "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7"); - return ret; -} - -static void draw_char(unsigned short *dst, int mod, int c, void *font_base) -{ - unsigned char *src; - int i, j; - if(c<=32 || c>255 || (c>=127 && c<160)) c=160; - if(c<128) c -= 32; else c -= 64; - src = c*36 + (unsigned char *)font_base; - for(i=0; i<12; i++) { - int n = (src[0]<<16)|(src[1]<<8)|src[2]; - for(j=0; j<12; j++, n<<=1) - if(n & (1<<23)) { - dst[j] = 0xffff; - dst[j+1] = 0xffff; - dst[j+2] = 0xa108; - dst[j+mod] = 0xa108; - dst[j+mod+1] = 0xa108; - } - dst += mod; - for(j=0; j<12; j++, n<<=1) - if(n & (1<<23)) { - dst[j] = 0xffff; - dst[j+1] = 0xffff; - dst[j+2] = 0xa108; - dst[j+mod] = 0xa108; - dst[j+mod+1] = 0xa108; - } - dst += mod; - src += 3; - } -} - -void Label::create_texture(const char *text) -{ - void *font = get_romfont_address(); - int l = strlen(text); - if(l>64) l=64; - int w = 14*l; - for(tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u0) - draw_char(tex+(p-=14), u, text[--l], font); - texture = tex; -} - -void Label::draw(float x, float y, unsigned int argb, float scale) -{ - struct polygon_list mypoly; - struct packed_colour_vertex_list myvertex; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| - TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA| - TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_V_SIZE_32|tex_u; - mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED| - TA_TEXTUREMODE_ADDRESS(texture); - - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - - ta_commit_list(&mypoly); - - myvertex.cmd = TA_CMD_VERTEX; - myvertex.ocolour = 0; - myvertex.colour = argb; - myvertex.z = 0.5; - myvertex.u = 0.0; - myvertex.v = 0.0; - - myvertex.x = x; - myvertex.y = y; - ta_commit_list(&myvertex); - - myvertex.x = x+u*scale; - myvertex.u = 1.0; - ta_commit_list(&myvertex); - - myvertex.x = x; - myvertex.y = y+25.0*scale; - myvertex.u = 0.0; - myvertex.v = 25.0/32.0; - ta_commit_list(&myvertex); - - myvertex.x = x+u*scale; - myvertex.u = 1.0; - myvertex.cmd |= TA_CMD_VERTEX_EOS; - ta_commit_list(&myvertex); -} - diff --git a/dc/label.h b/dc/label.h deleted file mode 100644 index d4a407307d..0000000000 --- a/dc/label.h +++ /dev/null @@ -1,11 +0,0 @@ -class Label -{ - private: - void *texture; - int tex_u, u; - - public: - void create_texture(const char *text); - void draw(float x, float y, unsigned int argb = 0xffffffff, - float scale = 1.0); -}; diff --git a/dc/portdefs.h b/dc/portdefs.h deleted file mode 100644 index fd7929ffe7..0000000000 --- a/dc/portdefs.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/dc/selector.cpp b/dc/selector.cpp deleted file mode 100644 index 22cba5bbfc..0000000000 --- a/dc/selector.cpp +++ /dev/null @@ -1,487 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "mididrv.h" -#include "gameDetector.h" -#include "dc.h" -#include "icon.h" -#include "label.h" - -#include - - -#define MAX_GAMES 100 -#define MAX_DIR 100 - - -void draw_solid_quad(float x1, float y1, float x2, float y2, - int c0, int c1, int c2, int c3) -{ - struct polygon_list mypoly; - struct packed_colour_vertex_list myvertex; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR| - TA_CMD_POLYGON_GOURAUD_SHADING; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC|TA_POLYMODE2_FOG_DISABLED; - mypoly.texture = 0; - - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - - ta_commit_list(&mypoly); - - myvertex.cmd = TA_CMD_VERTEX; - myvertex.ocolour = 0; - myvertex.z = 0.5; - myvertex.u = 0.0; - myvertex.v = 0.0; - - myvertex.colour = c0; - myvertex.x = x1; - myvertex.y = y1; - ta_commit_list(&myvertex); - - myvertex.colour = c1; - myvertex.x = x2; - ta_commit_list(&myvertex); - - myvertex.colour = c2; - myvertex.x = x1; - myvertex.y = y2; - ta_commit_list(&myvertex); - - myvertex.colour = c3; - myvertex.x = x2; - myvertex.cmd |= TA_CMD_VERTEX_EOS; - ta_commit_list(&myvertex); -} - -void draw_trans_quad(float x1, float y1, float x2, float y2, - int c0, int c1, int c2, int c3) -{ - struct polygon_list mypoly; - struct packed_colour_vertex_list myvertex; - - mypoly.cmd = - TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST| - TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR| - TA_CMD_POLYGON_GOURAUD_SHADING; - mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE; - mypoly.mode2 = - TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA| - TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA; - mypoly.texture = 0; - - mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; - - ta_commit_list(&mypoly); - - myvertex.cmd = TA_CMD_VERTEX; - myvertex.ocolour = 0; - myvertex.z = 0.5; - myvertex.u = 0.0; - myvertex.v = 0.0; - - myvertex.colour = c0; - myvertex.x = x1; - myvertex.y = y1; - ta_commit_list(&myvertex); - - myvertex.colour = c1; - myvertex.x = x2; - ta_commit_list(&myvertex); - - myvertex.colour = c2; - myvertex.x = x1; - myvertex.y = y2; - ta_commit_list(&myvertex); - - myvertex.colour = c3; - myvertex.x = x2; - myvertex.cmd |= TA_CMD_VERTEX_EOS; - ta_commit_list(&myvertex); -} - - -struct Game -{ - char dir[256]; - char filename_base[256]; - char text[256]; - Icon icon; - Label label; -}; - -struct Dir -{ - char name[256]; - char deficon[256]; -}; - -static Game the_game; - -static bool isGame(const char *fn, char *base) -{ - int l = strlen(fn); - if(l>4 && (!strcasecmp(fn+l-4, ".000") || - !strcasecmp(fn+l-4, ".SM0"))) { - strcpy(base, fn); - base[l-4]='\0'; - return true; - } - if(!strcasecmp(fn, "00.LFL") || - !strcasecmp(fn, "000.LFL")) { - *base = '\0'; - return true; - } - return false; -} - -static void checkName(GameDetector *d, Game &game) -{ - d->_exe_name = game.filename_base; - if(d->detectGame()) { - char *n = d->getGameName(); - strcpy(game.text, n); - free(n); - } else - strcpy(game.text, game.filename_base); - d->_exe_name = NULL; -} - -static bool checkExe(const char *dir, const char *f) -{ - char fn[520]; - int fd; - sprintf(fn, "%s%s.EXE", dir, f); - if((fd = open(fn, O_RDONLY))<0) - return false; - close(fd); - return true; -} - -static bool isIcon(const char *fn) -{ - int l = strlen(fn); - if(l>4 && !strcasecmp(fn+l-4, ".ICO")) - return true; - else - return false; -} - -static bool loadIcon(Game &game, Dir *dirs, int num_dirs) -{ - char icofn[520]; - sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base); - if(game.icon.load(icofn)) - return true; - for(int i=0; id_size < 0) { - if(num_dirs < MAX_DIR) { - strcpy(dirs[num_dirs].name, dirs[curr_dir-1].name); - if(strlen(dirs[num_dirs].name)+strlen(entry->d_name)<255) { - strcat(dirs[num_dirs].name, entry->d_name); - strcat(dirs[num_dirs].name, "/"); - num_dirs++; - } - } - } else - if(isIcon(entry->d_name)) - strcpy(dirs[curr_dir-1].deficon, entry->d_name); - else if(curr_game < max && - isGame(entry->d_name, games[curr_game].filename_base)) { - strcpy(games[curr_game].dir, dirs[curr_dir-1].name); - if(!*games[curr_game].filename_base) { - int i; - for(i=strlen(games[curr_game].dir)-1; --i>=0; ) - if(games[curr_game].dir[i]=='/') - break; - if(i>=0) { - strcpy(games[curr_game].filename_base, - games[curr_game].dir+i+1); - games[curr_game].filename_base[strlen(games[curr_game]. - filename_base)-1]='\0'; -#if 0 - games[curr_game].dir[i+1]='\0'; -#endif - } - if(checkExe(games[curr_game].dir, "loom")) - strcpy(games[curr_game].filename_base, "loomcd"); - } - checkName(d, games[curr_game]); -#if 0 - printf("Registered game <%s> in <%s> <%s> because of <%s> <%s>\n", - games[curr_game].text, games[curr_game].dir, - games[curr_game].filename_base, - dirs[curr_dir-1].name, entry->d_name); -#endif - curr_game++; - } - closedir(dirp); - } - } - for(int i=0; i= 6) - wasopen = 1; - if(s > 0 && s < 6 && wasopen) { - cdfs_reinit(); - chdir("/"); - chdir("/"); - ta_sync(); - ta_txrelease(mark); - return; - } - - ta_begin_frame(); - - drawBackground(); - - ta_commit_end(); - - lab.draw(166.0, 200.0, 0xffff2020); - - ta_commit_frame(); - - int mousex = 0, mousey = 0; - byte shiftFlags; - - int mask = getimask(); - setimask(15); - handleInput(locked_get_pads(), mousex, mousey, shiftFlags); - setimask(mask); - } -} - -static void drawGameLabel(Game &game, int pal, float x, float y, - unsigned int argb, int fade = 0, float scale = 1.0) -{ - unsigned int fade_alpha = (255-fade)<<24; - - game.icon.draw(x, y, x+32.0*scale, y+32.0*scale, pal, 0xffffff|fade_alpha); - game.label.draw(x+54.0*scale, y+4.0*scale, argb|fade_alpha, scale); -} - -int gameMenu(Game *games, int num_games) -{ - int top_game = 0, selector_pos = 0; - int mousex = 0, mousey = 0; - - if(!num_games) - return -1; - - for(;;) { - - if(getCdState()>=6) - return -1; - - ta_begin_frame(); - - drawBackground(); - - ta_commit_end(); - - float y = 40.0; - for(int i=top_game, cnt=0; cnt<10 && i=16) { - if(selector_pos + top_game + 1 < num_games) - if(++selector_pos >= 10) { - --selector_pos; - ++top_game; - } - mousey -= 16; - } else if(mousey<=-16) { - if(selector_pos + top_game > 0) - if(--selector_pos < 0) { - ++selector_pos; - --top_game; - } - mousey += 16; - } - } -} - -bool selectGame(GameDetector *d, char *&ret, char *&dir_ret, Icon &icon) -{ - Game *games = new Game[MAX_GAMES]; - int selected, num_games; - - ta_sync(); - void *mark = ta_txmark(); - - for(;;) { - num_games = findGames(d, games, MAX_GAMES); - - for(int i=0; i= num_games) - selected = -1; - - if(selected >= 0) - the_game = games[selected]; - - delete games; - - if(selected>=0) { -#if 0 - chdir(the_game.dir); -#else - chdir("/"); - static char dirarg[258]; - sprintf(dirarg, "-p%s", the_game.dir); - dir_ret = dirarg; -#endif - ret = the_game.filename_base; - icon = the_game.icon; - return true; - } else - return false; -} diff --git a/dc/vmsave.cpp b/dc/vmsave.cpp deleted file mode 100644 index 34bf2e40fa..0000000000 --- a/dc/vmsave.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Dreamcast port - * Copyright (C) 2002 Marcus Comstedt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "mididrv.h" -#include "gameDetector.h" -#include "dc.h" -#include "icon.h" -#include "saveload.h" - -#include - - -// Savegame can not be bigger than this, even before compression -#define MAX_SAVE_SIZE (128*1024) - - -enum vmsaveResult { - VMSAVE_OK, - VMSAVE_NOVM, - VMSAVE_NOSPACE, - VMSAVE_WRITEERROR, -}; - - -static int lastvm=-1; - -static vmsaveResult trySave(GameDetector *d, const char *data, int size, - const char *filename, class Icon &icon, int vm) -{ - struct vmsinfo info; - struct superblock super; - struct vms_file file; - struct vms_file_header header; - struct timestamp tstamp; - struct tm tm; - time_t t; - unsigned char iconbuffer[512+32]; - - if(!vmsfs_check_unit(vm, 0, &info)) - return VMSAVE_NOVM; - if(!vmsfs_get_superblock(&info, &super)) - return VMSAVE_NOVM; - int free_cnt = vmsfs_count_free(&super); - if(vmsfs_open_file(&super, filename, &file)) - free_cnt += file.blks; - if(((128+512+size+511)>>9) > free_cnt) - return VMSAVE_NOSPACE; - - memset(&header, 0, sizeof(header)); - strncpy(header.shortdesc, "ScummVM savegame", 16); - char *game_name = d->getGameName(); - strncpy(header.longdesc, game_name, 32); - free(game_name); - strncpy(header.id, "ScummVM", 16); - icon.create_vmicon(iconbuffer); - header.numicons = 1; - memcpy(header.palette, iconbuffer, sizeof(header.palette)); - time(&t); - tm = *localtime(&t); - tstamp.year = tm.tm_year+1900; - tstamp.month = tm.tm_mon+1; - tstamp.day = tm.tm_mday; - tstamp.hour = tm.tm_hour; - tstamp.minute = tm.tm_min; - tstamp.second = tm.tm_sec; - tstamp.wkday = (tm.tm_wday+6)%7; - - vmsfs_beep(&info, 1); - - vmsfs_errno = 0; - if(!vmsfs_create_file(&super, filename, &header, - iconbuffer+sizeof(header.palette), NULL, - data, size, &tstamp)) { - fprintf(stderr, "%s\n", vmsfs_describe_error()); - vmsfs_beep(&info, 0); - return VMSAVE_WRITEERROR; - } - - vmsfs_beep(&info, 0); - return VMSAVE_OK; -} - -static bool tryLoad(char *&buffer, int &size, const char *filename, int vm) -{ - struct vmsinfo info; - struct superblock super; - struct vms_file file; - struct vms_file_header header; - struct timestamp tstamp; - struct tm tm; - time_t t; - unsigned char iconbuffer[512+32]; - - if(!vmsfs_check_unit(vm, 0, &info)) - return false; - if(!vmsfs_get_superblock(&info, &super)) - return false; - if(!vmsfs_open_file(&super, filename, &file)) - return false; - - buffer = new char[size = file.size]; - - if(vmsfs_read_file(&file, (unsigned char *)buffer, size)) - return true; - - delete buffer; - return false; -} - -vmsaveResult writeSaveGame(GameDetector *d, const char *data, int size, - const char *filename, class Icon &icon) -{ - vmsaveResult r, res = VMSAVE_NOVM; - - if(lastvm >= 0 && - (res = trySave(d, data, size, filename, icon, lastvm)) == VMSAVE_OK) - return res; - - for(int i=0; i<24; i++) - if((r = trySave(d, data, size, filename, icon, i)) == VMSAVE_OK) { - lastvm = i; - return r; - } else if(r > res) - res = r; - - return res; -} - -bool readSaveGame(char *&buffer, int &size, const char *filename) -{ - if(lastvm >= 0 && - tryLoad(buffer, size, filename, lastvm)) - return true; - - for(int i=0; i<24; i++) - if(tryLoad(buffer, size, filename, i)) { - lastvm = i; - return true; - } - - return false; -} - - -struct vmStreamContext { - bool issave; - char *buffer; - int pos, size; - char filename[16]; -}; - -bool SerializerStream::fopen(const char *filename, const char *mode) -{ - vmStreamContext *c = new vmStreamContext; - context = c; - if(strchr(mode, 'w')) { - c->issave = true; - strncpy(c->filename, filename, 16); - c->pos = 0; - c->buffer = new char[c->size = MAX_SAVE_SIZE]; - return true; - } else if(readSaveGame(c->buffer, c->size, filename)) { - if(c->size > 0 && c->buffer[0] != 'S') { - // Data does not start with "SCVM". Maybe compressed? - char *expbuf = new char[MAX_SAVE_SIZE]; - unsigned long destlen = MAX_SAVE_SIZE; - if(!uncompress((Bytef*)expbuf, &destlen, (Bytef*)c->buffer, c->size)) { - delete(c->buffer); - c->buffer = expbuf; - c->size = destlen; - } else delete expbuf; - } - c->issave = false; - c->pos = 0; - return true; - } else { - delete c; - context = NULL; - return false; - } -} - -void SerializerStream::fclose() -{ - extern GameDetector detector; - extern Icon icon; - - if(context) { - vmStreamContext *c = (vmStreamContext *)context; - if(c->issave) { - if(c->pos) { - // Try compression - char *compbuf = new char[c->pos]; - unsigned long destlen = c->pos; - if(!compress((Bytef*)compbuf, &destlen, (Bytef*)c->buffer, c->pos)) { - delete c->buffer; - c->buffer = compbuf; - c->pos = destlen; - } else delete compbuf; - } - writeSaveGame(&detector, c->buffer, c->pos, - c->filename, icon); - } - delete c->buffer; - delete c; - context = NULL; - } -} - -int SerializerStream::fread(void *buf, int size, int cnt) -{ - vmStreamContext *c = (vmStreamContext *)context; - - if (!c || c->issave) - return -1; - - int nbyt = size*cnt; - if (c->pos + nbyt > c->size) { - cnt = (c->size - c->pos)/size; - nbyt = size*cnt; - } - if (nbyt) - memcpy(buf, c->buffer + c->pos, nbyt); - c->pos += nbyt; - return cnt; -} - -int SerializerStream::fwrite(void *buf, int size, int cnt) -{ - vmStreamContext *c = (vmStreamContext *)context; - - if (!c || !c->issave) - return -1; - - int nbyt = size*cnt; - if (c->pos + nbyt > c->size) { - cnt = (c->size - c->pos)/size; - nbyt = size*cnt; - } - if (nbyt) - memcpy(c->buffer + c->pos, buf, nbyt); - c->pos += nbyt; - return cnt; -} - diff --git a/debian/.cvsignore b/debian/.cvsignore deleted file mode 100644 index 2ac039bcbd..0000000000 --- a/debian/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -changelog -files -scummvm -scummvm.postinst.debhelper -scummvm.prerm.debhelper -scummvm.substvars diff --git a/debian/README.Debian b/debian/README.Debian deleted file mode 100644 index 5394ccae26..0000000000 --- a/debian/README.Debian +++ /dev/null @@ -1,9 +0,0 @@ -scummvm for Debian ------------------- - - There is no documentation for the configuration file. For now you can use: - scummvm -w -p[path] [options] game - it will write a config file in ~/.scummvmrc and from then on you can just - run 'scummvm game' and it will remember your options - - -- Bastien Nocera , Friday 10 May 2002 diff --git a/debian/changelog.cvs b/debian/changelog.cvs deleted file mode 100644 index 7cdd91fada..0000000000 --- a/debian/changelog.cvs +++ /dev/null @@ -1,8 +0,0 @@ -scummvm (@VERSION@-1) unstable; urgency=low - - * This is a CVS snapshot, don't file bugs on the Debian BTS if you use - this package. Instead use the Sourceforge bug tracker: - http://sourceforge.net/tracker/?group_id=37116 - - -- Bastien Nocera Fri, 5 Apr 2002 16:37:09 +0100 - diff --git a/debian/changelog.debian b/debian/changelog.debian deleted file mode 100644 index e46253fe48..0000000000 --- a/debian/changelog.debian +++ /dev/null @@ -1,22 +0,0 @@ -scummvm (0.2.0) unstable; urgency=low - - * Release of ScummVM 0.2.0 - - -- James Brown Tue, 14 May 2002 18:16:02 +0800 - -scummvm (0.1.0b-2) unstable; urgency=low - - * Moved the scummvm main bin under /usr/lib, the wrapper script under - /usr/games - * Fixed bug in the script that made it not work if the path was relative - - -- Bastien Nocera Wed, 10 Apr 2002 19:27:05 +0100 - -scummvm (0.1.0b-1) unstable; urgency=low - - * Initial Release. - * Packaged made under the influence of beer at GUAD3C in Sevilla ! Arriba ! - Ole ! - - -- Bastien Nocera Fri, 5 Apr 2002 16:37:09 +0100 - diff --git a/debian/changelog.debian_official b/debian/changelog.debian_official deleted file mode 100644 index 55fc446a38..0000000000 --- a/debian/changelog.debian_official +++ /dev/null @@ -1,23 +0,0 @@ -scummvm (0.2.0) unstable; urgency=low - - * New upstream version (Closes: #143281) - * Killed the wrapper script, see upstream changelog - - -- Bastien Nocera Wed, 15 May 2002 03:27:11 +0100 - -scummvm (0.1.0b-2) unstable; urgency=low - - * Moved the scummvm main bin under /usr/lib, the wrapper script under - /usr/games - * Fixed bug in the script that made it not work if the path was relative - - -- Bastien Nocera Wed, 10 Apr 2002 19:27:05 +0100 - -scummvm (0.1.0b-1) unstable; urgency=low - - * Initial Release. - * Packaged made under the influence of beer at GUAD3C in Sevilla ! Arriba ! - Ole ! - - -- Bastien Nocera Fri, 5 Apr 2002 16:37:09 +0100 - diff --git a/debian/control b/debian/control deleted file mode 100644 index f2ffa3a003..0000000000 --- a/debian/control +++ /dev/null @@ -1,15 +0,0 @@ -Source: scummvm -Section: contrib/games -Priority: optional -Maintainer: Bastien Nocera -Build-Depends: debhelper (>> 3.0.0), libsdl1.2-dev, libreadline4-dev, libncurses5-dev -Standards-Version: 3.5.2 - -Package: scummvm -Architecture: any -Depends: ${shlibs:Depends} -Description: Engine to run some LucasArts adventure games - The "Script Creation Utility for Maniac Mansion Virtual Machine" (scummvm for - short) is an engine used to run a lot of LucasArts adventure games. - . - You will also need the data files from the game to be able to play it. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index ef03344742..0000000000 --- a/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -This package was debianized by Bastien Nocera on -Fri, 5 Apr 2002 16:37:09 +0100. - -It was downloaded from http://prdownloads.sourceforge.net/scummvm/ - -Upstream Author(s): ScummVM team - -Copyright: - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -On Debian GNU/Linux systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. diff --git a/debian/prepare b/debian/prepare deleted file mode 100755 index 0698be1184..0000000000 --- a/debian/prepare +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -if [ ! -e debian/rules ] ; then - echo "Run from the top-level source directory as debian/prepare" - exit 1 -fi - -if [ -d CVS/ ] && [ $1 != "--nocvs" ]; then - TODATE=`date +%Y%m%d` - NEXT_VERSION=`grep SCUMMVM_VERSION scumm.h | sed 's,\#define\ SCUMMVM_VERSION\ \",,gi' | sed 's,\ devel\",,gi'` - cat debian/changelog.cvs | sed s/@VERSION@/$NEXT_VERSION.cvs$TODATE/g \ - > debian/changelog.tmp && mv debian/changelog.tmp debian/changelog - exit 0 -else - if [ x$USER = xhadess ]; then - cp debian/changelog.debian_official debian/changelog - else - cp debian/changelog.debian debian/changelog - fi -fi diff --git a/debian/rules b/debian/rules deleted file mode 100755 index b05473cabc..0000000000 --- a/debian/rules +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/make -f - -export DH_COMPAT=3 - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -build: - dh_testdir - $(MAKE) - -clean: - dh_testdir - dh_testroot - -$(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - install -m0777 scummvm $(CURDIR)/debian/scummvm/usr/games/scummvm - install -m0644 scummvm.6 \ - $(CURDIR)/debian/scummvm/usr/share/man/man6 - -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installchangelogs - dh_installmanpages scummvm.6 - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-arch -.PHONY: build clean binary-arch binary install diff --git a/debian/scummvm.dirs b/debian/scummvm.dirs deleted file mode 100644 index 818b207667..0000000000 --- a/debian/scummvm.dirs +++ /dev/null @@ -1,3 +0,0 @@ -usr/games -usr/lib/scummvm -usr/share/man/man6 diff --git a/debian/scummvm.docs b/debian/scummvm.docs deleted file mode 100644 index 6e88c596f4..0000000000 --- a/debian/scummvm.docs +++ /dev/null @@ -1,2 +0,0 @@ -readme.txt -whatsnew.txt diff --git a/debug.cpp b/debug.cpp deleted file mode 100644 index 6957f13bf4..0000000000 --- a/debug.cpp +++ /dev/null @@ -1,485 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -/* - * Readline and command completion support by Tom Dunstan - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "debug.h" - -#ifdef HAVE_READLINE -#include "debugrl.h" -#endif - -enum { - CMD_INVALID, - CMD_HELP, - CMD_CONTINUE, - CMD_GO, - CMD_ACTOR, - CMD_SCRIPTS, - CMD_LOAD_ROOM, - CMD_DUMPBOX, - CMD_VAR, - CMD_WATCH, - CMD_QUIT -}; - -void ScummDebugger::attach(Scumm *s) -{ - if (_s) - detach(); - - _welcome = true; - _s = s; - s->_debugger = this; - - _go_amount = 1; -#ifdef HAVE_READLINE - initialize_readline(); -#endif -} - -bool ScummDebugger::do_command() -{ - switch (get_command()) { - case CMD_HELP: - printf("Debugger commands:\n" - "(a)ctor [actornum] -> show actor information\n" - "(b)ox [boxnum] -> list and draw the specified (or all) boxes\n" - "(c)ontinue -> exit the debugger and continue the program\n" - "(h)elp -> display this help text\n" - "(g)o [numframes] -> increase frame\n" - "(r)oom [roomnum] -> load room\n" - "(s)cripts -> show running scripts\n" - "(v)ariable -> set or show a variable value\n" - "(w)atch [varnum] -> set a variable watch. 0 means all variables.\n" - "(q)uit -> exit game\n"); - return true; - - case CMD_CONTINUE: - detach(); - return false; - - case CMD_GO: - if (!_parameters[0]) - _go_amount = 1; - else - _go_amount = atoi(_parameters); - return false; - case CMD_ACTOR: - if (!_parameters[0]) - printActors(-1); - else - printActors(atoi(_parameters)); - return true; - case CMD_SCRIPTS: - printScripts(); - return true; - case CMD_LOAD_ROOM: - if (!_parameters[0]) { - printf("Current room: %d [%d]\n", _s->_currentRoom, _s->_roomResource); - } else { - int room = atoi(_parameters); - _s->_actors[_s->_vars[_s->VAR_EGO]].room = room; - _s->startScene(room, 0, 0); - _s->_fullRedraw = 1; - } - return true; - case CMD_DUMPBOX: - if (!_parameters[0]) - printBoxes(); - else - printBox(atoi(_parameters)); - return true; - case CMD_VAR: - if (!_parameters[0]) { - printf("v 123 will show the value of 123, v 123 456 will set the value of 123 to 456.\n"); - } else { - char *tok = strtok(_parameters, " "); - int var = atoi(tok); - tok = strtok(NULL, ""); - if (tok) - _s->writeVar(var, atoi(tok)); - - printf("Var[%d] = %d\n", var, _s->readVar(var)); - } - return true; - - case CMD_WATCH: - if (!_parameters[0]) { - printf("Clearing all watches..\n"); - _s->_varwatch = -1; - } else { - _s->_varwatch = atoi(_parameters); - if (_s->_varwatch == 0) - printf("Watching all variables\n"); - else - printf("Watching vars[%d]\n", _s->_varwatch); - } - return true; - case CMD_QUIT: - exit(1); - - default: /* this line is never reached */ - error("Unknown debug command"); - return true; - } -} - -void ScummDebugger::enter() -{ - if (_welcome) { - _welcome = false; - printf - ("Debugging Mode entered!, please switch to this console for input.\n" - "Enter h to list all the debug commands\n"); - } - while (do_command()) { - } -} - - -void ScummDebugger::on_frame() -{ - if (_go_amount == 0) - return; - if (!--_go_amount) - enter(); -} - - -void ScummDebugger::detach() -{ - _s->_debugger = NULL; - _s = NULL; -} - -struct DebuggerCommands { - char text[8]; - byte len; - byte id; -}; - -static const DebuggerCommands debugger_commands[] = { - {"h", 1, CMD_HELP}, - {"c", 1, CMD_CONTINUE}, - {"g", 1, CMD_GO}, - {"a", 1, CMD_ACTOR}, - {"s", 1, CMD_SCRIPTS}, - {"r", 1, CMD_LOAD_ROOM}, - {"b", 1, CMD_DUMPBOX}, - {"v", 1, CMD_VAR}, - {"w", 1, CMD_WATCH}, - {"q", 1, CMD_QUIT}, - {"", 0, 0} -}; - -int ScummDebugger::get_command() -{ - const DebuggerCommands *dc; - char *s; - int i; - static char *buf; - - do { -#ifndef HAVE_READLINE - buf = _cmd_buffer; - printf("debug> "); - if (!fgets(_cmd_buffer, sizeof(_cmd_buffer), stdin)) - return CMD_CONTINUE; - - i = strlen(_cmd_buffer); - while (i > 0 && _cmd_buffer[i - 1] == 10) - _cmd_buffer[--i] = 0; - - if (i == 0) - continue; - -#else // yes we do have readline - if (buf) { - free(buf); - } - buf = readline("debug> "); - if (!buf) { - printf("\n"); - return CMD_CONTINUE; - } - if (strlen(buf) == 0) { - continue; - } - add_history(buf); -#endif - - dc = debugger_commands; - do { - if (!strncmp(buf, dc->text, dc->len)) { - for (s = buf; *s; s++) { - if (*s == 32) { - s++; - break; - } - } - _parameters = s; - return _command = dc->id; - } - } while ((++dc)->text[0]); - - for (s = buf; *s; s++) - if (*s == 32) { - *s = 0; - break; - } - printf("Invalid command '%s'. Type 'help' for a list of available commands.\n", buf); - } while (1); -} - -void ScummDebugger::printActors(int act) -{ - int i; - Actor *a; - - printf("+------------------------------------------------------------------+\n"); - printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|cls|\n"); - printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+---+\n"); - for (i = 1; i < _s->NUM_ACTORS; i++) { - if (act == -1 || act == i) { - a = &_s->_actors[i]; - if (a->visible) - printf("|%2d|%4d|%3d %3d|%4d|%3d|%5d|%3d|%3d|%2d|%5d|%5d|%3d|%3d|$%02x|\n", - a->number, a->room, a->x, a->y, a->elevation, a->costume, - a->width, a->walkbox, a->moving, a->forceClip, a->frame, - a->scalex, a->speedx, a->facing, _s->_classData[a->number]); - } - } - printf("+--------------------------------------------------------------+\n"); -} - -void ScummDebugger::printScripts() -{ - int i; - ScriptSlot *ss; - - printf("+---------------------------------+\n"); - printf("|# |num|sta|typ|un1|un2|fc|cut|un5|\n"); - printf("+--+---+---+---+---+---+--+---+---+\n"); - for (i = 0; i < 25; i++) { - ss = &_s->vm.slot[i]; - if (ss->number) { - printf("|%2d|%3d|%3d|%3d|%3d|%3d|%2d|%3d|%3d|\n", - i, ss->number, ss->status, ss->where, ss->unk1, ss->unk2, - ss->freezeCount, ss->cutsceneOverride, ss->unk5); - } - } - printf("+-------------------------------------+\n"); -} - - -void ScummDebugger::printBoxes() -{ - int num, i = 0; - byte *boxm = _s->getBoxMatrixBaseAddr(); - num = _s->getNumBoxes(); - - printf("Walk matrix:\n"); - for (i = 0; i < num; i++) { - while (*boxm != 0xFF) { - printf("[%d] ", *boxm); - boxm++; - } - boxm++; - printf("\n"); - } - - printf("\nWalk boxes:\n"); - for (i = 0; i < num; i++) - printBox(i); -} - -void ScummDebugger::printBox(int box) -{ - BoxCoords coords; - int flags = _s->getBoxFlags(box); - int mask = _s->getMaskFromBox(box); - - _s->getBoxCoordinates(box, &coords); - - // Draw the box - boxTest(box); - - // Print out coords, flags, zbuffer mask - printf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d], flags=0x%02x, mask=%d\n", - box, - coords.ul.x, coords.ul.y, coords.ll.x, coords.ll.y, - coords.ur.x, coords.ur.y, coords.lr.x, coords.lr.y, - flags, mask); -} - - -/************ ENDER: Temporary debug code for boxen **************/ -/* -int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) -*/ - -static int gfxPrimitivesCompareInt(const void *a, const void *b); - -static int *gfxPrimitivesPolyInts = NULL; -static int gfxPrimitivesPolyAllocated = 0; - - -static byte *getBasePtr(Scumm *_s, int x, int y) -{ - VirtScreen *vs = _s->findVirtScreen(y); - - if (vs == NULL) - return NULL; - - return vs->screenPtr + x + (y - vs->topline) * 320 + - _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; -} - -static void hline(Scumm *scumm, int x1, int x2, int y, byte color) -{ - byte *ptr; - - if (x2 < x1) - x2 ^= x1 ^= x2 ^= x1; // Swap x2 and x1 - - ptr = getBasePtr(scumm, x1, y); - - if (ptr == NULL) - return; - - while (x1++ <= x2) { - *ptr++ = color; - } -} - - -static void filledPolygonColor(Scumm *scumm, int16 *vx, int16 *vy, int n, int color) -{ - int i; - int y; - int miny, maxy; - int x1, y1; - int x2, y2; - int ind1, ind2; - int ints; - - /* Sanity check */ - if (n < 3) { - return; - } - - /* Allocate temp array, only grow array */ - if (!gfxPrimitivesPolyAllocated) { - gfxPrimitivesPolyInts = (int *)malloc(sizeof(int) * n); - gfxPrimitivesPolyAllocated = n; - } else { - if (gfxPrimitivesPolyAllocated < n) { - gfxPrimitivesPolyInts = (int *)realloc(gfxPrimitivesPolyInts, sizeof(int) * n); - gfxPrimitivesPolyAllocated = n; - } - } - - /* Determine Y maxima */ - miny = vy[0]; - maxy = vy[0]; - for (i = 1; (i < n); i++) { - if (vy[i] < miny) { - miny = vy[i]; - } else if (vy[i] > maxy) { - maxy = vy[i]; - } - } - - /* Draw, scanning y */ - for (y = miny; (y <= maxy); y++) { - ints = 0; - for (i = 0; (i < n); i++) { - if (!i) { - ind1 = n - 1; - ind2 = 0; - } else { - ind1 = i - 1; - ind2 = i; - } - y1 = vy[ind1]; - y2 = vy[ind2]; - if (y1 < y2) { - x1 = vx[ind1]; - x2 = vx[ind2]; - } else if (y1 > y2) { - y2 = vy[ind1]; - y1 = vy[ind2]; - x2 = vx[ind1]; - x1 = vx[ind2]; - } else { - continue; - } - if ((y >= y1) && (y < y2)) { - gfxPrimitivesPolyInts[ints++] = (y - y1) * (x2 - x1) / (y2 - y1) + x1; - } else if ((y == maxy) && (y > y1) && (y <= y2)) { - gfxPrimitivesPolyInts[ints++] = (y - y1) * (x2 - x1) / (y2 - y1) + x1; - } - } - qsort(gfxPrimitivesPolyInts, ints, sizeof(int), gfxPrimitivesCompareInt); - - for (i = 0; (i < ints); i += 2) { - hline(scumm, gfxPrimitivesPolyInts[i], gfxPrimitivesPolyInts[i + 1], y, color); - } - } - - return; -} - -static int gfxPrimitivesCompareInt(const void *a, const void *b) -{ - return (*(const int *)a) - (*(const int *)b); -} - -void ScummDebugger::boxTest(int num) -{ - BoxCoords box; - int16 rx1[4], ry1[4]; - - _s->getBoxCoordinates(num, &box); - rx1[0] = box.ul.x; - ry1[0] = box.ul.y; - rx1[1] = box.ur.x; - ry1[1] = box.ur.y; - rx1[2] = box.lr.x; - ry1[2] = box.lr.y; - rx1[3] = box.ll.x; - ry1[3] = box.ll.y; - - // TODO - maybe use different colors for each box, and/or print the box number inside it? - filledPolygonColor(_s, &rx1[0], &ry1[0], 4, 255); - - VirtScreen *vs = _s->findVirtScreen(box.ul.y); - if (vs != NULL) - _s->setVirtscreenDirty(vs, 0, 0, 320, 200); - _s->drawDirtyScreenParts(); - _s->_system->update_screen(); -} diff --git a/debug.h b/debug.h deleted file mode 100644 index 4a5f8f9b4c..0000000000 --- a/debug.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef DEBUG_H -#define DEBUG_H - -class Scumm; - -struct ScummDebugger { - Scumm *_s; - byte _command; - char *_parameters; - - bool _welcome; - - int _go_amount; - - char _cmd_buffer[256]; - - void on_frame(); - bool do_command(); - void enter(); - int get_command(); - void attach(Scumm *s); - void detach(); - - void printActors(int act); - void printScripts(); - - void printBox(int box); - void printBoxes(); - void boxTest(int box); -}; - -#endif diff --git a/debugrl.cpp b/debugrl.cpp deleted file mode 100644 index 8c9366a2f4..0000000000 --- a/debugrl.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#ifdef HAVE_READLINE - -#include "debugrl.h" - -// A lot of this was ripped straight from the readline fileman.c example. - -char *_debugger_commands[] = { - "help", - "quit", - "go", - "actor", - "scripts", - "exit", - (char *)NULL -}; - - -// forwards decls -char **scumm_debugger_completion(const char *text, int start, int end); -char *scumm_debugger_command_generator(const char *text, int state); - -void initialize_readline() -{ - /* Allow conditional parsing of the ~/.inputrc file. */ - rl_readline_name = "scummvm"; - - /* Tell the completer that we want a crack first. */ - rl_attempted_completion_function = scumm_debugger_completion; -} - -char **scumm_debugger_completion(const char *text, int start, int end) -{ - - char **matches; - - matches = (char **)NULL; - - // If this word is at the start of the line, then it is a command - // to complete. - if (start == 0) { - matches = rl_completion_matches(text, scumm_debugger_command_generator); - } else { - // At some stage it'd be nice to have symbolic actor name completion - // or something similarly groovy. Not right now though. - } - - // This just makes sure that readline doesn't try to use its default - // completer, which uses filenames in the current dir, if we can't find - // a match, since filenames don't have much use in the debuger :) - // There's probably a nice way to do this once, rather than every time. - rl_attempted_completion_over = 1; - - return (matches); -} - - -/* Generator function for command completion. STATE lets us know whether - to start from scratch; without any state (i.e. STATE == 0), then we - start at the top of the list. */ -char *scumm_debugger_command_generator(const char *text, int state) -{ - - static int list_index, len; - char *name; - - /* If this is a new word to complete, initialize now. This includes - saving the length of TEXT for efficiency, and initializing the index - variable to 0. */ - if (!state) { - list_index = 0; - len = strlen(text); - } - - /* Return the next name which partially matches from the command list. */ - while (name = _debugger_commands[list_index]) { - list_index++; - - if (strncmp(name, text, len) == 0) - //return (dupstr(name)); - return strdup(name); - } - - /* If no names matched, then return NULL. */ - return ((char *)NULL); -} - -#endif /* HAVE_READLINE */ diff --git a/debugrl.h b/debugrl.h deleted file mode 100644 index c309ec96d8..0000000000 --- a/debugrl.h +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#include -// initializes readline with our own completer -void initialize_readline (); diff --git a/engine.cpp b/engine.cpp deleted file mode 100644 index bd416f5f70..0000000000 --- a/engine.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "engine.h" -#include "gameDetector.h" -#include "config-file.h" -#include "scumm.h" -#include "simon/simon.h" -#include "sound/mixer.h" - -/* FIXME - BIG HACK for MidiEmu */ -OSystem *g_system = 0; -SoundMixer *g_mixer = 0; - -Engine::Engine(GameDetector *detector, OSystem *syst) - : _system(syst) -{ - _mixer = new SoundMixer(); - - _gameDataPath = detector->_gameDataPath; - - /* FIXME - BIG HACK for MidiEmu */ - g_system = _system; - g_mixer = _mixer; -} - -Engine::~Engine() -{ - delete _mixer; -} - -const char *Engine::getSavePath() const -{ - const char *dir = NULL; - -#ifdef _WIN32_WCE - dir = _gameDataPath; -#else - -#if !defined(MACOS_CARBON) - dir = getenv("SCUMMVM_SAVEPATH"); -#endif - - // If SCUMMVM_SAVEPATH was not specified, try to use game specific savepath from config - if (!dir || dir[0] == 0) - dir = scummcfg->get("savepath"); - - // If SCUMMVM_SAVEPATH was not specified, try to use general path from config - if (!dir || dir[0] == 0) - dir = scummcfg->get("savepath", "scummvm"); - - // If no save path was specified, use no directory prefix - if (dir == NULL) - dir = ""; -#endif - - return dir; -} - -Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) -{ - Engine *engine; - - if (detector->_gameId >= GID_SIMON_FIRST && detector->_gameId <= GID_SIMON_LAST) { - // Simon the Sorcerer - detector->_gameId -= GID_SIMON_FIRST; - engine = new SimonState(detector, syst); - } else { - // Some kind of Scumm game - if (detector->_features & GF_OLD256) - engine = new Scumm_v3(detector, syst); - else if (detector->_features & GF_SMALL_HEADER) // this force loomCD as v4 - engine = new Scumm_v4(detector, syst); - else if (detector->_features & GF_AFTER_V7) - engine = new Scumm_v7(detector, syst); - else if (detector->_features & GF_AFTER_V6) // this force SamnmaxCD as v6 - engine = new Scumm_v6(detector, syst); - else - engine = new Scumm_v5(detector, syst); - } - - return engine; -} diff --git a/engine.h b/engine.h deleted file mode 100644 index 6241d70a7f..0000000000 --- a/engine.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef ENGINE_H -#define ENGINE_H - -#include "scummsys.h" -#include "system.h" - -class SoundMixer; -class GameDetector; - -/* FIXME - BIG HACK for MidiEmu */ -extern OSystem *g_system; -extern SoundMixer *g_mixer; - -class Engine { -public: - OSystem *_system; - SoundMixer *_mixer; - -protected: - char *_gameDataPath; - -public: - Engine(GameDetector *detector, OSystem *syst); - virtual ~Engine(); - - // Invoke the main engine loop using this method - virtual void go() = 0; - - // Get the save game dir path - const char *getSavePath() const; - - const char *getGameDataPath() const { return _gameDataPath; } - - // Create a new engine object based on the detector - either - // a Scumm or a SimonState object currently. - static Engine *createFromDetector(GameDetector *detector, OSystem *syst); -}; - - -#endif diff --git a/fb2opengl.h b/fb2opengl.h deleted file mode 100644 index 39ab98ddc5..0000000000 --- a/fb2opengl.h +++ /dev/null @@ -1,355 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -// FrameBuffer renderer in an OpenGL texture -// Andre Souza - -#include -#include -#include -#include - -// FLAGS -#define FB2GL_FS 1 // FULLSCREEN -#define FB2GL_RGBA 2 // Use RGBA (else use palette) -#define FB2GL_320 4 // 320x256 texture (else use 256x256) -#define FB2GL_AUDIO 8 // Activate SDL Audio -#define FB2GL_PITCH 16 // On fb2l_update, use pitch (else bytes per pixel) -#define FB2GL_EXPAND 32 // Create a RGB fb with the color lookup table - -// This extension isn't defined in OpenGL 1.1 -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#endif - -class FB2GL { - private: - // Framebuffer for 8 bpp - unsigned char ogl_fb[256][256]; - unsigned char ogl_fbb[256][64]; - // Framebuffer for RGBA */ - unsigned char ogl_fb1[256][256][4]; - unsigned char ogl_fb2[256][64][4]; - // Texture(s) - GLuint texture; - GLuint textureb; - // Display list - GLuint dlist; - // Color Table (256 colors, RGB) - char ogl_ctable[256][3]; - char ogl_temp_ctable[256][3]; // Support for OpenGL 1.1 - char flags; - void maketex(); - void makedlist(int xf, int yf); - void display(); - - public: - SDL_Surface *screen; - FB2GL() { - flags=0; - screen=NULL; - } - int init(int width, int height, int xfix, int yfix, char _flags); - void update(void *fb, int width, int height, int pitch, int xskip, int yskip); - void palette(int index, int r, int g, int b); - void setPalette(int first, int ncolors); -}; - -void FB2GL::maketex() -{ - glGenTextures(0,&texture); - glBindTexture(GL_TEXTURE_2D,texture); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - // Bilinear filtering - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -/* - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -*/ - - if (flags & FB2GL_RGBA) { - glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,256,256,0,GL_RGBA, GL_UNSIGNED_BYTE, ogl_fb1); - } - else { - glTexImage2D(GL_TEXTURE_2D,0,GL_COLOR_INDEX,256,256,0,GL_COLOR_INDEX, GL_UNSIGNED_BYTE, ogl_fb); - } - - if (flags & FB2GL_320) { - glGenTextures(1,&textureb); - glBindTexture(GL_TEXTURE_2D,textureb); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - // Bilinear filtering - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -/* - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -*/ - - if (flags & FB2GL_RGBA) { - glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,64,256,0,GL_RGBA, - GL_UNSIGNED_BYTE, ogl_fb2); - } - else { - glTexImage2D(GL_TEXTURE_2D,0,GL_COLOR_INDEX,64,256,0,GL_COLOR_INDEX, - GL_UNSIGNED_BYTE, ogl_fbb); - } - } - -} - -void FB2GL::makedlist(int xf, int yf) -{ - double xfix=(double)xf/128; // 128 = 256/2 (half texture => 0.0 to 1.0) - double yfix=(double)yf/128; - // End of 256x256 (from -1.0 to 1.0) - double texend = (double)96/160; // 160=320/2 (== 0.0), 256-160=96. - - dlist=glGenLists(1); - glNewList(dlist,GL_COMPILE); - - glEnable(GL_TEXTURE_2D); - - glBindTexture(GL_TEXTURE_2D, texture); - - if (!(flags & FB2GL_320)) { // Normal 256x256 - glBegin(GL_QUADS); - glTexCoord2f(0.0,1.0); glVertex2f(-1.0,-1.0-yfix); // upper left - glTexCoord2f(0.0,0.0); glVertex2f(-1.0,1.0); // lower left - glTexCoord2f(1.0,0.0); glVertex2f(1.0+xfix,1.0); // lower right - glTexCoord2f(1.0,1.0); glVertex2f(1.0+xfix,-1.0-yfix); // upper right - glEnd(); - } - else { // 320x256 - - // First, the 256x256 texture - glBegin(GL_QUADS); - glTexCoord2f(0.0,1.0); glVertex2f(-1.0,-1.0-yfix); // upper left - glTexCoord2f(0.0,0.0); glVertex2f(-1.0,1.0); // lower left - glTexCoord2f(1.0,0.0); glVertex2f(texend+xfix,1.0); // lower right - glTexCoord2f(1.0,1.0); glVertex2f(texend+xfix,-1.0-yfix); // upper right - glEnd(); - - // 64x256 - glBindTexture(GL_TEXTURE_2D, textureb); - - glBegin(GL_QUADS); - glTexCoord2f(0.0,1.0); glVertex2f(texend+xfix,-1.0-yfix); // upper left - glTexCoord2f(0.0,0.0); glVertex2f(texend+xfix,1.0); // lower left - glTexCoord2f(1.0,0.0); glVertex2f(1.0+xfix,1.0); // lower right - glTexCoord2f(1.0,1.0); glVertex2f(1.0+xfix,-1.0-yfix); // upper right - glEnd(); - } - - glDisable(GL_TEXTURE_2D); - - glEndList(); -} - -int FB2GL::init(int width, int height, int xfix, int yfix, char _flags) -{ - char gl_ext[4096]; - gl_ext[0]='\0'; - - flags = _flags; - - // Fullscreen? - if ((flags & FB2GL_FS) && !screen) { - screen = SDL_SetVideoMode(width, height, 0, SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_FULLSCREEN); - } - else if (!screen) { - screen = SDL_SetVideoMode(width, height, 0, SDL_HWPALETTE | SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER); - } - - if (!screen) { - fprintf(stderr, "Couldn't start video res %dx%d\n", width, height); - return 0; - } - - - if (!(flags & FB2GL_RGBA)) { // Check for Paletted Texture Extension - - strcpy(gl_ext, (char *)glGetString(GL_EXTENSIONS)); - fprintf(stderr,"gl_ext= %s\n",gl_ext); - - if ( strstr( gl_ext , "GL_EXT_paletted_texture") ) - glEnable(GL_EXT_paletted_texture); - else { - fprintf(stderr,"Your OpenGL version doesn't support paletted texture\n"); - return 0; - } - } - - maketex(); - makedlist(xfix, yfix); - - return 1; -} - -void FB2GL::display() -{ - glCallList(dlist); - SDL_GL_SwapBuffers(); -} - -void FB2GL::update(void *fb, int w, int h, int pitch, int xskip, int yskip) { - unsigned char *fb1=(unsigned char *)fb; - int x,y,scr_pitch,byte=0; - - if (flags & FB2GL_PITCH) scr_pitch=pitch; - else { - scr_pitch=w*pitch; - byte = pitch; // Bytes perl pixel (for RGBA mode) - } - - if (flags & FB2GL_RGBA) { - - if (flags & FB2GL_EXPAND) { // Expand the 8 bit fb into a RGB fb - - for (y=yskip; y]] [-n] [-b] [-t] [-s] [-p] [-m] [-f] game\n" - "Flags:\n" - "\t-a - specify game is amiga version\n" - "\t-b - start in room \n" - "\t-c - use cdrom for cd audio\n" - "\t-d[] - enable debug output (debug level [1])\n" - "\t-e - set music engine (see readme.txt for details)\n" - "\t-f - fullscreen mode\n" - "\t-g - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n" - "\t-l - load config file instead of default\n" - "\t-m - set music volume to (0-100)\n" - "\t-n - no subtitles for speech\n" - "\t-p - look for game in \n" - "\t-s - set sfx volume to (0-255)\n" - "\t-t - set music tempo (default- adlib: 0x1F0000, midi: 0x460000)\n" - "\t-v - show version info and exit\n" -#if defined(UNIX) - "\t-w[] - write to config file [~/.scummvmrc]\n" -#else - "\t-w[] - write to config file [scummvm.ini]\n" -#endif - "\t-x[] - save game slot to load (default: autosave)\n" - "\t-y - set text speed (default: 60)\n" -; - -void GameDetector::updateconfig() -{ - const char * val; - - _amiga = scummcfg->getBool("amiga", _amiga); - - _save_slot = scummcfg->getInt("save_slot", _save_slot); - - _cdrom = scummcfg->getInt("cdrom", _cdrom); - - if ((val = scummcfg->get("music_driver"))) - if (!parseMusicDriver(val)) { - printf("Error in the config file: invalid music_driver.\n"); - printf(USAGE_STRING); - exit(-1); - } - - _fullScreen = scummcfg->getBool("fullscreen", _fullScreen); - - if ((val = scummcfg->get("gfx_mode"))) - if ((_gfx_mode = parseGraphicsMode(val)) == -1) { - printf("Error in the config file: invalid gfx_mode.\n"); - printf(USAGE_STRING); - exit(-1); - } - - _music_volume = scummcfg->getInt("music_volume", _music_volume); - - _noSubtitles = scummcfg->getBool("nosubtitles", _noSubtitles); - - if ((val = scummcfg->get("path"))) - _gameDataPath = strdup(val); - - _sfx_volume = scummcfg->getInt("sfx_volume", _sfx_volume); - - // We use strtol for the tempo to allow it to be specified in hex. - if ((val = scummcfg->get("tempo"))) - _gameTempo = strtol(val, NULL, 0); - - _talkSpeed = scummcfg->getInt("talkspeed", _talkSpeed); -} - -void GameDetector::parseCommandLine(int argc, char **argv) -{ - int i; - char *s; - char *current_option = NULL; - char *option = NULL; - char c; - _save_slot = -1; - - // check for arguments - if (argc < 2) { - printf(USAGE_STRING); - //exit(1); - } - - scummcfg->set_domain("game-specific"); - /* Parse the arguments */ - for (i = argc - 1; i >= 1; i--) { - s = argv[i]; - - if (s[0] == '-') { - s++; - c = *s++; - switch (tolower(c)) { - case 'a': - CHECK_OPTION(); - _amiga = (c == 'a'); - scummcfg->set("amiga", _amiga); - break; - case 'b': - HANDLE_OPTION(); - _bootParam = atoi(option); - break; - case 'c': - HANDLE_OPTION(); - _cdrom = atoi(option); - scummcfg->set("cdrom", _cdrom); - break; - case 'd': - _debugMode = true; - HANDLE_OPT_OPTION(); - if (option != NULL) - _debugLevel = atoi(option); - debug(1,"Debugmode (level %d) on", _debugLevel); - break; - case 'e': - HANDLE_OPTION(); - if (!parseMusicDriver(option)) - goto ShowHelpAndExit; - scummcfg->set("music_driver", option); - break; - case 'f': - CHECK_OPTION(); - _fullScreen = (c == 'f'); - scummcfg->set("fullscreen", _fullScreen, "scummvm"); - break; - case 'g': - HANDLE_OPTION(); - _gfx_mode = parseGraphicsMode(option); - if (_gfx_mode == -1) - goto ShowHelpAndExit; - scummcfg->set("gfx_mode", option, "scummvm"); - break; - case 'l': - HANDLE_OPTION(); - { - Config * newconfig = new Config(option, "scummvm"); - scummcfg->merge_config(newconfig); - delete newconfig; - updateconfig(); - break; - } - break; - case 'm': - HANDLE_OPTION(); - _music_volume = atoi(option); - scummcfg->set("music_volume", _music_volume); - break; - case 'n': - CHECK_OPTION(); - _noSubtitles = (c == 'n'); - scummcfg->set("nosubtitles", _noSubtitles); - break; - case 'p': - HANDLE_OPTION(); - _gameDataPath = option; - scummcfg->set("path", _gameDataPath); - break; - case 'r': - HANDLE_OPTION(); - // Ignore -r for now, to ensure backward compatibility. - break; - case 's': - HANDLE_OPTION(); - _sfx_volume = atoi(option); - scummcfg->set("sfx_volume", _sfx_volume); - break; - case 't': - HANDLE_OPTION(); - _gameTempo = strtol(option, 0, 0); - scummcfg->set("tempo", option); - break; - case 'v': - CHECK_OPTION(); - printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " " - __TIME__ "\n"); -#ifdef SCUMMVM_PLATFORM_VERSION - printf(" " SCUMMVM_PLATFORM_VERSION "\n"); -#endif - exit(1); - case 'w': - _saveconfig = true; - scummcfg->set_writing(true); - HANDLE_OPT_OPTION(); - if (option != NULL) - scummcfg->change_filename(option); - break; - case 'x': - _save_slot = 0; - HANDLE_OPT_OPTION(); - if (option != NULL) { - _save_slot = atoi(option); - scummcfg->set("save_slot", _save_slot); - } - break; - case 'y': - HANDLE_OPTION(); - _talkSpeed = atoi(option); - scummcfg->set("talkspeed", _talkSpeed); - break; - default: - goto ShowHelpAndExit; - } - } else { - if (i == (argc - 1)) { - _exe_name = s; - scummcfg->set_domain(s); - scummcfg->rename_domain("game-specific"); - scummcfg->rename_domain(s); - updateconfig(); - } else { - if (current_option == NULL) - current_option = s; - else - goto ShowHelpAndExit; - } - } - } - - if (_exe_name) - scummcfg->flush(); - - return; - - ShowHelpAndExit: - printf(USAGE_STRING); - exit(1); -} - -int GameDetector::parseGraphicsMode(const char *s) { - struct GraphicsModes { - const char *name; - int id; - }; - - const struct GraphicsModes gfx_modes[] = { - {"normal",GFX_NORMAL}, - {"1x",GFX_NORMAL}, - {"2x",GFX_DOUBLESIZE}, - {"3x",GFX_TRIPLESIZE}, - {"2xsai",GFX_2XSAI}, - {"super2xsai",GFX_SUPER2XSAI}, - {"supereagle",GFX_SUPEREAGLE}, - {"advmame2x",GFX_ADVMAME2X} - }; - - const GraphicsModes *gm = gfx_modes; - int i; - for(i=0; i!=ARRAYSIZE(gfx_modes); i++,gm++) { - if (!scumm_stricmp(gm->name, s)) - return gm->id; - } - - return -1; -} - -bool GameDetector::parseMusicDriver(const char *s) { - struct MusicDrivers { - const char *name; - int id; - }; - - const struct MusicDrivers music_drivers[] = { - {"auto",MD_AUTO}, - {"null",MD_NULL}, - {"windows",MD_WINDOWS}, - {"seq",MD_SEQ}, - {"qt",MD_QTMUSIC}, - {"core",MD_COREAUDIO}, - {"amidi",MD_AMIDI}, - {"midiemu",MD_MIDIEMU}, - {"alsa", MD_ALSA}, - {"adlib",-1}, - }; - - const MusicDrivers *md = music_drivers; - int i; - - _use_adlib = false; - - for(i=0; i!=ARRAYSIZE(music_drivers); i++,md++) { - if (!scumm_stricmp(md->name, s)) { - if (md->id == -1) { - _use_adlib = true; - } - _midi_driver = md->id; - return true; - } - } - - return false; -} - - -struct VersionSettings { - const char *filename; - const char *gamename; - byte id, major, middle, minor; - uint32 features; -}; - -/* - This is a list of all known SCUMM games. Commented games are not - supported at this time */ - -static const VersionSettings version_settings[] = { - /* Scumm Version 1 */ -// {"maniac", "Maniac Mansion (C64)", GID_MANIAC64, 1, 0, 0,}, -// {"zak", "Zak McKracken and the Alien Mindbenders (C64)", GID_ZAK64, 1, 0, 0,}, - - /* Scumm Version 2 */ -// {"maniac", "Maniac Mansion", GID_MANIAC, 2, 0, 0,}, -// {"zak", "Zak McKracken and the Alien Mindbenders", GID_ZAK, 2, 0, 0,}, -// {"indy3", "Indiana Jones and the Last Crusade", GID_INDY3, 2, 0, 0,}, - - /* Scumm Version 3 */ - {"indy3", "Indiana Jones and the Last Crusade (256)", GID_INDY3_256, 3, 0, 22, - GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD256 | GF_NO_SCALLING}, - {"zak256", "Zak McKracken and the Alien Mindbenders (256)", GID_ZAK256, 3, 0, 0, - GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD256 | GF_AUDIOTRACKS | GF_NO_SCALLING}, - {"loom", "Loom", GID_LOOM, 3, 5, 40, - GF_SMALL_HEADER | GF_USE_KEY | GF_SMALL_NAMES | GF_OLD_BUNDLE | GF_16COLOR | GF_NO_SCALLING}, - - /* Scumm Version 4 */ - {"monkeyEGA", "Monkey Island 1 (EGA)", GID_MONKEY_EGA, 4, 0, 67, - GF_SMALL_HEADER | GF_USE_KEY | GF_16COLOR}, // EGA version - - /* Scumm version 5 */ - {"monkeyVGA", "Monkey Island 1 (256 color Floppy version)", GID_MONKEY_VGA, 5, 0, 16, - GF_SMALL_HEADER | GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, - {"loomcd", "Loom (256 color CD version)", GID_LOOM256, 5, 1, 42, - GF_SMALL_HEADER | GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, - {"monkey", "Monkey Island 1", GID_MONKEY, 5, 2, 2, - GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, - {"monkey1", "Monkey Island 1 (alt)", GID_MONKEY, 5, 2, 2, - GF_USE_KEY | GF_AUDIOTRACKS | GF_ADLIB_DEFAULT}, - {"monkey2", "Monkey Island 2: LeChuck's revenge", GID_MONKEY2, 5, 2, 2, - GF_USE_KEY | GF_ADLIB_DEFAULT}, - {"atlantis", "Indiana Jones and the Fate of Atlantis", GID_INDY4, 5, 5, 0, - GF_USE_KEY | GF_ADLIB_DEFAULT}, - {"playfate", "Indiana Jones and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0, - GF_USE_KEY | GF_ADLIB_DEFAULT}, - {"fate", "Indiana Jones and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0, - GF_USE_KEY | GF_ADLIB_DEFAULT}, - - /* Scumm Version 6 */ - {"tentacle", "Day Of The Tentacle", GID_TENTACLE, 6, 4, 2, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT}, - {"dottdemo", "Day Of The Tentacle (Demo)", GID_TENTACLE, 6, 3, 2, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT}, - {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER}, - {"samdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER | GF_ADLIB_DEFAULT}, - {"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER | GF_ADLIB_DEFAULT}, - - {"puttdemo", "Putt Putt joins the parade (demo)", GID_SAMNMAX, 6, 3, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT | GF_HUMONGOUS}, - {"moondemo", "Putt Putt goes to the moon (demo)", GID_SAMNMAX, 6, 3, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_USE_KEY | GF_ADLIB_DEFAULT | GF_HUMONGOUS}, - - {"test", "Test demo game", GID_SAMNMAX, 6, 6, 6, GF_NEW_OPCODES | GF_AFTER_V6}, - - /* Scumm Version 7 */ - {"ft", "Full Throttle", GID_FT, 7, 3, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7}, - {"dig", "The Dig", GID_DIG, 7, 5, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7}, - - /* Simon the Sorcerer 1 & 2 (not SCUMM games) */ - {"simon1dos", "Simon the Sorcerer 1 for DOS", GID_SIMON_FIRST+0, 99, 99, 99, 0}, - {"simon2dos", "Simon the Sorcerer 2 for DOS", GID_SIMON_FIRST+1, 99, 99, 99, 0}, - {"simon1win", "Simon the Sorcerer 1 for Windows", GID_SIMON_FIRST+2, 99, 99, 99, 0}, - {"simon2win", "Simon the Sorcerer 2 for Windows", GID_SIMON_FIRST+3, 99, 99, 99, 0}, - - /* Scumm Version 8 */ - {"comi", "The Curse of Monkey Island", GID_CMI, 8, 1, 0, - GF_NEW_OPCODES | GF_AFTER_V6 | GF_AFTER_V7 | GF_AFTER_V8}, - - {NULL, NULL} -}; - -bool GameDetector::detectGame() -{ - const VersionSettings *gnl = version_settings; - - _gameId = 0; - _gameText = NULL; - do { - if (!scumm_stricmp(_exe_name, gnl->filename)) { - _gameId = gnl->id; - _scummVersion = gnl->major; - - _features = gnl->features; - _gameText = gnl->gamename; - debug(1, "Detected game '%s', version %d.%d.%d", - gnl->gamename, gnl->major, gnl->middle, gnl->minor); - return true; - } - } while ((++gnl)->filename); - - debug(1, "Failed game detection"); - - return true; -} - -char *GameDetector::getGameName() -{ - if (_gameText == NULL) { - char buf[256]; - sprintf(buf, "Unknown game: \"%s\"", _exe_name); - return strdup(buf); - } - return strdup(_gameText); -} - -int GameDetector::detectMain(int argc, char **argv) -{ - _debugMode = 0; // off by default... - - _noSubtitles = 0; // use by default - should this depend on soundtrack? - - _talkSpeed = 60; - -#ifndef _WIN32_WCE - _gfx_mode = GFX_DOUBLESIZE; -#else - _gfx_mode = GFX_NORMAL; -#endif - _sfx_volume = kDefaultSFXVolume; - _music_volume = kDefaultMusicVolume; - -#if defined(USE_NULL_DRIVER) - _gfx_driver = GD_NULL; -#elif defined(__DC__) - _gfx_driver = GD_DC; -#elif defined(X11_BACKEND) - _gfx_driver = GD_X; -#elif defined(__MORPHOS__) - _gfx_driver = GD_MORPHOS; -#elif defined(_WIN32_WCE) - _gfx_driver = GD_WINCE; -#elif defined(MACOS_CARBON) - _gfx_driver = GD_MAC; -#else - /* SDL is the default driver for now */ - _gfx_driver = GD_SDL; -#endif - - _gameDataPath = NULL; - _gameTempo = 0; - _soundCardType = 3; - - - - _midi_driver = MD_AUTO; - -#if defined(__DC__) - extern int dc_setup(GameDetector &detector); - dc_setup(*this); -#elif defined(MACOS_CARBON) - extern char* SelectGame(); - char *game_name = SelectGame(); - printf(game_name); -#else - _saveconfig = false; - updateconfig(); - parseCommandLine(argc, argv); -#endif - - if (_exe_name == NULL) { - //launcherLoop(); - //setWindowName(this); - warning("No game was specified..."); - return (-1); - } - - - if (!detectGame()) { - warning("Game detection failed. Using default settings"); - _features = GF_DEFAULT; - _gameText = "Please choose a game"; - } - - /* Use the adlib sound driver if auto mode is selected, - * and the game is one of those that want adlib as - * default */ - if (_midi_driver == MD_AUTO && _features&GF_ADLIB_DEFAULT) { - _use_adlib = true; - } - - if (!_gameDataPath) { - warning("No path was provided. Assuming the data files are in the current directory"); - _gameDataPath = strdup(""); - } else if (_gameDataPath[strlen(_gameDataPath)-1] != '/' -#ifdef __MORPHOS__ - && _gameDataPath[strlen(_gameDataPath)-1] != ':' -#endif - && _gameDataPath[strlen(_gameDataPath)-1] != '\\') { - char slashless[1024]; /* Append slash to path */ - strcpy(slashless, _gameDataPath); - _gameDataPath = (char *)malloc((strlen(slashless) + 1) * sizeof(char)); - sprintf(_gameDataPath, "%s/", slashless); - } - - if (_amiga) - _features = _features | GF_AMIGA; - - return (0); -} - -OSystem *GameDetector::createSystem() { - /* auto is to use SDL */ - switch(_gfx_driver) { -#if defined(X11_BACKEND) - case GD_X: - return OSystem_X11_create(); -#elif defined(__DC__) - case GD_DC: - return OSystem_Dreamcast_create(); -#elif defined(_WIN32_WCE) - case GD_WINCE: - return OSystem_WINCE3_create(); -#elif defined(__MORPHOS__) - case GD_MORPHOS: - return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen); -#elif defined(MACOS_CARBON) - case GD_MAC: - return OSystem_MAC_create(_gfx_mode, _fullScreen); -#elif defined(USE_NULL_DRIVER) - case GD_NULL: - return OSystem_NULL_create(); -#else - case GD_SDL: - return OSystem_SDL_create(_gfx_mode, _fullScreen); -#endif - } - - error("Invalid graphics driver"); - return NULL; -} - -MidiDriver *GameDetector::createMidi() { - int drv = _midi_driver; - -#if defined (_WIN32_WCE) - /* Always use MIDI emulation on CE devices */ - if (drv == MD_AUTO) drv = MD_MIDIEMU; -#endif - -#if defined (WIN32) && !defined(_WIN32_WCE) - /* MD_WINDOWS is default MidiDriver on windows targets */ - if (drv == MD_AUTO) drv = MD_WINDOWS; -#elif defined(__APPLE__) || defined(macintosh) - /* MD_QTMUSIC is default MidiDriver on MacOS targets */ - if (drv == MD_AUTO) drv = MD_QTMUSIC; -#elif defined(UNIX) || defined(X11_BACKEND) - /* MD_MIDIEMU is default MidiDriver on UNIX targets. */ - /* FIXME: Attempt to detect if sequencer is available, - and use it in preference. */ - if (drv == MD_AUTO) drv = MD_MIDIEMU; -#endif - - switch(drv) { - case MD_AUTO: - case MD_NULL: return MidiDriver_NULL_create(); - case MD_MIDIEMU: return MidiDriver_MIDIEMU_create(); -#if defined(WIN32) && !defined(_WIN32_WCE) - case MD_WINDOWS: return MidiDriver_WIN_create(); -#endif -#if defined(__MORPHOS__) - case MD_AMIDI: return MidiDriver_AMIDI_create(); -#endif -#if defined(UNIX) && !defined(__BEOS__) - case MD_SEQ: return MidiDriver_SEQ_create(); -#endif -#if defined(__APPLE__) || defined(macintosh) - case MD_QTMUSIC: return MidiDriver_QT_create(); -#endif -#if defined(MACOSX) - case MD_COREAUDIO: return MidiDriver_CORE_create(); -#endif -#if defined(UNIX) && defined(USE_ALSA) - case MD_ALSA: return MidiDriver_ALSA_create(); -#endif - } - - error("Invalid midi driver selected"); - return NULL; -} diff --git a/gameDetector.h b/gameDetector.h deleted file mode 100644 index 4cbfa3453f..0000000000 --- a/gameDetector.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef GAMEDETECTOR_H -#define GAMEDETECTOR_H - -class OSystem; -class MidiDriver; - -class GameDetector { -public: - int detectMain(int argc, char **argv); - void parseCommandLine(int argc, char **argv); - bool detectGame(void); - char *getGameName(void); - - bool _fullScreen; - byte _gameId; - bool _simon; - - bool _use_adlib; - - int _music_volume; - int _sfx_volume; - bool _amiga; - - uint16 _talkSpeed; - uint16 _debugMode; - uint16 _noSubtitles; - uint16 _bootParam; - uint16 _soundCardType; - - char *_gameDataPath; - int _gameTempo; - int _midi_driver; - char *_exe_name; - const char *_gameText; - uint32 _features; - - int _gfx_driver; - int _gfx_mode; - - int _scummVersion; - int _cdrom; - int _save_slot; - - bool _saveconfig; - - int parseGraphicsMode(const char *s); - - bool parseMusicDriver(const char *s); - - void updateconfig(); - -public: - OSystem *createSystem(); - MidiDriver *createMidi(); -}; - -#endif diff --git a/gapi_keys.h b/gapi_keys.h deleted file mode 100644 index 5eee52e518..0000000000 --- a/gapi_keys.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifdef _WIN32_WCE - -typedef void (*pAction)(); - -enum ActionType { - ACTION_NONE = 0, - ACTION_PAUSE = 1, - ACTION_SAVE = 2, - ACTION_QUIT = 3, - ACTION_SKIP = 4, - ACTION_HIDE = 5, - ACTION_KEYBOARD = 6, - ACTION_SOUND = 7, - ACTION_RIGHTCLICK = 8, - ACTION_CURSOR = 9, - ACTION_SUBTITLES = 10 -}; - -struct oneAction { - unsigned char action_key; - int action_type; -}; - - -#define NUMBER_ACTIONS 10 -#define TOTAL_ACTIONS 10 - -#define GAPI_KEY_BASE 1000 -#define GAPI_KEY_VKA 1 -#define GAPI_KEY_VKB 2 -#define GAPI_KEY_VKC 3 -#define GAPI_KEY_VKSTART 4 -#define GAPI_KEY_CALENDAR 5 -#define GAPI_KEY_CONTACTS 6 -#define GAPI_KEY_INBOX 7 -#define GAPI_KEY_ITASK 8 -#define GAPI_KEY_VKUP 9 -#define GAPI_KEY_VKDOWN 10 -#define GAPI_KEY_VKLEFT 11 -#define GAPI_KEY_VKRIGHT 12 - -#define INTERNAL_KEY_CALENDAR 0xc1 -#define INTERNAL_KEY_CONTACTS 0xc2 -#define INTERNAL_KEY_INBOX 0xc3 -#define INTERNAL_KEY_ITASK 0xc4 - -void GAPIKeysInit(pAction*); -void GAPIKeysGetReference(void); -const unsigned char getGAPIKeyMapping(short); -const char* getGAPIKeyName(unsigned char); -struct oneAction* getAction(int); -void processAction (short); -void clearActionKey (unsigned char); -const unsigned char* getActionKeys(void); -void setActionKeys(unsigned char *); -const char* getActionName(int); -void setActionTypes(unsigned char *); -const unsigned char* getActionTypes(); -void setNextType(int); -void setPreviousType(int); - -#endif diff --git a/gfx.cpp b/gfx.cpp deleted file mode 100644 index e16b7662b5..0000000000 --- a/gfx.cpp +++ /dev/null @@ -1,2872 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "gui.h" -#include "newgui.h" -#include "resource.h" - -void Scumm::getGraphicsPerformance() -{ - int i; - - for (i = 10; i != 0; i--) { - initScreens(0, 0, _realWidth, _realHeight); //ender - } - - if (!(_features & GF_SMALL_HEADER)) /* FIXME TEST: Enders Zak fix */ - _vars[VAR_PERFORMANCE_1] = 0; //_scummTimer; - - for (i = 10; i != 0; i--) { - setDirtyRange(0, 0, _realHeight); //ender - drawDirtyScreenParts(); - } - - if (!(_features & GF_SMALL_HEADER)) /* FIXME TEST: Enders Zak fix */ - _vars[VAR_PERFORMANCE_2] = 0; //_scummTimer; - - if (_gameId == GID_DIG) - initScreens(0, 0, _realWidth, _realHeight); - else - initScreens(0, 16, _realWidth, 144); -} - -void Scumm::initScreens(int a, int b, int w, int h) -{ - int i; - - for (i = 0; i < 3; i++) { - nukeResource(rtBuffer, i + 1); - nukeResource(rtBuffer, i + 5); - } - - if (!getResourceAddress(rtBuffer, 4)) { - initVirtScreen(3, 0, 80, _realWidth, 13, false, false); - } - initVirtScreen(0, 0, b, _realWidth, h - b, true, true); - initVirtScreen(1, 0, 0, _realWidth, b, false, false); - initVirtScreen(2, 0, h, _realWidth, _realHeight - h, false, false); //ender - - _screenB = b; - _screenH = h; - -} - -void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, - bool fourextra) -{ - VirtScreen *vs = &virtscr[slot]; - int size; - int i; - byte *ptr; - - assert(height >= 0); - assert(slot >= 0 && slot < 4); - - vs->number = slot; - vs->unk1 = 0; - vs->width = 320; - vs->topline = top; - vs->height = height; - vs->alloctwobuffers = twobufs; - vs->scrollable = fourextra; - vs->xstart = 0; - size = vs->width * vs->height; - vs->size = size; - vs->backBuf = NULL; - - if (vs->scrollable) - size += 320 * 4; - - createResource(rtBuffer, slot + 1, size); - vs->screenPtr = getResourceAddress(rtBuffer, slot + 1); - - ptr = vs->screenPtr; - for (i = 0; i < size; i++) // reset background ? - *ptr++ = 0; - - if (twobufs) { - createResource(rtBuffer, slot + 5, size); - } - - if (slot != 3) { - setDirtyRange(slot, 0, height); - } -} - -void Scumm::setDirtyRange(int slot, int top, int bottom) -{ - int i; - VirtScreen *vs = &virtscr[slot]; - for (i = 0; i < NUM_STRIPS; i++) { - vs->tdirty[i] = top; - vs->bdirty[i] = bottom; - } -} - -/* power of 2 */ -#define NUM_SHAKE_POSITIONS 8 - -static const int8 shake_positions[NUM_SHAKE_POSITIONS] = { - 0, 1 * 2, 2 * 2, 1 * 2, 0 * 2, 2 * 2, 3 * 2, 1 * 2 -}; - -void Scumm::drawDirtyScreenParts() -{ - int i; - VirtScreen *vs; - byte *src; - - updateDirtyScreen(2); - if (_features & GF_OLD256) - updateDirtyScreen(1); - - if ((camera._last.x == camera._cur.x && camera._last.y == camera._cur.y && (_features & GF_AFTER_V7)) - || (camera._last.x == camera._cur.x)) { - updateDirtyScreen(0); - } else { - vs = &virtscr[0]; - - src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100; - _system->copy_rect(src, 320, 0, vs->topline, 320, vs->height); - - for (i = 0; i < NUM_STRIPS; i++) { - vs->tdirty[i] = (byte)vs->height; - vs->bdirty[i] = 0; - } - } - - /* Handle shaking */ - if (_shakeEnabled && !_gui->isActive() && !_newgui->isActive()) { - _shakeFrame = (_shakeFrame + 1) & (NUM_SHAKE_POSITIONS - 1); - _system->set_shake_pos(shake_positions[_shakeFrame]); - } else if (!_shakeEnabled &&_shakeFrame != 0) { - _shakeFrame = 0; - _system->set_shake_pos(shake_positions[_shakeFrame]); - } -} - -void Scumm::updateDirtyScreen(int slot) -{ - gdi.updateDirtyScreen(&virtscr[slot]); -} - -void Gdi::updateDirtyScreen(VirtScreen *vs) -{ - int i; - int start, w, top, bottom; - - if (vs->height == 0) - return; - - _readOffs = 0; - if (vs->scrollable) - _readOffs = vs->xstart; - - w = 8; - start = 0; - - for (i = 0; i < NUM_STRIPS; i++) { - bottom = vs->bdirty[i]; - - if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y)) - drawStripToScreen(vs, start, w, 0, vs->height); - else if (bottom) { - top = vs->tdirty[i]; - vs->tdirty[i] = (byte)vs->height; - vs->bdirty[i] = 0; - if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) { - w += 8; - continue; - } - if (_vm->_features & GF_AFTER_V7) - drawStripToScreen(vs, start, w, 0, vs->height); - else - drawStripToScreen(vs, start, w, top, bottom); - w = 8; - } - start = i + 1; - } -} - -void Gdi::drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b) -{ - byte *ptr; - int scrollY; - int height; - - if (b <= t) - return; - - if (t > vs->height) - t = 0; - - if (b > vs->height) - b = vs->height; - - height = b - t; - if (height > 200) - height = 200; - - scrollY = _vm->camera._cur.y - 100; - if (scrollY == -100) - scrollY = 0; - - ptr = vs->screenPtr + (t * NUM_STRIPS + x) * 8 + _readOffs + scrollY * 320; - _vm->_system->copy_rect(ptr, 320, x * 8, vs->topline + t, w, height); -} - -void blit(byte *dst, byte *src, int w, int h) -{ - assert(h > 0); - - do { - memcpy(dst, src, w); - dst += 320; - src += 320; - } while (--h); -} - -void Scumm::setCursor(int cursor) -{ - warning("setCursor(%d)", cursor); -} - -void Scumm::setCameraAt(int pos_x, int pos_y) -{ - - if (_features & GF_AFTER_V7) { - ScummPoint old; - - old = camera._cur; - - camera._cur.x = pos_x; - camera._cur.y = pos_y; - - clampCameraPos(&camera._cur); - - camera._dest = camera._cur; - - assert(camera._cur.x >= 160 && camera._cur.y >= 100); - - if ((camera._cur.x != old.x || camera._cur.y != old.y) - && _vars[VAR_SCROLL_SCRIPT]) { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - _vars[VAR_CAMERA_POS_Y] = camera._cur.y; - runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); - } - } else { - int t; - - if (camera._mode != CM_FOLLOW_ACTOR || abs(pos_x - camera._cur.x) > 160) { - camera._cur.x = pos_x; - } - camera._dest.x = pos_x; - - t = _vars[VAR_CAMERA_MIN_X]; - if (camera._cur.x < t) - camera._cur.x = t; - - t = _vars[VAR_CAMERA_MAX_X]; - if (camera._cur.x > t) - camera._cur.x = t; - - if (_vars[VAR_SCROLL_SCRIPT]) { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); - } - - if (camera._cur.x != camera._last.x && charset._hasMask) - stopTalk(); - } -} - -void Scumm::setCameraFollows(Actor *a) -{ - if (_features & GF_AFTER_V7) { - byte oldfollow = camera._follows; - int ax, ay; - - camera._follows = a->number; - - if (!a->isInCurrentRoom()) { - startScene(a->getRoom(), 0, 0); - } - - ax = abs(a->x - camera._cur.x); - ay = abs(a->y - camera._cur.y); - - if (ax > _vars[VAR_CAMERA_THRESHOLD_X] || ay > _vars[VAR_CAMERA_THRESHOLD_Y] || ax > 160 || ay > 100) { - setCameraAt(a->x, a->y); - } - - if (a->number != oldfollow) - runHook(0); - } else { - int t, i; - - camera._mode = CM_FOLLOW_ACTOR; - camera._follows = a->number; - - if (!a->isInCurrentRoom()) { - startScene(a->getRoom(), 0, 0); - camera._mode = CM_FOLLOW_ACTOR; - camera._cur.x = a->x; - setCameraAt(camera._cur.x, 0); - } - - t = (a->x >> 3); - - if (t - _screenStartStrip < camera._leftTrigger || t - _screenStartStrip > camera._rightTrigger) - setCameraAt(a->x, 0); - - for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { - if (a->isInCurrentRoom()) - a->needRedraw = true; - } - runHook(0); - } -} - -void Scumm::initBGBuffers(int height) -{ - byte *ptr; - int size, itemsize, i; - byte *room; - - if (_features & GF_AFTER_V7) { - initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1); - } - - room = getResourceAddress(rtRoom, _roomResource); - if (_features & GF_OLD256) { - // FIXME - maybe this should check for multiple planes like we do - // for GF_SMALL_HEADER already. - gdi._numZBuffer = 2; - } else if (_features & GF_SMALL_HEADER) { - -//#define DEBUG_ZPLANE_CODE - - ptr = findResourceData(MKID('SMAP'), room); -#ifdef DEBUG_ZPLANE_CODE - printf("Trying to determine room zplanes:\n"); - hexdump(ptr-6, 0x20); -#endif - - int off; - gdi._numZBuffer = 0; - off = READ_LE_UINT32(ptr); - for (i = 0; off && (i < 4); i++) { -#ifdef DEBUG_ZPLANE_CODE - printf("Plane %d\n", i); - hexdump(ptr, 0x20); -#endif - - gdi._numZBuffer++; - ptr += off; - off = READ_LE_UINT16(ptr); - } -#ifdef DEBUG_ZPLANE_CODE - printf("Real plane count = %d\n", gdi._numZBuffer); -#endif - } else { - ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room)); - gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1; - } - assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5); - - if (_features & GF_AFTER_V7) - itemsize = (virtscr[0].height + 4) * NUM_STRIPS; - else - itemsize = (_scrHeight + 4) * NUM_STRIPS; - - - size = itemsize * gdi._numZBuffer; - createResource(rtBuffer, 9, size); - - for (i = 0; i < 4; i++) - gdi._imgBufOffs[i] = i * itemsize; -} - -void Scumm::setPaletteFromPtr(byte *ptr) -{ - int i, r, g, b; - byte *dest; - int numcolor; - - if (_features & GF_SMALL_HEADER) { - if (_features & GF_OLD256) - numcolor = 256; - else - numcolor = READ_LE_UINT16(ptr + 6) / 3; - ptr += 8; - } else { - numcolor = getResourceDataSize(ptr) / 3; - } - - checkRange(256, 0, numcolor, "Too many colors (%d) in Palette"); - - dest = _currentPalette; - - for (i = 0; i < numcolor; i++) { - r = *ptr++; - g = *ptr++; - b = *ptr++; - if (i <= 15 || r < 252 || g < 252 || b < 252) { - *dest++ = r; - *dest++ = g; - *dest++ = b; - } else { - dest += 3; - } - } - - setDirtyColors(0, numcolor - 1); -} - -void Scumm::setPaletteFromRes() -{ - byte *ptr; - ptr = getResourceAddress(rtRoom, _roomResource) + _CLUT_offs; - setPaletteFromPtr(ptr); -} - - -void Scumm::setDirtyColors(int min, int max) -{ - if (_palDirtyMin > min) - _palDirtyMin = min; - if (_palDirtyMax < max) - _palDirtyMax = max; -} - -void Scumm::initCycl(byte *ptr) -{ - int j; - ColorCycle *cycl; - - memset(_colorCycle, 0, sizeof(_colorCycle)); - - while ((j = *ptr++) != 0) { - if (j < 1 || j > 16) { - error("Invalid color cycle index %d", j); - } - cycl = &_colorCycle[j - 1]; - - ptr += 2; - cycl->counter = 0; - cycl->delay = 16384 / READ_BE_UINT16_UNALIGNED(ptr); - ptr += 2; - cycl->flags = READ_BE_UINT16_UNALIGNED(ptr); - ptr += 2; - cycl->start = *ptr++; - cycl->end = *ptr++; - } -} - -void Scumm::stopCycle(int i) -{ - ColorCycle *cycl; - - checkRange(16, 0, i, "Stop Cycle %d Out Of Range"); - if (i != 0) { - _colorCycle[i - 1].delay = 0; - return; - } - - for (i = 0, cycl = _colorCycle; i < 16; i++, cycl++) - cycl->delay = 0; -} - -void Scumm::cyclePalette() -{ - ColorCycle *cycl; - int valueToAdd; - int i, num; - byte *start, *end; - byte tmp[3]; - - valueToAdd = _vars[VAR_TIMER]; - if (valueToAdd < _vars[VAR_TIMER_NEXT]) - valueToAdd = _vars[VAR_TIMER_NEXT]; - - if (!_colorCycle) // FIXME - return; - - for (i = 0, cycl = _colorCycle; i < 16; i++, cycl++) { - if (cycl->delay && (cycl->counter += valueToAdd) >= cycl->delay) { - do { - cycl->counter -= cycl->delay; - } while (cycl->delay <= cycl->counter); - - setDirtyColors(cycl->start, cycl->end); - moveMemInPalRes(cycl->start, cycl->end, cycl->flags & 2); - start = &_currentPalette[cycl->start * 3]; - end = &_currentPalette[cycl->end * 3]; - - num = cycl->end - cycl->start; - - if (!(cycl->flags & 2)) { - memmove(tmp, end, 3); - memmove(start + 3, start, num * 3); - memmove(start, tmp, 3); - } else { - memmove(tmp, start, 3); - memmove(start, start + 3, num * 3); - memmove(end, tmp, 3); - } - } - } -} - -void Scumm::moveMemInPalRes(int start, int end, byte direction) -{ - byte *startptr, *endptr; - byte *startptr2, *endptr2; - int num; - byte tmp[6]; - byte tmp2[6]; - - if (!_palManipCounter) - return; - - startptr = getResourceAddress(rtTemp, 4) + start * 6; - endptr = getResourceAddress(rtTemp, 4) + end * 6; - - startptr2 = getResourceAddress(rtTemp, 5) + start * 6; - endptr2 = getResourceAddress(rtTemp, 5) + end * 6; - - num = end - start; - - if (!endptr) { - warning("moveMemInPalRes(%d,%d): Bad end pointer\n", start, end); - return; - } - - if (!direction) { - memmove(tmp, endptr, 6); - memmove(startptr + 6, startptr, num * 6); - memmove(startptr, tmp, 6); - memmove(tmp2, endptr2, 6); - memmove(startptr2 + 6, startptr2, num * 6); - memmove(startptr2, tmp2, 6); - } else { - memmove(tmp, startptr, 6); - memmove(startptr, startptr + 6, num * 6); - memmove(endptr, tmp, 6); - memmove(tmp2, startptr2, 6); - memmove(startptr2, startptr2 + 6, num * 6); - memmove(endptr2, tmp2, 6); - } -} - -void Scumm::drawFlashlight() -{ - static byte *flashBuffer = NULL; - static int flashX, flashY, flashW, flashH; - - int i, j, offset; - int topline = virtscr[0].topline; - - // Remove the flash light first if it was previously drawn - if (_flashlightIsDrawn) { - updateDirtyRect(0, flashX<<3, (flashX+flashW)<<3, flashY, flashY+flashH, 0x80000000); - - if (flashBuffer) { - - offset = 320 - flashW*8; - i = flashH; - do { - j = flashW*2; - do { - *(uint32 *)flashBuffer = 0; - flashBuffer += 4; - } while (--j); - flashBuffer += offset; - } while (--i); - } - - _flashlightIsDrawn = false; - } - - if (_flashlightXStrips == 0 || _flashlightYStrips == 0) - return; - - // Calculate the area of the flashlight - Actor *a = a = derefActorSafe(_vars[VAR_EGO], "drawFlashlight"); - flashW = _flashlightXStrips; - flashH = _flashlightYStrips * 8; - flashX = a->x/8 - flashW/2 - _screenStartStrip; - flashY = a->y - flashH/2; - - // Clip the flashlight at the borders - if (flashX < 0) - flashX = 0; - else if (flashX > NUM_STRIPS - flashW) - flashX = NUM_STRIPS - flashW; - if (flashY < 0) - flashY = 0; - else if (flashY > virtscr[0].height - flashH) - flashY = virtscr[0].height - flashH; - - // Redraw any actors "under" the flashlight - for (i = flashX; i < flashX+flashW; i++) { - gfxUsageBits[_screenStartStrip + i] |= 0x80000000; - virtscr[0].tdirty[i] = 0; - virtscr[0].bdirty[i] = virtscr[0].height; - } - - byte *bgbak; - offset = (flashY - topline) * 320 + virtscr[0].xstart + flashX*8; - flashBuffer = virtscr[0].screenPtr + offset; - bgbak = getResourceAddress(rtBuffer, 5) + offset; - - blit(flashBuffer, bgbak, flashW*8, flashH); - - // TODO - flashlight should have round corners - - _flashlightIsDrawn = true; -} - -void Scumm::fadeIn(int effect) -{ - switch (effect) { - case 1: - case 2: - case 3: - case 4: - transitionEffect(effect - 1); - break; - case 128: - unkScreenEffect6(); - break; - case 130: - unkScreenEffect1(); - break; - case 131: - unkScreenEffect2(); - break; - case 132: - unkScreenEffect3(); - break; - case 133: - unkScreenEffect4(); - break; - case 134: - unkScreenEffect5(0); - break; - case 135: - unkScreenEffect5(1); - break; - case 129: - break; - default: - warning("Unknown screen effect, %d", effect); - } - _screenEffectFlag = true; -} - -void Scumm::fadeOut(int a) -{ - VirtScreen *vs; - - setDirtyRange(0, 0, 0); - if (!(_features & GF_AFTER_V7)) - camera._last.x = camera._cur.x; - - if (!_screenEffectFlag) - return; - _screenEffectFlag = false; - - if (a == 0) - return; - - // Fill screen 0 with black - vs = &virtscr[0]; - gdi._backbuff_ptr = vs->screenPtr + vs->xstart; - memset(gdi._backbuff_ptr, 0, vs->size); - - // Fade to black with the specified effect, if any. - switch (a) { - case 1: - case 2: - case 3: - case 4: - transitionEffect(a - 1); - break; - case 128: - unkScreenEffect6(); - break; - case 129: - // Just blit screen 0 to the display (i.e. display will be black) - setDirtyRange(0, 0, vs->height); - updateDirtyScreen(0); - break; - case 134: - unkScreenEffect5(0); - break; - case 135: - unkScreenEffect5(1); - break; - default: - warning("fadeOut: default case %d", a); - } -} - -void Scumm::redrawBGAreas() -{ - int i; - int val; - int diff; - - if (!(_features & GF_AFTER_V7)) - if (camera._cur.x != camera._last.x && charset._hasMask) - stopTalk(); - - val = 0; - - if (!_fullRedraw && _BgNeedsRedraw) { - for (i = 0; i != NUM_STRIPS; i++) { - if (gfxUsageBits[_screenStartStrip + i] & 0x80000000) { - redrawBGStrip(i, 1); - } - } - } - - if (_features & GF_AFTER_V7) { - diff = (camera._cur.x >> 3) - (camera._last.x >> 3); - if (_fullRedraw == 0 && diff == 1) { - val = 2; - redrawBGStrip(NUM_STRIPS-1, 1); - } else if (_fullRedraw == 0 && diff == -1) { - val = 1; - redrawBGStrip(0, 1); - } else if (_fullRedraw != 0 || diff != 0) { - _BgNeedsRedraw = false; - _fullRedraw = false; - redrawBGStrip(0, NUM_STRIPS); - } - } else { - if (_fullRedraw == 0 && camera._cur.x - camera._last.x == 8) { - val = 2; - redrawBGStrip(NUM_STRIPS-1, 1); - } else if (_fullRedraw == 0 && camera._cur.x - camera._last.x == -8) { - val = 1; - redrawBGStrip(0, 1); - } else if (_fullRedraw != 0 || camera._cur.x != camera._last.x) { - _BgNeedsRedraw = false; - _flashlightIsDrawn = false; - redrawBGStrip(0, NUM_STRIPS); - } - } - - drawRoomObjects(val); - _BgNeedsRedraw = false; -} - -const uint32 zplane_tags[] = { - MKID('ZP00'), - MKID('ZP01'), - MKID('ZP02'), - MKID('ZP03'), - MKID('ZP04') -}; - -void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, - int stripnr, int numstrip, byte flag) -{ - byte *smap_ptr, *where_draw_ptr; - int i; - byte *zplane_list[6]; - - int bottom; - byte twobufs; - int numzbuf; - int sx; - bool lightsOn; - - // Check whether lights are turned on or not - lightsOn = (_vm->_features & GF_AFTER_V6) || (vs->number != 0) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen); - - CHECK_HEAP; - if (_vm->_features & GF_SMALL_HEADER) - smap_ptr = _smap_ptr = ptr; - else - smap_ptr = findResource(MKID('SMAP'), ptr); - - assert(smap_ptr); - - numzbuf = _disable_zbuffer ? 0 : _numZBuffer; - - if (_vm->_features & GF_SMALL_HEADER) { - /* this is really ugly, FIXME */ - if (ptr[-2] == 'B' && ptr[-1] == 'M' && READ_LE_UINT32(ptr - 6) > (READ_LE_UINT32(ptr) + 10)) { - zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr); - // FIXME - how does GF_OLD256 encode the multiple zplanes? - if (!(_vm->_features & GF_OLD256)) - for (i = 2; i < numzbuf; i++) { - zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]); - } - } else if (ptr[-4] == 'O' && ptr[-3] == 'I' && READ_LE_UINT32(ptr - 8) > READ_LE_UINT32(ptr) + 12) { - zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr); - // FIXME - how does GF_OLD256 encode the multiple zplanes? - if (!(_vm->_features & GF_OLD256)) - for (i = 2; i < numzbuf; i++) { - zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]); - } - } else { - zplane_list[1] = 0; - } - } else { - for (i = 1; i < numzbuf; i++) { - zplane_list[i] = findResource(zplane_tags[i], ptr); - } - } - - - - bottom = y + h; - if (bottom > vs->height) { - warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", bottom, vs->height); - } - - twobufs = vs->alloctwobuffers; - - _vertStripNextInc = h * 320 - 1; - - _numLinesToProcess = h; - - do { - if (_vm->_features & GF_SMALL_HEADER) - _smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4); - else - _smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8); - - CHECK_HEAP; - sx = x; - if (vs->scrollable) - sx -= vs->xstart >> 3; - - if ((uint) sx >= NUM_STRIPS) - return; - - if (y < vs->tdirty[sx]) - vs->tdirty[sx] = y; - - if (bottom > vs->bdirty[sx]) - vs->bdirty[sx] = bottom; - - _backbuff_ptr = vs->screenPtr + (y * NUM_STRIPS + x) * 8; - if (twobufs) - _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number + 5) + (y * NUM_STRIPS + x) * 8; - else - _bgbak_ptr = _backbuff_ptr; - - _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * NUM_STRIPS + x); - - where_draw_ptr = _bgbak_ptr; - decompressBitmap(); - - CHECK_HEAP; - if (twobufs) { - _bgbak_ptr = where_draw_ptr; - - if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) { - if (flag & dbClear || !lightsOn) - clear8ColWithMasking(); - else - draw8ColWithMasking(); - } else { - if (flag & dbClear || !lightsOn) - clear8Col(); - else - blit(_backbuff_ptr, _bgbak_ptr, 8, h); - } - } - CHECK_HEAP; - if (flag & dbDrawMaskOnBoth) { - _z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8); - _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x; - if (_useOrDecompress && flag & dbAllowMaskOr) - decompressMaskImgOr(); - else - decompressMaskImg(); - } - - for (i = 1; i < numzbuf; i++) { - uint16 offs; - - if (!zplane_list[i]) - continue; - - if (_vm->_features & GF_SMALL_HEADER) - if (_vm->_features & GF_OLD256) - offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4); - else - offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2); - else - offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); - - _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x + _imgBufOffs[i]; - - if (offs) { - _z_plane_ptr = zplane_list[i] + offs; - - if (_useOrDecompress && flag & dbAllowMaskOr) - decompressMaskImgOr(); - else - decompressMaskImg(); - } else { - if (_useOrDecompress && flag & dbAllowMaskOr); /* nothing */ - else - for (int h = 0; h < _numLinesToProcess; h++) - _mask_ptr_dest[h * NUM_STRIPS] = 0; - /* needs better abstraction, FIXME */ - } - } - CHECK_HEAP; - x++; - stripnr++; - } while (--numstrip); -} - - -void Gdi::decompressBitmap() -{ - const byte decompress_table[] = { - 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x0, - }; - - _useOrDecompress = false; - - byte code = *_smap_ptr++; - assert(_numLinesToProcess); - - if (_vm->_features & GF_AMIGA) - _palette_mod = 16; - else - _palette_mod = 0; - - switch (code) { - case 1: - unkDecode7(); - break; - - case 2: - unkDecode8(); /* Ender - Zak256/Indy256 */ - break; - - case 3: - unkDecode9(); /* Ender - Zak256/Indy256 */ - break; - - case 4: - unkDecode10(); /* Ender - Zak256/Indy256 */ - break; - - case 7: - unkDecode11(); /* Ender - Zak256/Indy256 */ - break; - - case 14: - case 15: - case 16: - case 17: - case 18: - _decomp_shr = code - 10; - _decomp_mask = decompress_table[code - 10]; - unkDecode6(); - break; - - case 24: - case 25: - case 26: - case 27: - case 28: - _decomp_shr = code - 20; - _decomp_mask = decompress_table[code - 20]; - unkDecode5(); - break; - - case 34: - case 35: - case 36: - case 37: - case 38: - _useOrDecompress = true; - _decomp_shr = code - 30; - _decomp_mask = decompress_table[code - 30]; - unkDecode4(); - break; - - case 44: - case 45: - case 46: - case 47: - case 48: - _useOrDecompress = true; - _decomp_shr = code - 40; - _decomp_mask = decompress_table[code - 40]; - unkDecode2(); - break; - - case 64: - case 65: - case 66: - case 67: - case 68: - _decomp_shr = code - 60; - _decomp_mask = decompress_table[code - 60]; - unkDecode1(); - break; - - case 84: - case 85: - case 86: - case 87: - case 88: - _useOrDecompress = true; - _decomp_shr = code - 80; - _decomp_mask = decompress_table[code - 80]; - unkDecode3(); - break; - - /* New since version 6 */ - case 104: - case 105: - case 106: - case 107: - case 108: - _decomp_shr = code - 100; - _decomp_mask = decompress_table[code - 100]; - unkDecode1(); - break; - - /* New since version 6 */ - case 124: - case 125: - case 126: - case 127: - case 128: - _useOrDecompress = true; - _decomp_shr = code - 120; - _decomp_mask = decompress_table[code - 120]; - unkDecode3(); - break; - - default: - error("Gdi::decompressBitmap: default case %d", code); - } -} - -int Scumm::hasCharsetMask(int x, int y, int x2, int y2) -{ - if (!charset._hasMask || y > gdi._mask_bottom || x > gdi._mask_right || - y2 < gdi._mask_top || x2 < gdi._mask_left) - return 0; - return 1; -} - -void Gdi::draw8ColWithMasking() -{ - int height = _numLinesToProcess; - byte *mask = _mask_ptr; - byte *dst = _backbuff_ptr; - byte *src = _bgbak_ptr; - byte maskbits; - - do { - maskbits = *mask; - if (maskbits) { - if (!(maskbits & 0x80)) - dst[0] = src[0]; - if (!(maskbits & 0x40)) - dst[1] = src[1]; - if (!(maskbits & 0x20)) - dst[2] = src[2]; - if (!(maskbits & 0x10)) - dst[3] = src[3]; - if (!(maskbits & 0x08)) - dst[4] = src[4]; - if (!(maskbits & 0x04)) - dst[5] = src[5]; - if (!(maskbits & 0x02)) - dst[6] = src[6]; - if (!(maskbits & 0x01)) - dst[7] = src[7]; - } else { - ((uint32 *)dst)[0] = ((uint32 *)src)[0]; - ((uint32 *)dst)[1] = ((uint32 *)src)[1]; - } - src += 320; - dst += 320; - mask += NUM_STRIPS; - } while (--height); -} - -void Gdi::clear8ColWithMasking() -{ - int height = _numLinesToProcess; - byte *mask = _mask_ptr; - byte *dst = _backbuff_ptr; - byte maskbits; - - do { - maskbits = *mask; - if (maskbits) { - if (!(maskbits & 0x80)) - dst[0] = 0; - if (!(maskbits & 0x40)) - dst[1] = 0; - if (!(maskbits & 0x20)) - dst[2] = 0; - if (!(maskbits & 0x10)) - dst[3] = 0; - if (!(maskbits & 0x08)) - dst[4] = 0; - if (!(maskbits & 0x04)) - dst[5] = 0; - if (!(maskbits & 0x02)) - dst[6] = 0; - if (!(maskbits & 0x01)) - dst[7] = 0; - } else { - ((uint32 *)dst)[0] = 0; - ((uint32 *)dst)[1] = 0; - } - dst += 320; - mask += NUM_STRIPS; - } while (--height); -} - -void Gdi::clear8Col() -{ - int height = _numLinesToProcess; - byte *dst = _backbuff_ptr; - - do { - ((uint32 *)dst)[0] = 0; - ((uint32 *)dst)[1] = 0; - dst += 320; - } while (--height); -} - -void Gdi::decompressMaskImg() -{ - byte *src = _z_plane_ptr; - byte *dst = _mask_ptr_dest; - int height = _numLinesToProcess; - byte b, c; - - while (1) { - b = *src++; - - if (b & 0x80) { - b &= 0x7F; - c = *src++; - - do { - *dst = c; - dst += NUM_STRIPS; - if (!--height) - return; - } while (--b); - } else { - do { - *dst = *src++; - dst += NUM_STRIPS; - if (!--height) - return; - } while (--b); - } - } -} - -void Gdi::decompressMaskImgOr() -{ - byte *src = _z_plane_ptr; - byte *dst = _mask_ptr_dest; - int height = _numLinesToProcess; - byte b, c; - - while (1) { - b = *src++; - if (b & 0x80) { - b &= 0x7F; - c = *src++; - - do { - *dst |= c; - dst += NUM_STRIPS; - if (!--height) - return; - } while (--b); - } else { - do { - *dst |= *src++; - dst += NUM_STRIPS; - if (!--height) - return; - } while (--b); - } - } -} - -void Scumm::redrawBGStrip(int start, int num) -{ - int s = _screenStartStrip + start; - - assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / sizeof(gfxUsageBits[0])); - - _curVirtScreen = &virtscr[0]; - - for (int i = 0; i < num; i++) - gfxUsageBits[s + i] |= 0x80000000; - - /*if (_curVirtScreen->height < _scrHeight) { - warning("Screen Y size %d < Room height %d", - _curVirtScreen->height, - _scrHeight); - } */ - - gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs, - _curVirtScreen, s, 0, _curVirtScreen->height, s, num, 0); -} - -#define READ_BIT (cl--,bit = bits&1, bits>>=1,bit) -#define FILL_BITS if (cl <= 8) { bits |= (*src++ << cl); cl += 8;} - -void Gdi::unkDecode1() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - uint bits = *src++; - byte cl = 8; - byte bit; - byte incm, reps; - _tempNumLines = _numLinesToProcess; - - do { - _currentX = 8; - do { - FILL_BITS *dst++ = color + _palette_mod;; - - againPos:; - - if (!READ_BIT) { - } else if (READ_BIT) { - incm = (bits & 7) - 4; - cl -= 3; - bits >>= 3; - if (!incm) { - FILL_BITS reps = bits & 0xFF; - do { - if (!--_currentX) { - _currentX = 8; - dst += 312; - if (!--_tempNumLines) - return; - } - *dst++ = color + _palette_mod; - } while (--reps); - bits >>= 8; - bits |= (*src++) << (cl - 8); - goto againPos; - } else { - color += incm; - } - } else { - FILL_BITS color = bits & _decomp_mask; - cl -= _decomp_shr; - bits >>= _decomp_shr; - } - } while (--_currentX); - dst += 312; - } while (--_tempNumLines); -} - -void Gdi::unkDecode2() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - int8 inc = -1; - uint bits = *src++; - byte cl = 8; - byte bit; - - _tempNumLines = _numLinesToProcess; - - do { - _currentX = 8; - do { - FILL_BITS if (color != _transparency) - *dst = color + _palette_mod; - dst++; - if (!READ_BIT) { - } else if (!READ_BIT) { - FILL_BITS color = bits & _decomp_mask; - bits >>= _decomp_shr; - cl -= _decomp_shr; - inc = -1; - } else if (!READ_BIT) { - color += inc; - } else { - inc = -inc; - color += inc; - } - } while (--_currentX); - dst += 312; - } while (--_tempNumLines); -} - -void Gdi::unkDecode3() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - uint bits = *src++; - byte cl = 8; - byte bit; - byte incm, reps; - - _tempNumLines = _numLinesToProcess; - - do { - _currentX = 8; - do { - FILL_BITS if (color != _transparency) - *dst = color + _palette_mod; - dst++; - - againPos:; - if (!READ_BIT) { - } else if (READ_BIT) { - incm = (bits & 7) - 4; - - cl -= 3; - bits >>= 3; - if (incm) { - color += incm; - } else { - FILL_BITS reps = bits & 0xFF; - if (color == _transparency) { - do { - if (!--_currentX) { - _currentX = 8; - dst += 312; - if (!--_tempNumLines) - return; - } - dst++; - } while (--reps); - } else { - do { - if (!--_currentX) { - _currentX = 8; - dst += 312; - if (!--_tempNumLines) - return; - } - *dst++ = color + _palette_mod; - } while (--reps); - } - bits >>= 8; - bits |= (*src++) << (cl - 8); - goto againPos; - } - } else { - FILL_BITS color = bits & _decomp_mask; - cl -= _decomp_shr; - bits >>= _decomp_shr; - } - } while (--_currentX); - dst += 312; - } while (--_tempNumLines); -} - -void Gdi::unkDecode4() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - int8 inc = -1; - uint bits = *src++; - byte cl = 8; - byte bit; - - _currentX = 8; - do { - _tempNumLines = _numLinesToProcess; - do { - FILL_BITS if (color != _transparency) - *dst = color + _palette_mod; - dst += 320; - if (!READ_BIT) { - } else if (!READ_BIT) { - FILL_BITS color = bits & _decomp_mask; - bits >>= _decomp_shr; - cl -= _decomp_shr; - inc = -1; - } else if (!READ_BIT) { - color += inc; - } else { - inc = -inc; - color += inc; - } - } while (--_tempNumLines); - dst -= _vertStripNextInc; - } while (--_currentX); -} - -void Gdi::unkDecode5() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - int8 inc = -1; - uint bits = *src++; - byte cl = 8; - byte bit; - - _tempNumLines = _numLinesToProcess; - - do { - _currentX = 8; - do { - FILL_BITS *dst++ = color + _palette_mod; - if (!READ_BIT) { - } else if (!READ_BIT) { - FILL_BITS color = bits & _decomp_mask; - bits >>= _decomp_shr; - cl -= _decomp_shr; - inc = -1; - } else if (!READ_BIT) { - color += inc; - } else { - inc = -inc; - color += inc; - } - } while (--_currentX); - dst += 312; - } while (--_tempNumLines); -} - -void Gdi::unkDecode6() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - byte color = *src++; - int8 inc = -1; - uint bits = *src++; - byte cl = 8; - byte bit; - - _currentX = 8; - do { - _tempNumLines = _numLinesToProcess; - do { - FILL_BITS *dst = color + _palette_mod; - dst += 320; - if (!READ_BIT) { - } else if (!READ_BIT) { - FILL_BITS color = bits & _decomp_mask; - bits >>= _decomp_shr; - cl -= _decomp_shr; - inc = -1; - } else if (!READ_BIT) { - color += inc; - } else { - inc = -inc; - color += inc; - } - } while (--_tempNumLines); - dst -= _vertStripNextInc; - } while (--_currentX); -} - -/* Ender - Zak256/Indy256 decoders */ -#define READ_256BIT \ - if ((mask <<= 1) == 256) {buffer = *src++; mask = 1;} \ - bits = ((buffer & mask) != 0); - -#define NEXT_ROW \ - dst += 320; \ - if (--h == 0) { \ - if (!--_currentX) \ - return; \ - dst -= _vertStripNextInc; \ - h = _numLinesToProcess; \ - } - -void Gdi::unkDecode7() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - int height = _numLinesToProcess; - uint h = _numLinesToProcess; - - - if (_vm->_features & GF_OLD256) { - _currentX = 8; - for (;;) { - byte color = *src++; - *dst = color; - NEXT_ROW} - return; - } - - do { - /* Endian safe */ -#if defined(SCUMM_NEED_ALIGNMENT) - memcpy(dst, src, 8); -#else - ((uint32 *)dst)[0] = ((uint32 *)src)[0]; - ((uint32 *)dst)[1] = ((uint32 *)src)[1]; -#endif - dst += 320; - src += 8; - } while (--height); -} - -void Gdi::unkDecode8() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - uint h = _numLinesToProcess; - - _currentX = 8; - for (;;) { - uint run = (*src++) + 1; - byte color = *src++; - - do { - *dst = color; - NEXT_ROW} while (--run); - } -} - -void Gdi::unkDecode9() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - unsigned char c, bits, color, run; - int x, y, i, z; - uint buffer = 0, mask = 128; - int h = _numLinesToProcess; - x = y = i = z = run = 0; - - _currentX = 8; - for (;;) { - c = 0; - for (i = 0; i < 4; i++) { - READ_256BIT; - c += (bits << i); - } - - switch ((c >> 2)) { - case 0: - color = 0; - for (i = 0; i < 4; i++) { - READ_256BIT; - color += bits << i; - } - for (i = 0; i < ((c & 3) + 2); i++) { - *dst = (run * 16 + color); - NEXT_ROW} - break; - - case 1: - for (i = 0; i < ((c & 3) + 1); i++) { - color = 0; - for (z = 0; z < 4; z++) { - READ_256BIT; - color += bits << z; - } - *dst = (run * 16 + color); - NEXT_ROW} - break; - - case 2: - run = 0; - for (i = 0; i < 4; i++) { - READ_256BIT; - run += bits << i; - } - break; - } - } -} - -void Gdi::unkDecode10() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - int i; - unsigned char local_palette[256], numcolors = *src++; - uint h = _numLinesToProcess; - - for (i = 0; i < numcolors; i++) - local_palette[i] = *src++; - - _currentX = 8; - - for (;;) { - byte color = *src++; - if (color < numcolors) { - *dst = local_palette[color]; - NEXT_ROW} else { - uint run = color - numcolors + 1; - color = *src++; - do { - *dst = color; - NEXT_ROW} while (--run); - } - } -} - - -void Gdi::unkDecode11() -{ - byte *src = _smap_ptr; - byte *dst = _bgbak_ptr; - int bits, i; - uint buffer = 0, mask = 128; - unsigned char inc = 1, color = *src++; - - _currentX = 8; - do { - _tempNumLines = _numLinesToProcess; - do { - *dst = color; - dst += 320; - for (i = 0; i < 3; i++) { - READ_256BIT if (!bits) - break; - } - switch (i) { - case 1: - inc = -inc; - color -= inc; - break; - - case 2: - color -= inc; - break; - - case 3: - color = 0; - inc = 1; - for (i = 0; i < 8; i++) { - READ_256BIT color += bits << i; - } - break; - } - } while (--_tempNumLines); - dst -= _vertStripNextInc; - } while (--_currentX); -} - - -#undef NEXT_ROW -#undef READ_256BIT -#undef READ_BIT -#undef FILL_BITS - -void Scumm::restoreCharsetBg() -{ - _bkColor = 0; - - if (gdi._mask_left != -1) { - restoreBG(gdi._mask_left, gdi._mask_top, gdi._mask_right, gdi._mask_bottom); - charset._hasMask = false; - gdi._mask_left = -1; - charset._strLeft = -1; - charset._left = -1; - } - - charset._xpos2 = string[0].xpos; - charset._ypos2 = string[0].ypos; -} - -void Scumm::restoreBG(int left, int top, int right, int bottom) -{ - VirtScreen *vs; - int topline, height, width, widthmod; - byte *backbuff, *bgbak, *mask; - - if (left == right || top == bottom) - return; - if (top < 0) - top = 0; - - if ((vs = findVirtScreen(top)) == NULL) - return; - - topline = vs->topline; - height = topline + vs->height; - if (vs->number == 0) { - left += _lastXstart - vs->xstart; - right += _lastXstart - vs->xstart; - } - - right++; - if (left < 0) - left = 0; - if (right < 0) - right = 0; - if (left > 320) - return; - if (right > 320) - right = 320; - if (bottom >= height) - bottom = height; - - updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, 0x40000000); - - height = (top - topline) * 320 + vs->xstart + left; - - backbuff = vs->screenPtr + height; - bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height; - mask = getResourceAddress(rtBuffer, 9) + top * NUM_STRIPS + (left >> 3) + _screenStartStrip; - if (vs->number == 0) { - mask += vs->topline * 216; - } - - height = bottom - top; - width = right - left; - widthmod = (width >> 2) + 2; - - if (vs->alloctwobuffers && _currentRoom != 0 /*&& _vars[VAR_V5_DRAWFLAGS]&2 */ ) { - blit(backbuff, bgbak, width, height); - if (vs->number == 0 && charset._hasMask && height) { - do { - memset(mask, 0, widthmod); - mask += NUM_STRIPS; - } while (--height); - } - } else { - if (height) { - do { - memset(backbuff, _bkColor, width); - backbuff += 320; - } while (--height); - } - } -} - -void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits) -{ - VirtScreen *vs = &virtscr[virt]; - int lp, rp; - uint32 *sp; - int num; - - if (top > vs->height || left > vs->width || right < 0 || bottom < 0) - return; - - if (top < 0) - top = 0; - if (left < 0) - left = 0; - if (bottom > vs->height) - bottom = vs->height; - if (right > vs->width) - right = vs->width; - - if (virt == 0 && dirtybits) { - rp = (right >> 3) + _screenStartStrip; - lp = (left >> 3) + _screenStartStrip; - if (lp < 0) - lp = 0; - if (rp >= 200) - rp = 200; - if (lp <= rp) { - num = rp - lp + 1; - sp = &gfxUsageBits[lp]; - do { - *sp++ |= dirtybits; - } while (--num); - } - } - - setVirtscreenDirty(vs, left, top, right, bottom); -} - -void Scumm::setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom) -{ - int lp = left >> 3; - int rp = right >> 3; - - if (lp >= NUM_STRIPS || rp < 0) - return; - if (lp < 0) - lp = 0; - if (rp >= NUM_STRIPS) - rp = NUM_STRIPS - 1; - - while (lp <= rp) { - if (top < vs->tdirty[lp]) - vs->tdirty[lp] = top; - if (bottom > vs->bdirty[lp]) - vs->bdirty[lp] = bottom; - lp++; - } -} - -VirtScreen *Scumm::findVirtScreen(int y) -{ - VirtScreen *vs = virtscr; - int i; - - for (i = 0; i < 3; i++, vs++) { - if (y >= vs->topline && y < vs->topline + vs->height) { - return _curVirtScreen = vs; - } - } - return _curVirtScreen = NULL; -} - -void Scumm::unkScreenEffect1() -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect1()"); -} - -void Scumm::unkScreenEffect2() -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect2()"); -} - -void Scumm::unkScreenEffect3() -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect3()"); -} - -void Scumm::unkScreenEffect4() -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect4()"); -} - -/* *INDENT-OFF* */ - -static const int8 screen_eff7_table1[4][16] = { - { 1, 1, -1, 1, -1, 1, -1, -1, - 1, -1, -1, -1, 1, 1, 1, -1}, - { 0, 1, 2, 1, 2, 0, 2, 1, - 2, 0, 2, 1, 0, 0, 0, 0}, - {-2, -1, 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, 0, 0, 0, 0}, - { 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, -2, -1, 0, 0, 0, 0} -}; - -static const byte screen_eff7_table2[4][16] = { - { 0, 0, 39, 0, 39, 0, 39, 24, - 0, 24, 39, 24, 0, 0, 0, 24}, - { 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 255, 0, 0, 0}, - {39, 24, 39, 24, 39, 24, 39, 24, - 38, 24, 38, 24, 255, 0, 0, 0}, - { 0, 24, 39, 24, 39, 0, 39, 24, - 38, 0, 38, 24, 255, 0, 0, 0} -}; - -static const byte transition_num_of_iterations[4] = { - 13, 25, 25, 25 -}; - -/* *INDENT-ON* */ - -/* Transition effect. There are four different effects possible, - * indicated by the value of a: - * 0: Iris effect - * 1: ? - * 2: ? - * 3: ? - * All effects basically operate on 8x8 blocks of the screen. These blocks - * are updated in a certain order; the exact order determines how the - * effect appears to the user. - */ -void Scumm::transitionEffect(int a) -{ - int delta[16]; // Offset applied during each iteration - int tab_2[16]; - int i, j; - int bottom; - int l, t, r, b; - - for (i = 0; i < 16; i++) { - delta[i] = screen_eff7_table1[a][i]; - j = screen_eff7_table2[a][i]; - if (j == 24) - j = (virtscr[0].height >> 3) - 1; - tab_2[i] = j; - } - - bottom = virtscr[0].height >> 3; - for (j = 0; j < transition_num_of_iterations[a]; j++) { - for (i = 0; i < 4; i++) { - l = tab_2[i * 4]; - t = tab_2[i * 4 + 1]; - r = tab_2[i * 4 + 2]; - b = tab_2[i * 4 + 3]; - if (t == b) { - while (l <= r) { - if (l >= 0 && l < NUM_STRIPS && (uint) t < (uint) bottom) { - virtscr[0].tdirty[l] = t << 3; - virtscr[0].bdirty[l] = (t + 1) << 3; - } - l++; - } - } else { - if (l < 0 || l >= NUM_STRIPS || b <= t) - continue; - if (b > bottom) - b = bottom; - virtscr[0].tdirty[l] = t << 3; - virtscr[0].bdirty[l] = (b + 1) << 3; - } - updateDirtyScreen(0); - } - - for (i = 0; i < 16; i++) - tab_2[i] += delta[i]; - - // Draw the current state to the screen and wait half a sec so the user - // can watch the effect taking place. - updatePalette(); - _system->update_screen(); - waitForTimer(30); - } -} - -void Scumm::unkScreenEffect6() -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect6"); -} - -void Scumm::unkScreenEffect5(int a) -{ - /* XXX: not implemented */ - warning("stub unkScreenEffect5(%d)", a); -} - -void Scumm::setShake(int mode) -{ - if (_shakeEnabled != (mode != 0)) - _fullRedraw = true; - - _shakeEnabled = mode != 0; - _shakeFrame = 0; - _system->set_shake_pos(0); -} - -void Gdi::clearUpperMask() -{ - memset(_vm->getResourceAddress(rtBuffer, 9), 0, _imgBufOffs[1] - _imgBufOffs[0] - ); -} - -void Scumm::clampCameraPos(ScummPoint *pt) -{ - if (pt->x < _vars[VAR_CAMERA_MIN_X]) - pt->x = _vars[VAR_CAMERA_MIN_X]; - - if (pt->x > _vars[VAR_CAMERA_MAX_X]) - pt->x = _vars[VAR_CAMERA_MAX_X]; - - if (pt->y < _vars[VAR_CAMERA_MIN_Y]) - pt->y = _vars[VAR_CAMERA_MIN_Y]; - - if (pt->y > _vars[VAR_CAMERA_MAX_Y]) - pt->y = _vars[VAR_CAMERA_MAX_Y]; -} - - -void Scumm::moveCamera() -{ - if (_features & GF_AFTER_V7) { - ScummPoint old = camera._cur; - Actor *a = NULL; - - if (camera._follows) { - a = derefActorSafe(camera._follows, "moveCamera"); - if (abs(camera._cur.x - a->x) > _vars[VAR_CAMERA_THRESHOLD_X] || - abs(camera._cur.y - a->y) > _vars[VAR_CAMERA_THRESHOLD_Y]) { - camera._movingToActor = true; - if (_vars[VAR_CAMERA_THRESHOLD_X] == 0) - camera._cur.x = a->x; - if (_vars[VAR_CAMERA_THRESHOLD_Y] == 0) - camera._cur.y = a->y; - clampCameraPos(&camera._cur); - } - } else { - camera._movingToActor = false; - } - - if (camera._movingToActor) { - camera._dest.x = a->x; - camera._dest.y = a->y; - } - - assert(camera._cur.x >= 160 && camera._cur.y >= 100); - - clampCameraPos(&camera._dest); - - if (camera._cur.x < camera._dest.x) { - camera._cur.x += _vars[VAR_CAMERA_SPEED_X]; - if (camera._cur.x > camera._dest.x) - camera._cur.x = camera._dest.x; - } - - if (camera._cur.x > camera._dest.x) { - camera._cur.x -= _vars[VAR_CAMERA_SPEED_X]; - if (camera._cur.x < camera._dest.x) - camera._cur.x = camera._dest.x; - } - - if (camera._cur.y < camera._dest.y) { - camera._cur.y += _vars[VAR_CAMERA_SPEED_Y]; - if (camera._cur.y > camera._dest.y) - camera._cur.y = camera._dest.y; - } - - if (camera._cur.y > camera._dest.y) { - camera._cur.y -= _vars[VAR_CAMERA_SPEED_Y]; - if (camera._cur.y < camera._dest.y) - camera._cur.y = camera._dest.y; - } - - if (camera._cur.x == camera._dest.x && camera._cur.y == camera._dest.y) { - - camera._movingToActor = false; - camera._accel.x = camera._accel.y = 0; - _vars[VAR_CAMERA_SPEED_X] = _vars[VAR_CAMERA_SPEED_Y] = 0; - } else { - - camera._accel.x += _vars[VAR_CAMERA_ACCEL_X]; - camera._accel.y += _vars[VAR_CAMERA_ACCEL_Y]; - - _vars[VAR_CAMERA_SPEED_X] += camera._accel.x / 100; - _vars[VAR_CAMERA_SPEED_Y] += camera._accel.y / 100; - - if (_vars[VAR_CAMERA_SPEED_X] < 8) - _vars[VAR_CAMERA_SPEED_X] = 8; - - if (_vars[VAR_CAMERA_SPEED_Y] < 8) - _vars[VAR_CAMERA_SPEED_Y] = 8; - - } - - cameraMoved(); - - if (camera._cur.x != old.x || camera._cur.y != old.y) { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - _vars[VAR_CAMERA_POS_Y] = camera._cur.y; - - _vars[VAR_CAMERA_DEST_X] = camera._dest.x; - - _vars[VAR_CAMERA_DEST_Y] = camera._dest.y; - - _vars[VAR_CAMERA_FOLLOWED_ACTOR] = camera._follows; - - if (_vars[VAR_SCROLL_SCRIPT]) - runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); - } - } else { - int pos = camera._cur.x; - int actorx, t; - Actor *a = NULL; - - camera._cur.x &= 0xFFF8; - - if (camera._cur.x < _vars[VAR_CAMERA_MIN_X]) { - if (_vars[VAR_CAMERA_FAST_X]) - camera._cur.x = _vars[VAR_CAMERA_MIN_X]; - else - camera._cur.x += 8; - cameraMoved(); - return; - } - - if (camera._cur.x > _vars[VAR_CAMERA_MAX_X]) { - if (_vars[VAR_CAMERA_FAST_X]) - camera._cur.x = _vars[VAR_CAMERA_MAX_X]; - else - camera._cur.x -= 8; - cameraMoved(); - return; - } - - if (camera._mode == CM_FOLLOW_ACTOR) { - a = derefActorSafe(camera._follows, "moveCamera"); - - actorx = a->x; - t = (actorx >> 3) - _screenStartStrip; - - if (t < camera._leftTrigger || t > camera._rightTrigger) { - if (_vars[VAR_CAMERA_FAST_X]) { - if (t > 35) - camera._dest.x = actorx + 80; - if (t < 5) - camera._dest.x = actorx - 80; - } else - camera._movingToActor = 1; - } - } - - if (camera._movingToActor) { - a = derefActorSafe(camera._follows, "moveCamera(2)"); - camera._dest.x = a->x; - } - - if (camera._dest.x < _vars[VAR_CAMERA_MIN_X]) - camera._dest.x = _vars[VAR_CAMERA_MIN_X]; - - if (camera._dest.x > _vars[VAR_CAMERA_MAX_X]) - camera._dest.x = _vars[VAR_CAMERA_MAX_X]; - - if (_vars[VAR_CAMERA_FAST_X]) { - camera._cur.x = camera._dest.x; - } else { - if (camera._cur.x < camera._dest.x) - camera._cur.x += 8; - if (camera._cur.x > camera._dest.x) - camera._cur.x -= 8; - } - - /* a is set a bit above */ - if (camera._movingToActor && camera._cur.x >> 3 == a->x >> 3) { - camera._movingToActor = 0; - } - - cameraMoved(); - - if (pos != camera._cur.x && _vars[VAR_SCROLL_SCRIPT]) { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); - } - } -} - -void Scumm::cameraMoved() -{ - if (_features & GF_AFTER_V7) { - - assert(camera._cur.x >= 160 && camera._cur.y >= 100); - - _screenStartStrip = (camera._cur.x - 160) >> 3; - _screenEndStrip = _screenStartStrip + NUM_STRIPS - 1; - virtscr[0].xstart = _screenStartStrip << 3; - - _screenLeft = camera._cur.x - 160; - _screenTop = camera._cur.y - 100; - } else { - - if (camera._cur.x < 160) { - camera._cur.x = 160; - } else if (camera._cur.x + 160 >= _scrWidth) { - camera._cur.x = _scrWidth - 160; - } - - _screenStartStrip = (camera._cur.x >> 3) - 20; - _screenEndStrip = _screenStartStrip + NUM_STRIPS - 1; - virtscr[0].xstart = _screenStartStrip << 3; - } -} - -void Scumm::panCameraTo(int x, int y) -{ - if (_features & GF_AFTER_V7) { - - camera._follows = 0; - camera._dest.x = x; - camera._dest.y = y; - } else { - - camera._dest.x = x; - camera._mode = CM_PANNING; - camera._movingToActor = 0; - } -} - -void Scumm::actorFollowCamera(int act) -{ - if (!(_features & GF_AFTER_V7)) { - int old; - - /* mi1 compatibilty */ - if (act == 0) { - camera._mode = CM_NORMAL; - camera._follows = 0; - camera._movingToActor = 0; - return; - } - - old = camera._follows; - setCameraFollows(derefActorSafe(act, "actorFollowCamera")); - if (camera._follows != old) - runHook(0); - - camera._movingToActor = 0; - } -} - -void Scumm::setCameraAtEx(int at) -{ - if (!(_features & GF_AFTER_V7)) { - camera._mode = CM_NORMAL; - camera._cur.x = at; - setCameraAt(at, 0); - camera._movingToActor = 0; - } -} - -void Scumm::palManipulate() -{ - byte *srcptr, *destptr; - byte *pal; - int i, j; - - if (!_palManipCounter) - return; - srcptr = getResourceAddress(rtTemp, 4) + _palManipStart * 6; - destptr = getResourceAddress(rtTemp, 5) + _palManipStart * 6; - pal = _currentPalette + _palManipStart * 3; - - i = _palManipStart; - while (i < _palManipEnd) { - j = (*((uint16 *)srcptr) += *(uint16 *)destptr); - *pal++ = j >> 8; - srcptr += 2; - destptr += 2; - - j = (*((uint16 *)srcptr) += *(uint16 *)destptr); - *pal++ = j >> 8; - srcptr += 2; - destptr += 2; - - j = (*((uint16 *)srcptr) += *(uint16 *)destptr); - *pal++ = j >> 8; - srcptr += 2; - destptr += 2; - - i++; - } - setDirtyColors(_palManipStart, _palManipEnd); - if (!--_palManipCounter) { - nukeResource(rtTemp, 4); - nukeResource(rtTemp, 5); - } -} - -void Scumm::swapPalColors(int a, int b) -{ - byte *ap, *bp; - byte t; - - if ((uint) a >= 256 || (uint) b >= 256) - error("swapPalColors: invalid values, %d, %d", a, b); - - ap = &_currentPalette[a * 3]; - bp = &_currentPalette[b * 3]; - - t = ap[0]; - ap[0] = bp[0]; - bp[0] = t; - t = ap[1]; - ap[1] = bp[1]; - bp[1] = t; - t = ap[2]; - ap[2] = bp[2]; - bp[2] = t; - - setDirtyColors(a, b); -} - -void Gdi::resetBackground(int top, int bottom, int strip) -{ - VirtScreen *vs = &_vm->virtscr[0]; - int offs; - - if (top < vs->tdirty[strip]) - vs->tdirty[strip] = top; - - if (bottom > vs->bdirty[strip]) - vs->bdirty[strip] = bottom; - - offs = (top * NUM_STRIPS + _vm->_screenStartStrip + strip); - _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + offs; - _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + (offs << 3); - _backbuff_ptr = vs->screenPtr + (offs << 3); - - _numLinesToProcess = bottom - top; - if (_numLinesToProcess) { - if ((_vm->_features & GF_AFTER_V6) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen)) { - if (_vm->hasCharsetMask(strip << 3, top, (strip + 1) << 3, bottom)) - draw8ColWithMasking(); - else - blit(_backbuff_ptr, _bgbak_ptr, 8, _numLinesToProcess); - } else { - clear8Col(); - } - } -} - -void Scumm::setPalColor(int idx, int r, int g, int b) -{ - _currentPalette[idx * 3 + 0] = r; - _currentPalette[idx * 3 + 1] = g; - _currentPalette[idx * 3 + 2] = b; - setDirtyColors(idx, idx); -} - -void Scumm::setCursorHotspot2(int x, int y) -{ - _cursorHotspotX = x; - _cursorHotspotY = y; -} - -byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem) -{ - int w, h, i; - - l >>= 3; - if (l < 0) - l = 0; - if (t < 0) - t = 0; - - r >>= 3; - if (r > NUM_STRIPS-1) - r = NUM_STRIPS-1; - - mem += l + t * NUM_STRIPS; - - w = r - l; - h = b - t + 1; - - do { - for (i = 0; i <= w; i++) - if (mem[i]) { - return true; - } - mem += NUM_STRIPS; - } while (--h); - - return false; -} - -void Scumm::setPalette(int palindex) -{ - byte *pals; - - _curPalIndex = palindex; - pals = getPalettePtr(); - if (pals == NULL) - error("invalid palette %d", palindex); - setPaletteFromPtr(pals); -} - -byte *Scumm::findPalInPals(byte *pal, int idx) -{ - byte *offs; - uint32 size; - - pal = findResource(MKID('WRAP'), pal); - if (pal == NULL) - return NULL; - - offs = findResourceData(MKID('OFFS'), pal); - if (offs == NULL) - return NULL; - - size = getResourceDataSize(offs) >> 2; - - if ((uint32)idx >= (uint32)size) - return NULL; - - return offs + READ_LE_UINT32(offs + idx * sizeof(uint32)); -} - -byte *Scumm::getPalettePtr() -{ - byte *cptr; - - cptr = getResourceAddress(rtRoom, _roomResource); - if (_CLUT_offs) { - cptr += _CLUT_offs; - } else { - cptr = findPalInPals(cptr + _PALS_offs, _curPalIndex); - } - return cptr; -} - -void Scumm::darkenPalette(int startColor, int endColor, int redScale, int greenScale, int blueScale) -{ - if (startColor <= endColor) { - byte *cptr, *cur; - int num; - int color; - - cptr = getPalettePtr() + startColor * 3; - cur = _currentPalette + startColor * 3; - num = endColor - startColor + 1; - - do { - color = *cptr++; - if (redScale != 0xFF) - color = color * redScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - - color = *cptr++; - if (greenScale != 0xFF) - color = color * greenScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - - color = *cptr++; - if (blueScale != 0xFF) - color = color * blueScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - } while (--num); - setDirtyColors(startColor, endColor); - } -} - -void Scumm::desaturatePalette() -{ - // FIXME: Should this be made to take a range of colors instead? - - byte *cur; - int i; - - cur = _currentPalette; - - for (i = 0; i <= 255; i++) - { - int max, min; - int brightness; - - // An algorithm that is good enough for The GIMP should be - // good enough for us... - - max = (cur[0] > cur[1]) ? cur[0] : cur[1]; - if (cur[2] > max) - max = cur[2]; - - min = (cur[0] < cur[1]) ? cur[0] : cur[1]; - if (cur[2] < min) - min = cur[2]; - - brightness = (min + max) / 2; - - *cur++ = brightness; - *cur++ = brightness; - *cur++ = brightness; - } - - setDirtyColors(0, 255); -} - -void Scumm::grabCursor(int x, int y, int w, int h) -{ - VirtScreen *vs = findVirtScreen(y); - - if (vs == NULL) { - warning("grabCursor: invalid Y %d", y); - return; - } - - grabCursor(vs->screenPtr + (y - vs->topline) * 320 + x, w, h); - -} - -void Scumm::decompressBomp(byte *dst, byte *src, int w, int h) -{ - int len, num; - byte code, color; - - src += 8; - - do { - len = w; - src += 2; - while (len) { - code = *src++; - num = (code >> 1) + 1; - if (num > len) - num = len; - len -= num; - if (code & 1) { - color = *src++; - do - *dst++ = color; - while (--num); - } else { - do - *dst++ = *src++; - while (--num); - } - } - } while (--h); -} - -void Scumm::grabCursor(byte *ptr, int width, int height) -{ - uint size; - byte *dst; - - size = width * height; - if (size > sizeof(_grabbedCursor)) - error("grabCursor: grabbed cursor too big"); - - _cursorWidth = width; - _cursorHeight = height; - _cursorAnimate = 0; - - dst = _grabbedCursor; - for (; height; height--) { - memcpy(dst, ptr, width); - dst += width; - ptr += 320; - } - - updateCursor(); -} - -void Scumm::useIm01Cursor(byte *im, int w, int h) -{ - VirtScreen *vs = &virtscr[0]; - - w <<= 3; - h <<= 3; - - drawBox(0, 0, w - 1, h - 1, 0xFF); - - vs->alloctwobuffers = false; - gdi._disable_zbuffer = true; - gdi.drawBitmap(im, vs, _screenStartStrip, 0, h, 0, w >> 3, 0); - vs->alloctwobuffers = true; - gdi._disable_zbuffer = false; - - grabCursor(vs->screenPtr + vs->xstart, w, h); - - blit(vs->screenPtr + vs->xstart, getResourceAddress(rtBuffer, 5) + vs->xstart, w, h); -} - -void Scumm::updateCursor() -{ - _system->set_mouse_cursor(_grabbedCursor, _cursorWidth, _cursorHeight, - _cursorHotspotX, _cursorHotspotY); -} - -void Scumm::animateCursor() -{ - if (_cursorAnimate) { - if (!(_cursorAnimateIndex & 0x3)) { - decompressDefaultCursor((_cursorAnimateIndex >> 2) & 3); - } - _cursorAnimateIndex++; - } - -} - -void Scumm::useBompCursor(byte *im, int width, int height) -{ - uint size; - - width <<= 3; - height <<= 3; - - size = width * height; - if (size > sizeof(_grabbedCursor)) - error("useBompCursor: cursor too big"); - - _cursorWidth = width; - _cursorHeight = height; - _cursorAnimate = 0; - - decompressBomp(_grabbedCursor, im + 10, width, height); - - updateCursor(); -} - -static const byte default_cursor_colors[4] = { - 15, 15, 7, 8 -}; - -void Scumm::decompressDefaultCursor(int idx) -{ - int i; - byte color; - - memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor)); - _cursorWidth = 16; - _cursorHeight = 16; - _cursorHotspotX = 8; - _cursorHotspotY = 8; - - color = default_cursor_colors[idx]; - - for (i = 0; i < 16; i++) { - if ((i < 7) || (i > 9)) { - _grabbedCursor[16 * 8 + i] = color; - _grabbedCursor[16 * i + 8] = color; - } - } - - updateCursor(); -} - - -int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) -{ - int i; - int ar, ag, ab; - uint sum, j, bestsum, bestitem = 0; - byte *pal = _currentPalette; - - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; - - bestsum = (uint) - 1; - - r &= ~3; - g &= ~3; - b &= ~3; - - for (i = 0; i < 256; i++, pal += 3) { - ar = pal[0] & ~3; - ag = pal[1] & ~3; - ab = pal[2] & ~3; - if (ar == r && ag == g && ab == b) - return i; - - j = ar - r; - sum = j * j * 3; - j = ag - g; - sum += j * j * 6; - j = ab - b; - sum += j * j * 2; - - if (sum < bestsum) { - bestsum = sum; - bestitem = i; - } - } - - if (threshold != (uint) - 1 && bestsum > threshold * threshold * (2 + 3 + 6)) { - pal = _currentPalette + (256 - 2) * 3; - for (i = 254; i > 48; i--, pal -= 3) { - if (pal[0] >= 252 && pal[1] >= 252 && pal[2] >= 252) { - setPalColor(i, r, g, b); - return i; - } - } - } - - return bestitem; -} - - -// param3= clipping - -// param2= mirror - -// param1= never used ? -void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, int param3) -{ - byte *dest = bd->out + bd->y * bd->outwidth, *src; - int h = bd->srcheight; - bool inside; - - if (h == 0 || bd->srcwidth == 0) - return; - - inside = (bd->x >= 0) && (bd->y >= 0) && - (bd->x <= bd->outwidth - bd->srcwidth) && (bd->y <= bd->outheight - bd->srcheight); - - if (1 || bd->scale_x == 255 && bd->scale_y == 255) { - /* Routine used when no scaling is needed */ - if (inside) { - dest += bd->x; - src = bd->dataptr; - do { - byte code, color; - uint len = bd->srcwidth, num, i; - byte *d = dest; - src += 2; - do { - code = *src++; - num = (code >> 1) + 1; - if (num > len) - num = len; - len -= num; - if (code & 1) { - color = *src++; - if (color != 255) { - do - *d++ = color; - while (--num); - } else { - d += num; - } - } else { - for (i = 0; i < num; i++) - if ((color = src[i]) != 255) - d[i] = color; - d += num; - src += num; - } - } while (len); - dest += bd->outwidth; - } while (--h); - } else { - uint y = bd->y; - src = bd->dataptr; - - do { - byte color; - uint len, num; - uint x; - if ((uint) y >= (uint) bd->outheight) { - src += READ_LE_UINT16(src) + 2; - continue; - } - len = bd->srcwidth; - x = bd->x; - - src += 2; - do { - byte code = *src++; - num = (code >> 1) + 1; - if (num > len) - num = len; - len -= num; - if (code & 1) { - if ((color = *src++) != 255) { - do { - if ((uint) x < (uint) bd->outwidth) - dest[x] = color; - } while (++x, --num); - } else { - x += num; - } - } else { - do { - if ((color = *src++) != 255 && (uint) x < (uint) bd->outwidth) - dest[x] = color; - } while (++x, --num); - } - } while (len); - } while (dest += bd->outwidth, y++, --h); - } - } else { - /* scaling of bomp images not supported yet */ - } - - CHECK_HEAP; -} - - -/* Yazoo: This function create the specialPalette used for semi-transparency in SamnMax */ - - -void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, - int16 colorMax) -{ - byte *palPtr; - byte *curPtr; - byte *searchPtr; - - byte readComp1; - byte readComp2; - byte readComp3; - - int colorComp1; - int colorComp2; - int colorComp3; - - int searchComp1; - int searchComp2; - int searchComp3; - - short int bestResult; - short int currentResult; - - byte currentIndex; - - int i; - int j; - - palPtr = getPalettePtr(); - - for (i = 0; i < 256; i++) - _proc_special_palette[i] = i; - - curPtr = palPtr + colorMin * 3; - - for (i = colorMin; i < colorMax; i++) { - readComp1 = *(curPtr++); - readComp2 = *(curPtr++); - readComp3 = *(curPtr++); - - colorComp1 = ((readComp1) * c) >> 8; - colorComp2 = ((readComp2) * d) >> 8; - colorComp3 = ((readComp3) * e) >> 8; - - searchPtr = palPtr; - bestResult = 32000; - currentIndex = 0; - - for (j = a; j < b; j++) { - searchComp1 = (*searchPtr++); - searchComp2 = (*searchPtr++); - searchComp3 = (*searchPtr++); - - currentResult = - abs(searchComp1 - colorComp1) + abs(searchComp2 - colorComp2) + abs(searchComp3 - colorComp3); - - if (currentResult < bestResult) { - _proc_special_palette[i] = currentIndex; - bestResult = currentResult; - } - currentIndex++; - } - } -} - diff --git a/gfx.h b/gfx.h deleted file mode 100644 index bc858536a4..0000000000 --- a/gfx.h +++ /dev/null @@ -1,193 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef GFX_H -#define GFX_H - -enum { - NUM_STRIPS = 40 -}; - -enum VideoMode { /* Video scalers */ - VIDEO_SCALE = 0, - VIDEO_2XSAI = 1, - VIDEO_SUPERSAI = 2, - VIDEO_SUPEREAGLE = 3 -}; - -enum { /* Camera modes */ - CM_NORMAL = 1, - CM_FOLLOW_ACTOR = 2, - CM_PANNING = 3 -}; - -struct CameraData { /* Camera state data */ - ScummPoint _cur; - ScummPoint _dest; - ScummPoint _accel; - ScummPoint _last; - int _leftTrigger, _rightTrigger; - byte _follows, _mode; - bool _movingToActor; -}; - - -struct VirtScreen { /* Virtual screen areas */ - int number; - uint16 unk1; - uint16 topline; - uint16 width, height; - uint16 size; - byte alloctwobuffers; - byte scrollable; - uint16 xstart; - uint16 tdirty[40]; - uint16 bdirty[40]; - byte *screenPtr; - byte *backBuf; -}; - -struct MouseCursor { /* Mouse cursor */ - int8 hotspot_x, hotspot_y; - byte colors[4]; - byte data[32]; -}; - -struct ColorCycle { /* Palette cycles */ - uint16 delay; - uint16 counter; - uint16 flags; - byte start; - byte end; -}; - -struct BlastObject { /* BlastObjects to draw */ - uint16 number, areaX, areaY, areaWidth, areaHeight; - int16 posX, posY; - uint16 width, height; - uint16 unk3, unk4, image; - - uint16 mode; -}; - -#if !defined(__GNUC__) - #pragma START_PACK_STRUCTS -#endif - -struct BompHeader { /* Bomp header */ - uint16 unk; - uint16 width, height; -} GCC_PACK; - -#if !defined(__GNUC__) - #pragma END_PACK_STRUCTS -#endif - -struct BompDrawData { /* Bomp graphics data */ - byte *out; - int outwidth, outheight; - int x, y; - byte scale_x, scale_y; - byte *dataptr; - int srcwidth, srcheight; -}; - -struct Gdi { - Scumm *_vm; - - byte *_readPtr; - uint _readOffs; - - int _numZBuffer; - int _imgBufOffs[4]; - byte _disable_zbuffer; - - bool _useOrDecompress; - int _numLinesToProcess; - int _tempNumLines; - byte _currentX; - byte _hotspot_x; - byte _hotspot_y; - byte _cursorActive; - - int16 _drawMouseX; - int16 _drawMouseY; - int16 _mask_top, _mask_bottom, _mask_right, _mask_left; - byte _currentCursor; - byte _mouseColors[4]; - byte _mouseColor; - byte _mouseClipMask1, _mouseClipMask2, _mouseClipMask3; - byte _mouseColorIndex; - byte *_mouseMaskPtr; - byte *_smap_ptr; - byte *_backbuff_ptr; - byte *_bgbak_ptr; - byte *_mask_ptr; - byte *_mask_ptr_dest; - byte *_z_plane_ptr; - - byte _palette_mod; - byte _decomp_shr, _decomp_mask; - byte _transparency; - uint32 _vertStripNextInc; - byte *_backupIsWhere; - - /* Bitmap decompressors */ - void decompressBitmap(); - void unkDecode1(); - void unkDecode2(); - void unkDecode3(); - void unkDecode4(); - void unkDecode5(); - void unkDecode6(); - void unkDecode7(); - void unkDecode8(); - void unkDecode9(); - void unkDecode10(); - void unkDecode11(); - - void drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, int stripnr, int numstrip, byte flag); - void clearUpperMask(); - - void disableZBuffer() { _disable_zbuffer++; } - void enableZBuffer() { _disable_zbuffer--; } - - void draw8ColWithMasking(); - void clear8ColWithMasking(); - void clear8Col(); - void decompressMaskImgOr(); - void decompressMaskImg(); - - void resetBackground(int top, int bottom, int strip); - void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b); - void updateDirtyScreen(VirtScreen *vs); - - enum DrawBitmapFlags { - dbAllowMaskOr = 1, - dbDrawMaskOnBoth = 2, - dbClear = 4 - }; -}; - -void blit(byte *dst, byte *src, int w, int h); - -#endif diff --git a/gui.cpp b/gui.cpp deleted file mode 100644 index d80c6948c8..0000000000 --- a/gui.cpp +++ /dev/null @@ -1,1252 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" -#include "sound/mididrv.h" -#include "sound/imuse.h" -#include "gui.h" -#include "guimaps.h" -#include "config-file.h" - -#include - -#define hline(x, y, x2, color) line(x, y, x2, y, color); -#define vline(x, y, y2, color) line(x, y, x, y2, color); - -#ifdef _WIN32_WCE -// Additional variables for WinCE specific GUI -#include "gapi_keys.h" -extern bool toolbar_drawn; -extern bool hide_toolbar; -extern bool draw_keyboard; -extern bool get_key_mapping; -extern struct keyops keyMapping; -extern void save_key_mapping(void); -extern void do_hide(bool); -extern void do_quit(); -uint16 _key_mapping_required; -uint16 _current_page; -bool keyboard_override; -bool save_hide_toolbar; -#else -#define save_key_mapping() ; -bool get_key_mapping; -uint16 _key_mapping_required; -#endif - -enum { - GUI_NONE = 0, - GUI_RESTEXT = 1, - GUI_IMAGE = 2, - GUI_STAT = 3, - GUI_CUSTOMTEXT = 4, - GUI_VARTEXT = 5, - GUI_ACTIONTEXT = 6, - GUI_KEYTEXT = 7, - GUI_SCROLLTEXT = 8, - GUI_NEXTTEXT = 9, - GUI_UPDOWNARROW = 10, - GUI_CHECKBOX = 11 -}; - -enum { - GWF_BORDER = 1, - GWF_CLEARBG = 2, - GWF_PARENT = 4, - GWF_DELAY = 8, - GWF_DEFAULT = GWF_BORDER | GWF_CLEARBG, - GWF_BUTTON = GWF_BORDER | GWF_CLEARBG | GWF_DELAY -}; - -struct GuiWidget { - byte _type; - byte _page; - byte _flags; - int16 _x, _y; - uint16 _w, _h; - uint16 _id; - byte _string_number; - uint8 _hotkey; -}; - -enum { - SAVELOAD_DIALOG, - PAUSE_DIALOG, - SOUND_DIALOG, - KEYS_DIALOG, - OPTIONS_DIALOG, - ABOUT_DIALOG, - LAUNCHER_DIALOG, - MISC_DIALOG -}; - - -#define IMG_SIZE 8 - -// Triangles pointing up-/downwards, used for save/load dialog -static uint32 up_arrow[IMG_SIZE] = { - 0x00011000, - 0x00011000, - 0x00100100, - 0x00100100, - 0x01000010, - 0x01000010, - 0x10000001, - 0x10000001, -}; - -static uint32 down_arrow[IMG_SIZE] = { - 0x10000001, - 0x10000001, - 0x01000010, - 0x01000010, - 0x00100100, - 0x00100100, - 0x00011000, - 0x00011000, -}; - -static uint32 checked_img[IMG_SIZE] = { - 0x00000000, - 0x01000010, - 0x00100100, - 0x00011000, - 0x00011000, - 0x00100100, - 0x01000010, - 0x00000000, -}; - -const GuiWidget launcher_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT, 0, 0, 320, 200, 0, 0}, - {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 5, 180, 45, 15, 20, 12}, - {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 130, 180, 65, 15, 21, 17}, - {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 265, 180, 50, 15, 22, 7}, - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget keys_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 10, 260, 130, 0, 0}, - - // First action - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10, 15, 15, 10, 3}, // CUSTOMTEXT_PLUS - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10, 15, 15, 11, 4}, // CUSTOMTEXT_MINUS - {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 11 + 33 + 10, 10 + 10, 100, 15, 100, 1}, - {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 3, 100, 15, 1, 1}, - - //Second action - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5, 15, 15, 20, 3}, // CUSTOMTEXT_PLUS - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5, 15, 15, 21, 4}, // CUSTOMTEXT_MINUS - {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5, 100, 15, 101, 2}, - {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 3, 100, 15, 2, 2}, - - //Third action - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5, 15, 15, 30, 3}, // CUSTOMTEXT_PLUS - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5, 15, 15, 31, 4}, // CUSTOMTEXT_MINUS - {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5, 100, 15, 102, 3}, - {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 3, 100, 15, 3, 3}, - - //Fourth action - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, 40, 3}, - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, 41, 4}, - {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 100, 15, - 103, 4}, - {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 3, 100, 15, 4, 4}, - - //Fifth action - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, - 50, 3}, - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, - 51, 4}, - {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, - 100, 15, 104, 5}, - {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5 + 3, 100, - 15, 5, 5}, - - //OK - {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 60, 10 + 106, 54, 16, 60, 9}, - //Previous-Next - {GUI_NEXTTEXT, 0x01, GWF_BUTTON, 30 + 120, 10 + 106, 54, 16, 61, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget about_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 10, 260, 134, 0, 0}, - {GUI_CUSTOMTEXT, 0x01, 0, 30 + 68, 10 + 20, 160, 15, 0, 9}, // Build - {GUI_CUSTOMTEXT, 0x01, 0, 30 + 10, 10 + 35, 240, 15, 0, 10}, // ScummVM Url - {GUI_CUSTOMTEXT, 0x01, 0, 30 + 75, 10 + 65, 150, 15, 0, 11}, // Lucasarts - {GUI_CUSTOMTEXT, 0x01, 0, 30 + 110, 10 + 80, 40, 15, 0, 21}, // Except: - {GUI_CUSTOMTEXT, 0x01, 0, 30 + 25, 10 + 95, 210, 15, 0, 22}, // Adventuresoft - {GUI_SCROLLTEXT, 0x01, 0, 30 + 95, 10 + 10, 100, 15, 0}, - {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 100, 10 + 112, 54, 16, 40, 9}, - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget options_dialog[] = { - // Only display the "Keys" options for WinCE -#ifdef _WIN32_WCE - {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 60, 0, 0}, - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10, 40, 15, 1, 5, 'S'}, // Sound - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30, 80 + 10, 40, 15, 2, 6, 'K'}, // Keys - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30 + 40 + 30, 80 + 10, 40, 15, 3, 7, 'A'}, // About - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10 + 15 + 10, 40, 15, 4, 18, 'M'}, // Misc - {0, 0, 0, 0, 0, 0, 0, 0, 0} -#else - {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 40, 0, 0}, - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10, 40, 15, 1, 5, 'S'}, // Sound - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30, 80 + 10, 40, 15, 3, 7, 'A'}, // About - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30 + 40 + 30, 80 + 10, 40, 15, 4, 18, 'M'}, // Misc - {0, 0, 0, 0, 0, 0, 0, 0, 0} -#endif -}; - -const GuiWidget misc_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 65, 0, 0}, - {GUI_CHECKBOX, 0x01, GWF_DEFAULT, 50 + 10, 80 + 6, 14, 14, 1, 0, 'S'}, // checkbox for subtitles - {GUI_CUSTOMTEXT, 0x01, 0, 50 + 10 + 20, 80 + 10, 140, 15, 0, 19}, // "Show speech subtitles" - {GUI_CHECKBOX, 0x01, GWF_DEFAULT, 50 + 10, 80 + 6 + 16, 14, 14, 5, 0, 'A'}, // checkbox for amiga pallete - {GUI_CUSTOMTEXT, 0x01, 0, 50 + 10 + 20, 80 + 10 + 15, 140, 15, 0, 20}, // "Amiga pallete conversion" - {GUI_RESTEXT, 0x01, GWF_BUTTON, 50 + 10 + 20, 80 + 10 + 15 + 20, 54, 16, 3, 9, 13}, // ok - {GUI_RESTEXT, 0x01, GWF_BUTTON, 50 + 10 + 20 + 80, 80 + 10 + 15 + 20, 54, 16, 4, 7}, // cancel - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget sound_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 20, 260, 120, 0, 0}, - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 11, 15, 15, 1, 3}, // Plus - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 11, 15, 15, 2, 4}, // Minus - {GUI_VARTEXT, 0x01, GWF_DEFAULT, 30 + 73, 20 + 11, 128, 15, 3, 0}, // Master - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 25 + 11, 15, 15, 11, 3}, // Plus - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 25 + 11, 15, 15, 12, 4}, // Minus - {GUI_VARTEXT, 0x01, GWF_BUTTON, 30 + 73, 20 + 25 + 11, 128, 15, 13, 1}, // Music - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 25 + 25 + 11, 15, 15, 21, 3}, // Plus - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 25 + 25 + 11, 15, 15, 22, 4}, // Minus - {GUI_VARTEXT, 0x01, GWF_BUTTON, 30 + 73, 20 + 25 + 25 + 11, 128, 15, 23, 2}, // SFX - {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + (260 / 2) - 80, 20 + 25 + 25 + 11 + 25, 54, 16, 40, 9, 13}, /* OK */ - {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + (260 / 2), 20 + 25 + 25 + 11 + 25, 54, 16, 50, 7}, /* Cancel */ - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget save_load_dialog[] = { - {GUI_STAT, 0xFF, GWF_DEFAULT | GWF_PARENT, 30, 20, 260, 124, 0, 0}, - {GUI_RESTEXT, 0x01, 0, 10, 7, 240, 16, 0, 1}, /* How may I serve you? */ - {GUI_RESTEXT, 0x02, 0, 10, 7, 240, 16, 0, 2}, /* Select a game to LOAD */ - {GUI_RESTEXT, 0x04, 0, 10, 7, 240, 16, 0, 3}, /* Name your SAVE game */ - - {GUI_STAT, 0xFF, GWF_DEFAULT, 6, 20, 170, 96, 0, 0}, - {GUI_UPDOWNARROW, 0x01, GWF_BUTTON, 180, 24, 16, 40, 0, 0}, /* Up (dummy) */ - {GUI_UPDOWNARROW, 0x01, GWF_BUTTON, 180, 72, 16, 40, 0, 1}, /* Down (dummy) */ - {GUI_UPDOWNARROW, 0xFE, GWF_BUTTON, 180, 24, 16, 40, 1, 0}, /* Up */ - {GUI_UPDOWNARROW, 0xFE, GWF_BUTTON, 180, 72, 16, 40, 2, 1}, /* Down */ - - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 24, 160, 10, 20, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 34, 160, 10, 21, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 44, 160, 10, 22, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 54, 160, 10, 23, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 64, 160, 10, 24, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 74, 160, 10, 25, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 84, 160, 10, 26, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 94, 160, 10, 27, 0}, - {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 104, 160, 10, 28, 0}, - - {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 20, 54, 16, 3, 4, 'S'}, /* Save */ - {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 40, 54, 16, 4, 5, 'L'}, /* Load */ - {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 60, 54, 16, 5, 6, 'P'}, /* Play */ - {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 200, 80, 54, 16, 9, 17, 'O'}, /* Options */ - {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 100, 54, 16, 6, 8, 'Q'}, /* Quit */ - - {GUI_RESTEXT, 0x02, GWF_BUTTON, 200, 60, 54, 16, 7, 7}, /* Cancel */ - - {GUI_RESTEXT, 0x04, GWF_BUTTON, 200, 40, 54, 16, 8, 9}, /* Ok */ - {GUI_RESTEXT, 0x04, GWF_BUTTON, 200, 60, 54, 16, 7, 7}, /* Cancel */ - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -const GuiWidget pause_dialog[] = { - {GUI_RESTEXT, 0x01, GWF_DEFAULT, 50, 80, 220, 16, 0, 10}, - {0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - - -void Gui::draw(int start, int end) -{ - int i; - - if (end == -1) - end = start; - - for (i = 0; i < (int)(sizeof(_widgets) / sizeof(_widgets[0])); i++) { - const GuiWidget *w = _widgets[i]; - if (w) { - _parentX = 0; - _parentY = 0; - while (w->_type != GUI_NONE) { - if (w->_id >= start && w->_id <= end && (w->_page & (1 << _cur_page))) { - drawWidget(w); - } - if (w->_flags & GWF_PARENT) { - _parentX += w->_x; - _parentY += w->_y; - } - w++; - } - } - } -} - -const GuiWidget *Gui::widgetFromPos(int x, int y) -{ - int i; - - for (i = sizeof(_widgets) / sizeof(_widgets[0]) - 1; i >= 0; i--) { - const GuiWidget *w = _widgets[i]; - if (w) { - while (w->_type != GUI_NONE) { - if ((w->_page & (1 << _cur_page)) && w->_id && - (uint16)(x - w->_x) < w->_w && (uint16)(y - w->_y) < w->_h) - return w; - if (w->_flags & GWF_PARENT) { - x -= w->_x; - y -= w->_y; - } - w++; - } - } - } - return NULL; -} - -void Gui::drawChar(const char str, int xx, int yy) -{ - unsigned int buffer = 0, mask = 0, x, y; - byte *tmp; - int tempc = _color; - _color = _textcolor; - - tmp = &guifont[0]; - tmp += 224 + (str + 1) * 8; - - byte *ptr = getBasePtr(xx, yy); - if (ptr == NULL) - return; - - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) { - unsigned char color; - if ((mask >>= 1) == 0) { - buffer = *tmp++; - mask = 0x80; - } - color = ((buffer & mask) != 0); - if (color) - ptr[x] = _color; - } - ptr += 320; - } - _color = tempc; - -} -void Gui::drawString(const char *str, int x, int y, int w, byte color, bool center) -{ - StringTab *st = &_s->string[5]; - st->charset = 1; - st->center = center; - st->color = color; - st->xpos = x; - st->ypos = y; - st->right = x + w; - - if (_s->_gameId) { /* If a game is active.. */ - _s->_messagePtr = (byte *)str; - _s->drawString(5); - } else { - for (uint letter = 0; letter < strlen(str); letter++) - drawChar(str[letter], st->xpos + (letter * 8), st->ypos); - } -} - -void Gui::drawWidget(const GuiWidget *w) -{ - const char *s; - int x, y; - - x = w->_x; - y = w->_y; - - if (w->_flags & GWF_CLEARBG) - widgetClear(w); - - if (w->_flags & GWF_BORDER) { - widgetBorder(w); - x += 4; - y += 4; - } - - switch (w->_type) { - case GUI_CUSTOMTEXT: - case GUI_VARTEXT: - case GUI_KEYTEXT: - case GUI_ACTIONTEXT: - case GUI_RESTEXT: - case GUI_NEXTTEXT: - { - char text[500]; - text[0] = '\0'; - - switch (w->_type) { - case GUI_CUSTOMTEXT: - strcpy(text, string_map_table_custom[w->_string_number]); - break; - case GUI_RESTEXT: - s = queryString(w->_string_number, w->_id); - if (s) - strcpy(text, s); - break; - case GUI_VARTEXT: - sprintf(text, "%s %d", string_map_table_custom[w->_string_number], - _gui_variables[w->_string_number]); - break; - case GUI_SCROLLTEXT: - sprintf(text, "%s", _gui_scroller); - break; -#ifdef _WIN32_WCE - case GUI_KEYTEXT: - strcpy(text, getGAPIKeyName(getAction((_current_page * 5) + w->_string_number - 1)->action_key)); - break; - case GUI_ACTIONTEXT: - strcpy(text, getActionName(getAction((_current_page * 5) + w->_string_number - 1)->action_type)); - break; - case GUI_NEXTTEXT: - if (_current_page == 0) - strcpy(text, "Next"); - else - strcpy(text, "Prev"); - break; - -#endif - } - - if (*text) { - drawString(text, x + _parentX, y + _parentY, w->_w, - (_clickWidget && _clickWidget == w->_id) ? _textcolorhi : _textcolor, false); - } - break; - } - case GUI_IMAGE: - break; - case GUI_UPDOWNARROW: - case GUI_CHECKBOX: - { - uint32 *data; - byte color = (_clickWidget && _clickWidget == w->_id) ? _textcolorhi : _textcolor; - - if (w->_type == GUI_UPDOWNARROW) { - if (w->_string_number == 0) - data = up_arrow; - else - data = down_arrow; - // if not an updownarrow, it must be a checkbox - } else { - data = checked_img; - } - - // Center the image - x += w->_w / 2 - IMG_SIZE / 2; - y += w->_h / 2 - IMG_SIZE / 2; - if (w->_flags & GWF_BORDER) { - x -= 4; - y -= 4; - } - - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - // If the checkbox is checked, or this is not a checkbox, draw the image - if ((getCheckboxChecked(w->_id) == true) || (w->_type != GUI_CHECKBOX)) { - for (int y2 = 0; y2 < IMG_SIZE; y2++) { - uint32 mask = 0xF0000000; - for (int x2 = 0; x2 < IMG_SIZE; x2++) { - if (data[y2] & mask) - ptr[x2] = color; - mask >>= 4; - } - ptr += 320; - } - } - } - break; - } -} - -void Gui::widgetClear(const GuiWidget *wid) -{ - int x = wid->_x; - int y = wid->_y; - int w = wid->_w; - int h = wid->_h; - int i; - - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - _s->setVirtscreenDirty(_vs, x + _parentX, y + _parentY, x + _parentX + w, y + _parentY + h); - - if (wid->_flags & GWF_BORDER) { - // Inset by 1 pixel in all directions - ptr += 320 + 1; - w -= 2; - h -= 2; - } - - while (h--) { - for (i = 0; i < w; i++) - ptr[i] = _bgcolor; - ptr += 320; - } -} - -void Gui::widgetBorder(const GuiWidget *w) -{ - box(w->_x, w->_y, w->_w, w->_h); -} - -void Gui::box(int x, int y, int width, int height) -{ - hline(x + 1, y, x + width - 2, _color); - hline(x, y + 1, x + width - 1, _color); - vline(x, y + 1, y + height - 2, _color); - vline(x + 1, y, y + height - 1, _color); - - hline(x + 1, y + height - 2, x + width - 1, _shadowcolor); - hline(x + 1, y + height - 1, x + width - 2, _shadowcolor); - vline(x + width - 1, y + 1, y + height - 2, _shadowcolor); - vline(x + width - 2, y + 1, y + height - 1, _shadowcolor); -} - -byte *Gui::getBasePtr(int x, int y) -{ - x += _parentX; - y += _parentY; - _vs = _s->findVirtScreen(y); - - if (_vs == NULL) - return NULL; - - return _vs->screenPtr + x + (y - _vs->topline) * 320 + - _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; -} - -void Gui::line(int x, int y, int x2, int y2, byte color) -{ - byte *ptr; - - if (x2 < x) - x2 ^= x ^= x2 ^= x; // Swap x2 and x - - if (y2 < y) - y2 ^= y ^= y2 ^= y; // Swap y2 and y - - ptr = getBasePtr(x, y); - - if (ptr == NULL) - return; - - if (x == x2) { - /* vertical line */ - while (y++ <= y2) { - *ptr = color; - ptr += 320; - } - } else if (y == y2) { - /* horizontal line */ - while (x++ <= x2) { - *ptr++ = color; - } - } -} - -void Gui::leftMouseClick(int x, int y) -{ - const GuiWidget *w = widgetFromPos(x, y); - int old; - - _clickTimer = 0; - - old = _clickWidget; - _clickWidget = w ? w->_id : 0; - - if (old) - draw(old); - if (_clickWidget) { - draw(_clickWidget); - if (w->_flags & GWF_DELAY) - _clickTimer = 5; - else - handleCommand(_clickWidget); - } - - if (_dialog == PAUSE_DIALOG) - close(); -} - -void Gui::handleSoundDialogCommand(int cmd) -{ - if (cmd == 50) { - close(); - } else if (cmd == 40) { - _s->_sound->_sound_volume_master = _gui_variables[0]; // Master - _s->_sound->_sound_volume_music = _gui_variables[1]; // Music - _s->_sound->_sound_volume_sfx = _gui_variables[2]; // SFX - - _s->_imuse->set_music_volume(_s->_sound->_sound_volume_music); - _s->_imuse->set_master_volume(_s->_sound->_sound_volume_master); - _s->_mixer->set_volume(_s->_sound->_sound_volume_sfx); - _s->_mixer->set_music_volume(_s->_sound->_sound_volume_music); - - scummcfg->set("master_volume", _s->_sound->_sound_volume_master); - scummcfg->set("music_volume", _s->_sound->_sound_volume_music); - scummcfg->set("sfx_volume", _s->_sound->_sound_volume_sfx); - scummcfg->flush(); - - close(); - } else { - if ((cmd % 10) == 1) { - _gui_variables[cmd / 10] += 5; - if (_gui_variables[cmd / 10] > 256) - _gui_variables[cmd / 10] = 256; - } else { - _gui_variables[cmd / 10] -= 5; - if (_gui_variables[cmd / 10] < 0) - _gui_variables[cmd / 10] = 0; - } - - draw((cmd / 10) * 10 + 3, (cmd / 10) * 10 + 3); - } -} - -void Gui::handleOptionsDialogCommand(int cmd) -{ - switch (cmd) { - case 1: - _widgets[0] = sound_dialog; - _gui_variables[0] = _s->_sound->_sound_volume_master; - _gui_variables[1] = _s->_sound->_sound_volume_music; - _gui_variables[2] = _s->_sound->_sound_volume_sfx; - _active = true; - _cur_page = 0; - _dialog = SOUND_DIALOG; - draw(0, 100); - return; - case 2: - _key_mapping_required = 0; - get_key_mapping = true; - _widgets[0] = keys_dialog; - _active = true; - _cur_page = 0; - _dialog = KEYS_DIALOG; - draw(0, 200); - return; - case 3: - _widgets[0] = about_dialog; - _active = true; - _cur_page = 0; - _return_to = 0; - _dialog = ABOUT_DIALOG; - draw(0, 100); - return; - case 4: - _widgets[0] = misc_dialog; - _active = true; - _cur_page = 0; - _return_to = 0; - _dialog = MISC_DIALOG; - clearCheckboxes(); - setCheckbox(!(_s->_noSubtitles), 1); - if (_s->_features & GF_AMIGA) - setCheckbox(true, 5); - else - setCheckbox(false, 5); - draw(0, 100); - return; - } -} - -void Gui::handleMiscDialogCommand(int cmd) -{ - switch (cmd) { - case 1: - if ((getCheckboxChecked(1)) == true) - setCheckbox(false, 1); - else - setCheckbox(true, 1); - draw(1, 1); - return; - case 5: - if (getCheckboxChecked(5) == true) - setCheckbox(false, 5); - else - setCheckbox(true, 5); - draw(5, 5); - return; - case 3: - case 4: - // OK button - perform the actions of the checkboxes - if (cmd == 3) { - // The opposite of the checkbox(1) is set because the internal variable is 'no subtitles' but - // a "Show subtitles" option makes more usability sense - _s->_noSubtitles = (!getCheckboxChecked(1)); - - // Amiga pallete conversion checkbox - if (getCheckboxChecked(5)) - _s->_features = _s->_features | GF_AMIGA; - else - _s->_features = _s->_features & ~GF_AMIGA; - _s->_fullRedraw = true; - } - close(); - } -} - -void Gui::handleKeysDialogCommand(int cmd) -{ -#ifdef _WIN32_WCE - if (cmd < 100 && cmd != 60 && cmd != 61) { - - if ((cmd % 10) == 1) - setNextType((_current_page * 5) + (cmd / 10) - 1); - else - setPreviousType((_current_page * 5) + (cmd / 10) - 1); - - draw(0, 200); - - return; - } - - if (cmd >= 100) - _key_mapping_required = cmd; - - if (cmd == 60) { - get_key_mapping = false; - save_key_mapping(); - close(); - } - - if (cmd == 61) { - if (!_current_page) - _current_page = 1; - else - _current_page = 0; - draw(0, 200); - return; - } -#else - close(); -#endif -} - -void Gui::handleLauncherDialogCommand(int cmd) -{ - debug(9, "handle launcher command\n"); - switch (cmd) { - case 20: - close(); - break; - case 21: - // Nothing yet - break; - case 22: - _widgets[0] = about_dialog; - _active = true; - _cur_page = 0; - _return_to = LAUNCHER_DIALOG; - _dialog = ABOUT_DIALOG; - draw(0, 100); - debug(9, "about dialog\n"); - break; - default: - debug(9, "default\n"); - close(); - } -} - -void Gui::handleCommand(int cmd) -{ - int lastEdit = _editString; - showCaret(false); - - switch (_dialog) { - case LAUNCHER_DIALOG: - handleLauncherDialogCommand(cmd); - return; - case SOUND_DIALOG: - handleSoundDialogCommand(cmd); - return; - case OPTIONS_DIALOG: - handleOptionsDialogCommand(cmd); - return; - case MISC_DIALOG: - handleMiscDialogCommand(cmd); - return; - case KEYS_DIALOG: - handleKeysDialogCommand(cmd); - return; - case ABOUT_DIALOG: - if (_return_to == LAUNCHER_DIALOG) { - _widgets[0] = launcher_dialog; - _active = true; - _cur_page = 0; - _dialog = LAUNCHER_DIALOG; - draw(0, 100); - } else - close(); - return; - } - - // If we get here, it's the SAVELOAD_DIALOG - - switch (cmd) { - case 1: /* up button */ - if (_slotIndex - 9 < 0) - return; - getSavegameNames(_slotIndex - 9); - draw(20, 28); - return; - case 2: /* down button */ - if (_slotIndex + 9 > 80) - return; - getSavegameNames(_slotIndex + 9); - draw(20, 28); - return; - case 3: /* save button */ - _cur_page = 2; - getSavegameNames(1); /* Start at 1, since slot 0 is reserved for autosave */ - draw(0, 100); - return; - case 4: /* load button */ - _cur_page = 1; - getSavegameNames(0); - draw(0, 100); - return; - case 5: /* play button */ - close(); - return; - case 6: /* quit button */ -#ifdef _WIN32_WCE - do_quit(); -#endif - exit(1); - return; - case 7: /* cancel button */ - _cur_page = 0; - draw(0, 100); - return; - case 8: /* ok button (save game) */ - if (lastEdit == -1 || game_names[lastEdit][0] == 0) - return; - - _s->_saveLoadSlot = lastEdit + _slotIndex; - _s->_saveLoadCompatible = false; - _s->_saveLoadFlag = 1; - memcpy(_s->_saveLoadName, game_names[lastEdit], sizeof(_s->_saveLoadName)); - close(); - return; - case 9: /* options button */ - options(); - draw(0, 100); - return; - default: - if (cmd >= 20 && cmd <= 28) { - if (_cur_page == 1) { - if (valid_games[cmd - 20]) { - _s->_saveLoadSlot = cmd - 20 + _slotIndex; - _s->_saveLoadCompatible = false; - _s->_saveLoadFlag = 2; - close(); - } - return; - } else if (_cur_page == 2) { - _clickWidget = cmd; - editString(cmd - 20); - } - } - } - -} - -void Gui::getSavegameNames(int start) -{ - int i; - _slotIndex = start; - - for (i = 0; i < 9; i++) { - valid_games[i] = _s->getSavegameName(start + i, game_names[i]); - } -} - -const char *Gui::queryString(int stringno, int id) -{ - static char namebuf[64]; - char *result; - int string; - - if (id >= 20 && id <= 28) { - // Save game names - sprintf(namebuf, "%2d. %s", id - 20 + _slotIndex, game_names[id - 20]); - return namebuf; - } - - if (stringno == 0) - return NULL; - - if (_s->_features & GF_AFTER_V7) - string = _s->_vars[string_map_table_v7[stringno - 1].num]; - else if (_s->_features & GF_AFTER_V6) - string = _s->_vars[string_map_table_v6[stringno - 1].num]; - else - string = string_map_table_v5[stringno - 1].num; - - result = (char *)_s->getStringAddress(string); - - if (!result) { // Gracelessly degrade to english :) - if (_s->_features & GF_AFTER_V6) - return string_map_table_v6[stringno - 1].string; - else - return string_map_table_v5[stringno - 1].string; - } - - return result; -} - -void Gui::showCaret(bool show) -{ - int i; - char *s; - - if (_editString == -1) - return; - - i = _editLen; - s = game_names[_editString]; - - if (show) { - if (i < SAVEGAME_NAME_LEN - 1) { - s[i] = '_'; - s[i + 1] = 0; - } - } else { - s[i] = 0; - } - - draw(_editString + 20); - - if (!show) - _editString = -1; -} - -void Gui::editString(int i) -{ - char *s = game_names[i]; - if (!valid_games[i]) { - valid_games[i] = true; - *s = 0; - } - _editString = i; - _editLen = strlen(s); - showCaret(true); -} - -void Gui::addLetter(byte letter) -{ - switch (_dialog) { - case SAVELOAD_DIALOG: - if (_editString == -1) - return; - -/* - FIXME - this code here has no effect at all, since Scumm::convertKeysToClicks() - swallows all return key events. - // Return pressed? - if (letter == '\n' || letter == '\r') { - handleCommand(8); - return; - } -*/ - - if (letter >= 32 && letter < 128 && _editLen < SAVEGAME_NAME_LEN - 1) { - game_names[_editString][_editLen++] = letter; - } else if (letter == 8 && _editLen > 0) { - _editLen--; - } - showCaret(true); - break; - case PAUSE_DIALOG: - if (letter == 32) - close(); - break; - -#ifdef _WIN32_WCE - case KEYS_DIALOG: - clearActionKey(letter); - if (_key_mapping_required) - getAction((_current_page * 5) + _key_mapping_required - 100)->action_key = letter; - _key_mapping_required = 0; - draw(0, 200); - break; -#endif - } -} - -bool Gui::getCheckboxChecked(int id) -{ - return _cbox_checked[id]; -} - -void Gui::setCheckbox(bool state, int id) -{ - _cbox_checked[id] = state; -} - -void Gui::clearCheckboxes() -{ - for (int id = 0; id <= 100; id++) { - _cbox_checked[id] = false; - } -} - -void Gui::init(Scumm *s) -{ - /* Default GUI colors */ - _bgcolor = 0; - _color = 0; - _textcolor = 8; // 15 is nice - _textcolorhi = 15; - _shadowcolor = 0; - _s = s; - - strcpy(_gui_scroller, "Brought to you by:"); -} - -void Gui::loop() -{ - if (_active && !_inited) { - _inited = true; - draw(0, 200); // was 100 - _old_soundsPaused = _s->_sound->_soundsPaused; - _s->_sound->pauseSounds(true); - - // Backup old cursor - memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); - _old_cursorWidth = _s->_cursorWidth; - _old_cursorHeight = _s->_cursorHeight; - _old_cursorHotspotX = _s->_cursorHotspotX; - _old_cursorHotspotY = _s->_cursorHotspotY; - _old_cursor_mode = _s->_system->show_mouse(true); - - _s->_cursorAnimate++; - _s->gdi._cursorActive = 1; - } - _s->animateCursor(); - _s->getKeyInput(0); - if (_s->_mouseButStat & MBS_LEFT_CLICK) { - leftMouseClick(_s->mouse.x, _s->mouse.y); - } else if (_s->_lastKeyHit) { - if (_dialog != KEYS_DIALOG) { - if (_s->_lastKeyHit == 27) - close(); - else { - addLetter((unsigned char)_s->_lastKeyHit); - checkHotKey(_s->_lastKeyHit); - } -#ifdef _WIN32_WCE - } else if (_s->_lastKeyHit > 1000) { // GAPI - addLetter(_s->_lastKeyHit - 1000); -#endif - } - } - - if (_clickTimer && !--_clickTimer) { - int old = _clickWidget; - _clickWidget = 0; - draw(old); - handleCommand(old); - } - - _s->drawDirtyScreenParts(); - _s->_mouseButStat = 0; -} - -void Gui::close() -{ - _s->_fullRedraw = true; - _s->_completeScreenRedraw = true; - _s->_cursorAnimate--; - - // Restore old cursor - memcpy(_s->_grabbedCursor, _old_grabbedCursor, sizeof(_old_grabbedCursor)); - _s->_cursorWidth = _old_cursorWidth; - _s->_cursorHeight = _old_cursorHeight; - _s->_cursorHotspotX = _old_cursorHotspotX; - _s->_cursorHotspotY = _old_cursorHotspotY; - _s->updateCursor(); - - _s->_system->show_mouse(_old_cursor_mode); - - _s->_sound->pauseSounds(_old_soundsPaused); - _active = false; - _inited = false; - -#ifdef _WIN32_WCE - - // Option dialog can be accessed from the file dialog now, always check - if (save_hide_toolbar) { - do_hide(true); - save_hide_toolbar = false; - } - if (keyboard_override) { - keyboard_override = false; - draw_keyboard = false; - toolbar_drawn = false; - } -#endif -} - -void Gui::checkHotKey(int keycode) -{ - byte page; - for (int i = 0; i < (int)(sizeof(_widgets) / sizeof(_widgets[0])); i++) { - const GuiWidget *w = _widgets[i]; - if (w) { - while (w->_type != GUI_NONE) { - - // This rubbish is needed because the current page is 0 when really it should be 1 - if (_cur_page == 0) - page = 1; - else - page = _cur_page; - - // Only check for widgets that are on the current GUI page (otherwise save dialog problems occur) - if (w->_page == page) { - // Check the actual key pressed, and the uppercase version. For people who have caps lock on - if (keycode == w->_hotkey || toupper(keycode) == w->_hotkey) - handleCommand(w->_id); - } - w++; - } - } - } -} - -void Gui::saveLoadDialog() -{ - _widgets[0] = save_load_dialog; - _editString = -1; - _active = true; - _cur_page = 0; - _dialog = SAVELOAD_DIALOG; - -#ifdef _WIN32_WCE - save_hide_toolbar = hide_toolbar; - if (save_hide_toolbar) { - // Display the keyboard while the dialog is running - do_hide(false); - } - if (!draw_keyboard) { - keyboard_override = true; - draw_keyboard = true; - toolbar_drawn = false; - } -#endif - -} - -void Gui::pause() -{ - _widgets[0] = pause_dialog; - _active = true; - _cur_page = 0; - _dialog = PAUSE_DIALOG; -} - -void Gui::options() -{ -#ifdef _WIN32_WCE - _current_page = 0; -#endif - _widgets[0] = options_dialog; - _active = true; - _cur_page = 0; - _dialog = OPTIONS_DIALOG; -} - -void Gui::launcher() -{ - _widgets[0] = launcher_dialog; - _active = true; - _cur_page = 0; - _dialog = LAUNCHER_DIALOG; -} - - - - - - - - - - - - - - - - - - -/* -void Gui::loop() -{ - if (_active && !_inited) { - _inited = true; - _old_soundsPaused = _s->_soundsPaused; - _s->pauseSounds(true); - - // Backup old cursor - memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); - _old_cursorWidth = _s->_cursorWidth; - _old_cursorHeight = _s->_cursorHeight; - _old_cursorHotspotX = _s->_cursorHotspotX; - _old_cursorHotspotY = _s->_cursorHotspotY; - _old_cursor_mode = _s->_system->show_mouse(true); - - _s->_cursorAnimate++; - _s->gdi._cursorActive = 1; - } - _s->animateCursor(); - _s->getKeyInput(0); - - _s->drawDirtyScreenParts(); - _s->_mouseButStat = 0; -} -*/ diff --git a/gui.h b/gui.h deleted file mode 100644 index b7755cf226..0000000000 --- a/gui.h +++ /dev/null @@ -1,124 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef GUI_H -#define GUI_H - -// Forward declaration for GuiWidget -struct GuiWidget; - -#define SAVEGAME_NAME_LEN 32 - -class Gui { -public: - byte _color,_shadowcolor; - byte _bgcolor; - byte _textcolor; - byte _textcolorhi; - - // Init - void init(Scumm *s); - - // Dialogs - void saveLoadDialog(); - void pause(); - void options(); - void launcher(); - - void loop(); - - bool isActive() { return _active; } - -protected: - Scumm *_s; - const GuiWidget *_widgets[4]; - int _return_to; - VirtScreen *_vs; - int _parentX, _parentY; - bool _active; - bool _inited; - byte _clickTimer; - byte _cur_page; - byte _dialog; - int _clickWidget; - char *_queryMess; - bool _old_soundsPaused; - - // mouse cursor state - bool _old_cursor_mode; - int _old_cursorHotspotX, _old_cursorHotspotY, _old_cursorWidth, _old_cursorHeight; - byte _old_grabbedCursor[2048]; - - // optiondialog specifics - int _gui_variables[100]; - - // checkboxes - bool _cbox_checked[100]; - const char *_cbox_cfg_key[100]; - - // savedialog specifics - int _slotIndex; - int _editString; - int _editLen; - bool valid_games[9]; - char game_names[9][SAVEGAME_NAME_LEN]; - - // Drawing - void draw(int start, int end); - void draw(int item) { draw(item,-1); } - void drawWidget(const GuiWidget *w); - - void line(int x, int y, int x2, int y2, byte color); - void box(int x, int y, int width, int height); - - //void hline(int x, int y, int x2, byte color); - //void vline(int x, int y, int y2, byte color); - void drawChar(const char str, int xx, int yy); - void drawString(const char *str, int x, int y, int w, byte color, bool center); - void widgetClear(const GuiWidget *w); - void widgetBorder(const GuiWidget *w); - byte *getBasePtr(int x, int y); - const GuiWidget *widgetFromPos(int x, int y); - - // Actions - void leftMouseClick(int x, int y); - void handleCommand(int cmd); - void close(); - const char *queryString(int string, int id); - void getSavegameNames(int start); - void editString(int index); - void showCaret(bool show); - void addLetter(byte letter); - void queryMessage(const char *msg, const char *alts); - byte getDefaultColor(int color); - bool getCheckboxChecked(int id); - void setCheckbox(bool state, int id); - void clearCheckboxes(); - void checkHotKey(int keycode); - - char _gui_scroller[255]; - - void handleSoundDialogCommand(int cmd); - void handleOptionsDialogCommand(int cmd); - void handleKeysDialogCommand(int cmd); - void handleLauncherDialogCommand(int cmd); - void handleMiscDialogCommand(int cmd); -}; -#endif diff --git a/gui/dialog.cpp b/gui/dialog.cpp index ecc444b71d..71b55f8c80 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -28,7 +28,7 @@ #include "ListWidget.h" #include "config-file.h" #include "sound/mididrv.h" -#include "sound/imuse.h" +#include "scumm/imuse.h" /* * TODO list @@ -407,11 +407,29 @@ AboutDialog::AboutDialog(NewGui *gui) } PauseDialog::PauseDialog(NewGui *gui) - : Dialog (gui, 50, 80, 220, 16) + : Dialog (gui, 60, 20, 100, 100) { addResText(4, 4, 220, 16, 10); } +void PauseDialog::draw() +{ + if (_screenBuf) { + _gui->blitFrom(_screenBuf, _x, _y, _w, _h); + } else { + _gui->fillRect(_x, _y, _w, _h, _gui->_bgcolor); + _gui->box(_x, _y, _w, _h); + } + _gui->addDirtyRect(_x, _y, _w, _h); + + _gui->frameRect(10 + _x, 15 + _y, 100, 100, _gui->_color); + for (int y = 0; y < 16; ++y) + for (int x = 0; x < 16; ++x) + _gui->fillRect(10 + _x + x*5, 15 + _y + y*5, 5, 5, y*16 + x); + + +} + SoundDialog::SoundDialog(NewGui *gui) : Dialog (gui, 30, 20, 260, 110) { diff --git a/gui/dialog.h b/gui/dialog.h index 0e9b46222a..55fd464a42 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -116,6 +116,8 @@ class PauseDialog : public Dialog { public: PauseDialog(NewGui *gui); + virtual void draw(); + virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); } virtual void handleKeyDown(char key, int modifiers) diff --git a/gui/gui.cpp b/gui/gui.cpp new file mode 100644 index 0000000000..270641ae17 --- /dev/null +++ b/gui/gui.cpp @@ -0,0 +1,1252 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" +#include "sound/mididrv.h" +#include "scumm/imuse.h" +#include "gui.h" +#include "guimaps.h" +#include "config-file.h" + +#include + +#define hline(x, y, x2, color) line(x, y, x2, y, color); +#define vline(x, y, y2, color) line(x, y, x, y2, color); + +#ifdef _WIN32_WCE +// Additional variables for WinCE specific GUI +#include "gapi_keys.h" +extern bool toolbar_drawn; +extern bool hide_toolbar; +extern bool draw_keyboard; +extern bool get_key_mapping; +extern struct keyops keyMapping; +extern void save_key_mapping(void); +extern void do_hide(bool); +extern void do_quit(); +uint16 _key_mapping_required; +uint16 _current_page; +bool keyboard_override; +bool save_hide_toolbar; +#else +#define save_key_mapping() ; +bool get_key_mapping; +uint16 _key_mapping_required; +#endif + +enum { + GUI_NONE = 0, + GUI_RESTEXT = 1, + GUI_IMAGE = 2, + GUI_STAT = 3, + GUI_CUSTOMTEXT = 4, + GUI_VARTEXT = 5, + GUI_ACTIONTEXT = 6, + GUI_KEYTEXT = 7, + GUI_SCROLLTEXT = 8, + GUI_NEXTTEXT = 9, + GUI_UPDOWNARROW = 10, + GUI_CHECKBOX = 11 +}; + +enum { + GWF_BORDER = 1, + GWF_CLEARBG = 2, + GWF_PARENT = 4, + GWF_DELAY = 8, + GWF_DEFAULT = GWF_BORDER | GWF_CLEARBG, + GWF_BUTTON = GWF_BORDER | GWF_CLEARBG | GWF_DELAY +}; + +struct GuiWidget { + byte _type; + byte _page; + byte _flags; + int16 _x, _y; + uint16 _w, _h; + uint16 _id; + byte _string_number; + uint8 _hotkey; +}; + +enum { + SAVELOAD_DIALOG, + PAUSE_DIALOG, + SOUND_DIALOG, + KEYS_DIALOG, + OPTIONS_DIALOG, + ABOUT_DIALOG, + LAUNCHER_DIALOG, + MISC_DIALOG +}; + + +#define IMG_SIZE 8 + +// Triangles pointing up-/downwards, used for save/load dialog +static uint32 up_arrow[IMG_SIZE] = { + 0x00011000, + 0x00011000, + 0x00100100, + 0x00100100, + 0x01000010, + 0x01000010, + 0x10000001, + 0x10000001, +}; + +static uint32 down_arrow[IMG_SIZE] = { + 0x10000001, + 0x10000001, + 0x01000010, + 0x01000010, + 0x00100100, + 0x00100100, + 0x00011000, + 0x00011000, +}; + +static uint32 checked_img[IMG_SIZE] = { + 0x00000000, + 0x01000010, + 0x00100100, + 0x00011000, + 0x00011000, + 0x00100100, + 0x01000010, + 0x00000000, +}; + +const GuiWidget launcher_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT, 0, 0, 320, 200, 0, 0}, + {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 5, 180, 45, 15, 20, 12}, + {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 130, 180, 65, 15, 21, 17}, + {GUI_CUSTOMTEXT, 0x01, GWF_CLEARBG, 265, 180, 50, 15, 22, 7}, + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget keys_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 10, 260, 130, 0, 0}, + + // First action + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10, 15, 15, 10, 3}, // CUSTOMTEXT_PLUS + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10, 15, 15, 11, 4}, // CUSTOMTEXT_MINUS + {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 11 + 33 + 10, 10 + 10, 100, 15, 100, 1}, + {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 3, 100, 15, 1, 1}, + + //Second action + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5, 15, 15, 20, 3}, // CUSTOMTEXT_PLUS + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5, 15, 15, 21, 4}, // CUSTOMTEXT_MINUS + {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5, 100, 15, 101, 2}, + {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 3, 100, 15, 2, 2}, + + //Third action + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5, 15, 15, 30, 3}, // CUSTOMTEXT_PLUS + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5, 15, 15, 31, 4}, // CUSTOMTEXT_MINUS + {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5, 100, 15, 102, 3}, + {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 3, 100, 15, 3, 3}, + + //Fourth action + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, 40, 3}, + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, 41, 4}, + {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5, 100, 15, + 103, 4}, + {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 3, 100, 15, 4, 4}, + + //Fifth action + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, + 50, 3}, + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, 15, 15, + 51, 4}, + {GUI_ACTIONTEXT, 0x01, GWF_BUTTON, 30 + 10 + 33 + 10, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5, + 100, 15, 104, 5}, + {GUI_KEYTEXT, 0x01, 0, 30 + 11 + 33 + 120, 10 + 10 + 15 + 5 + 15 + 5 + 15 + 5 + 15 + 5 + 3, 100, + 15, 5, 5}, + + //OK + {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 60, 10 + 106, 54, 16, 60, 9}, + //Previous-Next + {GUI_NEXTTEXT, 0x01, GWF_BUTTON, 30 + 120, 10 + 106, 54, 16, 61, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget about_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 10, 260, 134, 0, 0}, + {GUI_CUSTOMTEXT, 0x01, 0, 30 + 68, 10 + 20, 160, 15, 0, 9}, // Build + {GUI_CUSTOMTEXT, 0x01, 0, 30 + 10, 10 + 35, 240, 15, 0, 10}, // ScummVM Url + {GUI_CUSTOMTEXT, 0x01, 0, 30 + 75, 10 + 65, 150, 15, 0, 11}, // Lucasarts + {GUI_CUSTOMTEXT, 0x01, 0, 30 + 110, 10 + 80, 40, 15, 0, 21}, // Except: + {GUI_CUSTOMTEXT, 0x01, 0, 30 + 25, 10 + 95, 210, 15, 0, 22}, // Adventuresoft + {GUI_SCROLLTEXT, 0x01, 0, 30 + 95, 10 + 10, 100, 15, 0}, + {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 100, 10 + 112, 54, 16, 40, 9}, + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget options_dialog[] = { + // Only display the "Keys" options for WinCE +#ifdef _WIN32_WCE + {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 60, 0, 0}, + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10, 40, 15, 1, 5, 'S'}, // Sound + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30, 80 + 10, 40, 15, 2, 6, 'K'}, // Keys + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30 + 40 + 30, 80 + 10, 40, 15, 3, 7, 'A'}, // About + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10 + 15 + 10, 40, 15, 4, 18, 'M'}, // Misc + {0, 0, 0, 0, 0, 0, 0, 0, 0} +#else + {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 40, 0, 0}, + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10, 80 + 10, 40, 15, 1, 5, 'S'}, // Sound + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30, 80 + 10, 40, 15, 3, 7, 'A'}, // About + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 50 + 10 + 40 + 30 + 40 + 30, 80 + 10, 40, 15, 4, 18, 'M'}, // Misc + {0, 0, 0, 0, 0, 0, 0, 0, 0} +#endif +}; + +const GuiWidget misc_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT, 50, 80, 210, 65, 0, 0}, + {GUI_CHECKBOX, 0x01, GWF_DEFAULT, 50 + 10, 80 + 6, 14, 14, 1, 0, 'S'}, // checkbox for subtitles + {GUI_CUSTOMTEXT, 0x01, 0, 50 + 10 + 20, 80 + 10, 140, 15, 0, 19}, // "Show speech subtitles" + {GUI_CHECKBOX, 0x01, GWF_DEFAULT, 50 + 10, 80 + 6 + 16, 14, 14, 5, 0, 'A'}, // checkbox for amiga pallete + {GUI_CUSTOMTEXT, 0x01, 0, 50 + 10 + 20, 80 + 10 + 15, 140, 15, 0, 20}, // "Amiga pallete conversion" + {GUI_RESTEXT, 0x01, GWF_BUTTON, 50 + 10 + 20, 80 + 10 + 15 + 20, 54, 16, 3, 9, 13}, // ok + {GUI_RESTEXT, 0x01, GWF_BUTTON, 50 + 10 + 20 + 80, 80 + 10 + 15 + 20, 54, 16, 4, 7}, // cancel + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget sound_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT, 30, 20, 260, 120, 0, 0}, + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 11, 15, 15, 1, 3}, // Plus + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 11, 15, 15, 2, 4}, // Minus + {GUI_VARTEXT, 0x01, GWF_DEFAULT, 30 + 73, 20 + 11, 128, 15, 3, 0}, // Master + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 25 + 11, 15, 15, 11, 3}, // Plus + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 25 + 11, 15, 15, 12, 4}, // Minus + {GUI_VARTEXT, 0x01, GWF_BUTTON, 30 + 73, 20 + 25 + 11, 128, 15, 13, 1}, // Music + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 11, 20 + 25 + 25 + 11, 15, 15, 21, 3}, // Plus + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 30 + 33, 20 + 25 + 25 + 11, 15, 15, 22, 4}, // Minus + {GUI_VARTEXT, 0x01, GWF_BUTTON, 30 + 73, 20 + 25 + 25 + 11, 128, 15, 23, 2}, // SFX + {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + (260 / 2) - 80, 20 + 25 + 25 + 11 + 25, 54, 16, 40, 9, 13}, /* OK */ + {GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + (260 / 2), 20 + 25 + 25 + 11 + 25, 54, 16, 50, 7}, /* Cancel */ + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget save_load_dialog[] = { + {GUI_STAT, 0xFF, GWF_DEFAULT | GWF_PARENT, 30, 20, 260, 124, 0, 0}, + {GUI_RESTEXT, 0x01, 0, 10, 7, 240, 16, 0, 1}, /* How may I serve you? */ + {GUI_RESTEXT, 0x02, 0, 10, 7, 240, 16, 0, 2}, /* Select a game to LOAD */ + {GUI_RESTEXT, 0x04, 0, 10, 7, 240, 16, 0, 3}, /* Name your SAVE game */ + + {GUI_STAT, 0xFF, GWF_DEFAULT, 6, 20, 170, 96, 0, 0}, + {GUI_UPDOWNARROW, 0x01, GWF_BUTTON, 180, 24, 16, 40, 0, 0}, /* Up (dummy) */ + {GUI_UPDOWNARROW, 0x01, GWF_BUTTON, 180, 72, 16, 40, 0, 1}, /* Down (dummy) */ + {GUI_UPDOWNARROW, 0xFE, GWF_BUTTON, 180, 24, 16, 40, 1, 0}, /* Up */ + {GUI_UPDOWNARROW, 0xFE, GWF_BUTTON, 180, 72, 16, 40, 2, 1}, /* Down */ + + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 24, 160, 10, 20, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 34, 160, 10, 21, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 44, 160, 10, 22, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 54, 160, 10, 23, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 64, 160, 10, 24, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 74, 160, 10, 25, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 84, 160, 10, 26, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 94, 160, 10, 27, 0}, + {GUI_RESTEXT, 0x06, GWF_CLEARBG, 10, 104, 160, 10, 28, 0}, + + {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 20, 54, 16, 3, 4, 'S'}, /* Save */ + {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 40, 54, 16, 4, 5, 'L'}, /* Load */ + {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 60, 54, 16, 5, 6, 'P'}, /* Play */ + {GUI_CUSTOMTEXT, 0x01, GWF_BUTTON, 200, 80, 54, 16, 9, 17, 'O'}, /* Options */ + {GUI_RESTEXT, 0x01, GWF_BUTTON, 200, 100, 54, 16, 6, 8, 'Q'}, /* Quit */ + + {GUI_RESTEXT, 0x02, GWF_BUTTON, 200, 60, 54, 16, 7, 7}, /* Cancel */ + + {GUI_RESTEXT, 0x04, GWF_BUTTON, 200, 40, 54, 16, 8, 9}, /* Ok */ + {GUI_RESTEXT, 0x04, GWF_BUTTON, 200, 60, 54, 16, 7, 7}, /* Cancel */ + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +const GuiWidget pause_dialog[] = { + {GUI_RESTEXT, 0x01, GWF_DEFAULT, 50, 80, 220, 16, 0, 10}, + {0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + + +void Gui::draw(int start, int end) +{ + int i; + + if (end == -1) + end = start; + + for (i = 0; i < (int)(sizeof(_widgets) / sizeof(_widgets[0])); i++) { + const GuiWidget *w = _widgets[i]; + if (w) { + _parentX = 0; + _parentY = 0; + while (w->_type != GUI_NONE) { + if (w->_id >= start && w->_id <= end && (w->_page & (1 << _cur_page))) { + drawWidget(w); + } + if (w->_flags & GWF_PARENT) { + _parentX += w->_x; + _parentY += w->_y; + } + w++; + } + } + } +} + +const GuiWidget *Gui::widgetFromPos(int x, int y) +{ + int i; + + for (i = sizeof(_widgets) / sizeof(_widgets[0]) - 1; i >= 0; i--) { + const GuiWidget *w = _widgets[i]; + if (w) { + while (w->_type != GUI_NONE) { + if ((w->_page & (1 << _cur_page)) && w->_id && + (uint16)(x - w->_x) < w->_w && (uint16)(y - w->_y) < w->_h) + return w; + if (w->_flags & GWF_PARENT) { + x -= w->_x; + y -= w->_y; + } + w++; + } + } + } + return NULL; +} + +void Gui::drawChar(const char str, int xx, int yy) +{ + unsigned int buffer = 0, mask = 0, x, y; + byte *tmp; + int tempc = _color; + _color = _textcolor; + + tmp = &guifont[0]; + tmp += 224 + (str + 1) * 8; + + byte *ptr = getBasePtr(xx, yy); + if (ptr == NULL) + return; + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + unsigned char color; + if ((mask >>= 1) == 0) { + buffer = *tmp++; + mask = 0x80; + } + color = ((buffer & mask) != 0); + if (color) + ptr[x] = _color; + } + ptr += 320; + } + _color = tempc; + +} +void Gui::drawString(const char *str, int x, int y, int w, byte color, bool center) +{ + StringTab *st = &_s->string[5]; + st->charset = 1; + st->center = center; + st->color = color; + st->xpos = x; + st->ypos = y; + st->right = x + w; + + if (_s->_gameId) { /* If a game is active.. */ + _s->_messagePtr = (byte *)str; + _s->drawString(5); + } else { + for (uint letter = 0; letter < strlen(str); letter++) + drawChar(str[letter], st->xpos + (letter * 8), st->ypos); + } +} + +void Gui::drawWidget(const GuiWidget *w) +{ + const char *s; + int x, y; + + x = w->_x; + y = w->_y; + + if (w->_flags & GWF_CLEARBG) + widgetClear(w); + + if (w->_flags & GWF_BORDER) { + widgetBorder(w); + x += 4; + y += 4; + } + + switch (w->_type) { + case GUI_CUSTOMTEXT: + case GUI_VARTEXT: + case GUI_KEYTEXT: + case GUI_ACTIONTEXT: + case GUI_RESTEXT: + case GUI_NEXTTEXT: + { + char text[500]; + text[0] = '\0'; + + switch (w->_type) { + case GUI_CUSTOMTEXT: + strcpy(text, string_map_table_custom[w->_string_number]); + break; + case GUI_RESTEXT: + s = queryString(w->_string_number, w->_id); + if (s) + strcpy(text, s); + break; + case GUI_VARTEXT: + sprintf(text, "%s %d", string_map_table_custom[w->_string_number], + _gui_variables[w->_string_number]); + break; + case GUI_SCROLLTEXT: + sprintf(text, "%s", _gui_scroller); + break; +#ifdef _WIN32_WCE + case GUI_KEYTEXT: + strcpy(text, getGAPIKeyName(getAction((_current_page * 5) + w->_string_number - 1)->action_key)); + break; + case GUI_ACTIONTEXT: + strcpy(text, getActionName(getAction((_current_page * 5) + w->_string_number - 1)->action_type)); + break; + case GUI_NEXTTEXT: + if (_current_page == 0) + strcpy(text, "Next"); + else + strcpy(text, "Prev"); + break; + +#endif + } + + if (*text) { + drawString(text, x + _parentX, y + _parentY, w->_w, + (_clickWidget && _clickWidget == w->_id) ? _textcolorhi : _textcolor, false); + } + break; + } + case GUI_IMAGE: + break; + case GUI_UPDOWNARROW: + case GUI_CHECKBOX: + { + uint32 *data; + byte color = (_clickWidget && _clickWidget == w->_id) ? _textcolorhi : _textcolor; + + if (w->_type == GUI_UPDOWNARROW) { + if (w->_string_number == 0) + data = up_arrow; + else + data = down_arrow; + // if not an updownarrow, it must be a checkbox + } else { + data = checked_img; + } + + // Center the image + x += w->_w / 2 - IMG_SIZE / 2; + y += w->_h / 2 - IMG_SIZE / 2; + if (w->_flags & GWF_BORDER) { + x -= 4; + y -= 4; + } + + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + // If the checkbox is checked, or this is not a checkbox, draw the image + if ((getCheckboxChecked(w->_id) == true) || (w->_type != GUI_CHECKBOX)) { + for (int y2 = 0; y2 < IMG_SIZE; y2++) { + uint32 mask = 0xF0000000; + for (int x2 = 0; x2 < IMG_SIZE; x2++) { + if (data[y2] & mask) + ptr[x2] = color; + mask >>= 4; + } + ptr += 320; + } + } + } + break; + } +} + +void Gui::widgetClear(const GuiWidget *wid) +{ + int x = wid->_x; + int y = wid->_y; + int w = wid->_w; + int h = wid->_h; + int i; + + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + _s->setVirtscreenDirty(_vs, x + _parentX, y + _parentY, x + _parentX + w, y + _parentY + h); + + if (wid->_flags & GWF_BORDER) { + // Inset by 1 pixel in all directions + ptr += 320 + 1; + w -= 2; + h -= 2; + } + + while (h--) { + for (i = 0; i < w; i++) + ptr[i] = _bgcolor; + ptr += 320; + } +} + +void Gui::widgetBorder(const GuiWidget *w) +{ + box(w->_x, w->_y, w->_w, w->_h); +} + +void Gui::box(int x, int y, int width, int height) +{ + hline(x + 1, y, x + width - 2, _color); + hline(x, y + 1, x + width - 1, _color); + vline(x, y + 1, y + height - 2, _color); + vline(x + 1, y, y + height - 1, _color); + + hline(x + 1, y + height - 2, x + width - 1, _shadowcolor); + hline(x + 1, y + height - 1, x + width - 2, _shadowcolor); + vline(x + width - 1, y + 1, y + height - 2, _shadowcolor); + vline(x + width - 2, y + 1, y + height - 1, _shadowcolor); +} + +byte *Gui::getBasePtr(int x, int y) +{ + x += _parentX; + y += _parentY; + _vs = _s->findVirtScreen(y); + + if (_vs == NULL) + return NULL; + + return _vs->screenPtr + x + (y - _vs->topline) * 320 + + _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; +} + +void Gui::line(int x, int y, int x2, int y2, byte color) +{ + byte *ptr; + + if (x2 < x) + x2 ^= x ^= x2 ^= x; // Swap x2 and x + + if (y2 < y) + y2 ^= y ^= y2 ^= y; // Swap y2 and y + + ptr = getBasePtr(x, y); + + if (ptr == NULL) + return; + + if (x == x2) { + /* vertical line */ + while (y++ <= y2) { + *ptr = color; + ptr += 320; + } + } else if (y == y2) { + /* horizontal line */ + while (x++ <= x2) { + *ptr++ = color; + } + } +} + +void Gui::leftMouseClick(int x, int y) +{ + const GuiWidget *w = widgetFromPos(x, y); + int old; + + _clickTimer = 0; + + old = _clickWidget; + _clickWidget = w ? w->_id : 0; + + if (old) + draw(old); + if (_clickWidget) { + draw(_clickWidget); + if (w->_flags & GWF_DELAY) + _clickTimer = 5; + else + handleCommand(_clickWidget); + } + + if (_dialog == PAUSE_DIALOG) + close(); +} + +void Gui::handleSoundDialogCommand(int cmd) +{ + if (cmd == 50) { + close(); + } else if (cmd == 40) { + _s->_sound->_sound_volume_master = _gui_variables[0]; // Master + _s->_sound->_sound_volume_music = _gui_variables[1]; // Music + _s->_sound->_sound_volume_sfx = _gui_variables[2]; // SFX + + _s->_imuse->set_music_volume(_s->_sound->_sound_volume_music); + _s->_imuse->set_master_volume(_s->_sound->_sound_volume_master); + _s->_mixer->set_volume(_s->_sound->_sound_volume_sfx); + _s->_mixer->set_music_volume(_s->_sound->_sound_volume_music); + + scummcfg->set("master_volume", _s->_sound->_sound_volume_master); + scummcfg->set("music_volume", _s->_sound->_sound_volume_music); + scummcfg->set("sfx_volume", _s->_sound->_sound_volume_sfx); + scummcfg->flush(); + + close(); + } else { + if ((cmd % 10) == 1) { + _gui_variables[cmd / 10] += 5; + if (_gui_variables[cmd / 10] > 256) + _gui_variables[cmd / 10] = 256; + } else { + _gui_variables[cmd / 10] -= 5; + if (_gui_variables[cmd / 10] < 0) + _gui_variables[cmd / 10] = 0; + } + + draw((cmd / 10) * 10 + 3, (cmd / 10) * 10 + 3); + } +} + +void Gui::handleOptionsDialogCommand(int cmd) +{ + switch (cmd) { + case 1: + _widgets[0] = sound_dialog; + _gui_variables[0] = _s->_sound->_sound_volume_master; + _gui_variables[1] = _s->_sound->_sound_volume_music; + _gui_variables[2] = _s->_sound->_sound_volume_sfx; + _active = true; + _cur_page = 0; + _dialog = SOUND_DIALOG; + draw(0, 100); + return; + case 2: + _key_mapping_required = 0; + get_key_mapping = true; + _widgets[0] = keys_dialog; + _active = true; + _cur_page = 0; + _dialog = KEYS_DIALOG; + draw(0, 200); + return; + case 3: + _widgets[0] = about_dialog; + _active = true; + _cur_page = 0; + _return_to = 0; + _dialog = ABOUT_DIALOG; + draw(0, 100); + return; + case 4: + _widgets[0] = misc_dialog; + _active = true; + _cur_page = 0; + _return_to = 0; + _dialog = MISC_DIALOG; + clearCheckboxes(); + setCheckbox(!(_s->_noSubtitles), 1); + if (_s->_features & GF_AMIGA) + setCheckbox(true, 5); + else + setCheckbox(false, 5); + draw(0, 100); + return; + } +} + +void Gui::handleMiscDialogCommand(int cmd) +{ + switch (cmd) { + case 1: + if ((getCheckboxChecked(1)) == true) + setCheckbox(false, 1); + else + setCheckbox(true, 1); + draw(1, 1); + return; + case 5: + if (getCheckboxChecked(5) == true) + setCheckbox(false, 5); + else + setCheckbox(true, 5); + draw(5, 5); + return; + case 3: + case 4: + // OK button - perform the actions of the checkboxes + if (cmd == 3) { + // The opposite of the checkbox(1) is set because the internal variable is 'no subtitles' but + // a "Show subtitles" option makes more usability sense + _s->_noSubtitles = (!getCheckboxChecked(1)); + + // Amiga pallete conversion checkbox + if (getCheckboxChecked(5)) + _s->_features = _s->_features | GF_AMIGA; + else + _s->_features = _s->_features & ~GF_AMIGA; + _s->_fullRedraw = true; + } + close(); + } +} + +void Gui::handleKeysDialogCommand(int cmd) +{ +#ifdef _WIN32_WCE + if (cmd < 100 && cmd != 60 && cmd != 61) { + + if ((cmd % 10) == 1) + setNextType((_current_page * 5) + (cmd / 10) - 1); + else + setPreviousType((_current_page * 5) + (cmd / 10) - 1); + + draw(0, 200); + + return; + } + + if (cmd >= 100) + _key_mapping_required = cmd; + + if (cmd == 60) { + get_key_mapping = false; + save_key_mapping(); + close(); + } + + if (cmd == 61) { + if (!_current_page) + _current_page = 1; + else + _current_page = 0; + draw(0, 200); + return; + } +#else + close(); +#endif +} + +void Gui::handleLauncherDialogCommand(int cmd) +{ + debug(9, "handle launcher command\n"); + switch (cmd) { + case 20: + close(); + break; + case 21: + // Nothing yet + break; + case 22: + _widgets[0] = about_dialog; + _active = true; + _cur_page = 0; + _return_to = LAUNCHER_DIALOG; + _dialog = ABOUT_DIALOG; + draw(0, 100); + debug(9, "about dialog\n"); + break; + default: + debug(9, "default\n"); + close(); + } +} + +void Gui::handleCommand(int cmd) +{ + int lastEdit = _editString; + showCaret(false); + + switch (_dialog) { + case LAUNCHER_DIALOG: + handleLauncherDialogCommand(cmd); + return; + case SOUND_DIALOG: + handleSoundDialogCommand(cmd); + return; + case OPTIONS_DIALOG: + handleOptionsDialogCommand(cmd); + return; + case MISC_DIALOG: + handleMiscDialogCommand(cmd); + return; + case KEYS_DIALOG: + handleKeysDialogCommand(cmd); + return; + case ABOUT_DIALOG: + if (_return_to == LAUNCHER_DIALOG) { + _widgets[0] = launcher_dialog; + _active = true; + _cur_page = 0; + _dialog = LAUNCHER_DIALOG; + draw(0, 100); + } else + close(); + return; + } + + // If we get here, it's the SAVELOAD_DIALOG + + switch (cmd) { + case 1: /* up button */ + if (_slotIndex - 9 < 0) + return; + getSavegameNames(_slotIndex - 9); + draw(20, 28); + return; + case 2: /* down button */ + if (_slotIndex + 9 > 80) + return; + getSavegameNames(_slotIndex + 9); + draw(20, 28); + return; + case 3: /* save button */ + _cur_page = 2; + getSavegameNames(1); /* Start at 1, since slot 0 is reserved for autosave */ + draw(0, 100); + return; + case 4: /* load button */ + _cur_page = 1; + getSavegameNames(0); + draw(0, 100); + return; + case 5: /* play button */ + close(); + return; + case 6: /* quit button */ +#ifdef _WIN32_WCE + do_quit(); +#endif + exit(1); + return; + case 7: /* cancel button */ + _cur_page = 0; + draw(0, 100); + return; + case 8: /* ok button (save game) */ + if (lastEdit == -1 || game_names[lastEdit][0] == 0) + return; + + _s->_saveLoadSlot = lastEdit + _slotIndex; + _s->_saveLoadCompatible = false; + _s->_saveLoadFlag = 1; + memcpy(_s->_saveLoadName, game_names[lastEdit], sizeof(_s->_saveLoadName)); + close(); + return; + case 9: /* options button */ + options(); + draw(0, 100); + return; + default: + if (cmd >= 20 && cmd <= 28) { + if (_cur_page == 1) { + if (valid_games[cmd - 20]) { + _s->_saveLoadSlot = cmd - 20 + _slotIndex; + _s->_saveLoadCompatible = false; + _s->_saveLoadFlag = 2; + close(); + } + return; + } else if (_cur_page == 2) { + _clickWidget = cmd; + editString(cmd - 20); + } + } + } + +} + +void Gui::getSavegameNames(int start) +{ + int i; + _slotIndex = start; + + for (i = 0; i < 9; i++) { + valid_games[i] = _s->getSavegameName(start + i, game_names[i]); + } +} + +const char *Gui::queryString(int stringno, int id) +{ + static char namebuf[64]; + char *result; + int string; + + if (id >= 20 && id <= 28) { + // Save game names + sprintf(namebuf, "%2d. %s", id - 20 + _slotIndex, game_names[id - 20]); + return namebuf; + } + + if (stringno == 0) + return NULL; + + if (_s->_features & GF_AFTER_V7) + string = _s->_vars[string_map_table_v7[stringno - 1].num]; + else if (_s->_features & GF_AFTER_V6) + string = _s->_vars[string_map_table_v6[stringno - 1].num]; + else + string = string_map_table_v5[stringno - 1].num; + + result = (char *)_s->getStringAddress(string); + + if (!result) { // Gracelessly degrade to english :) + if (_s->_features & GF_AFTER_V6) + return string_map_table_v6[stringno - 1].string; + else + return string_map_table_v5[stringno - 1].string; + } + + return result; +} + +void Gui::showCaret(bool show) +{ + int i; + char *s; + + if (_editString == -1) + return; + + i = _editLen; + s = game_names[_editString]; + + if (show) { + if (i < SAVEGAME_NAME_LEN - 1) { + s[i] = '_'; + s[i + 1] = 0; + } + } else { + s[i] = 0; + } + + draw(_editString + 20); + + if (!show) + _editString = -1; +} + +void Gui::editString(int i) +{ + char *s = game_names[i]; + if (!valid_games[i]) { + valid_games[i] = true; + *s = 0; + } + _editString = i; + _editLen = strlen(s); + showCaret(true); +} + +void Gui::addLetter(byte letter) +{ + switch (_dialog) { + case SAVELOAD_DIALOG: + if (_editString == -1) + return; + +/* + FIXME - this code here has no effect at all, since Scumm::convertKeysToClicks() + swallows all return key events. + // Return pressed? + if (letter == '\n' || letter == '\r') { + handleCommand(8); + return; + } +*/ + + if (letter >= 32 && letter < 128 && _editLen < SAVEGAME_NAME_LEN - 1) { + game_names[_editString][_editLen++] = letter; + } else if (letter == 8 && _editLen > 0) { + _editLen--; + } + showCaret(true); + break; + case PAUSE_DIALOG: + if (letter == 32) + close(); + break; + +#ifdef _WIN32_WCE + case KEYS_DIALOG: + clearActionKey(letter); + if (_key_mapping_required) + getAction((_current_page * 5) + _key_mapping_required - 100)->action_key = letter; + _key_mapping_required = 0; + draw(0, 200); + break; +#endif + } +} + +bool Gui::getCheckboxChecked(int id) +{ + return _cbox_checked[id]; +} + +void Gui::setCheckbox(bool state, int id) +{ + _cbox_checked[id] = state; +} + +void Gui::clearCheckboxes() +{ + for (int id = 0; id <= 100; id++) { + _cbox_checked[id] = false; + } +} + +void Gui::init(Scumm *s) +{ + /* Default GUI colors */ + _bgcolor = 0; + _color = 0; + _textcolor = 8; // 15 is nice + _textcolorhi = 15; + _shadowcolor = 0; + _s = s; + + strcpy(_gui_scroller, "Brought to you by:"); +} + +void Gui::loop() +{ + if (_active && !_inited) { + _inited = true; + draw(0, 200); // was 100 + _old_soundsPaused = _s->_sound->_soundsPaused; + _s->_sound->pauseSounds(true); + + // Backup old cursor + memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); + _old_cursorWidth = _s->_cursorWidth; + _old_cursorHeight = _s->_cursorHeight; + _old_cursorHotspotX = _s->_cursorHotspotX; + _old_cursorHotspotY = _s->_cursorHotspotY; + _old_cursor_mode = _s->_system->show_mouse(true); + + _s->_cursorAnimate++; + _s->gdi._cursorActive = 1; + } + _s->animateCursor(); + _s->getKeyInput(0); + if (_s->_mouseButStat & MBS_LEFT_CLICK) { + leftMouseClick(_s->mouse.x, _s->mouse.y); + } else if (_s->_lastKeyHit) { + if (_dialog != KEYS_DIALOG) { + if (_s->_lastKeyHit == 27) + close(); + else { + addLetter((unsigned char)_s->_lastKeyHit); + checkHotKey(_s->_lastKeyHit); + } +#ifdef _WIN32_WCE + } else if (_s->_lastKeyHit > 1000) { // GAPI + addLetter(_s->_lastKeyHit - 1000); +#endif + } + } + + if (_clickTimer && !--_clickTimer) { + int old = _clickWidget; + _clickWidget = 0; + draw(old); + handleCommand(old); + } + + _s->drawDirtyScreenParts(); + _s->_mouseButStat = 0; +} + +void Gui::close() +{ + _s->_fullRedraw = true; + _s->_completeScreenRedraw = true; + _s->_cursorAnimate--; + + // Restore old cursor + memcpy(_s->_grabbedCursor, _old_grabbedCursor, sizeof(_old_grabbedCursor)); + _s->_cursorWidth = _old_cursorWidth; + _s->_cursorHeight = _old_cursorHeight; + _s->_cursorHotspotX = _old_cursorHotspotX; + _s->_cursorHotspotY = _old_cursorHotspotY; + _s->updateCursor(); + + _s->_system->show_mouse(_old_cursor_mode); + + _s->_sound->pauseSounds(_old_soundsPaused); + _active = false; + _inited = false; + +#ifdef _WIN32_WCE + + // Option dialog can be accessed from the file dialog now, always check + if (save_hide_toolbar) { + do_hide(true); + save_hide_toolbar = false; + } + if (keyboard_override) { + keyboard_override = false; + draw_keyboard = false; + toolbar_drawn = false; + } +#endif +} + +void Gui::checkHotKey(int keycode) +{ + byte page; + for (int i = 0; i < (int)(sizeof(_widgets) / sizeof(_widgets[0])); i++) { + const GuiWidget *w = _widgets[i]; + if (w) { + while (w->_type != GUI_NONE) { + + // This rubbish is needed because the current page is 0 when really it should be 1 + if (_cur_page == 0) + page = 1; + else + page = _cur_page; + + // Only check for widgets that are on the current GUI page (otherwise save dialog problems occur) + if (w->_page == page) { + // Check the actual key pressed, and the uppercase version. For people who have caps lock on + if (keycode == w->_hotkey || toupper(keycode) == w->_hotkey) + handleCommand(w->_id); + } + w++; + } + } + } +} + +void Gui::saveLoadDialog() +{ + _widgets[0] = save_load_dialog; + _editString = -1; + _active = true; + _cur_page = 0; + _dialog = SAVELOAD_DIALOG; + +#ifdef _WIN32_WCE + save_hide_toolbar = hide_toolbar; + if (save_hide_toolbar) { + // Display the keyboard while the dialog is running + do_hide(false); + } + if (!draw_keyboard) { + keyboard_override = true; + draw_keyboard = true; + toolbar_drawn = false; + } +#endif + +} + +void Gui::pause() +{ + _widgets[0] = pause_dialog; + _active = true; + _cur_page = 0; + _dialog = PAUSE_DIALOG; +} + +void Gui::options() +{ +#ifdef _WIN32_WCE + _current_page = 0; +#endif + _widgets[0] = options_dialog; + _active = true; + _cur_page = 0; + _dialog = OPTIONS_DIALOG; +} + +void Gui::launcher() +{ + _widgets[0] = launcher_dialog; + _active = true; + _cur_page = 0; + _dialog = LAUNCHER_DIALOG; +} + + + + + + + + + + + + + + + + + + +/* +void Gui::loop() +{ + if (_active && !_inited) { + _inited = true; + _old_soundsPaused = _s->_soundsPaused; + _s->pauseSounds(true); + + // Backup old cursor + memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); + _old_cursorWidth = _s->_cursorWidth; + _old_cursorHeight = _s->_cursorHeight; + _old_cursorHotspotX = _s->_cursorHotspotX; + _old_cursorHotspotY = _s->_cursorHotspotY; + _old_cursor_mode = _s->_system->show_mouse(true); + + _s->_cursorAnimate++; + _s->gdi._cursorActive = 1; + } + _s->animateCursor(); + _s->getKeyInput(0); + + _s->drawDirtyScreenParts(); + _s->_mouseButStat = 0; +} +*/ diff --git a/gui/gui.h b/gui/gui.h new file mode 100644 index 0000000000..b7755cf226 --- /dev/null +++ b/gui/gui.h @@ -0,0 +1,124 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef GUI_H +#define GUI_H + +// Forward declaration for GuiWidget +struct GuiWidget; + +#define SAVEGAME_NAME_LEN 32 + +class Gui { +public: + byte _color,_shadowcolor; + byte _bgcolor; + byte _textcolor; + byte _textcolorhi; + + // Init + void init(Scumm *s); + + // Dialogs + void saveLoadDialog(); + void pause(); + void options(); + void launcher(); + + void loop(); + + bool isActive() { return _active; } + +protected: + Scumm *_s; + const GuiWidget *_widgets[4]; + int _return_to; + VirtScreen *_vs; + int _parentX, _parentY; + bool _active; + bool _inited; + byte _clickTimer; + byte _cur_page; + byte _dialog; + int _clickWidget; + char *_queryMess; + bool _old_soundsPaused; + + // mouse cursor state + bool _old_cursor_mode; + int _old_cursorHotspotX, _old_cursorHotspotY, _old_cursorWidth, _old_cursorHeight; + byte _old_grabbedCursor[2048]; + + // optiondialog specifics + int _gui_variables[100]; + + // checkboxes + bool _cbox_checked[100]; + const char *_cbox_cfg_key[100]; + + // savedialog specifics + int _slotIndex; + int _editString; + int _editLen; + bool valid_games[9]; + char game_names[9][SAVEGAME_NAME_LEN]; + + // Drawing + void draw(int start, int end); + void draw(int item) { draw(item,-1); } + void drawWidget(const GuiWidget *w); + + void line(int x, int y, int x2, int y2, byte color); + void box(int x, int y, int width, int height); + + //void hline(int x, int y, int x2, byte color); + //void vline(int x, int y, int y2, byte color); + void drawChar(const char str, int xx, int yy); + void drawString(const char *str, int x, int y, int w, byte color, bool center); + void widgetClear(const GuiWidget *w); + void widgetBorder(const GuiWidget *w); + byte *getBasePtr(int x, int y); + const GuiWidget *widgetFromPos(int x, int y); + + // Actions + void leftMouseClick(int x, int y); + void handleCommand(int cmd); + void close(); + const char *queryString(int string, int id); + void getSavegameNames(int start); + void editString(int index); + void showCaret(bool show); + void addLetter(byte letter); + void queryMessage(const char *msg, const char *alts); + byte getDefaultColor(int color); + bool getCheckboxChecked(int id); + void setCheckbox(bool state, int id); + void clearCheckboxes(); + void checkHotKey(int keycode); + + char _gui_scroller[255]; + + void handleSoundDialogCommand(int cmd); + void handleOptionsDialogCommand(int cmd); + void handleKeysDialogCommand(int cmd); + void handleLauncherDialogCommand(int cmd); + void handleMiscDialogCommand(int cmd); +}; +#endif diff --git a/gui/guimaps.h b/gui/guimaps.h new file mode 100644 index 0000000000..181dbb6bc9 --- /dev/null +++ b/gui/guimaps.h @@ -0,0 +1,157 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#if !defined(guimaps_h) +#define guimaps_h + +struct ResString { + int num; + char string[80]; +}; + +// String maps +static const char* string_map_table_custom[] = { + "Master Volume :", //0 + "Music Volume :", //1 + "SFX Volume :", //2 + "+", //3 + "-", //4 + "Sound", //5 + "Keys", //6 + "About", //7 + "Pocket ScummVM", //8 + "Build " SCUMMVM_VERSION " (" SCUMMVM_CVS ")", //9 + "ScummVM http://scummvm.sourceforge.net", //10 + "All games (c) LucasArts", //11 + "Quit", //12 + "Pause", //13 + "Save", //14 + "Skip", //15 + "Hide", //16 + "Options", //17 + "Misc", //18 + "Show speech subtitles", //19 + "Amiga palette conversion", //20 + "Except:", //21 + "Simon the Sorcerer (c) Adventuresoft", //22 + "Close" //23 +}; + +static ResString string_map_table_v7[] = { + {96, "game name and version"}, //that's how it's supposed to be + {77, "Select a game to LOAD"}, + {76, "Name your SAVE game"}, + {70, "save"}, //boot8 + {71, "load"}, //boot9 + {72, "play"}, //boot10 + {73, "cancel"}, //boot11 + {74, "quit"}, //boot12 + {75, "ok"}, //boot13 + {85, "game paused"}, // boot3 + + /* this is the almost complete string map for v7 + {63, "how may I serve you?"}, + {64, "the dig v1.0"}, //(game name/version) + {67, "text display only"}, + {68, "c:\\dig"}, //boot007 (save path ?) + {69, "the dig"}, //boot21 (game name) + {70, "save"}, //boot8 + {71, "load"}, //boot9 + {72, "play"}, //boot10 + {73, "cancel"}, //boot11 + {74, "quit"}, //boot12 + {75, "ok"}, //boot13 + {76, "name your save game"}, //boot19 + {77, "select a game to load"}, //boot20 + {78, "you must enter a name"},//boot14 + {79, "saving '%s'"}, //boot17 + {80, "loading '%s'"}, //boot18 + {81, "the game was NOT saved"}, //boot15 + {82, "the game was NOT loaded"}, //boot16 + {83, "how may I serve you?"}, + {84, "how may I serve you?"}, + {85, "game paused"}, // boot3 + {86, "Are you sure you want to restart"}, + {87, "Are you sure you want to quit?"}, //boot05 + {89, "how may I serve you?"}, + {90, "music"}, //boot22 + {91, "voice"}, //boot23 + {92, "sfx"}, //boot24 + {93, "disabled"}, //boot25 + {94, "text speed"}, //boot26 + {95, "text display"}, //boot27 + {96, "the dig v1.0"},*/ + +}; + +static ResString string_map_table_v6[] = { + {117, "How may I serve you?"}, + {109, "Select a game to LOAD"}, + {108, "Name your SAVE game"}, + {96, "Save"}, + {97, "Load"}, + {98, "Play"}, + {99, "Cancel"}, + {100, "Quit"}, + {101, "Ok"}, + {93, "Game paused"}, +}; + +static ResString string_map_table_v5[] = { + {28, "How may I serve you?"}, + {20, "Select a game to LOAD"}, + {19, "Name your SAVE game"}, + {7, "Save"}, + {8, "Load"}, + {9, "Play"}, + {10, "Cancel"}, + {11, "Quit"}, + {12, "Ok"}, + {4, "Game paused"} +}; + +// Built-in font +static byte guifont[] = {0,0,99,1,226,8,4,8,6,8,6,0,0,0,0,0,0,0,0,0,0,0,8,2,1,8,0,0,0,0,0,0,0,0,0,0,0,0,4,3,7,8,7,7,8,4,5,5,8,7,4,7,3,8,7,7,7,7,8,7,7,7,7,7,3,4,7,5,7,7,8,7,7,7,7,7,7,7,7,5,7,7, +7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5,0,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0, +0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,1,3,6,12, +24,62,3,0,128,192,96,48,24,124,192,0,0,3,62,24,12,6,3,1,0,192,124,24,48,96,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,74,72,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,60,66,153,161,161,153,66,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,96,96,96,96,0,0,96,0,102,102,102,0,0,0,0,0,102,102,255,102,255,102,102,0,24,62,96,60,6,124,24,0,98,102,12,24,48,102,70,0,60,102,60,56,103,102,63,0,96,48,16,0,0,0,0,0,24,48,96,96,96,48,24,0,96,48,24,24,24,48,96,0, +0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0,0,0,0,0,0,48,48,96,0,0,0,126,0,0,0,0,0,0,0,0,0,96,96,0,0,3,6,12,24,48,96,0,60,102,102,102,102,102,60,0,24,24,56,24,24,24,126,0,60,102,6,12,48,96,126,0,60,102,6,28,6,102,60,0,6, +14,30,102,127,6,6,0,126,96,124,6,6,102,60,0,60,102,96,124,102,102,60,0,126,102,12,24,24,24,24,0,60,102,102,60,102,102,60,0,60,102,102,62,6,102,60,0,0,0,96,0,0,96,0,0,0,0,48,0,0,48,48,96,14,24,48,96,48,24,14,0,0,0,120,0,120,0,0,0,112,24, +12,6,12,24,112,0,60,102,6,12,24,0,24,0,0,0,0,255,255,0,0,0,24,60,102,126,102,102,102,0,124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0,120,108,102,102,102,108,120,0,126,96,96,120,96,96,126,0,126,96,96,120,96,96,96,0,60,102,96,110,102,102,60,0,102,102,102, +126,102,102,102,0,120,48,48,48,48,48,120,0,30,12,12,12,12,108,56,0,102,108,120,112,120,108,102,0,96,96,96,96,96,96,126,0,99,119,127,107,99,99,99,0,102,118,126,126,110,102,102,0,60,102,102,102,102,102,60,0,124,102,102,124,96,96,96,0,60,102,102,102,102,60,14,0,124,102,102,124, +120,108,102,0,60,102,96,60,6,102,60,0,126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0,102,102,102,102,102,60,24,0,99,99,99,107,127,119,99,0,102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0,126,6,12,24,48,96,126,0,120,96,96,96,96,96,120,0,3,6,12,24,48, +96,192,0,120,24,24,24,24,24,120,0,0,0,0,0,0,219,219,0,0,0,0,0,0,0,0,255,102,102,102,0,0,0,0,0,0,0,60,6,62,102,62,0,0,96,96,124,102,102,124,0,0,0,60,96,96,96,60,0,0,6,6,62,102,102,62,0,0,0,60,102,126,96,60,0,0,14,24,62,24,24, +24,0,0,0,62,102,102,62,6,124,0,96,96,124,102,102,102,0,0,48,0,112,48,48,120,0,0,12,0,12,12,12,12,120,0,96,96,108,120,108,102,0,0,112,48,48,48,48,120,0,0,0,102,127,127,107,99,0,0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0,0,0,124,102,102,124,96, +96,0,0,62,102,102,62,6,6,0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0,0,24,126,24,24,24,14,0,0,0,102,102,102,102,62,0,0,0,102,102,102,60,24,0,0,0,99,107,127,62,54,0,0,0,102,60,24,60,102,0,0,0,102,102,102,62,12,120,0,0,126,12,24,48,126,0, +24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0,0,0,0,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48, +24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,60,96,96,96,60,24,56,24,36,60,102,126,96,60,0,102,0,60,102,126,96,60,0,48,24,60,102,126,96,60,0,0,216,0,112,48,48,120,0,48,72,0,112,48,48,120,0,96,48,0,112,48,48,120,0,102,24,60,102,126,102,102,0,0,0, +0,0,0,0,0,0,24,48,124,96,120,96,124,0,0,0,108,26,126,216,110,0,30,40,40,126,72,136,142,0,24,36,60,102,102,102,60,0,102,0,60,102,102,102,60,0,48,24,60,102,102,102,60,0,24,36,0,102,102,102,62,0,48,24,102,102,102,102,62,0,0,0,0,0,0,0,0,0,102,60,102, +102,102,102,60,0,102,0,102,102,102,102,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,28,54,54,124,102,102,124,64,0,0,0}; +#endif diff --git a/gui/newgui.cpp b/gui/newgui.cpp new file mode 100644 index 0000000000..8b4cca035a --- /dev/null +++ b/gui/newgui.cpp @@ -0,0 +1,541 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" +#include "newgui.h" +#include "guimaps.h" +#include "gui/dialog.h" +#include "util.h" + +/* + * TODO list + * - implement the missing / incomplete dialogs + * - add more widgets + * - allow multi line (l/c/r aligned) text via StaticTextWidget ? + * - add "close" widget to all dialogs (with a flag to turn it off) ? + * - make dialogs "moveable" ? + * - come up with a new look&feel / theme for the GUI + * - ... + */ + +#define ABS(x) ((x) < 0 ? -(x) : (x)) + +NewGui::NewGui(Scumm *s) : _s(s), _use_alpha_blending(false), + _need_redraw(false),_prepare_for_gui(true), + _pauseDialog(0), _saveLoadDialog(0), _aboutDialog(0), _optionsDialog(0), + _currentKeyDown(0) +{ +} + +void NewGui::pauseDialog() +{ + if (!_pauseDialog) + _pauseDialog = new PauseDialog(this); + _pauseDialog->open(); +} + +void NewGui::saveloadDialog() +{ + if (!_saveLoadDialog) + _saveLoadDialog = new SaveLoadDialog(this); + _saveLoadDialog->open(); +} + +void NewGui::aboutDialog() +{ + if (!_aboutDialog) + _aboutDialog = new AboutDialog(this); + _aboutDialog->open(); +} + +void NewGui::optionsDialog() +{ + if (!_optionsDialog) + _optionsDialog = new OptionsDialog(this); + _optionsDialog->open(); +} + +void NewGui::soundDialog() +{ + if (!_soundDialog) + _soundDialog = new SoundDialog(this); + _soundDialog->open(); +} + +void NewGui::loop() +{ + Dialog *activeDialog = _dialogStack.top(); + int i; + + if (_prepare_for_gui) { + ClearBlendCache(_s->_currentPalette, 128); + saveState(); + if (_use_alpha_blending) + activeDialog->setupScreenBuf(); +#if 1 + // FIXME - hack to encode our own custom GUI colors. Since we have to live + // with a given 8 bit palette, the result is not always as nice as one + // would wish, but this is just an experiment after all. + _bgcolor = RGBMatch(_s->_currentPalette, 0, 0, 0); + + _color = RGBMatch(_s->_currentPalette, 80, 80, 80); + _shadowcolor = RGBMatch(_s->_currentPalette, 64, 64, 64); + + _textcolor = RGBMatch(_s->_currentPalette, 32, 192, 32); + _textcolorhi = RGBMatch(_s->_currentPalette, 0, 256, 0); +#endif + + _eventList.clear(); + _currentKeyDown = 0; + + _lastClick.x = _lastClick.y = 0; + _lastClick.time = 0; + _lastClick.count = 0; + + _prepare_for_gui = false; + } + + activeDialog->handleTickle(); + + if (_need_redraw) { + for (i = 0; i < _dialogStack.size(); i++) + _dialogStack[i]->draw(); + _need_redraw = false; + } + + _s->animateCursor(); + + if (_eventList.size() > 0) + { + OSystem::Event t; + + for (i = 0; i < _eventList.size(); i++) + { + t = _eventList[i]; + + switch(t.event_code) { + case OSystem::EVENT_KEYDOWN: + activeDialog->handleKeyDown(t.kbd.ascii, t.kbd.flags); + + // init continuous event stream + _currentKeyDown = t.kbd.ascii; + _currentKeyDownFlags = t.kbd.flags; + _keyRepeatEvenCount = 1; + _keyRepeatLoopCount = 0; + break; + case OSystem::EVENT_KEYUP: + activeDialog->handleKeyUp(t.kbd.ascii, t.kbd.flags); + if (t.kbd.ascii == _currentKeyDown) + // only stop firing events if it's the current key + _currentKeyDown = 0; + break; + case OSystem::EVENT_MOUSEMOVE: + activeDialog->handleMouseMoved(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 0); + break; + // We don't distinguish between mousebuttons (for now at least) + case OSystem::EVENT_LBUTTONDOWN: + case OSystem::EVENT_RBUTTONDOWN: { + uint32 time = _s->_system->get_msecs(); + if (_lastClick.count && (time < _lastClick.time + 1000) + && ABS(_lastClick.x - t.mouse.x) < 3 + && ABS(_lastClick.y - t.mouse.y) < 3) { + _lastClick.count++; + } else { + _lastClick.x = t.mouse.x; + _lastClick.y = t.mouse.y; + _lastClick.count = 1; + } + _lastClick.time = time; + } + activeDialog->handleMouseDown(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 1, _lastClick.count); + break; + case OSystem::EVENT_LBUTTONUP: + case OSystem::EVENT_RBUTTONUP: + activeDialog->handleMouseUp(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 1, _lastClick.count); + break; + } + } + + _eventList.clear(); + } + + // check if event should be sent again (keydown) + if (_currentKeyDown != 0) + { + // if only fired once, wait longer + if ( _keyRepeatLoopCount >= ((_keyRepeatEvenCount > 1) ? 2 : 4) ) + // ^ loops to wait first event + // ^ loops to wait after first event + { + // fire event + activeDialog->handleKeyDown(_currentKeyDown, _currentKeyDownFlags); + _keyRepeatEvenCount++; + _keyRepeatLoopCount = 0; + } + _keyRepeatLoopCount++; + } + + _s->drawDirtyScreenParts(); +} + +#pragma mark - + +void NewGui::saveState() +{ + _old_soundsPaused = _s->_sound->_soundsPaused; + _s->_sound->pauseSounds(true); + + // Backup old cursor + memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); + _old_cursorWidth = _s->_cursorWidth; + _old_cursorHeight = _s->_cursorHeight; + _old_cursorHotspotX = _s->_cursorHotspotX; + _old_cursorHotspotY = _s->_cursorHotspotY; + _old_cursor_mode = _s->_system->show_mouse(true); + + _s->_cursorAnimate++; + _s->gdi._cursorActive = 1; +} + +void NewGui::restoreState() +{ + _s->_fullRedraw = true; + _s->_completeScreenRedraw = true; + _s->_cursorAnimate--; + + // Restore old cursor + memcpy(_s->_grabbedCursor, _old_grabbedCursor, sizeof(_old_grabbedCursor)); + _s->_cursorWidth = _old_cursorWidth; + _s->_cursorHeight = _old_cursorHeight; + _s->_cursorHotspotX = _old_cursorHotspotX; + _s->_cursorHotspotY = _old_cursorHotspotY; + _s->updateCursor(); + + _s->_system->show_mouse(_old_cursor_mode); + + _s->_sound->pauseSounds(_old_soundsPaused); +} + +void NewGui::openDialog(Dialog *dialog) +{ + if (_dialogStack.empty()) + _prepare_for_gui = true; + else if (_use_alpha_blending) + dialog->setupScreenBuf(); + + _dialogStack.push(dialog); + _need_redraw = true; +} + +void NewGui::closeTopDialog() +{ + // Don't do anything if no dialog is open + if (_dialogStack.empty()) + return; + + // Tear down its screenBuf + if (_use_alpha_blending) + _dialogStack.top()->teardownScreenBuf(); + + // Remove the dialog from the stack + _dialogStack.pop(); + if (_dialogStack.empty()) + restoreState(); + else + _need_redraw = true; +} + +#pragma mark - + +const char *NewGui::queryResString(int stringno) +{ + char *result; + int string; + + if (stringno == 0) + return NULL; + + if (_s->_features & GF_AFTER_V7) + string = _s->_vars[string_map_table_v7[stringno - 1].num]; + else if (_s->_features & GF_AFTER_V6) + string = _s->_vars[string_map_table_v6[stringno - 1].num]; + else + string = string_map_table_v5[stringno - 1].num; + + result = (char *)_s->getStringAddress(string); + + if (!result) { // Gracelessly degrade to english :) + if (_s->_features & GF_AFTER_V6) + return string_map_table_v6[stringno - 1].string; + else + return string_map_table_v5[stringno - 1].string; + } + + return result; +} + +const char *NewGui::queryCustomString(int stringno) +{ + return string_map_table_custom[stringno]; +} + + +#pragma mark - + + +byte *NewGui::getBasePtr(int x, int y) +{ + VirtScreen *vs = _s->findVirtScreen(y); + + if (vs == NULL) + return NULL; + + return vs->screenPtr + x + (y - vs->topline) * 320 + + _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; +} + +void NewGui::box(int x, int y, int width, int height) +{ + hline(x + 1, y, x + width - 2, _color); + hline(x, y + 1, x + width - 1, _color); + vline(x, y + 1, y + height - 2, _color); + vline(x + 1, y, y + height - 1, _color); + + hline(x + 1, y + height - 2, x + width - 1, _shadowcolor); + hline(x + 1, y + height - 1, x + width - 2, _shadowcolor); + vline(x + width - 1, y + 1, y + height - 2, _shadowcolor); + vline(x + width - 2, y + 1, y + height - 1, _shadowcolor); +} + +void NewGui::line(int x, int y, int x2, int y2, byte color) +{ + byte *ptr; + + if (x2 < x) + x2 ^= x ^= x2 ^= x; // Swap x2 and x + + if (y2 < y) + y2 ^= y ^= y2 ^= y; // Swap y2 and y + + ptr = getBasePtr(x, y); + + if (ptr == NULL) + return; + + if (x == x2) { + /* vertical line */ + while (y++ <= y2) { + *ptr = color; + ptr += 320; + } + } else if (y == y2) { + /* horizontal line */ + while (x++ <= x2) { + *ptr++ = color; + } + } +} + +void NewGui::blendRect(int x, int y, int w, int h, byte color) +{ + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + while (h--) { + for (int i = 0; i < w; i++) { + ptr[i] = Blend(ptr[i], color, _s->_currentPalette); + } + ptr += 320; + } +} + +void NewGui::fillRect(int x, int y, int w, int h, byte color) +{ + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + while (h--) { + for (int i = 0; i < w; i++) { + ptr[i] = color; + } + ptr += 320; + } +} + +void NewGui::checkerRect(int x, int y, int w, int h, byte color) +{ + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + while (h--) { + for (int i = 0; i < w; i++) { + if ((h ^ i) & 1) + ptr[i] = color; + } + ptr += 320; + } +} + +void NewGui::frameRect(int x, int y, int w, int h, byte color) +{ + int i; + byte *ptr, *basePtr = getBasePtr(x, y); + if (basePtr == NULL) + return; + + ptr = basePtr; + for (i = 0; i < w; i++, ptr++) + *ptr = color; + ptr--; + for (i = 0; i < h; i++, ptr += 320) + *ptr = color; + ptr = basePtr; + for (i = 0; i < h; i++, ptr += 320) + *ptr = color; + ptr -= 320; + for (i = 0; i < w; i++, ptr++) + *ptr = color; +} + +void NewGui::addDirtyRect(int x, int y, int w, int h) +{ + VirtScreen *vs = _s->findVirtScreen(y); + + if (vs != NULL) + _s->setVirtscreenDirty(vs, x, y, x + w, y + h); +} + +void NewGui::drawChar(const char str, int xx, int yy) +{ + unsigned int buffer = 0, mask = 0, x, y; + byte *tmp; + int tempc = _color; + _color = _textcolor; + + tmp = &guifont[0]; + tmp += 224 + (str + 1) * 8; + + byte *ptr = getBasePtr(xx, yy); + if (ptr == NULL) + return; + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + unsigned char color; + if ((mask >>= 1) == 0) { + buffer = *tmp++; + mask = 0x80; + } + color = ((buffer & mask) != 0); + if (color) + ptr[x] = _color; + } + ptr += 320; + } + _color = tempc; + +} + +void NewGui::drawString(const char *str, int x, int y, int w, byte color, int align) +{ + if (_s->_gameId) { /* If a game is active.. */ + StringTab *st = &_s->string[5]; + st->charset = 1; + st->center = (align == kTextAlignCenter); + st->color = color; + + if (align == kTextAlignLeft) + st->xpos = x; + else if (align == kTextAlignCenter) + st->xpos = x + w/2; + else if (align == kTextAlignRight) + st->xpos = x + w - _s->charset.getStringWidth(0, (byte *)str, 0); + + st->ypos = y; + st->right = x + w; + + _s->_messagePtr = (byte *)str; + _s->drawString(5); + } else { + // FIXME - support center/right align, use nicer custom font. + // Ultimately, we might want to *always* draw our messages this way, + // but only if we have a nice font. + uint len = strlen(str); + for (uint letter = 0; letter < len; letter++) + drawChar(str[letter], x + (letter * 8), y); + } +} + +/* + * Draw an 8x8 bitmap at location (x,y) + */ +void NewGui::drawBitmap(uint32 bitmap[8], int x, int y, byte color) +{ + byte *ptr = getBasePtr(x, y); + if (ptr == NULL) + return; + + for (int y2 = 0; y2 < 8; y2++) { + uint32 mask = 0xF0000000; + for (int x2 = 0; x2 < 8; x2++) { + if (bitmap[y2] & mask) + ptr[x2] = color; + mask >>= 4; + } + ptr += 320; + } +} + +void NewGui::blitTo(byte buffer[320*200], int x, int y, int w, int h) +{ + byte *dstPtr = buffer + x + y*320; + byte *srcPtr = getBasePtr(x, y); + if (srcPtr == NULL) + return; + + while (h--) { + for (int i = 0; i < w; i++) { + *dstPtr++ = *srcPtr++; + } + dstPtr += 320 - w; + srcPtr += 320 - w; + } +} + +void NewGui::blitFrom(byte buffer[320*200], int x, int y, int w, int h) +{ + byte *srcPtr = buffer + x + y*320; + byte *dstPtr = getBasePtr(x, y); + if (dstPtr == NULL) + return; + + while (h--) { + for (int i = 0; i < w; i++) { + *dstPtr++ = *srcPtr++; + } + dstPtr += 320 - w; + srcPtr += 320 - w; + } +} + diff --git a/gui/newgui.h b/gui/newgui.h new file mode 100644 index 0000000000..f78f31ee2d --- /dev/null +++ b/gui/newgui.h @@ -0,0 +1,151 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef NEWGUI_H +#define NEWGUI_H + +#include "scummsys.h" +#include "system.h" // For events +#include "util.h" + +class Dialog; +class Scumm; + +#define hline(x, y, x2, color) line(x, y, x2, y, color); +#define vline(x, y, y2, color) line(x, y, x, y2, color); + +enum { + kTextAlignLeft, + kTextAlignCenter, + kTextAlignRight, +}; + +// Extremly simple stack class, doesn't even do any error checking (for now) +class DialogStack { +protected: + Dialog *_stack[10]; // Anybody nesting dialogs deeper than 4 is mad anyway + int _size; +public: + DialogStack() : _size(0) {} + + bool empty() const { return _size <= 0; } + void push(Dialog *d) { _stack[_size++] = d; } + Dialog *top() const { return _stack[_size-1]; } + void pop() { if (_size > 0) _stack[--_size] = 0; } + int size() const { return _size; } + Dialog *operator [](int i) { return _stack[i]; } +}; + +typedef ScummVM::List EventList; + +// This class hopefully will replace the old Gui class completly one day +class NewGui { + friend class Dialog; +public: + byte _color, _shadowcolor; + byte _bgcolor; + byte _textcolor; + byte _textcolorhi; + + // Dialogs + void pauseDialog(); + void saveloadDialog(); + void aboutDialog(); + void optionsDialog(); + void soundDialog(); + + void loop(); + + bool isActive() { return ! _dialogStack.empty(); } + + NewGui(Scumm *s); + + void handleEvent(const OSystem::Event &event) { _eventList.push_back(event); } + + Scumm *getScumm() { return _s; } + +protected: + Scumm *_s; + bool _use_alpha_blending; + bool _need_redraw; + bool _prepare_for_gui; + DialogStack _dialogStack; + + Dialog *_pauseDialog; + Dialog *_saveLoadDialog; + Dialog *_aboutDialog; + Dialog *_optionsDialog; + Dialog *_soundDialog; + + // for continuous events (keyDown) + int _currentKeyDown, _currentKeyDownFlags; + int _keyRepeatLoopCount; + int _keyRepeatEvenCount; + + // sound state + bool _old_soundsPaused; + + // mouse cursor state + bool _old_cursor_mode; + int _old_cursorHotspotX, _old_cursorHotspotY, _old_cursorWidth, _old_cursorHeight; + byte _old_grabbedCursor[2048]; + + // position and time of last mouse click (used to detect double clicks) + struct { + int16 x, y; // Position of mouse when the click occured + uint32 time; // Time + int count; // How often was it already pressed? + } _lastClick; + + // List of events to be handled + EventList _eventList; + + void saveState(); + void restoreState(); + + void openDialog(Dialog *dialog); + void closeTopDialog(); + +public: + // Drawing + byte *getBasePtr(int x, int y); + void box(int x, int y, int width, int height); + void line(int x, int y, int x2, int y2, byte color); + void blendRect(int x, int y, int w, int h, byte color); + void fillRect(int x, int y, int w, int h, byte color); + void checkerRect(int x, int y, int w, int h, byte color); + void frameRect(int x, int y, int w, int h, byte color); + void addDirtyRect(int x, int y, int w, int h); + void drawChar(const char c, int x, int y); + void drawString(const char *str, int x, int y, int w, byte color, int align = kTextAlignLeft); + + void drawBitmap(uint32 bitmap[8], int x, int y, byte color); + void blitTo(byte buffer[320*200], int x, int y, int w, int h); + void blitFrom(byte buffer[320*200], int x, int y, int w, int h); + + // Query a string from the resources + const char *queryResString(int stringno); + + // Query a custom string. This is in a seperate method so that we + // can easily localize the messages in the future if we want to. + const char *queryCustomString(int stringno); +}; + +#endif diff --git a/guimaps.h b/guimaps.h deleted file mode 100644 index 181dbb6bc9..0000000000 --- a/guimaps.h +++ /dev/null @@ -1,157 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#if !defined(guimaps_h) -#define guimaps_h - -struct ResString { - int num; - char string[80]; -}; - -// String maps -static const char* string_map_table_custom[] = { - "Master Volume :", //0 - "Music Volume :", //1 - "SFX Volume :", //2 - "+", //3 - "-", //4 - "Sound", //5 - "Keys", //6 - "About", //7 - "Pocket ScummVM", //8 - "Build " SCUMMVM_VERSION " (" SCUMMVM_CVS ")", //9 - "ScummVM http://scummvm.sourceforge.net", //10 - "All games (c) LucasArts", //11 - "Quit", //12 - "Pause", //13 - "Save", //14 - "Skip", //15 - "Hide", //16 - "Options", //17 - "Misc", //18 - "Show speech subtitles", //19 - "Amiga palette conversion", //20 - "Except:", //21 - "Simon the Sorcerer (c) Adventuresoft", //22 - "Close" //23 -}; - -static ResString string_map_table_v7[] = { - {96, "game name and version"}, //that's how it's supposed to be - {77, "Select a game to LOAD"}, - {76, "Name your SAVE game"}, - {70, "save"}, //boot8 - {71, "load"}, //boot9 - {72, "play"}, //boot10 - {73, "cancel"}, //boot11 - {74, "quit"}, //boot12 - {75, "ok"}, //boot13 - {85, "game paused"}, // boot3 - - /* this is the almost complete string map for v7 - {63, "how may I serve you?"}, - {64, "the dig v1.0"}, //(game name/version) - {67, "text display only"}, - {68, "c:\\dig"}, //boot007 (save path ?) - {69, "the dig"}, //boot21 (game name) - {70, "save"}, //boot8 - {71, "load"}, //boot9 - {72, "play"}, //boot10 - {73, "cancel"}, //boot11 - {74, "quit"}, //boot12 - {75, "ok"}, //boot13 - {76, "name your save game"}, //boot19 - {77, "select a game to load"}, //boot20 - {78, "you must enter a name"},//boot14 - {79, "saving '%s'"}, //boot17 - {80, "loading '%s'"}, //boot18 - {81, "the game was NOT saved"}, //boot15 - {82, "the game was NOT loaded"}, //boot16 - {83, "how may I serve you?"}, - {84, "how may I serve you?"}, - {85, "game paused"}, // boot3 - {86, "Are you sure you want to restart"}, - {87, "Are you sure you want to quit?"}, //boot05 - {89, "how may I serve you?"}, - {90, "music"}, //boot22 - {91, "voice"}, //boot23 - {92, "sfx"}, //boot24 - {93, "disabled"}, //boot25 - {94, "text speed"}, //boot26 - {95, "text display"}, //boot27 - {96, "the dig v1.0"},*/ - -}; - -static ResString string_map_table_v6[] = { - {117, "How may I serve you?"}, - {109, "Select a game to LOAD"}, - {108, "Name your SAVE game"}, - {96, "Save"}, - {97, "Load"}, - {98, "Play"}, - {99, "Cancel"}, - {100, "Quit"}, - {101, "Ok"}, - {93, "Game paused"}, -}; - -static ResString string_map_table_v5[] = { - {28, "How may I serve you?"}, - {20, "Select a game to LOAD"}, - {19, "Name your SAVE game"}, - {7, "Save"}, - {8, "Load"}, - {9, "Play"}, - {10, "Cancel"}, - {11, "Quit"}, - {12, "Ok"}, - {4, "Game paused"} -}; - -// Built-in font -static byte guifont[] = {0,0,99,1,226,8,4,8,6,8,6,0,0,0,0,0,0,0,0,0,0,0,8,2,1,8,0,0,0,0,0,0,0,0,0,0,0,0,4,3,7,8,7,7,8,4,5,5,8,7,4,7,3,8,7,7,7,7,8,7,7,7,7,7,3,4,7,5,7,7,8,7,7,7,7,7,7,7,7,5,7,7, -7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5,0,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0, -0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,1,3,6,12, -24,62,3,0,128,192,96,48,24,124,192,0,0,3,62,24,12,6,3,1,0,192,124,24,48,96,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,74,72,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,60,66,153,161,161,153,66,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,96,96,96,96,0,0,96,0,102,102,102,0,0,0,0,0,102,102,255,102,255,102,102,0,24,62,96,60,6,124,24,0,98,102,12,24,48,102,70,0,60,102,60,56,103,102,63,0,96,48,16,0,0,0,0,0,24,48,96,96,96,48,24,0,96,48,24,24,24,48,96,0, -0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0,0,0,0,0,0,48,48,96,0,0,0,126,0,0,0,0,0,0,0,0,0,96,96,0,0,3,6,12,24,48,96,0,60,102,102,102,102,102,60,0,24,24,56,24,24,24,126,0,60,102,6,12,48,96,126,0,60,102,6,28,6,102,60,0,6, -14,30,102,127,6,6,0,126,96,124,6,6,102,60,0,60,102,96,124,102,102,60,0,126,102,12,24,24,24,24,0,60,102,102,60,102,102,60,0,60,102,102,62,6,102,60,0,0,0,96,0,0,96,0,0,0,0,48,0,0,48,48,96,14,24,48,96,48,24,14,0,0,0,120,0,120,0,0,0,112,24, -12,6,12,24,112,0,60,102,6,12,24,0,24,0,0,0,0,255,255,0,0,0,24,60,102,126,102,102,102,0,124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0,120,108,102,102,102,108,120,0,126,96,96,120,96,96,126,0,126,96,96,120,96,96,96,0,60,102,96,110,102,102,60,0,102,102,102, -126,102,102,102,0,120,48,48,48,48,48,120,0,30,12,12,12,12,108,56,0,102,108,120,112,120,108,102,0,96,96,96,96,96,96,126,0,99,119,127,107,99,99,99,0,102,118,126,126,110,102,102,0,60,102,102,102,102,102,60,0,124,102,102,124,96,96,96,0,60,102,102,102,102,60,14,0,124,102,102,124, -120,108,102,0,60,102,96,60,6,102,60,0,126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0,102,102,102,102,102,60,24,0,99,99,99,107,127,119,99,0,102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0,126,6,12,24,48,96,126,0,120,96,96,96,96,96,120,0,3,6,12,24,48, -96,192,0,120,24,24,24,24,24,120,0,0,0,0,0,0,219,219,0,0,0,0,0,0,0,0,255,102,102,102,0,0,0,0,0,0,0,60,6,62,102,62,0,0,96,96,124,102,102,124,0,0,0,60,96,96,96,60,0,0,6,6,62,102,102,62,0,0,0,60,102,126,96,60,0,0,14,24,62,24,24, -24,0,0,0,62,102,102,62,6,124,0,96,96,124,102,102,102,0,0,48,0,112,48,48,120,0,0,12,0,12,12,12,12,120,0,96,96,108,120,108,102,0,0,112,48,48,48,48,120,0,0,0,102,127,127,107,99,0,0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0,0,0,124,102,102,124,96, -96,0,0,62,102,102,62,6,6,0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0,0,24,126,24,24,24,14,0,0,0,102,102,102,102,62,0,0,0,102,102,102,60,24,0,0,0,99,107,127,62,54,0,0,0,102,60,24,60,102,0,0,0,102,102,102,62,12,120,0,0,126,12,24,48,126,0, -24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0,0,0,0,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48, -24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,60,96,96,96,60,24,56,24,36,60,102,126,96,60,0,102,0,60,102,126,96,60,0,48,24,60,102,126,96,60,0,0,216,0,112,48,48,120,0,48,72,0,112,48,48,120,0,96,48,0,112,48,48,120,0,102,24,60,102,126,102,102,0,0,0, -0,0,0,0,0,0,24,48,124,96,120,96,124,0,0,0,108,26,126,216,110,0,30,40,40,126,72,136,142,0,24,36,60,102,102,102,60,0,102,0,60,102,102,102,60,0,48,24,60,102,102,102,60,0,24,36,0,102,102,102,62,0,48,24,102,102,102,102,62,0,0,0,0,0,0,0,0,0,102,60,102, -102,102,102,60,0,102,0,102,102,102,102,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,28,54,54,124,102,102,124,64,0,0,0}; -#endif diff --git a/insane.cpp b/insane.cpp deleted file mode 100644 index ef9dd779eb..0000000000 --- a/insane.cpp +++ /dev/null @@ -1,1510 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#if !defined(macintosh) && !defined(__MORPHOS__) -#define NEED_SDL_HEADERS -#endif - -#ifdef _WIN32_WCE -#define PICKY_ALIGN -#endif - -#include "stdafx.h" -#include "scumm.h" -#include "smush.h" - -static SmushPlayer * h_sp; - -SmushPlayer::SmushPlayer(Scumm * parent) { - _scumm = parent; - h_sp = this; -} - -SmushPlayer::~SmushPlayer() { -} - -static void smush_handler (Scumm * scumm) { - h_sp->update(); -} - -byte * SmushPlayer::loadTres() { - byte buf[100]; - FILE * f_tres; - uint32 tmp, l; - - sprintf((char *)buf, "%sVIDEO/DIGTXT.TRS", (byte *)_scumm->getGameDataPath()); - f_tres = (FILE*)_scumm->fileOpen((char *)&buf, 1); - - if (f_tres == NULL) { - sprintf((char *)buf, "%svideo/digtxt.trs", (byte *)_scumm->getGameDataPath()); - f_tres = (FILE*)_scumm->fileOpen((char *)&buf, 1); - if (f_tres == NULL) - return NULL; - } - - _scumm->fileRead(f_tres, &tmp, 4); // read tag - if (_scumm->_fileReadFailed) - error("SP: error while reading TRES"); - - tmp = READ_BE_UINT32(&tmp); - if (tmp == 'ETRS') - { - _scumm->fileRead(f_tres, &tmp, 4); // read length - tmp = READ_BE_UINT32(&tmp); - tmp -= 8; - _bufferTres = (byte*)malloc (tmp + 1); - _scumm->fileRead(f_tres, _bufferTres, 8); // skip 8 bytes - _scumm->fileRead(f_tres, _bufferTres, tmp); - for (l = 0; l < tmp; l++) - *(_bufferTres + l) ^= 0xcc; - _bufferTres[tmp] = 0; - } - else - { - _scumm->fileSeek(f_tres, 0, SEEK_END); // assume file is unencrypted - tmp = ftell(f_tres); - _scumm->fileSeek(f_tres, 0, SEEK_SET); - _bufferTres = (byte*)malloc (tmp + 1); - fread(_bufferTres, tmp, 1, f_tres); - _bufferTres[tmp] = 0; - } - _scumm->fileClose(f_tres); - - return _bufferTres; -} - -void SmushPlayer::loadFonts() { - byte buf[100]; - FILE * f_tres; - uint32 tmp; - int l; - byte * buffer = NULL; - - for (l = 0; l < SP_MAX_FONTS; l++) - { - _fonts [l] = NULL; - sprintf((char *)buf, "%sVIDEO/FONT%d.NUT", (char *)_scumm->getGameDataPath(), l); - f_tres = (FILE*)_scumm->fileOpen((char *)buf, 1); - - if (f_tres == NULL) { - sprintf((char *)buf, "%svideo/font%d.nut", (char *)_scumm->getGameDataPath(), l); - f_tres = (FILE*)_scumm->fileOpen((char *)buf, 1); - if (f_tres == NULL) - continue; - } - - _scumm->fileRead(f_tres, &tmp, 4); // read tag - tmp = READ_BE_UINT32(&tmp); - if (tmp == 'ANIM') { - _scumm->fileRead(f_tres, &tmp, 4); // read length - tmp = READ_BE_UINT32(&tmp); - buffer = (byte *)malloc(tmp); - _scumm->fileRead(f_tres, buffer, tmp); - _fonts[l] = buffer; - } - _scumm->fileClose(f_tres); - } -} - -byte * SmushPlayer::getStringTRES(int32 number) { - byte * txt = NULL; - uint32 l, i, j; - - for (l = 0;; l++) { - char t = *(_bufferTres + l); - if (t == 0) - break; - if (t == '#') { - byte buf[10]; - strncpy ((char*)buf, (char*)_bufferTres + l + 1, 9); - buf[9] = 0; - if (strcmp ((char*)buf, "define a ") == 0) { - l += 10; - for (i = 0; i < 5; i++) { - buf[i] = *(_bufferTres + l + i); - if (buf[i] == 0x0d) - { - buf[i] = 0; - l += 2; - break; - } - } - if (atol((char*)buf) == number) { - for (j = 0; j < 200; j++) { - t = *(_bufferTres + l + j + i); - if ((t == 0) || (t == '#')) - break; - } - txt = (byte *)malloc(j + 1); - strncpy((char*)txt, (char*)_bufferTres + l + i, j); - txt[j] = 0; - return txt; - } - } - } - } - - return txt; -} - -uint32 SmushPlayer::getFontHeight(uint8 c_font) { - byte * font = _fonts[c_font]; - uint32 offset = 0, t_offset = 0; - - if (font == NULL) - return 0; - - if (READ_BE_UINT32(font) != 'AHDR') - return 0; - - offset = READ_BE_UINT32(font + 4) + 8; - if (READ_BE_UINT32(font + offset) == 'FRME') { - offset += 8; - if (READ_BE_UINT32(font + offset) == 'FOBJ') { - t_offset = offset + 8; - } - else - return 0; - } - return READ_LE_UINT16(font + t_offset + 8); -} - -uint32 SmushPlayer::getCharWidth(uint8 c_font, byte txt) { - byte * font = _fonts[c_font]; - uint32 offset = 0, t_offset = 0, l; - - if (font == NULL) - return 0; - - if (READ_BE_UINT32(font) != 'AHDR') - return 0; - - offset = READ_BE_UINT32(font + 4) + 8; - for (l = 0; l <= txt; l++) { - if (READ_BE_UINT32(font + offset) == 'FRME') { - offset += 8; - if (READ_BE_UINT32(font + offset) == 'FOBJ') { - t_offset = offset + 8; - offset += READ_BE_UINT32(font + offset + 4) + 8; - } - else - return 0; - } - else - return 0; - } - return READ_LE_UINT16(font + t_offset + 6); -} - -void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt) { - char buf[4]; - uint32 c_line = 0, l = 0, i, tmp_x, x_pos, last_l, t_width, t_height; - uint8 c_font = 0, c_color = 0, last_j; - int j; - - if ((txt[l] == '^') && (txt[l + 1] == 'f')) { - buf[0] = txt[l + 2]; - buf[1] = txt[l + 3]; - buf[2] = 0; - l += 4; - c_font = atoi(buf); - if (c_font >= SP_MAX_FONTS) - error ("SP: number font out of range"); - } - if ((txt[l] == '^') && (txt[l + 1] == 'c')) { - buf[0] = txt[l + 2]; - buf[1] = txt[l + 3]; - buf[2] = txt[l + 4]; - buf[3] = 0; - l += 5; - c_color = atoi(buf); - } - - t_height = getFontHeight(c_font); - x_pos = x; - last_j = 0; - last_l = l; - - for (j = 0;; j++) { - if (txt[l + j] == 0) { - break; - } - if (txt[l + j] == 0x0d) { - if (txt[l + j + 2] == 0x0d) break; - l += j + 2; - j = -1; - last_j = 0; - c_line++; - x_pos = x; - if (c_line * t_height + y >= 200) { - if (y > t_height) { - y -= t_height; - } - else - { - y = 0; - } - continue; - } - } - t_width = getCharWidth (c_font, txt[l + j]); - if (x_pos + t_width >= 320) { - if ((x > t_width) && (c_line == 0)) { - x -= t_width; - x_pos += t_width; - if (txt[l + j] == ' ') { - last_j = j; - } - continue; - } - j = last_j; - txt[l + j] = 0x0d; - x_pos = x; - c_line++; - l++; - j = -1; - last_j = 0; - if (c_line * t_height + y >= 200) { - if (y > t_height) { - y -= t_height; - } - else { - y = 0; - } - } - } - else { - x_pos += t_width; - if (txt[l + j] == ' ') { - last_j = j; - } - } - } - - l = last_l; - c_line = 0; - - for (;;) { - tmp_x = x; - for (i = 0;; i++) { - if (txt[l + i] == 0) - goto exit_loop; - if (txt[l + i] == 0x0d) { - if (txt[l + i + 1] == 0x0a) { - l += i + 2; - break; - } - else { - l += i + 1; - break; - } - } - drawCharTRES (&tmp_x, y, c_line, c_font, c_color, txt[l + i]); - } - c_line++; - } -exit_loop: ; - -} - -void SmushPlayer::codec44Depack(byte *dst, byte *src, uint32 len) { - byte val; - uint16 size_line; - uint16 num; - - do { - size_line = READ_LE_UINT16(src); - src += 2; - len -= 2; - - for (; size_line != 0;) { - num = *src++; - val = *src++; - memset(dst, val, num); - dst += num; - len -= 2; - size_line -= 2; - if (size_line == 0) break; - - num = READ_LE_UINT16(src) + 1; - src += 2; - memcpy(dst, src, num); - dst += num; - src += num; - len -= num + 2; - size_line -= num + 2; - - } - dst--; - - } while (len > 1); -} - -void SmushPlayer::drawCharTRES(uint32 * x, uint32 y, uint32 c_line, uint8 c_font, uint8 color, uint8 txt) { - byte * font = _fonts[c_font]; - uint32 offset = 0, t_offset = 0, l, width, height, length = 0; - - if (font == NULL) - return; - - if (READ_BE_UINT32(font) != 'AHDR') - return; - - offset = READ_BE_UINT32(font + 4) + 8; - for (l = 0; l <= txt; l++) { - if (READ_BE_UINT32(font + offset) == 'FRME') { - offset += 8; - if (READ_BE_UINT32(font + offset) == 'FOBJ') { - t_offset = offset + 8; - length = READ_BE_UINT32(font + offset + 4) - 0xe; - offset += READ_BE_UINT32(font + offset + 4) + 8; - } - else - return; - } - else - return; - } - - byte * dst = (byte*)malloc (1000); - byte * src = (byte*)(font + t_offset + 0x0e); - - codec44Depack (dst, src, length); - - width = READ_LE_UINT16(font + t_offset + 6); - height = READ_LE_UINT16(font + t_offset + 8); - - y += c_line * height; - for (uint32 ty = 0; ty < height; ty++) { - for (uint32 tx = 0; tx < width; tx++) { - byte pixel = *(dst + ty * width + tx); - if (pixel != 0) { - if (color == 0) { - if (pixel == 0x01) - pixel = 0xf; - } - else { - if (pixel == 0x01) - pixel = color; - } - if (pixel == 0xff) - pixel = 0x0; - *(_renderBitmap + ((ty + y) * 320 + *x + tx)) = pixel; - } - } - } - *x += width; - free (dst); -} - -uint32 SmushPlayer::nextBE32() { - uint32 a = READ_BE_UINT32(_cur); - _cur += sizeof(uint32); - - return a; -} - -void SmushPlayer::openFile(byte *fileName) { - byte buf[100]; - - sprintf((char *)buf, "%sVIDEO/%s", (char *)_scumm->getGameDataPath(), (char *)fileName); - _in = (FILE*)_scumm->fileOpen((char *)buf, 1); - - if (_in == NULL) { - sprintf((char *)buf, "%svideo/%s", (char *)_scumm->getGameDataPath(), (char *)fileName); - _in = (FILE*)_scumm->fileOpen((char *)buf, 1); - } -} - -void SmushPlayer::nextBlock() { - _blockTag = _scumm->fileReadDwordBE(_in); - _blockSize = _scumm->fileReadDwordBE(_in); - - if (_block != NULL) - free(_block); - - _block = (byte *)malloc(_blockSize); - - if (_block == NULL) - error("SP: cannot allocate memory"); - - _scumm->fileRead(_in, _block, _blockSize); -} - -bool SmushPlayer::parseTag() { - switch (nextBlock(), _blockTag) { - - case 'AHDR': - parseAHDR(); - break; - - case 'FRME': - parseFRME(); - break; - - default: - error("SP: Encountered invalid block %c%c%c%c", _blockTag >> 24, _blockTag >> 16, _blockTag >> 8, _blockTag); - } - - return true; -} - -void SmushPlayer::parseAHDR() { - memcpy(_fluPalette, _block + 6, 0x300); - _paletteChanged = true; -} - -void SmushPlayer::parseIACT() { - uint32 pos, bpos, tag, sublen, subpos, trk, idx; - byte flags; - bool new_mixer = false; - byte *buf; - - flags = SoundMixer::FLAG_AUTOFREE; - - pos = 0; - pos += 6; - - trk = READ_LE_UINT32(_cur + pos); /* FIXME: is this correct ? */ - pos += 4; - - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_imusTrk[idx] == trk) - break; - } - - if (idx == MAX_STREAMER) { - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_imusTrk[idx] == 0 && _scumm->_mixer->_channels[idx] == NULL) { - _imusTrk[idx] = trk; - _imusSize[idx] = 0; - new_mixer = true; - break; - } - } - } - - if (idx == MAX_STREAMER) { - warning("iMUS table full"); - return; - } - - pos += 8; /* FIXME: what are these ? */ - - while (pos < _frmeSize) { - - if (_imusSize[idx] == 0) { - tag = READ_BE_UINT32(_cur + pos); - pos += 4; - if (tag != 'iMUS') - error("trk %d: iMUS tag not found", trk); - _imusSize[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - } - if (_imusSubSize[idx] == 0) { - _imusSubTag[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - _imusSubSize[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - _imusSize[idx] -= 8; - debug(3, "trk %d: tag '%4s' size %x", trk, _cur + pos - 8, _imusSubSize[idx]); - } - - sublen = _imusSubSize[idx] < (_frmeSize - pos) ? _imusSubSize[idx] : (_frmeSize - pos); - - switch (_imusSubTag[idx]) { - case 'MAP ': - tag = READ_BE_UINT32(_cur + pos); - if (tag != 'FRMT') - error("trk %d: no FRMT section"); - _imusCodec[idx] = READ_BE_UINT32(_cur + pos + 16); - _imusRate[idx] = READ_BE_UINT32(_cur + pos + 20); - _imusChan[idx] = READ_BE_UINT32(_cur + pos + 24); - _imusPos[idx] = 0; - break; - case 'DATA': - switch (_imusCodec[idx]) { - case 8: - if (_imusChan[idx] == 2) - flags |= SoundMixer::FLAG_STEREO; - flags |= SoundMixer::FLAG_UNSIGNED; - buf = (byte *)malloc(sublen); - memcpy(buf, _cur + pos, sublen); - bpos = sublen; - break; - case 12: - if (_imusChan[idx] == 2) - flags |= SoundMixer::FLAG_STEREO; - flags |= SoundMixer::FLAG_16BITS; - buf = (byte *)malloc(2 * sublen); - - bpos = 0; - subpos = 0; - - while (subpos < sublen) { - - while (_imusPos[idx] < 3 && subpos < sublen) { - _imusData[idx][_imusPos[idx]] = _cur[pos + subpos]; - _imusPos[idx]++; - subpos++; - } - - if (_imusPos[idx] == 3) { - uint32 temp; - - temp = (_imusData[idx][1] & 0x0f) << 8; - temp = (temp | _imusData[idx][0]) << 4; - temp -= 0x8000; - - buf[bpos++] = (byte)((temp >> 8) & 0xff); - buf[bpos++] = (byte)(temp & 0xff); - - temp = (_imusData[idx][1] & 0xf0) << 4; - temp = (temp | _imusData[idx][2]) << 4; - temp -= 0x8000; - - buf[bpos++] = (byte)((temp >> 8) & 0xff); - buf[bpos++] = (byte)(temp & 0xff); - _imusPos[idx] = 0; - } - } - break; - default: - error("trk %d: unknown iMUS codec %d", trk, _imusCodec[idx]); - } - - debug(3, "trk %d: iMUSE play part, len 0x%x rate %d remain 0x%x", - trk, bpos, _imusRate[idx], _imusSubSize[idx]); - - _imusBuf[idx] = buf; - _imusFinalSize[idx] = bpos; - _imusFlags[idx] = flags; - _imusNewMixer[idx] = new_mixer; - - break; - default: - error("trk %d: unknown tag inside iMUS %08x [%c%c%c%c]", - trk, _imusSubTag[idx], _imusSubTag[idx] >> 24, - _imusSubTag[idx] >> 16, _imusSubTag[idx] >> 8, _imusSubTag[idx]); - } - - _imusSubSize[idx] -= sublen; - _imusSize[idx] -= sublen; - pos += sublen; - - if (_imusSubSize[idx] == 0 && _imusSubTag[idx] == 'DATA') { - _imusTrk[idx] = 0; - return; - } - } -} - -void SmushPlayer::parseNPAL() { - memcpy(_fluPalette, _cur, 0x300); - _paletteChanged = true; -} - -void SmushPlayer::codec1(CodecData * cd) { - uint y = cd->y; - byte *src = cd->src; - byte *dest = cd->out; - uint h = cd->h; - - if (!h || !cd->w) - return; - - dest += cd->y * cd->pitch; - - do { - byte color; - uint len, num; - uint x; - - if ((uint) y >= (uint) cd->outheight) { - src += READ_LE_UINT16(src)+2; - continue; - } - - len = cd->w; - x = cd->x; - src += 2; - - do { - byte code = *src++; - - num = (code >> 1) + 1; - if (num > len) - num = len; - len -= num; - - if (code & 1) { - color = *src++; -// if ((color = *src++)!=0) { - do { - if ((uint) x < (uint) cd->outwidth) - dest[x] = color; - } while (++x, --num); -// } else { -// x += num; -// } - } else { - do { - color = *src++; - if ( /*(color=*src++) != 0 && */ (uint) x < (uint) cd->outwidth) - dest[x] = color; - } while (++x, --num); - } - } while (len); - } while (dest += cd->pitch, y++, --h); -} - -void SmushPlayer::codec37BompDepack(byte *dst, byte *src, int32 len) { - byte code; - byte color; - int32 num; - - do { - code = *src++; - if (code & 1) { - num = (code >> 1) + 1; - color = *src++; - memset(dst, color, num); - dst += num; - } else { - num = (code >> 1) + 1; - memcpy(dst, src, num); - dst += num; - src += num; - } - } while (len -= num); -} - -void SmushPlayer::codec37Proc4(byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table) { - byte code, *tmp; - int32 i; - uint32 t; - - if (pitch != 320) { - warning("SP: invalid pitch"); - return; - } - - do { - i = bw; - do { - code = *src++; - if (code == 0xFD) { - t = src[0]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst, &t, sizeof uint32); - memcpy(dst + 320, &t, sizeof uint32); - memcpy(dst + 320 * 2, &t, sizeof uint32); - memcpy(dst + 320 * 3, &t, sizeof uint32); -#else - *(uint32 *)(dst + 0) = t; - *(uint32 *)(dst + 320) = t; - *(uint32 *)(dst + 320 * 2) = t; - *(uint32 *)(dst + 320 * 3) = t; -#endif - src += 1; - dst += 4; - } else if (code == 0xFE) { - t = src[0]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst, &t, sizeof uint32); -#else - *(uint32 *)(dst + 0) = t; -#endif - t = src[1]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320) = t; -#endif - t = src[2]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320 * 2, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320 * 2) = t; -#endif - t = src[3]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320 * 3, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320 * 3) = t; -#endif - src += 4; - dst += 4; - } else if (code == 0xFF) { -#ifdef PICKY_ALIGN - memcpy(dst, src, sizeof uint32); - memcpy(dst + 320, src + sizeof uint32, sizeof uint32); - memcpy(dst + 320 * 2, src + 2 * sizeof uint32, sizeof uint32); - memcpy(dst + 320 * 3, src + 3 * sizeof uint32, sizeof uint32); -#else - *(uint32 *)(dst + 0) = ((uint32 *)src)[0]; - *(uint32 *)(dst + 320) = ((uint32 *)src)[1]; - *(uint32 *)(dst + 320 * 2) = ((uint32 *)src)[2]; - *(uint32 *)(dst + 320 * 3) = ((uint32 *)src)[3]; -#endif - src += 16; - dst += 4; - } else if (code == 0x00) { - uint16 count = src[0] + 1; - src += 1; - for (uint16 l = 0; l < count; l++) { - tmp = dst + next_offs; -#ifdef PICKY_ALIGN - memcpy(dst, tmp, sizeof uint32); - memcpy(dst + 320, tmp + 320, sizeof uint32); - memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); - memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); -#else - *(uint32 *)(dst + 0) = *(uint32 *)(tmp); - *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); - *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); - *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); -#endif - dst += 4; - i--; - if (i == 0) { - i = bw; - dst += 320 * 4 - 320; - bh--; - } - } - i++; - } else { - tmp = dst + table[code] + next_offs; -#ifdef PICKY_ALIGN - memcpy(dst, tmp, sizeof uint32); - memcpy(dst + 320, tmp + 320, sizeof uint32); - memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); - memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); -#else - *(uint32 *)(dst + 0) = *(uint32 *)(tmp); - *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); - *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); - *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); -#endif - dst += 4; - } - if (i <= 0) - break; - if (bh <= 0) - break; - } while (--i); - dst += 320 * 4 - 320; - if (bh <= 0) - break; - } while (--bh); -} - - -void SmushPlayer::codec37Proc5(int32 game, byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, - - int32 pitch, int16 *table) { - byte code, *tmp; - int32 i; - uint32 t; - - if (pitch != 320) { - warning("SP: invalid pitch"); - return; - } - - do { - i = bw; - do { - code = *src++; - - // FIXME: Full Throttle has different FD and FEs? - if ((game == GID_DIG) && (code == 0xFD)) { - t = src[0]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst, &t, sizeof uint32); - memcpy(dst + 320, &t, sizeof uint32); - memcpy(dst + 320 * 2, &t, sizeof uint32); - memcpy(dst + 320 * 3, &t, sizeof uint32); -#else - *(uint32 *)(dst + 0) = t; - *(uint32 *)(dst + 320) = t; - *(uint32 *)(dst + 320 * 2) = t; - *(uint32 *)(dst + 320 * 3) = t; -#endif - src += 1; - dst += 4; - } else if ((game == GID_DIG) && (code == 0xFE)) { - t = src[0]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst, &t, sizeof uint32); -#else - *(uint32 *)(dst + 0) = t; -#endif - t = src[1]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320) = t; -#endif - t = src[2]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320 * 2, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320 * 2) = t; -#endif - t = src[3]; - t += (t << 8) + (t << 16) + (t << 24); -#ifdef PICKY_ALIGN - memcpy(dst + 320 * 3, &t, sizeof uint32); -#else - *(uint32 *)(dst + 320 * 3) = t; -#endif - src += 4; - dst += 4; - } else if (code == 0xFF) { -#ifdef PICKY_ALIGN - memcpy(dst, src, sizeof uint32); - memcpy(dst + 320, src + sizeof uint32, sizeof uint32); - memcpy(dst + 320 * 2, src + 2 * sizeof uint32, sizeof uint32); - memcpy(dst + 320 * 3, src + 3 * sizeof uint32, sizeof uint32); -#else - *(uint32 *)(dst + 0) = ((uint32 *)src)[0]; - *(uint32 *)(dst + 320) = ((uint32 *)src)[1]; - *(uint32 *)(dst + 320 * 2) = ((uint32 *)src)[2]; - *(uint32 *)(dst + 320 * 3) = ((uint32 *)src)[3]; -#endif - src += 16; - dst += 4; - } else { - tmp = dst + table[code] + next_offs; -#ifdef PICKY_ALIGN - memcpy(dst, tmp, sizeof uint32); - memcpy(dst + 320, tmp + 320, sizeof uint32); - memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); - memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); -#else - *(uint32 *)(dst + 0) = *(uint32 *)(tmp); - *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); - *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); - *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); -#endif - dst += 4; - } - } while (--i); - dst += 320 * 4 - 320; - } while (--bh); -} - -// this table is the same in FT and Dig -static const int8 maketable_bytes[] = { - 0, 0, 1, 0, 2, 0, 3, 0, 5, 0, 8, 0, 13, 0, 21, 0, - -1, 0, -2, 0, -3, 0, -5, 0, -8, 0, -13, 0, -17, 0, -21, 0, - 0, 1, 1, 1, 2, 1, 3, 1, 5, 1, 8, 1, 13, 1, 21, 1, - -1, 1, -2, 1, -3, 1, -5, 1, -8, 1, -13, 1, -17, 1, -21, 1, - 0, 2, 1, 2, 2, 2, 3, 2, 5, 2, 8, 2, 13, 2, 21, 2, - -1, 2, -2, 2, -3, 2, -5, 2, -8, 2, -13, 2, -17, 2, -21, 2, - 0, 3, 1, 3, 2, 3, 3, 3, 5, 3, 8, 3, 13, 3, 21, 3, - -1, 3, -2, 3, -3, 3, -5, 3, -8, 3, -13, 3, -17, 3, -21, 3, - 0, 5, 1, 5, 2, 5, 3, 5, 5, 5, 8, 5, 13, 5, 21, 5, - -1, 5, -2, 5, -3, 5, -5, 5, -8, 5, -13, 5, -17, 5, -21, 5, - 0, 8, 1, 8, 2, 8, 3, 8, 5, 8, 8, 8, 13, 8, 21, 8, - -1, 8, -2, 8, -3, 8, -5, 8, -8, 8, -13, 8, -17, 8, -21, 8, - 0, 13, 1, 13, 2, 13, 3, 13, 5, 13, 8, 13, 13, 13, 21, 13, - -1, 13, -2, 13, -3, 13, -5, 13, -8, 13, -13, 13, -17, 13, -21, 13, - 0, 21, 1, 21, 2, 21, 3, 21, 5, 21, 8, 21, 13, 21, 21, 21, - -1, 21, -2, 21, -3, 21, -5, 21, -8, 21, -13, 21, -17, 21, -21, 21, - 0, -1, 1, -1, 2, -1, 3, -1, 5, -1, 8, -1, 13, -1, 21, -1, - -1, -1, -2, -1, -3, -1, -5, -1, -8, -1, -13, -1, -17, -1, -21, -1, - 0, -2, 1, -2, 2, -2, 3, -2, 5, -2, 8, -2, 13, -2, 21, -2, - -1, -2, -2, -2, -3, -2, -5, -2, -8, -2, -13, -2, -17, -2, -21, -2, - 0, -3, 1, -3, 2, -3, 3, -3, 5, -3, 8, -3, 13, -3, 21, -3, - -1, -3, -2, -3, -3, -3, -5, -3, -8, -3, -13, -3, -17, -3, -21, -3, - 0, -5, 1, -5, 2, -5, 3, -5, 5, -5, 8, -5, 13, -5, 21, -5, - -1, -5, -2, -5, -3, -5, -5, -5, -8, -5, -13, -5, -17, -5, -21, -5, - 0, -8, 1, -8, 2, -8, 3, -8, 5, -8, 8, -8, 13, -8, 21, -8, - -1, -8, -2, -8, -3, -8, -5, -8, -8, -8, -13, -8, -17, -8, -21, -8, - 0, -13, 1, -13, 2, -13, 3, -13, 5, -13, 8, -13, 13, -13, 21, -13, - -1, -13, -2, -13, -3, -13, -5, -13, -8, -13, -13, -13, -17, -13, -21, -13, - 0, -17, 1, -17, 2, -17, 3, -17, 5, -17, 8, -17, 13, -17, 21, -17, - -1, -17, -2, -17, -3, -17, -5, -17, -8, -17, -13, -17, -17, -17, -21, -17, - 0, -21, 1, -21, 2, -21, 3, -21, 5, -21, 8, -21, 13, -21, 21, -21, - -1, -21, -2, -21, -3, -21, -5, -21, -8, -21, -13, -21, -17, -21, 0, 0, - -8, -29, 8, -29, -18, -25, 17, -25, 0, -23, -6, -22, 6, -22, -13, -19, - 12, -19, 0, -18, 25, -18, -25, -17, -5, -17, 5, -17, -10, -15, 10, -15, - 0, -14, -4, -13, 4, -13, 19, -13, -19, -12, -8, -11, -2, -11, 0, -11, - 2, -11, 8, -11, -15, -10, -4, -10, 4, -10, 15, -10, -6, -9, -1, -9, - 1, -9, 6, -9, -29, -8, -11, -8, -8, -8, -3, -8, 3, -8, 8, -8, - 11, -8, 29, -8, -5, -7, -2, -7, 0, -7, 2, -7, 5, -7, -22, -6, - -9, -6, -6, -6, -3, -6, -1, -6, 1, -6, 3, -6, 6, -6, 9, -6, - 22, -6, -17, -5, -7, -5, -4, -5, -2, -5, 0, -5, 2, -5, 4, -5, - 7, -5, 17, -5, -13, -4, -10, -4, -5, -4, -3, -4, -1, -4, 0, -4, - 1, -4, 3, -4, 5, -4, 10, -4, 13, -4, -8, -3, -6, -3, -4, -3, - -3, -3, -2, -3, -1, -3, 0, -3, 1, -3, 2, -3, 4, -3, 6, -3, - 8, -3, -11, -2, -7, -2, -5, -2, -3, -2, -2, -2, -1, -2, 0, -2, - 1, -2, 2, -2, 3, -2, 5, -2, 7, -2, 11, -2, -9, -1, -6, -1, - -4, -1, -3, -1, -2, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, - 4, -1, 6, -1, 9, -1, -31, 0, -23, 0, -18, 0, -14, 0, -11, 0, - -7, 0, -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 0, -31, 1, 0, - 2, 0, 3, 0, 4, 0, 5, 0, 7, 0, 11, 0, 14, 0, 18, 0, - 23, 0, 31, 0, -9, 1, -6, 1, -4, 1, -3, 1, -2, 1, -1, 1, - 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 6, 1, 9, 1, -11, 2, - -7, 2, -5, 2, -3, 2, -2, 2, -1, 2, 0, 2, 1, 2, 2, 2, - 3, 2, 5, 2, 7, 2, 11, 2, -8, 3, -6, 3, -4, 3, -2, 3, - -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 6, 3, 8, 3, - -13, 4, -10, 4, -5, 4, -3, 4, -1, 4, 0, 4, 1, 4, 3, 4, - 5, 4, 10, 4, 13, 4, -17, 5, -7, 5, -4, 5, -2, 5, 0, 5, - 2, 5, 4, 5, 7, 5, 17, 5, -22, 6, -9, 6, -6, 6, -3, 6, - -1, 6, 1, 6, 3, 6, 6, 6, 9, 6, 22, 6, -5, 7, -2, 7, - 0, 7, 2, 7, 5, 7, -29, 8, -11, 8, -8, 8, -3, 8, 3, 8, - 8, 8, 11, 8, 29, 8, -6, 9, -1, 9, 1, 9, 6, 9, -15, 10, - -4, 10, 4, 10, 15, 10, -8, 11, -2, 11, 0, 11, 2, 11, 8, 11, - 19, 12, -19, 13, -4, 13, 4, 13, 0, 14, -10, 15, 10, 15, -5, 17, - 5, 17, 25, 17, -25, 18, 0, 18, -12, 19, 13, 19, -6, 22, 6, 22, - 0, 23, -17, 25, 18, 25, -8, 29, 8, 29, 0, 31, 0, 0, -6, -22, - 6, -22, -13, -19, 12, -19, 0, -18, -5, -17, 5, -17, -10, -15, 10, -15, - 0, -14, -4, -13, 4, -13, 19, -13, -19, -12, -8, -11, -2, -11, 0, -11, - 2, -11, 8, -11, -15, -10, -4, -10, 4, -10, 15, -10, -6, -9, -1, -9, - 1, -9, 6, -9, -11, -8, -8, -8, -3, -8, 0, -8, 3, -8, 8, -8, - 11, -8, -5, -7, -2, -7, 0, -7, 2, -7, 5, -7, -22, -6, -9, -6, - -6, -6, -3, -6, -1, -6, 1, -6, 3, -6, 6, -6, 9, -6, 22, -6, - -17, -5, -7, -5, -4, -5, -2, -5, -1, -5, 0, -5, 1, -5, 2, -5, - 4, -5, 7, -5, 17, -5, -13, -4, -10, -4, -5, -4, -3, -4, -2, -4, - -1, -4, 0, -4, 1, -4, 2, -4, 3, -4, 5, -4, 10, -4, 13, -4, - -8, -3, -6, -3, -4, -3, -3, -3, -2, -3, -1, -3, 0, -3, 1, -3, - 2, -3, 3, -3, 4, -3, 6, -3, 8, -3, -11, -2, -7, -2, -5, -2, - -4, -2, -3, -2, -2, -2, -1, -2, 0, -2, 1, -2, 2, -2, 3, -2, - 4, -2, 5, -2, 7, -2, 11, -2, -9, -1, -6, -1, -5, -1, -4, -1, - -3, -1, -2, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, - 5, -1, 6, -1, 9, -1, -23, 0, -18, 0, -14, 0, -11, 0, -7, 0, - -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 0, -23, 1, 0, 2, 0, - 3, 0, 4, 0, 5, 0, 7, 0, 11, 0, 14, 0, 18, 0, 23, 0, - -9, 1, -6, 1, -5, 1, -4, 1, -3, 1, -2, 1, -1, 1, 0, 1, - 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 9, 1, -11, 2, - -7, 2, -5, 2, -4, 2, -3, 2, -2, 2, -1, 2, 0, 2, 1, 2, - 2, 2, 3, 2, 4, 2, 5, 2, 7, 2, 11, 2, -8, 3, -6, 3, - -4, 3, -3, 3, -2, 3, -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, - 4, 3, 6, 3, 8, 3, -13, 4, -10, 4, -5, 4, -3, 4, -2, 4, - -1, 4, 0, 4, 1, 4, 2, 4, 3, 4, 5, 4, 10, 4, 13, 4, - -17, 5, -7, 5, -4, 5, -2, 5, -1, 5, 0, 5, 1, 5, 2, 5, - 4, 5, 7, 5, 17, 5, -22, 6, -9, 6, -6, 6, -3, 6, -1, 6, - 1, 6, 3, 6, 6, 6, 9, 6, 22, 6, -5, 7, -2, 7, 0, 7, - 2, 7, 5, 7, -11, 8, -8, 8, -3, 8, 0, 8, 3, 8, 8, 8, - 11, 8, -6, 9, -1, 9, 1, 9, 6, 9, -15, 10, -4, 10, 4, 10, - 15, 10, -8, 11, -2, 11, 0, 11, 2, 11, 8, 11, 19, 12, -19, 13, - -4, 13, 4, 13, 0, 14, -10, 15, 10, 15, -5, 17, 5, 17, 0, 18, - -12, 19, 13, 19, -6, 22, 6, 22, 0, 23, -}; - -void SmushPlayer::codec37Maketable(PersistentCodecData37 * pcd, int32 pitch, byte idx) { - int32 i, j; - - if (pcd->table_last_pitch == pitch && pcd->table_last_flags == idx) - return; - - pcd->table_last_pitch = pitch; - pcd->table_last_flags = idx; - - assert(idx * 255 + 254 < (int32)(sizeof(maketable_bytes) / 2)); - - for (i = 0; i < 255; i++) { - j = i + idx * 255; - pcd->table1[i] = maketable_bytes[j * 2 + 1] * pitch + maketable_bytes[j * 2]; - } -} - -bool SmushPlayer::codec37(int32 game, CodecData * cd, PersistentCodecData37 * pcd) { - int32 width_in_blocks, height_in_blocks; - int32 src_pitch; - byte *curbuf; - int32 size; - bool result = false; - - _frameChanged = 1; - - width_in_blocks = (cd->w + 3) >> 2; - height_in_blocks = (cd->h + 3) >> 2; - src_pitch = width_in_blocks * 4; - - codec37Maketable(pcd, src_pitch, cd->src[1]); - - switch (cd->src[0]) { - case 0:{ - curbuf = pcd->deltaBufs[pcd->curtable]; - memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf); - size = READ_LE_UINT32(cd->src + 4); - memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size); - memcpy(curbuf, cd->src + 16, size); - break; - } - - case 2:{ - size = READ_LE_UINT32(cd->src + 4); - curbuf = pcd->deltaBufs[pcd->curtable]; - if (size == 64000) - codec37BompDepack(curbuf, cd->src + 16, size); - else - return (1); - - memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf); - memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size); - break; - } - - case 3:{ - uint16 number = READ_LE_UINT16(cd->src + 2); - - if (number && pcd->flags + 1 != number) - break; - - if (number & 1 && cd->src[12] & 1 && cd->flags & 0x10) { - _frameChanged = 0; - result = true; - break; - } - - if ((number & 1) || !(cd->src[12] & 1)) { - pcd->curtable ^= 1; - } - - codec37Proc5(game, pcd->deltaBufs[pcd->curtable], cd->src + 16, - pcd->deltaBufs[pcd->curtable ^ 1] - - pcd->deltaBufs[pcd->curtable], width_in_blocks, - height_in_blocks, src_pitch, pcd->table1); - break; - - } - case 4:{ - uint16 number = READ_LE_UINT16(cd->src + 2); - - if (number && pcd->flags + 1 != number) - break; - - if (number & 1 && cd->src[12] & 1 && cd->flags & 0x10) { - _frameChanged = 0; - result = true; - break; - } - - if ((number & 1) || !(cd->src[12] & 1)) { - pcd->curtable ^= 1; - } - - codec37Proc4(pcd->deltaBufs[pcd->curtable], cd->src + 16, - pcd->deltaBufs[pcd->curtable ^ 1] - - pcd->deltaBufs[pcd->curtable], width_in_blocks, - height_in_blocks, src_pitch, pcd->table1); - break; - } - - case 1: - warning("SP: code %d", cd->src[0]); - return (1); - - default: - error("SP: codec37 default case"); - } - - pcd->flags = READ_LE_UINT16(cd->src + 2); - - if (result) { - pcd->curtable ^= 1; - } else { - memcpy(cd->out, pcd->deltaBufs[pcd->curtable], 320 * 200); - } - - return (_frameChanged); -} - -void SmushPlayer::codec37Init(PersistentCodecData37 * pcd, int32 width, int32 height) { - pcd->width = width; - pcd->height = height; - pcd->deltaSize = width * height * 2 + 0x3E00 + 0xBA00; - pcd->deltaBuf = (byte *)calloc(pcd->deltaSize, 1); - pcd->deltaBufs[0] = pcd->deltaBuf + 0x3E00; - pcd->deltaBufs[1] = pcd->deltaBuf + width * height + 0xBA00; - pcd->curtable = 0; - pcd->table1 = (int16 *)calloc(255, sizeof(uint16)); -} - -void SmushPlayer::parseFOBJ() { - byte codec; - CodecData cd; - - cd.out = _renderBitmap; - cd.pitch = cd.outwidth = 320; - cd.outheight = 200; - cd.y = 0; - cd.x = 0; - cd.src = _cur + 0xE; - cd.w = READ_LE_UINT16(_cur + 6); - cd.h = READ_LE_UINT16(_cur + 8); - cd.flags = 0; - - codec = _cur[0]; - - switch (codec) { - case 1: - codec1(&cd); - break; - case 37: - _frameChanged = codec37(_scumm->_gameId, &cd, &pcd37); - break; - default: - error("SP: invalid codec %d", codec); - } -} - -void SmushPlayer::parsePSAD() { // FIXME: Needs to append to a sound buffer - uint32 pos, sublen, tag, idx, trk; - bool new_mixer = false; - byte *buf; - pos = 0; - - trk = READ_LE_UINT16(_cur + pos); /* FIXME: is this correct ? */ - pos += 2; - - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_psadTrk[idx] == trk) - break; - } - - if (idx == MAX_STREAMER) { - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_psadTrk[idx] == 0 && _scumm->_mixer->_channels[idx] == NULL) { - _psadTrk[idx] = trk; - _saudSize[idx] = 0; - new_mixer = true; - break; - } - } - } - - if (idx == MAX_STREAMER) { - warning("PSAD table full\n"); - return; - } - - pos += 8; /* FIXME: what are these ? */ - - while (pos < _frmeSize) { - - if (_saudSize[idx] == 0) { - tag = READ_BE_UINT32(_cur + pos); - pos += 4; - if (tag != 'SAUD') // FIXME: DIG specific? - warning("trk %d: SAUD tag not found", trk); - _saudSize[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - } - - if (_saudSubSize[idx] == 0) { - _saudSubTag[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - _saudSubSize[idx] = READ_BE_UINT32(_cur + pos); - pos += 4; - _saudSize[idx] -= 8; - debug(3, "trk %d: tag '%4s' size %x", trk, _cur + pos - 8, _saudSubSize[idx]); - } - - sublen = _saudSubSize[idx] < (_frmeSize - pos) ? _saudSubSize[idx] : (_frmeSize - pos); - - switch (_saudSubTag[idx]) { - case 'STRK': - /* FIXME: what is this stuff ? */ - _strkRate[idx] = 22050; - break; - case 'SDAT': - buf = (byte *)malloc(sublen); - - memcpy(buf, _cur + pos, sublen); - - debug(3, "trk %d: SDAT part len 0x%x rate %d", trk, sublen, _strkRate[idx]); - - _strkBuf[idx] = buf; - _strkFinalSize[idx] = sublen; - _strkNewMixer[idx] = new_mixer; - break; - case 'SMRK': - _psadTrk[idx] = 0; - break; - case 'SHDR': - /* FIXME: what is this stuff ? */ - break; - default: // FIXME: Add FT tags - warning("trk %d: unknown tag inside PSAD", trk); - } - _saudSubSize[idx] -= sublen; - _saudSize[idx] -= sublen; - pos += sublen; - } -} - -void SmushPlayer::parseTRES() { - if (_scumm->_gameId == GID_DIG) { - if ((_scumm->_noSubtitles) && (READ_LE_UINT16(_cur + 4) != 0)) - return; - - byte * txt = getStringTRES (READ_LE_UINT16(_cur + 16)); - drawStringTRES (READ_LE_UINT16(_cur), READ_LE_UINT16(_cur + 2), txt); - if (txt != NULL) - free (txt); - } -} - -void SmushPlayer::parseXPAL() { - int32 num; - int32 i; - - num = READ_LE_UINT16(_cur + 2); - if (num == 0 || num == 0x200) { - if (num == 0x200) - memcpy(_fluPalette, _cur + 0x604, 0x300); - - for (i = 0; i < 0x300; i++) { - _fluPalMul129[i] = _fluPalette[i] * 129; - _fluPalWords[i] = READ_LE_UINT16(_cur + 4 + i * 2); - } - return; - } - - parseNPAL(); - - for (i = 0; i < 0x300; i++) { - _fluPalMul129[i] += _fluPalWords[i]; - _fluPalette[i] = _fluPalMul129[i] >> 7; - } - - _paletteChanged = true; -} - -void SmushPlayer::parseFRME() { - _cur = _block; - - do { - _frmeTag = nextBE32(); - _frmeSize = nextBE32(); - - switch (_frmeTag) { - case 'NPAL': - parseNPAL(); - break; - case 'FOBJ': - parseFOBJ(); - break; - case 'PSAD': - parsePSAD(); - break; - case 'TRES': - parseTRES(); - break; - case 'XPAL': - parseXPAL(); - break; - case 'IACT': - parseIACT(); - break; - case 'STOR': - case 'FTCH': - break; - - default: - error("SP: Encountered invalid block %c%c%c%c", _frmeTag >> 24, _frmeTag >> 16, _frmeTag >> 8, _frmeTag); - } - - _cur += (_frmeSize + 1) & ~1; - } while (_cur + 4 < _block + _blockSize); -} - -void SmushPlayer::init() { - _renderBitmap = _scumm->_videoBuffer; - codec37Init(&pcd37, 320, 200); - - memset(_saudSize, 0, sizeof(_saudSize)); - memset(_saudSubSize, 0, sizeof(_saudSubSize)); - memset(_psadTrk, 0, sizeof(_psadTrk)); - - memset(_imusSize, 0, sizeof(_imusSize)); - memset(_imusSubSize, 0, sizeof(_imusSubSize)); - memset(_imusTrk, 0, sizeof(_imusTrk)); - memset(_imusData, 0, sizeof(_imusData)); - memset(_imusPos, 0, sizeof(_imusPos)); - memset(_imusChan, 0, sizeof(_imusChan)); - - if (_scumm->_gameId == GID_DIG) - { - for (uint8 l = 0; l < SP_MAX_FONTS; l++) { - _fonts[l] = NULL; - } - _bufferTres = NULL; - loadTres(); - loadFonts(); - } - _scumm->_timer->installProcedure(&smush_handler, 75); -} - -void SmushPlayer::deinit() { - if (_scumm->_gameId == GID_DIG) - { - if (_bufferTres != NULL) - free (_bufferTres); - - for (int l = 0; l < SP_MAX_FONTS; l++) { - if (_fonts[l] != NULL) { - free (_fonts[l]); - _fonts[l] = NULL; - } - } - } - _scumm->_timer->releaseProcedure(&smush_handler); -} - -void SmushPlayer::go() { - while (parseTag()) { - } -} - -void SmushPlayer::setPalette() { - int32 i; - byte palette_colors[1024]; - byte *p = palette_colors; - byte *data = _fluPalette; - - for (i = 0; i != 256; i++, data += 3, p += 4) { - p[0] = data[0]; - p[1] = data[1]; - p[2] = data[2]; - p[3] = 0; - } - - _scumm->_system->set_palette(palette_colors, 0, 256); -} - -void SmushPlayer::update() { - _lock = false; -} - -void SmushPlayer::startVideo(short int arg, byte *videoFile) { - int32 frameIndex = 0; - int32 idx; - - _in = NULL; - _paletteChanged = false; - _block = NULL; - _blockTag = 0; - _blockSize = 0; - _cur = NULL; - _renderBitmap = NULL; - _frameSize = 0; - _frmeTag = 0; - _frmeSize = 0; - _deltaBuf = NULL; - _deltaBufSize = 0; - _lock = true; - - memset (&pcd37, 0, sizeof (PersistentCodecData37)); - - _scumm->_sound->pauseBundleMusic(true); - init(); - openFile(videoFile); - - if (_in == NULL) - return; - - if (_scumm->fileReadDwordBE(_in) != 'ANIM') - error("SP: file is not an anim"); - - fileSize = _scumm->fileReadDwordBE(_in); - - _scumm->videoFinished = 0; - _scumm->_insaneState = 1; - - do { - _frameChanged = true; - - if (ftell(_in) >= fileSize) - break; -#ifdef INSANE_DEBUG - warning("Playing frame %d", frameIndex); -#endif - - parseTag(); - frameIndex++; - - do { - _scumm->waitForTimer(1); - } while (_lock); - _lock = true; - - if (_scumm->_gameId == GID_DIG) { - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_imusTrk[idx] != 0) { - if (_imusNewMixer[idx]) { - _scumm->_mixer->play_stream(NULL, idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]); - } else { - _scumm->_mixer->append(idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]); - } - } - } - } - - if (_scumm->_gameId == GID_FT) { - for (idx = 0; idx < MAX_STREAMER; idx++) { - if (_psadTrk[idx] != 0) { - if (_strkNewMixer[idx]) { - _scumm->_mixer->play_stream(NULL, idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - } else { - _scumm->_mixer->append(idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - } - } - } - } - - if (_paletteChanged) { - _paletteChanged = false; - setPalette(); - _scumm->setDirtyColors(0, 255); - } - - if (_frameChanged) { - _scumm->_system->copy_rect(_scumm->_videoBuffer, 320, 0, 0, 320, 200); - _scumm->_system->update_screen(); - } - - _scumm->processKbd(); - - } while (!_scumm->videoFinished); - - deinit(); - - _scumm->_insaneState = 0; - _scumm->exitCutscene(); - _scumm->_sound->pauseBundleMusic(false); -} diff --git a/mac/Carbon.r b/mac/Carbon.r deleted file mode 100644 index a296c97b26..0000000000 --- a/mac/Carbon.r +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Permit this Carbon application to launch on OS X - * - * © 1997-2000 Metrowerks Corp. - * - * Questions and comments to: - * - * - */ - -#include "MacTypes.r" -#include "Dialogs.r" -#include "Balloons.r" -#include "Menus.r" -#include "Finder.r" -#include "Quickdraw.r" -#include "Icons.r" -#include "Processes.r" -#include "Controls.r" - -/*----------------------------carb ¥ Carbon on OS X launch information --------------------------*/ -type 'carb' { -}; - - -resource 'carb'(0) { -}; - -resource 'ALRT' (129) { - {55, 39, 153, 407}, - 128, - { /* array: 4 elements */ - /* [1] */ - OK, visible, sound1, - /* [2] */ - OK, visible, sound1, - /* [3] */ - OK, visible, sound1, - /* [4] */ - OK, visible, sound1 - }, - alertPositionParentWindowScreen -}; - -resource 'DITL'(128) { - { - {8, 74, 61, 356}, - StaticText { - disabled, - "^0" - }, - - {70, 299, 90, 357}, - Button { - enabled, - "OK" - } - } -}; - -resource 'MENU'(999) { - 999, 63, allEnabled, enabled, "Please Select a GameÉ", - { - "Maniac Mansion (C64)", noIcon, noKey, noMark, plain, - "Zak McKracken and the Alien Mindbenders (C64)", noIcon, noKey, noMark, plain, - "Maniac Mansion", noIcon, noKey, noMark, plain, - "Zak McKracken and the Alien Mindbenders", noIcon, noKey, noMark, plain, - "Indiana Jones and the Last Crusade", noIcon, noKey, noMark, plain, - "Indiana Jones and the Last Crusade (256)", noIcon, noKey, noMark, plain, - "Zak McKracken and the Alien Mindbenders (256)", noIcon, noKey, noMark, plain, - "Loom", noIcon, noKey, noMark, plain, - "Monkey Island 1 (EGA)", noIcon, noKey, noMark, plain, - "Monkey Island 1 (256 color Floppy version)", noIcon, noKey, noMark, plain, - "Loom (256 color CD version)", noIcon, noKey, noMark, plain, - "Monkey Island 1", noIcon, noKey, noMark, plain, - "Monkey Island 1 (alt)", noIcon, noKey, noMark, plain, - "Monkey Island 2: LeChuck's revenge", noIcon, noKey, noMark, plain, - "Indiana Jones 4 and the Fate of Atlantis", noIcon, noKey, noMark, plain, - "Indiana Jones 4 and the Fate of Atlantis (Demo)", noIcon, noKey, noMark, plain, - "Day Of The Tentacle", noIcon, noKey, noMark, plain, - "Day Of The Tentacle (Demo)", noIcon, noKey, noMark, plain, - "Sam & Max", noIcon, noKey, noMark, plain, - "Sam & Max (Demo)", noIcon, noKey, noMark, plain, - "Full Throttle", noIcon, noKey, noMark, plain, - "The Dig", noIcon, noKey, noMark, plain, - "The Curse of Monkey Island", noIcon, noKey, noMark, plain, - "-", noIcon, noKey, noMark, plain, - "Simon the Sorcerer 1 (DOS)", noIcon, noKey, noMark, plain, - "Simon the Sorcerer 1 (Windows)", noIcon, noKey, noMark, plain, - "Simon the Sorcerer 2 (Windows)", noIcon, noKey, noMark, plain - } -}; - -resource 'MENU'(1000) { - 1000, 63, allEnabled, enabled, apple, - { - "About ScummVMÉ", noIcon, noKey, noMark, plain, - "-", noIcon, noKey, noMark, plain - } -}; - -resource 'MENU'(1001) { - 1001, 63, allEnabled, enabled, "File", - { - "New Game", noIcon, "N", noMark, plain, - "Open Game", noIcon, "O", noMark, plain, - "Save Game", noIcon, "S", noMark, plain, - "-", noIcon, noKey, noMark, plain, - "Q", noIcon, "Q", noMark, plain - } -}; \ No newline at end of file diff --git a/mac/CarbonPort-ReadMe.txt b/mac/CarbonPort-ReadMe.txt deleted file mode 100644 index 262b9a50f8..0000000000 --- a/mac/CarbonPort-ReadMe.txt +++ /dev/null @@ -1,34 +0,0 @@ -README FOR THE MAC CARBON PORT - -Runs on Mac OS X 10.1 (could also run on 10.0.x, but not tested), and Mac OS 8.6 or later (with CarbonLib -installed). - -HOW TO COMPILE? -Launch the scummvm.mcp file in CodeWarrior and choose one of the Targets to compile. For just playing, -you should choose "ScummVM Final", the Debug one is just for Developing. -Binaries will come up to the Website with the release 0.2.0, which will be hopefully soon. - -NOTES: -Put the games in a folder in the same directory as ScummVM, which have the name of the Data Files, like this: - --- - ScummVM - \- monkey2- - \- monkey2.000 - - monkey2.001 - - -Hope this will help you :) - -CHANGES: -- Thanks to Florent Boudet, QuickTime MIDI has been added, although it currently only works with DOTT -- Added SFX Sound Support -- Now draws the Games Cursors - -BUGS: -- On OS X it got some Problems with KeyDown-Events (seems to work now, most of the time) -- Bad behaviour of the Application towards other, will be fixed soon. -- Some minor bugs - -If you find any bugs, just make a Bug Report on our SourceForge Page. - --- Mutle \ No newline at end of file diff --git a/mac/ScummVM_Mac_Prefix.h b/mac/ScummVM_Mac_Prefix.h deleted file mode 100644 index ef3f2e6a4b..0000000000 --- a/mac/ScummVM_Mac_Prefix.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef __cplusplus - #include -#else - #include -#endif - -#define MACOS_CARBON diff --git a/mac/mac.cpp b/mac/mac.cpp deleted file mode 100644 index f22d72666b..0000000000 --- a/mac/mac.cpp +++ /dev/null @@ -1,1790 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 Mutwin Kraus (Mac Port) and The ScummVM Project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include -#include - -#include "stdafx.h" -#include "scumm.h" -#include "mididrv.h" -#include "gameDetector.h" -//#include "mp3_cd.h" -#include "gui.h" -//#include "gameDetector.h" -#include "scaler.h" - -#define MAX(a,b) (((a)<(b)) ? (b) : (a)) -#define MIN(a,b) (((a)>(b)) ? (b) : (a)) - -class OSystem_MAC : public OSystem { -public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Add a new callback timer - void set_timer(int timer, int (*callback)(int)) { /* FIXME - TODO */ } - - // Mutex handling - void *create_mutex(void) { return NULL; /* FIXME - TODO */ } - void lock_mutex(void *mutex) { /* FIXME - TODO */ } - void unlock_mutex(void *mutex) { /* FIXME - TODO */ } - void delete_mutex(void *mutex) { /* FIXME - TODO */ } - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - static OSystem *create(int gfx_mode, bool full_screen); - - void sound_callback(SndChannel *chan, SndCommand *cmd_passed); -private: - typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height); - - GWorldPtr screenBuf; - WindowRef wref; - CTabHandle pal; - Rect blit_rect; - - enum { - DF_WANT_RECT_OPTIM = 1 << 0, - DF_REAL_8BIT = 1 << 1, - DF_SEPARATE_TEMPSCREEN = 1 << 2, - DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 - }; - - int _mode; - bool _full_screen; - bool _mouse_visible; - bool _mouse_drawn; - uint32 _mode_flags; - byte _internal_scaling; - - bool force_full; //Force full redraw on next update_screen - bool cksum_valid; - - enum { - NUM_DIRTY_RECT = 100, - - MAX_MOUSE_W = 40, - MAX_MOUSE_H = 40, - MAX_SCALING = 3 - }; - - int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; - Rect *dirty_rect_list; - int num_dirty_rects; - uint32 *dirty_checksums; - - int scaling; - - /* CD Audio */ - int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; - uint32 cd_end_time, cd_stop_time, cd_next_second; - - struct MousePos { - int16 x,y,w,h; - }; - - byte *_ms_buf; - byte *_ms_backup; - MousePos _ms_cur; - MousePos _ms_old; - int16 _ms_hotspot_x; - int16 _ms_hotspot_y; - int _current_shake_pos; - - byte* _gfx_buf; /* Graphics memory */ - int16 *_sai_buf, *_tmp_buf; - uint _palette_changed_first, _palette_changed_last; - - TwoXSaiProc *_sai_func; - - void add_dirty_rgn_auto(const byte *buf); - void mk_checksums(const byte *buf); - - static void fill_sound(void *userdata, uint8 * stream, int len); - - void add_dirty_rect(int x, int y, int w, int h); - - void draw_mouse(); - void undraw_mouse(); - - void load_gfx_mode(); - void unload_gfx_mode(); - - void hotswap_gfx_mode(); - - void get_320x200_image(byte *buf); - - void init_mac_stuff(); - void set_scaling(); - void blit_to_screen(); - void update_rects(); - - static void autosave(Scumm * scumm); - - UInt8 *buffer[2]; - CmpSoundHeader header; - SndChannelPtr channel; - int size; - SoundProc *sndProc; - void * parameter; -}; - -KeyMap fKeyMap; - -Boolean CommandKeyDown() -{ - GetKeys(fKeyMap); // get info - if (fKeyMap[1] & 0x8000) - return true; - else - return false; -} - -static unsigned char *CToPascal(char *str) { - register char *p,*q; - register long len; - - len = strlen(str); - if (len > 255) len = 255; - p = str + len; - q = p-1; - while (p != str) - *p-- = *q--; - *str = len; - return((unsigned char *)str); -} - -static char *PascalToC(unsigned char *str) { - register unsigned char *p,*q,*end; - - end = str + *str; - q = (p=str) + 1; - - while (p < end) - *p++ = *q++; - *p = '\0'; - - return((char *)str); -} - -const EventTypeSpec kCmdEvents[] = -{ - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassKeyboard, kEventRawKeyDown }, - { kEventClassCommand, kEventProcessCommand } -}; - -const EventTypeSpec kWindowEvents[] = -{ - { kEventClassWindow, kEventWindowDrawContent }, - { kEventClassWindow, kEventWindowHandleContentClick }, - { kEventClassWindow, kEventWindowClose } -}; - -pascal OSErr QuitEventHandler(const AppleEvent *theEvent, AppleEvent *theReply, SInt32 refCon) -{ - //OSystem_MAC::quit(); - return(noErr); -} - -enum -{ - kNewGameCmd = 'newG', - kQuitCmd = kHICommandQuit, - kOpenGameCmd = 'opnG', - kSaveGameCmd = 'savG', - kPrefsCmd = kHICommandPreferences, - kAboutCmd = 'abtG' -}; - -ControlRef radioGroupRef, musicVolumeSlider, masterVolumeSlider; -char *gameTitle; -ControlRef popUpControlRef, checkBoxControlRef; - -OSStatus prefsEventHandler(EventHandlerCallRef eventHandlerCallRef,EventRef eventRef, - void *userData) -{ - OSStatus result = eventNotHandledErr; - UInt32 eventClass; - UInt32 eventKind; - ControlRef controlRef; - ControlID controlID; - - eventClass = GetEventClass(eventRef); - eventKind = GetEventKind(eventRef); - - if(eventClass == kEventClassControl) - { - if(eventKind == kEventControlHit) - { - GetEventParameter(eventRef,kEventParamDirectObject,typeControlRef,NULL, - sizeof(ControlRef),NULL,&controlRef); - - GetControlID(controlRef,&controlID); - if(controlID.id == 'okay') - { - /*scumm->_noSubtitles = (Boolean)!GetControlValue(checkBoxControlRef); - short scale = GetControlValue(radioGroupRef); - if(scale != scumm->_scale) - wm->ChangeScaling(scale); - short music_vol = GetControlValue(musicVolumeSlider); - if(music_vol != sound.get_music_volume()) - sound.set_music_volume(music_vol); - short master_vol = GetControlValue(masterVolumeSlider); - if(master_vol != sound.get_master_volume()) - sound.set_master_volume(master_vol);*/ - QuitAppModalLoopForWindow((WindowRef)userData); - DisposeWindow((WindowRef)userData); - result = noErr; - } - } - } -} - -void Preferences() -{ - WindowRef prefsWin; - OSStatus osError = noErr; - Rect rect = { 0,0,210,300 }; - Rect okButtonRect; - ControlID controlID; - ControlRef controlRef; - EventTypeSpec dialogEvents[] = { kEventClassControl, kEventControlHit }; - - osError = CreateNewWindow(kMovableModalWindowClass,kWindowStandardHandlerAttribute,&rect, &prefsWin); - SetWTitle(prefsWin, "\pPreferences"); - RepositionWindow(prefsWin,FrontWindow(),kWindowAlertPositionOnMainScreen); - SetThemeWindowBackground(prefsWin,kThemeBrushDialogBackgroundActive,false); - CreateRootControl(prefsWin,&controlRef); - - SetRect(&rect, 5, 5, 150, 21); - - CreateStaticTextControl(prefsWin, &rect, CFSTR("ScummVM Preferences"), NULL, &controlRef); - AutoEmbedControl(controlRef, prefsWin); - - SetRect(&okButtonRect, 225, 180, 295, 200); - - CreatePushButtonControl(prefsWin,&okButtonRect,CFSTR("OK"),&controlRef); - SetWindowDefaultButton(prefsWin,controlRef); - controlID.id = 'okay'; - SetControlID(controlRef,&controlID); - AutoEmbedControl(controlRef,prefsWin); - - SetRect(&rect, 150, 35, 260, 51); - - CreateCheckBoxControl(prefsWin,&rect, CFSTR("Subtitles"), 1, true, &checkBoxControlRef); - AutoEmbedControl(checkBoxControlRef, prefsWin); - - //if(scumm->_noSubtitles) - SetControlValue(checkBoxControlRef, false); - - OffsetRect(&rect, 0, 20); - - CreateCheckBoxControl(prefsWin,&rect, CFSTR("Fullscreen"), 0, true, &controlRef); - AutoEmbedControl(controlRef, prefsWin); - DeactivateControl(controlRef); - - Rect RadioGroupRect; - SetRect(&RadioGroupRect, 5, 35, 120, 100); - CreateRadioGroupControl(prefsWin, &RadioGroupRect, &radioGroupRef); - AutoEmbedControl(radioGroupRef, prefsWin); - - ControlRef radioButton; - - Rect RadioButtonRect; - SetRect(&RadioButtonRect, 5, 35, 120, 51); - CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 1x"), 0, true, &radioButton); - AutoEmbedControl(radioButton, prefsWin); - - OffsetRect(&RadioButtonRect, 0, 20); - CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 2x"), 0, true, &radioButton); - AutoEmbedControl(radioButton, prefsWin); - - OffsetRect(&RadioButtonRect, 0, 20); - CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 3x"), 0, true, &radioButton); - AutoEmbedControl(radioButton, prefsWin); - - //SetControlValue(radioGroupRef, scumm->_scale); - - SetRect(&rect, 5, 110, 175, 146); - - CreateSliderControl(prefsWin, &rect, 100, 1, 100, - kControlSliderPointsDownOrRight, 10, false, NULL, &musicVolumeSlider); - AutoEmbedControl(musicVolumeSlider, prefsWin); - - OffsetRect(&rect, 0, 36); - - CreateSliderControl(prefsWin, &rect, 100, 1, 100, - kControlSliderPointsDownOrRight, 10, false, NULL, &masterVolumeSlider); - AutoEmbedControl(masterVolumeSlider, prefsWin); - - OffsetRect(&rect, 180, -36); - - CreateStaticTextControl(prefsWin, &rect, CFSTR("Music Volume"), NULL, &controlRef); - AutoEmbedControl(controlRef, prefsWin); - - OffsetRect(&rect, 0, 36); - - CreateStaticTextControl(prefsWin, &rect, CFSTR("Master Volume"), NULL, &controlRef); - AutoEmbedControl(controlRef, prefsWin); - - InstallWindowEventHandler(prefsWin, NewEventHandlerUPP((EventHandlerProcPtr) prefsEventHandler), - GetEventTypeCount(dialogEvents),dialogEvents,prefsWin,NULL); - ShowWindow(prefsWin); - osError = RunAppModalLoopForWindow(prefsWin); -} - -void LaunchGame(int id) -{ - switch(id) - { - case 6: - gameTitle = "indy3"; - break; - - case 7: - gameTitle = "zak256"; - break; - - case 8: - gameTitle = "loom"; - break; - - case 9: - gameTitle = "monkeyEGA"; - break; - - case 10: - gameTitle = "monkeyVGA"; - break; - - case 11: - gameTitle = "loomcd"; - break; - - case 12: - gameTitle = "monkey"; - break; - - case 13: - gameTitle = "monkey1"; - break; - - case 14: - gameTitle = "monkey2"; - break; - - case 15: - gameTitle = "atlantis"; - break; - - case 16: - gameTitle = "playfate"; - break; - - case 17: - gameTitle = "tentacle"; - break; - - case 18: - gameTitle = "dottdemo"; - break; - - case 19: - gameTitle = "samnmax"; - break; - - case 20: - gameTitle = "snmdemo"; - break; - - case 21: - gameTitle = "ft"; - break; - - case 22: - gameTitle = "dig"; - break; - - case 25: - gameTitle = "simon1dos"; - break; - - case 26: - gameTitle = "simon1win"; - break; - - case 27: - gameTitle = "simon2win"; - break; - } -} - -OSStatus dialogEventHandler(EventHandlerCallRef eventHandlerCallRef,EventRef eventRef, - void *userData) -{ - OSStatus result = eventNotHandledErr; - UInt32 eventClass; - UInt32 eventKind; - ControlRef controlRef; - ControlID controlID; - - eventClass = GetEventClass(eventRef); - eventKind = GetEventKind(eventRef); - - if(eventClass == kEventClassControl) - { - if(eventKind == kEventControlHit) - { - - GetEventParameter(eventRef,kEventParamDirectObject,typeControlRef,NULL, - sizeof(ControlRef),NULL,&controlRef); - - GetControlID(controlRef,&controlID); - if(controlID.id == 'okay') - { - QuitAppModalLoopForWindow((WindowRef)userData); - LaunchGame(GetControlValue(popUpControlRef)); - - DisposeWindow((WindowRef)userData); - result = noErr; - } - else if(controlID.id == 'cncl') - { - QuitAppModalLoopForWindow((WindowRef)userData); - DisposeWindow((WindowRef)userData); - ExitToShell(); - } - } - } - return result; -} - -char* SelectGame() -{ - WindowRef aboutWin; - OSStatus osError = noErr; - Rect rect = { 0,0,120,350 }; - Rect pushButtonRect = { 75,250,96,330 }; - Rect popupRect = { 10, 10, 26, 330 }; - ControlID controlID; - ControlRef controlRef; - Rect checkboxRect = { 36, 10, 50, 80 }; - EventTypeSpec dialogEvents[] = { kEventClassControl, kEventControlHit }; - - InitCursor(); - - SIOUXSettings.autocloseonquit = true; - SIOUXSettings.asktosaveonclose = false; - SIOUXSettings.showstatusline = false; - SIOUXSettings.fontsize = 9; - GetFNum("\pMonaco",&SIOUXSettings.fontid); - SIOUXSettings.standalone = false; - SIOUXSettings.setupmenus = false; - SIOUXSettings.toppixel = 40; - SIOUXSettings.leftpixel = 5; - - osError = CreateNewWindow(kMovableModalWindowClass,kWindowStandardHandlerAttribute,&rect, &aboutWin); - SetWTitle(aboutWin, "\pPlease Select a GameÉ"); - RepositionWindow(aboutWin,FrontWindow(),kWindowAlertPositionOnMainScreen); - SetThemeWindowBackground(aboutWin,kThemeBrushDialogBackgroundActive,false); - CreateRootControl(aboutWin,&controlRef); - - CreatePushButtonControl(aboutWin,&pushButtonRect,CFSTR("OK"),&controlRef); - SetWindowDefaultButton(aboutWin,controlRef); - controlID.id = 'okay'; - SetControlID(controlRef,&controlID); - AutoEmbedControl(controlRef,aboutWin); - - OffsetRect(&pushButtonRect, -100, 0); - CreatePushButtonControl(aboutWin,&pushButtonRect,CFSTR("Cancel"),&controlRef); - SetWindowCancelButton(aboutWin,controlRef); - controlID.id = 'cncl'; - SetControlID(controlRef,&controlID); - AutoEmbedControl(controlRef,aboutWin); - - CreatePopupButtonControl(aboutWin, &popupRect, CFSTR("Game: "), 999, false, -1, 0, NULL, &popUpControlRef); - SetWindowDefaultButton(aboutWin,popUpControlRef); - controlID.id = 'game'; - - SetControlID(popUpControlRef,&controlID); - - AutoEmbedControl(controlRef,aboutWin); - - InstallWindowEventHandler(aboutWin, NewEventHandlerUPP((EventHandlerProcPtr) dialogEventHandler), - GetEventTypeCount(dialogEvents),dialogEvents,aboutWin,NULL); - ShowWindow(aboutWin); - osError = RunAppModalLoopForWindow(aboutWin); - return gameTitle; -} - -OSystem *OSystem_MAC::create(int gfx_mode, bool full_screen) { - Rect rectWin; - OSystem_MAC *syst = new OSystem_MAC(); - syst->_mode = gfx_mode; - syst->_full_screen = full_screen; - - /* Macintosh init */ - syst->init_mac_stuff(); - - return syst; -} - -void OSystem_MAC::autosave(Scumm * scumm) -{ - scumm->_doAutosave = true; - - return interval; -} - -OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen) { - return OSystem_MAC::create(gfx_mode, full_screen); -} - -void OSystem_MAC::set_palette(const byte *colors, uint start, uint num) { - const byte *b = colors; - - (*pal)->ctSeed = TickCount(); - for(int i = start; i < num; i++, b += 4) { - (*pal)->ctTable[i].value = i; - (*pal)->ctTable[i].rgb.red = b[0]<<8; - (*pal)->ctTable[i].rgb.green = b[1]<<8; - (*pal)->ctTable[i].rgb.blue = b[2]<<8; - } - - CTabChanged(pal); - - if(_sai_func) - UpdateGWorld(&screenBuf, 16, &blit_rect, NULL, NULL, 0); - else - UpdateGWorld(&screenBuf, 8, &blit_rect, pal, NULL, 0); - - if(start < _palette_changed_first) - _palette_changed_first = start; - - if(start + num > _palette_changed_last) - _palette_changed_last = start + num; -} - -void OSystem_MAC::load_gfx_mode() { - force_full = true; - scaling = 1; - _internal_scaling = 1; - _mode_flags = 0; - _sai_func = NULL; - - switch(_mode) { - case GFX_2XSAI: - _sai_func = _2xSaI; - break; - - case GFX_SUPER2XSAI: - _sai_func = Super2xSaI; - break; - - case GFX_SUPEREAGLE: - _sai_func = SuperEagle; - break; - - case GFX_ADVMAME2X: - _sai_func = AdvMame2x; - break; - - case GFX_DOUBLESIZE: - scaling = 2; - _internal_scaling = 2; - _mode_flags = DF_WANT_RECT_OPTIM; - break; - - case GFX_TRIPLESIZE: - if (_full_screen) { - warning("full screen in useless in triplesize mode, reverting to normal mode"); - goto normal_mode; - } - scaling = 3; - _internal_scaling = 3; - _mode_flags = DF_WANT_RECT_OPTIM; - break; - - case GFX_NORMAL: - normal_mode:; - _mode_flags = DF_WANT_RECT_OPTIM; - break; - - } - - if(_sai_func) - { - _mode_flags = DF_WANT_RECT_OPTIM | DF_SEPARATE_TEMPSCREEN | DF_UPDATE_EXPAND_1_PIXEL; - - Init_2xSaI(565); - _tmp_buf = (int16*)calloc((SCREEN_WIDTH+3)*(SCREEN_HEIGHT+3), sizeof(int16)); - - scaling = 2; - } - else - { - switch(scaling) { - case 3: - _sai_func = Normal3x; - break; - case 2: - _sai_func = Normal2x; - break; - case 1: - _sai_func = Normal1x; - break; - } - - _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; - } - - set_scaling(); -} - -void OSystem_MAC::unload_gfx_mode() { - //warning("STUB: unload_gfx_mode()"); /* FIXME: Must free data here */ - -} - -void OSystem_MAC::init_size(uint w, uint h) { - //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) - // error("320x200 is the only game resolution supported"); - - SCREEN_WIDTH = w; - SCREEN_HEIGHT = h; - CKSUM_NUM = (SCREEN_WIDTH * SCREEN_HEIGHT / (8*8)); - dirty_rect_list = (Rect*)calloc(NUM_DIRTY_RECT, sizeof(Rect)); - _ms_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); - dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); - - load_gfx_mode(); -} - -void OSystem_MAC::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { - if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { - /* Special, optimized case for full screen updates. - * It tries to determine what areas were actually changed, - * and just updates those, on the actual display. */ - add_dirty_rgn_auto(buf); - } else { - /* Clip the coordinates */ - if (x < 0) { w+=x; buf-=x; x = 0; } - - if (y < 0) { h+=y; buf-=y*pitch; y = 0; } - if (w >= SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } - if (h >= SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } - - if (w<=0 || h<=0) - return; - - cksum_valid = false; - add_dirty_rect(x, y, w, h); - } - - /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ - if (_mouse_drawn) - undraw_mouse(); - - byte *dst = (byte*)buf + y * SCREEN_WIDTH + x; - do { - memcpy(dst, buf, w); - dst += SCREEN_WIDTH; - buf += pitch; - } while(--h); -} - -void OSystem_MAC::add_dirty_rect(int x, int y, int w, int h) { - if (force_full) - return; - - if (num_dirty_rects == NUM_DIRTY_RECT) - force_full = true; - else { - Rect *r = &dirty_rect_list[num_dirty_rects++]; - - /* Update the dirty region by 1 pixel for graphics drivers - * that "smear" the screen */ - if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { - x--; - y--; - w+=2; - h+=2; - } - - /* clip */ - if (x<0) { w+=x; x=0; } - if (y<0) { h+=y; y=0; } - if (w>=SCREEN_WIDTH-x) { w=SCREEN_WIDTH-x; } - if (h>=SCREEN_HEIGHT-y) { h=SCREEN_HEIGHT-y; } - - if (_internal_scaling != 1) { - x *= _internal_scaling; - y *= _internal_scaling; - w *= _internal_scaling; - h *= _internal_scaling; - } - - r->left = x; - r->top = y; - r->right = x + w; - r->bottom = y + h; - } -} - -#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) -#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] -void OSystem_MAC::mk_checksums(const byte *buf) { - uint32 *sums = dirty_checksums; - uint x,y; - - /* the 8x8 blocks in buf are enumerated starting in the top left corner and - * reading each line at a time from left to right */ - for(y=0; y!=SCREEN_HEIGHT/8; y++,buf+=SCREEN_WIDTH*(8-1)) - for(x=0; x!=SCREEN_WIDTH/8; x++,buf+=8) { - uint32 a = x; - uint32 b = y; - - DOLINE(0); ROL(a,13); ROL(b,11); - DOLINE(2); ROL(a,13); ROL(b,11); - DOLINE(4); ROL(a,13); ROL(b,11); - DOLINE(6); ROL(a,13); ROL(b,11); - - a*=0xDEADBEEF; - b*=0xBAADF00D; - - DOLINE(1); ROL(a,13); ROL(b,11); - DOLINE(3); ROL(a,13); ROL(b,11); - DOLINE(5); ROL(a,13); ROL(b,11); - DOLINE(7); ROL(a,13); ROL(b,11); - - /* output the checksum for this block */ - *sums++=a+b; - } -} -#undef DOLINE -#undef ROL - - -void OSystem_MAC::add_dirty_rgn_auto(const byte *buf) { - assert( ((uint32)buf & 3) == 0); - - /* generate a table of the checksums */ - mk_checksums(buf); - -if (!cksum_valid) { - force_full = true; - cksum_valid = true; - } - - /* go through the checksum list, compare it with the previous checksums, - and add all dirty rectangles to a list. try to combine small rectangles - into bigger ones in a simple way */ - if (!force_full) { - uint x,y,w; - uint32 *ck = dirty_checksums; - - for(y=0; y!=SCREEN_HEIGHT/8; y++) { - for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { - if (ck[0] != ck[CKSUM_NUM]) { - /* found a dirty 8x8 block, now go as far to the right as possible, - and at the same time, unmark the dirty status by setting old to new. */ - w=0; - do { - ck[w+CKSUM_NUM] = ck[w]; - w++; - } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); - - add_dirty_rect(x*8, y*8, w*8, 8); - - if (force_full) - goto get_out; - } - } - } - } else { - get_out:; - /* Copy old checksums to new */ - memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); - } -} - -void OSystem_MAC::update_screen() { -#if 0 - /* First make sure the mouse is drawn, if it should be drawn. */ - draw_mouse(); - - if (_palette_changed_last != 0) { - //warning("MAC: Palette should be uploaded!");/* FIXME: Add Palette changing code */ - - /*GDevice **odisplay; - odisplay = GetGDevice(); - SetGDevice(GetMainDevice()); - SetEntries(0, (**pal).ctSize, (ColorSpec *)&(**pal).ctTable); - SetGDevice(odisplay);*/ - - /*_palette_changed_last = 0; - if (_mode_flags & DF_FORCE_FULL_ON_PALETTE) - */force_full = true; - } - - /* force a full redraw, accomplish that by adding one big rect to the dirty - * rect list */ - if (force_full) { - num_dirty_rects = 1; - - dirty_rect_list[0].left = 0; - dirty_rect_list[0].top = 0; - dirty_rect_list[0].right = SCREEN_WIDTH; - dirty_rect_list[0].bottom = SCREEN_HEIGHT; - } - - if (num_dirty_rects > 0) - { - Rect *r; - uint32 srcPitch, dstPitch; - Rect *last_rect = dirty_rect_list + num_dirty_rects; - - /* Convert appropriate parts of the image into 16bpp */ - if ((_mode_flags & DF_REAL_8BIT) == 0) { - Rect dst; - for(r=dirty_rect_list; r!=last_rect; ++r) { - dst = *r; - dst.left++; - dst.top++; - dst.right++; - dst.bottom++; - } - } - - /*srcPitch = sdl_tmpscreen->pitch; - dstPitch = sdl_hwscreen->pitch;*/ - - if ((_mode_flags & DF_REAL_8BIT) == 0) { - for(r=dirty_rect_list; r!=last_rect; ++r) { - register int dst_y = r->y + _current_shake_pos; - register int dst_h = 0; - if (dst_y < SCREEN_HEIGHT) { - dst_h = r->h; - if (dst_h > SCREEN_HEIGHT - dst_y) - dst_h = SCREEN_HEIGHT - dst_y; - - r->x <<= 1; - dst_y <<= 1; - - _sai_func((byte*)sdl_tmpscreen->pixels + (r->x+2) + (r->y+1)*srcPitch, srcPitch, NULL, - (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); - } - - r->y = dst_y; - r->w <<= 1; - r->h = dst_h << 1; - } - } else { - for(r=dirty_rect_list; r!=last_rect; ++r) { - register int dst_y = r->y + _current_shake_pos; - register int dst_h = 0; - if (dst_y < SCREEN_HEIGHT) { - dst_h = r->h; - if (dst_h > SCREEN_HEIGHT - dst_y) - dst_h = SCREEN_HEIGHT - dst_y; - - dst_y *= scaling; - - _sai_func((byte*)sdl_tmpscreen->pixels + r->x + r->y*srcPitch, srcPitch, NULL, - (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); - } - - r->x *= scaling; - r->y = dst_y; - r->w *= scaling; - r->h = dst_h * scaling; - } - } - - if (force_full) { - dirty_rect_list[0].y = 0; - dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; - } - } - - /*if(_mode_flags & DF_2xSAI) - { - Rect *r; - uint32 area = 0; - - Rect *dr = dirty_rect_list + num_dirty_rects; - - for(r = dirty_rect_list; r != dr; r++) - { - GWorldPtr gw; - Rect rec; - SetRect(&rec, 0, 0, 320, 200); - NewGWorldFromPtr(&gw, 16, &rec, NULL, NULL, 0, (char*)_tmp_buf, rec.right); - CopyBits(GetPortBitMapForCopyBits(gw), GetPortBitMapForCopyBits(screenBuf), - r, r, srcCopy, 0L); - } - - for(r = dirty_rect_list; r != dr; r++) - { - _sai_func((byte*)_tmp_buf + r->left * 2 + r->top * 640, 640, NULL, - (byte*)_sai_buf + r->left * 4 + r->top * 640 * 4, 640 * 2, - r->right - r->left, r->bottom - r->top); - - area += (r->right - r->left) * (r->bottom - r->top); - - r->left <<= 1; - r->right <<= 1; - r->top <<= 1; - r->bottom <<= 1; - } - }*/ - - update_rects(); - //blit_to_screen(); - - num_dirty_rects = 0; - -#endif -} - -bool OSystem_MAC::show_mouse(bool visible) { - if (_mouse_visible == visible) - return visible; - - bool last = _mouse_visible; - _mouse_visible = visible; - - if (visible) - draw_mouse(); - else - undraw_mouse(); - - return last; -} - -void OSystem_MAC::set_mouse_pos(int x, int y) { - if (x != _ms_cur.x || y != _ms_cur.y) { - _ms_cur.x = x; - _ms_cur.y = y; - undraw_mouse(); - } -} - -void OSystem_MAC::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { - _ms_cur.w = w; - _ms_cur.h = h; - - _ms_hotspot_x = hotspot_x; - _ms_hotspot_y = hotspot_y; - - _ms_buf = (byte*)buf; - - undraw_mouse(); -} - -void OSystem_MAC::set_shake_pos(int shake_pos) { - /*int old_shake_pos = _current_shake_pos; - int dirty_height, dirty_blackheight; - int dirty_top, dirty_blacktop; - - if (shake_pos != old_shake_pos) { - _current_shake_pos = shake_pos; - force_full = true; - - /* Old shake pos was current_shake_pos, new is shake_pos. - * Move the screen up or down to account for the change. - */ - //SDL_Rect dstr = { 0, shake_pos*scaling, 320*scaling, 200*scaling }; - //SDL_Rect srcr = { 0, old_shake_pos*scaling, 320*scaling, 200*scaling }; - //SDL_BlitSurface(sdl_screen, &srcr, sdl_screen, &dstr); - /* Rect srcr, dstr; - - SetRect(&srcr, 0, old_shake_pos * scaling, 320 * scaling, 200 * scaling); - SetRect(&dstr, 0, shake_pos * scaling, 320 * scaling, 200 * scaling); - - CopyBits(GetPortBitMapForCopyBits(screenBuf), GetPortBitMapForCopyBits(GetWindowPort(wref)), - &srcr, &dstr, srcCopy, 0L); - - /* Refresh either the upper part of the screen, - * or the lower part */ - /* if (shake_pos > old_shake_pos) { - dirty_height = MIN(shake_pos, 0) - MIN(old_shake_pos, 0); - dirty_top = -MIN(shake_pos, 0); - dirty_blackheight = MAX(shake_pos, 0) - MAX(old_shake_pos, 0); - dirty_blacktop = MAX(old_shake_pos, 0); - } else { - dirty_height = MAX(old_shake_pos, 0) - MAX(shake_pos, 0); - dirty_top = 200 - MAX(old_shake_pos, 0); - dirty_blackheight = MIN(old_shake_pos, 0) - MIN(shake_pos, 0); - dirty_blacktop = 200 + MIN(shake_pos, 0); - } - - /* Fill the dirty area with blackness or the scumm image */ - //SDL_Rect blackrect = {0, dirty_blacktop*scaling, 320*scaling, dirty_blackheight*scaling}; - //SDL_FillRect(sdl_screen, &blackrect, 0); - - /* FIXME: Um, screen seems to glitch since this - 'not needed' function was removed */ - //g_scumm->redrawLines(dirty_top, dirty_top + dirty_height); -/* }*/ -} - -uint32 OSystem_MAC::get_msecs() { - UnsignedWide ms; - - Microseconds(&ms); - return(ms.lo / 1000); -} - -void OSystem_MAC::delay_msecs(uint msecs) { - uint32 start = get_msecs(); - Event dummy; - - do { - poll_event(&dummy); /* Do something to avoid CPU lock */ - if(get_msecs() >= start + msecs) - break; - } while (1); -} - -void *OSystem_MAC::create_thread(ThreadProc *proc, void *param) { - warning("MAC: Stub create_thread()"); - //NewThread(kCooperativeThread, (void*)proc, param, 0L, kCreateIfNeeded, NULL, NULL); -} - -int mapKey(int key, byte code, byte mod) -{ - switch(code) { - case 0x35: - key = 27; - break; - case 0x31: - key = 32; - break; - case 0x60: - key = 601; - break; - } - - return key; -} - -bool OSystem_MAC::poll_event(Event *event) -{ - EventRef theEvent; - EventTargetRef theTarget; - OSStatus theErr; - - OSStatus result = eventNotHandledErr; - HICommand command; - Point mouse; - - theTarget = GetEventDispatcherTarget(); - theErr = ReceiveNextEvent(GetEventTypeCount(kCmdEvents), kCmdEvents, kEventDurationNoWait,true, &theEvent); - - GetEventParameter( theEvent, kEventParamDirectObject, typeHICommand, NULL, - sizeof( HICommand ), NULL, &command ); - - switch(GetEventClass(theEvent)) - { - case kEventClassWindow: - switch(GetEventKind(theEvent)) - { - case kEventWindowDrawContent: - break; - - case kEventWindowHandleContentClick: - EventMouseButton btn; - - GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, - sizeof(EventMouseButton), NULL, &btn); - - if(btn == kEventMouseButtonPrimary) - event->event_code = EVENT_RBUTTONDOWN; - else if(btn == kEventMouseButtonSecondary) - event->event_code = EVENT_LBUTTONDOWN; - - debug(1, "Mouse down!"); - - if(wref != FrontWindow()) - { -// FIXME - seems some versions of the CarbonLib stub are missing ActivateWindow -// ActivateWindow(wref, true); - BringToFront(wref); - } - return true; - break; - - case kEventWindowClose: - quit(); - break; - } - break; - - case kEventClassCommand: - switch(command.commandID) - { - case kNewGameCmd: - - break; - - case kOpenGameCmd: - //scumm->_saveLoadSlot = 0; - //scumm->_saveLoadFlag = 2; - break; - - case kSaveGameCmd: - //scumm->_saveLoadSlot = 0; - //sprintf(scumm->_saveLoadName, "Quicksave %d", scumm->_saveLoadSlot); - //scumm->_saveLoadFlag = 1; - break; - - case kQuitCmd: - quit(); - break; - - case kPrefsCmd: - //Preferences(); - break; - - case kAboutCmd: - //About(); - break; - } - break; - - case kEventClassKeyboard: - if(GetEventKind(theEvent) == kEventRawKeyDown) - { - char key; - UInt32 mod, code; - - GetEventParameter(theEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &code); - GetEventParameter(theEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key); - GetEventParameter(theEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &mod); - - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = code; - event->kbd.ascii = mapKey(key, code, mod); - debug(1, "Key down: %c", event->kbd.ascii); - return true; - } - break; - - case kEventClassMouse: - EventMouseButton btn; - Rect winRect; - - switch(GetEventKind(theEvent)) - { - case kEventMouseDown: - WindowRef theWin; - - GetEventParameter(theEvent, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), - NULL, &theWin); - if(theWin != FrontWindow()) - { -// FIXME - seems some versions of the CarbonLib stub are missing ActivateWindow -// ActivateWindow(theWin, true); - BringToFront(theWin); - } - - GetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &mouse); - - GetWindowBounds(wref, kWindowContentRgn, &winRect); - if(PtInRect(mouse, &winRect)) - { - GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, - sizeof(EventMouseButton), NULL, &btn); - - if(btn == kEventMouseButtonPrimary) - event->event_code = EVENT_RBUTTONDOWN; - else if(btn == kEventMouseButtonSecondary) - event->event_code = EVENT_LBUTTONDOWN; - - debug(1, "Mouse down!"); - } - break; - - case kEventMouseUp: - - GetEventParameter(theEvent, kEventParamMouseButton, typeMouseButton, NULL, - sizeof(EventMouseButton), NULL, &btn); - - if(btn == kEventMouseButtonPrimary) - event->event_code = EVENT_RBUTTONUP; - else if(btn == kEventMouseButtonSecondary) - event->event_code = EVENT_LBUTTONUP; - - debug(1, "Mouse up!"); - - return true; - break; - - case kEventMouseMoved: - GetEventParameter(theEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &mouse); - - GetWindowBounds(wref, kWindowContentRgn, &winRect); - if(PtInRect(mouse, &winRect)) - { - CGrafPtr oldPort; - - GetPort(&oldPort); - SetPortWindowPort(wref); - GlobalToLocal(&mouse); - - event->event_code = EVENT_MOUSEMOVE; - event->mouse.x = mouse.h / scaling; - event->mouse.y = mouse.v / scaling; - - //scumm->mouse.x = mouse.h/wm->scale; - //scumm->mouse.y = mouse.v/wm->scale; - } - Point offset = {0, 0}; - ShieldCursor(&winRect, offset); - return true; - break; - } - break; - } - - if(theErr == noErr && theEvent != NULL) { - SendEventToEventTarget (theEvent, theTarget); - ReleaseEvent(theEvent); - } -} - -pascal void sound_callback(SndChannel *chan, SndCommand *cmd_passed) -{ - OSystem_MAC* syst = (OSystem_MAC*)chan->userInfo; - syst->sound_callback(chan, cmd_passed); -} - -void OSystem_MAC::sound_callback(SndChannel *chan, SndCommand *cmd_passed) -{ - UInt32 fill_me, play_me; - SndCommand cmd; - - fill_me = cmd_passed->param2; - play_me = ! fill_me; - - header.samplePtr = (Ptr)buffer[play_me]; - - cmd.cmd = bufferCmd; - cmd.param1 = 0; - cmd.param2 = (long)&header; - - SndDoCommand(chan, &cmd, 0); - - memset(buffer[fill_me], 0, size); - //sndProc(parameter, buffer[fill_me], size); - //SoundMixer::on_generate_samples(parameter, buffer[fill_me], size); - - cmd.cmd = callBackCmd; - cmd.param1 = 0; - cmd.param2 = play_me; - - SndDoCommand(chan, &cmd, 0); -} - -bool OSystem_MAC::set_sound_proc(void *param, SoundProc *proc, byte format) -{ - SndCallBackUPP callback; - int sample_size; - - memset(&header, 0, sizeof(header)); - callback = NewSndCallBackUPP(::sound_callback); - size = ((0x9010 & 0xFF) / 8) * 2048; - sample_size = size / 2048 * 8; - header.numChannels = 1; - header.sampleSize = sample_size; - header.sampleRate = SAMPLES_PER_SEC << 16; - header.numFrames = 2048; - header.encode = cmpSH; - - for(int i = 0; i < 2; i++) - { - buffer[i] = (UInt8*)malloc(sizeof(UInt8) * size); - memset(buffer[i], 0, size); - } - - channel = (SndChannelPtr)malloc(sizeof(*channel)); - channel->qLength = 128; - channel->userInfo = (long)this; - SndNewChannel(&channel, sampledSynth, initMono, callback); - - SndCommand cmd; - cmd.cmd = callBackCmd; - cmd.param2 = 0; - SndDoCommand(channel, &cmd, 0); - - sndProc = proc; - parameter = param; - - return true; -} - - -/* retrieve the 320x200 bitmap currently being displayed */ -void OSystem_MAC::get_320x200_image(byte *buf) -{ - /* make sure the mouse is gone */ - undraw_mouse(); - - byte *src; - int x,y; - - switch(_internal_scaling) { - case 1: - memcpy(buf, _gfx_buf, 320*200); - break; - - case 2: - src = (byte*)_gfx_buf; - for(y=0; y!=200; y++) { - for(x=0; x!=320; x++) - buf[x] = src[x*2]; - buf += 320; - src += 320 * 2 * 2; - } - break; - - case 3: - src = (byte*)_gfx_buf; - for(y=0; y!=200; y++) { - for(x=0; x!=320; x++) - buf[x] = src[x*3]; - buf += 320; - src += 320 * 3 * 3; - } - break; - } -} - -void OSystem_MAC::hotswap_gfx_mode() -{ - /* hmm, need to allocate a 320x200 bitmap - * which will contain the "backup" of the screen during the change. - * then draw that to the new screen right after it's setup. - */ - - byte *bak_mem = (byte*)malloc(320*200); - - get_320x200_image(bak_mem); - - unload_gfx_mode(); - load_gfx_mode(); - - force_full = true; - - /* reset palette ? */ - pal = (CTabHandle)NewHandleClear(sizeof(ColorTable) + 255 * sizeof(ColorSpec)); - (*pal)->ctFlags = 0; - (*pal)->ctSize = 255; - - /* blit image */ - copy_rect(bak_mem, 320, 0, 0, 320, 200); - free(bak_mem); - - update_screen(); -} - -uint32 OSystem_MAC::property(int param, Property *value) { - switch(param) { - case PROP_TOGGLE_FULLSCREEN: - _full_screen ^= true; - return 1; - - case PROP_SET_WINDOW_CAPTION: - StringPtr gameText = CToPascal((char*)value->caption); - SetWTitle(wref, gameText); - return 1; - - case PROP_OPEN_CD: - break; - - case PROP_SET_GFX_MODE: - if(value->gfx_mode >= 7) - return 0; - _mode = value->gfx_mode; - hotswap_gfx_mode(); - return 1; - - - case PROP_SHOW_DEFAULT_CURSOR: - break; - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - break; - } - - return 0; -} - -void OSystem_MAC::quit() { - unload_gfx_mode(); - - QuitApplicationEventLoop(); - ExitToShell(); -} - -void OSystem_MAC::draw_mouse() { - if (_mouse_drawn || !_mouse_visible) - return; - _mouse_drawn = true; - - const int ydraw = _ms_cur.y + _current_shake_pos - _ms_hotspot_y; - const int xdraw = _ms_cur.x - _ms_hotspot_x; - const int w = _ms_cur.w; - const int h = _ms_cur.h; - int x,y; - byte color; - byte *dst, *bak = _ms_backup; - byte *buf = _ms_buf; - - _ms_old.w = w; - _ms_old.h = h; - _ms_old.x = xdraw; - _ms_old.y = ydraw; - - byte *src; - if(_sai_func) - src = (byte*)_tmp_buf; - else - src = _gfx_buf; - - switch(_internal_scaling) { - case 1: - dst = (byte *)src + ydraw * 320 + xdraw; - - for (y = 0; y < h; y++, dst += 320, bak += MAX_MOUSE_W, buf += w) { - if ((uint) (ydraw + y) < 200) { - for (x = 0; x < w; x++) { - if ((uint) (xdraw + x) < 320) { - bak[x] = dst[x]; - if ((color = buf[x]) != 0xFF) { - dst[x] = color; - } - } - } - } - } - break; - - case 2: - dst = (byte *)src + ydraw * 640 * 2 + xdraw * 2; - - for (y = 0; y < h; y++, dst += 640 * 2, bak += MAX_MOUSE_W * 2, buf += w) { - if ((uint) (ydraw + y) < 200) { - for (x = 0; x < w; x++) { - if ((uint) (xdraw + x) < 320) { - bak[x * 2] = dst[x * 2]; - bak[x * 2 + 1] = dst[x * 2 + 1]; - if ((color = buf[x]) != 0xFF) { - dst[x * 2] = color; - dst[x * 2 + 1] = color; - dst[x * 2 + 640] = color; - dst[x * 2 + 1 + 640] = color; - } - } - } - } - } - break; - - case 3: - dst = (byte *)src + ydraw * 960 * 3 + xdraw * 3; - - for (y = 0; y < h; y++, dst += 960 * 3, bak += MAX_MOUSE_W * 3, buf += w) { - if ((uint) (ydraw + y) < 200) { - for (x = 0; x < w; x++) { - if ((uint) (xdraw + x) < 320) { - bak[x * 3] = dst[x * 3]; - bak[x * 3 + 1] = dst[x * 3 + 1]; - bak[x * 3 + 2] = dst[x * 3 + 2]; - if ((color = buf[x]) != 0xFF) { - dst[x * 3] = color; - dst[x * 3 + 1] = color; - dst[x * 3 + 2] = color; - dst[x * 3 + 960] = color; - dst[x * 3 + 1 + 960] = color; - dst[x * 3 + 2 + 960] = color; - dst[x * 3 + 960 + 960] = color; - dst[x * 3 + 1 + 960 + 960] = color; - dst[x * 3 + 2 + 960 + 960] = color; - } - } - } - } - } - break; - } - - add_dirty_rect(xdraw,ydraw,w,h); -} - -void OSystem_MAC::undraw_mouse() { - if (!_mouse_drawn) - return; - _mouse_drawn = false; - - byte *dst, *bak = _ms_backup; - byte *src; - const int old_mouse_x = _ms_old.x; - const int old_mouse_y = _ms_old.y; - const int old_mouse_w = _ms_old.w; - const int old_mouse_h = _ms_old.h; - int x,y; - - if(_sai_func) - src = (byte*)_tmp_buf; - else - src = _gfx_buf; - - switch(_internal_scaling) { - case 1: - dst = (byte *)src + old_mouse_y * 320 + old_mouse_x; - - for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W, dst += 320) { - if ((uint) (old_mouse_y + y) < 200) { - for (x = 0; x < old_mouse_w; x++) { - if ((uint) (old_mouse_x + x) < 320) { - dst[x] = bak[x]; - } - } - } - } - break; - - case 2: - dst = (byte *)src + old_mouse_y * 640 * 2 + old_mouse_x * 2; - - for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W * 2, dst += 640 * 2) { - if ((uint) (old_mouse_y + y) < 200) { - for (x = 0; x < old_mouse_w; x++) { - if ((uint) (old_mouse_x + x) < 320) { - dst[x * 2 + 640] = dst[x * 2] = bak[x * 2]; - dst[x * 2 + 640 + 1] = dst[x * 2 + 1] = bak[x * 2 + 1]; - } - } - } - } - break; - - case 3: - dst = (byte *)src + old_mouse_y * 960 * 3 + old_mouse_x * 3; - - for (y = 0; y < old_mouse_h; y++, bak += MAX_MOUSE_W * 3, dst += 960 * 3) { - if ((uint) (old_mouse_y + y) < 200) { - for (x = 0; x < old_mouse_w; x++) { - if ((uint) (old_mouse_x + x) < 320) { - dst[x * 3 + 960] = dst[x * 3 + 960 + 960] = dst[x * 3] = - bak[x * 3]; - dst[x * 3 + 960 + 1] = dst[x * 3 + 960 + 960 + 1] = - dst[x * 3 + 1] = bak[x * 3 + 1]; - dst[x * 3 + 960 + 2] = dst[x * 3 + 960 + 960 + 2] = - dst[x * 3 + 2] = bak[x * 3 + 2]; - } - } - } - } - break; - } - - add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); -} - -void OSystem_MAC::stop_cdrom() { -} - -void OSystem_MAC::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { - /* Reset sync count */ - g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0; -} - -bool OSystem_MAC::poll_cdrom() { -} - -void OSystem_MAC::update_cdrom() { -} - - - -/*************************************************************/ -/** Mac specific code ****************************************/ -void OSystem_MAC::set_scaling() { - Rect rectWin; - SetRect(&rectWin, 0, 0, 320 * scaling, 200 * scaling); - HideWindow(wref); - SetWindowBounds(wref, kWindowContentRgn, &rectWin); - RepositionWindow(wref, NULL, kWindowCenterOnMainScreen); - ShowWindow(wref); - blit_rect = rectWin; - - if(_sai_func) - { - Rect r; - - //SetRect(&r, 0, 0, 320, 240); - _sai_buf = (int16*)malloc((320 * 200) * 2 * sizeof(int16)); - - NewGWorldFromPtr(&screenBuf, 16, &blit_rect, NULL, nil, 0, (char *)_sai_buf, blit_rect.right); - } - else - { - _gfx_buf = (byte*)malloc((320 * 200) * scaling * sizeof(byte)); - NewGWorldFromPtr(&screenBuf, 8, &blit_rect, pal, nil, 0, (char *)_gfx_buf, blit_rect.right); - } - - //NewGWorldFromPtr(&screenBuf, 8, &blit_rect, pal, nil, 0, (char *)_gfx_buf, blit_rect.right); - - //if(screenBuf != NULL) - // UpdateGWorld(&screenBuf, 8, &blit_rect, pal, NULL, NULL); -} - -void OSystem_MAC::blit_to_screen() -{ - CopyBits(GetPortBitMapForCopyBits(screenBuf), - GetPortBitMapForCopyBits(GetWindowPort(wref)), &blit_rect, &blit_rect, srcCopy, 0L); -} - -void OSystem_MAC::init_mac_stuff() -{ - Rect rectWin; - - - MenuRef AppleMenu = GetMenu(1000); - InsertMenu(AppleMenu, 0); - SetMenuItemCommandID(AppleMenu, 1, kAboutCmd); - MenuRef FileMenu = GetMenu(1001); - SetMenuItemCommandID(FileMenu, 1, kNewGameCmd); - SetMenuItemCommandID(FileMenu, 2, kOpenGameCmd); - SetMenuItemCommandID(FileMenu, 3, kSaveGameCmd); - SetMenuItemCommandID(FileMenu, 5, kQuitCmd); - DeleteMenuItems(FileMenu, CountMenuItems(FileMenu)-1, 2); - InsertMenu(FileMenu, 0); - MenuRef windMenu; - CreateStandardWindowMenu(0, &windMenu); - InsertMenu(windMenu, 0); - EnableMenuCommand(NULL, kPrefsCmd); - DrawMenuBar(); - - SetRect(&rectWin, 0, 0, 320, 200); - UInt32 WinAttrib = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | - kWindowInWindowMenuAttribute | kWindowStandardHandlerAttribute); - - if(noErr != CreateNewWindow(kDocumentWindowClass, WinAttrib, &rectWin, &wref)) - { - //Error("Couldn't create Window!"); - } - - RepositionWindow(wref, NULL, kWindowCenterOnMainScreen); - - Str255 WindowTitle = "\pScummVM"; - SetWTitle(wref, WindowTitle); - - SetPortWindowPort(wref); - //ShowWindow(wref); - - InstallStandardEventHandler(GetWindowEventTarget(wref)); - - //OSStatus err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(QuitEventHandler), 0L, false); - - blit_rect = rectWin; - pal = (CTabHandle)NewHandleClear(sizeof(ColorTable) + 255 * sizeof(ColorSpec)); - (*pal)->ctFlags = 0; - (*pal)->ctSize = 255; - //NewGWorld(&screenBuf, 8, &blit_rect, 0, 0, 0); -} - -void OSystem_MAC::update_rects() -{ - for(int i = 0; i < num_dirty_rects; i++) - { - Rect rec = dirty_rect_list[i]; - - CopyBits(GetPortBitMapForCopyBits(screenBuf), - GetPortBitMapForCopyBits(GetWindowPort(wref)), - &rec, &rec, srcCopy, 0L); - } -} diff --git a/mac/macos.h b/mac/macos.h deleted file mode 100755 index 09c40456e9..0000000000 --- a/mac/macos.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * - * - */ - - //#define MACOS_SDL - #define MACOS_CARBON - \ No newline at end of file diff --git a/mac/scummvm.mcp b/mac/scummvm.mcp deleted file mode 100644 index a0c11c7642..0000000000 Binary files a/mac/scummvm.mcp and /dev/null differ diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 43fd2e4563..0000000000 --- a/main.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "engine.h" -#include "scumm.h" -#include "sound/mididrv.h" -#include "gameDetector.h" -#include "simon/simon.h" -#include "config-file.h" - -GameDetector detector; - -Config *scummcfg = 0; - - -#if defined(QTOPIA) -// FIXME - why exactly is this needed? -extern "C" int main(int argc, char *argv[]); -#endif - -#if defined(MACOSX) || defined(QTOPIA) -#include -#elif !defined(__MORPHOS__) -#undef main -#endif - -#if defined(UNIX) -#include -#ifndef MAXPATHLEN -#define MAXPATHLEN 256 -#endif -#define DEFAULT_CONFIG_FILE ".scummvmrc" -#else -#define DEFAULT_CONFIG_FILE "scummvm.ini" -#endif - -#if defined(UNIX) -#include - -#ifndef SCUMM_NEED_ALIGNMENT -static void handle_errors(int sig_num) { - error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); -} -#endif - -/* This function is here to test if the endianness / alignement compiled it is matching - with the one at run-time. */ -static void do_memory_test(void) { - unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }; - unsigned int value; - /* First test endianness */ -#ifdef SCUMM_LITTLE_ENDIAN - if (*((int *) test) != 0x44332211) { - error("Compiled as LITTLE_ENDIAN on a big endian system. Please rebuild "); - } - value = 0x55443322; -#else - if (*((int *) test) != 0x11223344) { - error("Compiled as BIG_ENDIAN on a little endian system. Please rebuild "); - } - value = 0x22334455; -#endif - /* Then check if one really supports unaligned memory accesses */ -#ifndef SCUMM_NEED_ALIGNMENT - signal(SIGBUS, handle_errors); - signal(SIGABRT, handle_errors); - signal(SIGSEGV, handle_errors); - if (*((unsigned int *) ((char *) test + 1)) != value) { - error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); - } - signal(SIGBUS, SIG_DFL); - signal(SIGABRT, SIG_DFL); - signal(SIGSEGV, SIG_DFL); -#endif -} - -#endif - -int main(int argc, char *argv[]) -{ -#ifdef __DC__ - extern void dc_init_hardware(); - dc_init_hardware(); -#endif - -#if defined(UNIX) - /* On Unix, do a quick endian / alignement check before starting */ - do_memory_test(); - - char scummhome[MAXPATHLEN]; - if(getenv("HOME") != NULL) - sprintf(scummhome,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE); - else strcpy(scummhome,DEFAULT_CONFIG_FILE); -#else - char scummhome[255]; - #if defined (WIN32) && !defined(_WIN32_WCE) - GetWindowsDirectory(scummhome, 255); - strcat(scummhome, "\\"); - strcat(scummhome, DEFAULT_CONFIG_FILE); - #else - strcpy(scummhome,DEFAULT_CONFIG_FILE); - #endif -#endif - - scummcfg = new Config(scummhome, "scummvm"); - scummcfg->set("versioninfo", SCUMMVM_VERSION); - if (detector.detectMain(argc, argv)) - return (-1); - - OSystem *system = detector.createSystem(); - - { - char *s = detector.getGameName(); - OSystem::Property prop; - - prop.caption = s; - system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop); - free(s); - } - - // Create the game engine - Engine *engine = Engine::createFromDetector(&detector, system); - - // Run the game engine - engine->go(); - - delete scummcfg; - - return 0; -} diff --git a/morphos/Makefile b/morphos/Makefile deleted file mode 100644 index abd5a5c994..0000000000 --- a/morphos/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -vpath %.cpp ../:../sound/:../v3/:../v4/:../simon/:../gui/ -vpath %.h ../ - -CC = g++ -CFLAGS = -Wno-multichar -fstrength-reduce -fno-rtti -O2 -DEFINES = -DNO_PPCINLINE_STDARG -DNO_PPCINLINE_VARARGS -LDFLAGS := -noixemul -s -INCLUDES:= -I../ -I../sound -CPPFLAGS= $(DEFINES) $(INCLUDES) -LIBS = -lamiga -lamigastubs -lcdda -ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip - -INCS = scumm.h scummsys.h stdafx.h - -GUIOBJS = widget.o dialog.o newgui.o ListWidget.o ScrollBarWidget.o - -SCUMMOBJS = actor.o akos.o boxes.o bundle.o costume.o debug.o debugrl.o gfx.o \ - object.o saveload.o script.o scummvm.o sound.o string.o sys.o vars.o verbs.o \ - script_v1.o script_v2.o gui.o imuse.o insane.o resource.o resource_v3.o resource_v4.o - -SIMONOBJS = midi.o simon.o simondebug.o simonitems.o simonres.o simonsys.o simonverb.o simonvga.o - -OBJS = config-file.o engine.o gameDetector.o fmopl.o mixer.o mididrv.o util.o main.o \ - morphos.o morphos_scaler.o morphos_sound.o morphos_start.o morphos_timer.o \ - $(GUIOBJS) $(SCUMMOBJS) $(SIMONOBJS) - -DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \ - windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \ - scummvm.dsp scummvm.dsw sound/fmopl.h - -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o - -all: scummvm - -scummvm: $(OBJS) - $(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - -#$(OBJS): Makefile - -clean: - rm -f $(OBJS) scummvm - -dist: - rm -f $(ZIPFILE) - zip -q $(ZIPFILE) $(DISTFILES) - -check: -$(OBJS): $(INCS) diff --git a/morphos/MorphOS.readme b/morphos/MorphOS.readme deleted file mode 100644 index 693ae324c4..0000000000 --- a/morphos/MorphOS.readme +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the source for the MorphOS port of ScummVM. To build, you -must have a proper Geek Gadgets installation. Just type "make" in the MorphOS -subdirectory. If you don't have the includes for AMidi 2 and cdda.library, check -my webpage. If they aren't uploaded yet, feel free to e-mail me. - -You don't have to build ScummVM yourself. The latest official and CVS binaries are -available from my website at: - -http://www.muenster.de/~tomjoad/scummvm.html - -Ruediger Hanke -tomjoad@muenster.de - diff --git a/morphos/morphos.cpp b/morphos/morphos.cpp deleted file mode 100644 index a949cbfd2f..0000000000 --- a/morphos/morphos.cpp +++ /dev/null @@ -1,1293 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 Rüdiger Hanke - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * MorphOS interface - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include "morphos.h" -#include "morphos_scaler.h" - -static TagItem FindCDTags[] = { { CDFA_VolumeName, 0 }, - { TAG_DONE, 0 } - }; -static TagItem PlayTags[] = { { CDPA_StartTrack, 1 }, - { CDPA_StartFrame, 0 }, - { CDPA_EndTrack, 1 }, - { CDPA_EndFrame, 0 }, - { CDPA_Loops, 1 }, - { TAG_DONE, 0 } - }; - -TagItem musicProcTags[] = { { NP_Entry, 0 }, - { NP_Name, (ULONG)"ScummVM Music Thread" }, - { NP_Priority, 0 }, - { TAG_DONE, 0 } - }; -TagItem soundProcTags[] = { { NP_Entry, 0 }, - { NP_Name, (ULONG)"ScummVM Sound Thread" }, - { NP_Priority, 0 }, - { TAG_DONE, 0 } - }; - -#define BLOCKSIZE_X 32 -#define BLOCKSIZE_Y 8 - -#define BLOCKS_X (ScummBufferWidth/BLOCKSIZE_X) -#define BLOCKS_Y (ScummBufferHeight/BLOCKSIZE_Y) -#define BLOCK_ID(x, y) ((y/BLOCKSIZE_Y)*BLOCKS_X+(x/BLOCKSIZE_X)) - -OSystem_MorphOS *OSystem_MorphOS::create(int game_id, SCALERTYPE gfx_scaler, bool full_screen) -{ - OSystem_MorphOS *syst = new OSystem_MorphOS(game_id, gfx_scaler, full_screen); - - return syst; -} - -OSystem_MorphOS::OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen) -{ - GameID = game_id; - ScummScreen = NULL; - ScummWindow = NULL; - ScummBuffer = NULL; - ScummScreenBuffer[0] = NULL; - ScummScreenBuffer[1] = NULL; - ScummRenderTo = NULL; - ScummNoCursor = NULL; - ScummMusicThread = NULL; - ScummSoundThread = NULL; - ScummWinX = -1; - ScummWinY = -1; - ScummDefaultMouse = false; - ScummOrigMouse = false; - ScummShakePos = 0; - ScummScaler = gfx_mode; - ScummScale = (gfx_mode == ST_NONE) ? 0 : 1; - ScummDepth = 0; - Scumm16ColFmt16 = false; - ScummScrWidth = 0; - ScummScrHeight = 0; - ScreenChanged = false; - DirtyBlocks = NULL; - BlockColors = NULL; - Scaler = NULL; - FullScreenMode = full_screen; - CDrive = NULL; - CDDATrackOffset = 0; - strcpy(ScummWndTitle, "ScummVM MorphOS"); - TimerMsgPort = NULL; - TimerIORequest = NULL; - - OpenATimer(&TimerMsgPort, (IORequest **) &TimerIORequest, UNIT_MICROHZ); - - TimerBase = TimerIORequest->tr_node.io_Device; - ScummNoCursor = (UWORD *) AllocVec(16, MEMF_CHIP | MEMF_CLEAR); - UpdateRegion = NewRegion(); - NewUpdateRegion = NewRegion(); - if (!UpdateRegion || !NewUpdateRegion) - error("Could not create region for screen update"); -} - -OSystem_MorphOS::~OSystem_MorphOS() -{ - if (DirtyBlocks) - { - FreeVec(DirtyBlocks); - - for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - FreeVec(BlockColors[b]); - FreeVec(BlockColors); - } - - if (Scaler) - delete Scaler; - - if (UpdateRegion) - DisposeRegion(UpdateRegion); - - if (NewUpdateRegion) - DisposeRegion(NewUpdateRegion); - - if (CDrive && CDDABase) - { - CDDA_Stop(CDrive); - CDDA_ReleaseDrive(CDrive); - } - - if (TimerIORequest) - { - CloseDevice((IORequest *) TimerIORequest); - DeleteIORequest((IORequest *) TimerIORequest); - } - - if (TimerMsgPort) - DeleteMsgPort(TimerMsgPort); - - if (ScummMusicThread) - { - Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C); - ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ - ReleaseSemaphore(&ScummMusicThreadRunning); - } - - if (ScummSoundThread) - { - Signal((Task *) ScummSoundThread, SIGBREAKF_CTRL_C); - ObtainSemaphore(&ScummSoundThreadRunning); /* Wait for thread to finish */ - ReleaseSemaphore(&ScummSoundThreadRunning); - } - - if (ScummNoCursor) - FreeVec(ScummNoCursor); - - if (ScummBuffer) - FreeVec(ScummBuffer); - - if (ScummRenderTo && !ScummScreen) - FreeBitMap (ScummRenderTo); - - if (ScummWindow) - CloseWindow(ScummWindow); - - if (ScummScreen) - { - if (ScummScreenBuffer[0]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); - if( ScummScreenBuffer[1] ) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); - CloseScreen(ScummScreen); - } -} - -bool OSystem_MorphOS::OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required) -{ - *req = NULL; - const char *err_msg = NULL; - - *port = CreateMsgPort(); - if (*port) - { - *req = (IORequest *) CreateIORequest(*port, sizeof (timerequest)); - if (*req) - { - if (OpenDevice(TIMERNAME, unit, *req, 0)) - { - DeleteIORequest(*req); - *req = NULL; - err_msg = "Failed to open timer device"; - } - } - else - err_msg = "Failed to create IO request"; - } - else - err_msg = "Failed to create message port"; - - if (err_msg) - { - if (required) - error(err_msg); - warning(err_msg); - } - - return *req != NULL; -} - -uint32 OSystem_MorphOS::get_msecs() -{ - int ticks = clock(); - ticks *= (1000/CLOCKS_PER_SEC); - return ticks; -} - -void OSystem_MorphOS::delay_msecs(uint msecs) -{ - TimerIORequest->tr_node.io_Command = TR_ADDREQUEST; - TimerIORequest->tr_time.tv_secs = 0; - TimerIORequest->tr_time.tv_micro = msecs*1000; - DoIO((IORequest *) TimerIORequest); -} - -void OSystem_MorphOS::set_timer(int timer, int (*callback)(int)) -{ - warning("set_timer() unexpectedly called"); -} - -void *OSystem_MorphOS::create_thread(ThreadProc *proc, void *param) -{ - static EmulFunc ThreadEmulFunc; - - ThreadEmulFunc.Trap = TRAP_FUNC; - ThreadEmulFunc.Address = (ULONG)proc; - ThreadEmulFunc.StackSize = 16000; - ThreadEmulFunc.Extension = 0; - ThreadEmulFunc.Arg1 = (ULONG)param; - musicProcTags[0].ti_Data = (ULONG)&ThreadEmulFunc; - ScummMusicThread = CreateNewProc(musicProcTags); - return ScummMusicThread; -} - -void *OSystem_MorphOS::create_mutex(void) -{ - SignalSemaphore *sem = (SignalSemaphore *) AllocVec(sizeof (SignalSemaphore), MEMF_PUBLIC); - - if (sem) - InitSemaphore(sem); - - return sem; -} - -void OSystem_MorphOS::lock_mutex(void *mutex) -{ - ObtainSemaphore((SignalSemaphore *) mutex); -} - -void OSystem_MorphOS::unlock_mutex(void *mutex) -{ - ReleaseSemaphore((SignalSemaphore *)mutex); -} - -void OSystem_MorphOS::delete_mutex(void *mutex) -{ - FreeVec(mutex); -} - -uint32 OSystem_MorphOS::property(int param, Property *value) -{ - switch (param) - { - case PROP_TOGGLE_FULLSCREEN: - CreateScreen(CSDSPTYPE_TOGGLE); - return 1; - - case PROP_SET_WINDOW_CAPTION: - sprintf(ScummWndTitle, "ScummVM MorphOS - %s", value->caption); - if (ScummWindow) - SetWindowTitles(ScummWindow, ScummWndTitle, ScummWndTitle); - return 1; - - case PROP_OPEN_CD: - FindCDTags[0].ti_Data = (ULONG) ((GameID == GID_LOOM256) ? "LoomCD" : "Monkey1CD"); - if (!CDDABase) CDDABase = OpenLibrary("cdda.library", 2); - if (CDDABase) - { - CDrive = CDDA_FindNextDrive(NULL, FindCDTags); - if (!CDrive && GameID == GID_MONKEY) - { - FindCDTags[0].ti_Data = (ULONG) "Madness"; - CDrive = CDDA_FindNextDrive(NULL, FindCDTags); - } - if (CDrive) - { - if (!CDDA_ObtainDrive(CDrive, CDDA_SHARED_ACCESS, NULL)) - { - CDrive = NULL; - warning("Failed to obtain CD drive - music will not play"); - } - else if (GameID == GID_LOOM256) - { - // Offset correction *may* be required - CDS_TrackInfo ti = { sizeof (CDS_TrackInfo) }; - - if (CDDA_GetTrackInfo(CDrive, 1, 0, &ti)) - CDDATrackOffset = ti.ti_TrackStart.tm_Format.tm_Frame-22650; - } - } - else - warning( "Could not find game CD inserted in CD-ROM drive - cd audio will not play" ); - } - else - warning( "Failed to open cdda.library - cd audio will not play" ); - break; - - case PROP_SHOW_DEFAULT_CURSOR: - if (value->show_cursor) - ClearPointer(ScummWindow); - else - SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); - ScummOrigMouse = ScummDefaultMouse = value->show_cursor; - break; - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - } - - return 0; -} - -void OSystem_MorphOS::play_cdrom(int track, int num_loops, int start_frame, int length) -{ - if (CDrive && start_frame >= 0) - { - if (start_frame > 0) - start_frame -= CDDATrackOffset; - - PlayTags[0].ti_Data = track; - PlayTags[1].ti_Data = start_frame; - PlayTags[2].ti_Data = (length == 0) ? track+1 : track; - PlayTags[3].ti_Data = length ? start_frame+length : 0; - PlayTags[4].ti_Data = (num_loops == 0) ? 1 : num_loops; - CDDA_Play(CDrive, PlayTags); - } -} - -void OSystem_MorphOS::stop_cdrom() -{ - CDDA_Stop(CDrive); -} - -bool OSystem_MorphOS::poll_cdrom() -{ - ULONG status; - - if (CDrive == NULL) - return false; - - CDDA_GetAttr(CDDA_Status, CDrive, &status); - return status == CDDA_Status_Busy; -} - -void OSystem_MorphOS::update_cdrom() -{ -} - -void OSystem_MorphOS::quit() -{ - exit(0); -} - -#define CVT8TO32(col) ((col<<24) | (col<<16) | (col<<8) | col) - -void OSystem_MorphOS::set_palette(const byte *colors, uint start, uint num) -{ - const byte *data = colors; - UWORD changed_colors[256]; - UWORD num_changed = 0; - - for (uint i = start; i != start+num; i++) - { - ULONG color32 = (data[0] << 16) | (data[1] << 8) | data[2]; - if (color32 != ScummColors[i]) - { - if (ScummDepth == 8) - SetRGB32(&ScummScreen->ViewPort, i, CVT8TO32(data[0]), CVT8TO32(data[1]), CVT8TO32(data[2])); - ScummColors16[i] = Scumm16ColFmt16 ? (((data[0]*31)/255) << 11) | (((data[1]*63)/255) << 5) | ((data[ 2 ]*31)/255) : (((data[0]*31)/255) << 10) | (((data[1]*31)/255) << 5) | ((data[2]*31)/255); - ScummColors[i] = color32; - changed_colors[num_changed++] = i; - } - data += 4; - } - - if (ScummScale || ScummDepth != 8) - { - if (DirtyBlocks && num_changed < 200) - { - for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - { - UWORD *block_colors = BlockColors[b]; - UWORD *color_ptr = changed_colors; - for (int c = 0; c < num_changed; c++) - { - if (block_colors[*color_ptr++]) - { - UWORD x, y; - x = b % BLOCKS_X; - y = b / BLOCKS_X; - DirtyBlocks[b] = true; - AddUpdateRect(x*BLOCKSIZE_X, y*BLOCKSIZE_Y, BLOCKSIZE_X, BLOCKSIZE_Y); - break; - } - } - } - } - else - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); - } -} - -void OSystem_MorphOS::CreateScreen(CS_DSPTYPE dspType) -{ - ULONG mode = INVALID_ID; - int depths[] = { 8, 15, 16, 24, 32, 0 }; - int i; - Screen *wb = NULL; - - if (dspType != CSDSPTYPE_KEEP) - FullScreenMode = (dspType == CSDSPTYPE_FULLSCREEN) || (dspType == CSDSPTYPE_TOGGLE && !FullScreenMode); - - if (ScummRenderTo && !ScummScreen) - FreeBitMap(ScummRenderTo); - ScummRenderTo = NULL; - - if (ScummWindow) - { - if (ScummScreen == NULL) - { - ScummWinX = ScummWindow->LeftEdge; - ScummWinY = ScummWindow->TopEdge; - } - CloseWindow (ScummWindow); - ScummWindow = NULL; - } - - if (ScummScreen) - { - if (ScummScreenBuffer[0]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); - if (ScummScreenBuffer[1]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); - CloseScreen(ScummScreen); - ScummScreen = NULL; - } - - ScummScrWidth = ScummBufferWidth << ScummScale; - ScummScrHeight = ScummBufferHeight << ScummScale; - - if (FullScreenMode) - { - for (i = ScummScale; mode == INVALID_ID && depths[i]; i++) - mode = BestCModeIDTags(CYBRBIDTG_NominalWidth, ScummScrWidth, - CYBRBIDTG_NominalHeight, ScummScrHeight, - CYBRBIDTG_Depth, depths[i], - TAG_DONE - ); - ScummDepth = depths[i-1]; - - if (mode == INVALID_ID) - error("Could not find suitable screenmode"); - - ScummScreen = OpenScreenTags(NULL, SA_AutoScroll, TRUE, - SA_Depth, ScummDepth, - SA_Width, STDSCREENWIDTH, - SA_Height, STDSCREENHEIGHT, - SA_DisplayID, mode, - SA_ShowTitle, FALSE, - SA_Type, CUSTOMSCREEN, - SA_Title, "ScummVM MorphOS", - TAG_DONE - ); - - if (ScummScreen == NULL) - error("Failed to open screen"); - - ULONG RealDepth = GetBitMapAttr(&ScummScreen->BitMap, BMA_DEPTH); - if (RealDepth != ScummDepth) - { - warning("Screen did not open in expected depth"); - ScummDepth = RealDepth; - } - ScummScreenBuffer[0] = AllocScreenBuffer(ScummScreen, NULL, SB_SCREEN_BITMAP); - ScummScreenBuffer[1] = AllocScreenBuffer(ScummScreen, NULL, 0); - ScummRenderTo = ScummScreenBuffer[1]->sb_BitMap; - ScummPaintBuffer = 1; - - if (ScummScreenBuffer[0] == NULL || ScummScreenBuffer[1] == NULL) - error("Failed to allocate screen buffer"); - - // Make both buffers black to avoid grey strip on bottom of screen - RastPort rp; - InitRastPort(&rp); - SetRGB32(&ScummScreen->ViewPort, 0, 0, 0, 0); - rp.BitMap = ScummScreenBuffer[0]->sb_BitMap; - FillPixelArray(&ScummScreen->RastPort, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); - rp.BitMap = ScummRenderTo; - FillPixelArray(&rp, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); - - if (ScummDepth == 8) - { - for (int color = 0; color < 256; color++) - { - ULONG r, g, b; - - r = (ScummColors[color] >> 16) & 0xff; - g = (ScummColors[color] >> 8) & 0xff; - b = (ScummColors[color] >> 0) & 0xff; - SetRGB32(&ScummScreen->ViewPort, color, CVT8TO32(r), CVT8TO32(g), CVT8TO32(b)); - } - } - } - else - { - wb = LockPubScreen(NULL); - if (wb == NULL) - error("Could not lock default public screen"); - - ScreenToFront(wb); - } - - ScummWindow = OpenWindowTags(NULL, WA_Left, (wb && ScummWinX >= 0) ? ScummWinX : 0, - WA_Top, wb ? ((ScummWinY >= 0) ? ScummWinY : wb->BarHeight+1) : 0, - WA_InnerWidth, FullScreenMode ? ScummScreen->Width : ScummScrWidth, - WA_InnerHeight, FullScreenMode ? ScummScreen->Height : ScummScrHeight, - WA_Activate, TRUE, - WA_Title, wb ? ScummWndTitle : NULL, - WA_ScreenTitle, wb ? ScummWndTitle : NULL, - WA_Borderless, FullScreenMode, - WA_CloseGadget, !FullScreenMode, - WA_DepthGadget, !FullScreenMode, - WA_DragBar, !FullScreenMode, - WA_ReportMouse, TRUE, - WA_RMBTrap, TRUE, - WA_IDCMP, IDCMP_RAWKEY | - IDCMP_MOUSEMOVE | - IDCMP_CLOSEWINDOW | - IDCMP_MOUSEBUTTONS, - WA_CustomScreen, FullScreenMode ? (ULONG)ScummScreen : (ULONG)wb, - TAG_DONE - ); - - if (wb) - UnlockPubScreen(NULL, wb); - - if (ScummWindow == NULL) - error("Failed to open window"); - - if (!ScummDefaultMouse) - { - SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); - ScummOrigMouse = false; - } - - if (ScummScreen == NULL) - { - ScummDepth = GetCyberMapAttr(ScummWindow->RPort->BitMap, CYBRMATTR_DEPTH); - if (ScummDepth == 8) - error("Workbench screen must be running in 15 bit or higher"); - - ScummRenderTo = AllocBitMap(ScummScrWidth, ScummScrHeight, ScummDepth, BMF_MINPLANES, ScummWindow->RPort->BitMap); - if (ScummRenderTo == NULL) - error("Failed to allocate bitmap"); - } - - if ((ScummDepth == 15 && Scumm16ColFmt16) || (ScummDepth == 16 && !Scumm16ColFmt16)) - { - for (int col = 0; col < 256; col++) - { - int r = (ScummColors[col] >> 16) & 0xff; - int g = (ScummColors[col] >> 8) & 0xff; - int b = ScummColors[col] & 0xff; - ScummColors16[col] = (Scumm16ColFmt16 == false) ? (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255) : (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); - } - - Scumm16ColFmt16 = (ScummDepth == 16); - } - - if (Scaler) - { - delete Scaler; - Scaler = NULL; - } - - if (ScummScale) - { - Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); - if (Scaler == NULL) - { - warning("Failed to create scaler - scaling will be disabled"); - SwitchScalerTo(ST_NONE); - } - } - - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); -} - -void OSystem_MorphOS::SwitchScalerTo(SCALERTYPE newScaler) -{ - if (newScaler == ST_NONE && ScummScale != 0) - { - if (Scaler) - { - delete Scaler; - Scaler = NULL; - } - ScummScale = 0; - ScummScaler = ST_NONE; - CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); - } - else - { - if (ScummScale == 0) - { - ScummScale = 1; - ScummScaler = newScaler; - CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); - } - else if (ScummScaler != newScaler) - { - ScummScaler = newScaler; - if (Scaler) - delete Scaler; - Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); - if (Scaler == NULL) - { - warning("Failed to create scaler - scaling will be disabled"); - SwitchScalerTo(ST_NONE); - } - else - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); - } - } -} - -bool OSystem_MorphOS::poll_event(Event *event) -{ - IntuiMessage *ScummMsg; - - if (ScummMsg = (IntuiMessage *) GetMsg(ScummWindow->UserPort)) - { - switch (ScummMsg->Class) - { - case IDCMP_RAWKEY: - { - InputEvent FakedIEvent; - char charbuf; - int qual = 0; - - memset(&FakedIEvent, 0, sizeof (InputEvent)); - FakedIEvent.ie_Class = IECLASS_RAWKEY; - FakedIEvent.ie_Code = ScummMsg->Code; - - if (ScummMsg->Qualifier & (IEQUALIFIER_LALT | IEQUALIFIER_RALT)) - qual |= KBD_ALT; - if (ScummMsg->Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)) - qual |= KBD_SHIFT; - if (ScummMsg->Qualifier & IEQUALIFIER_CONTROL) - qual |= KBD_CTRL; - event->kbd.flags = qual; - - event->event_code = EVENT_KEYDOWN; - - if (ScummMsg->Code >= 0x50 && ScummMsg->Code <= 0x59) - { - /* - * Function key - */ - event->kbd.ascii = (ScummMsg->Code-0x50)+315; - event->kbd.keycode = 0; - } - else if (MapRawKey(&FakedIEvent, &charbuf, 1, NULL) == 1) - { - if (qual == KBD_CTRL) - { - switch (charbuf) - { - case 'z': - ReplyMsg((Message *) ScummMsg); - quit(); - } - } - else if (qual == KBD_ALT) - { - if (charbuf >= '0' && charbuf <= '9') - { - SCALERTYPE new_scaler = MorphOSScaler::FindByIndex(charbuf-'0'); - ReplyMsg((Message *) ScummMsg); - if (new_scaler != ST_INVALID) - SwitchScalerTo(new_scaler); - return false; - } - else if (charbuf == 'x') - { - ReplyMsg((Message *) ScummMsg); - quit(); - } - else if (charbuf == 0x0d) - { - ReplyMsg((Message *) ScummMsg); - CreateScreen(CSDSPTYPE_TOGGLE); - return false; - } - } - - event->kbd.ascii = charbuf; - event->kbd.keycode = event->kbd.ascii; - } - break; - } - - case IDCMP_MOUSEMOVE: - { - LONG newx, newy; - - newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; - newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; - - if (!FullScreenMode && !ScummDefaultMouse) - { - if (newx < 0 || newx > ScummBufferWidth || - newy < 0 || newy > ScummBufferHeight - ) - { - if (!ScummOrigMouse) - { - ScummOrigMouse = true; - ClearPointer(ScummWindow); - } - } - else if (ScummOrigMouse) - { - ScummOrigMouse = false; - SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); - } - } - else if (FullScreenMode) - newy = newy > ScummScale)-2; - - event->event_code = EVENT_MOUSEMOVE; - event->mouse.x = newx; - event->mouse.y = newy; - break; - } - - case IDCMP_MOUSEBUTTONS: - { - int newx, newy; - - newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; - newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; - - switch (ScummMsg->Code) - { - case SELECTDOWN: - event->event_code = EVENT_LBUTTONDOWN; - break; - - case SELECTUP: - event->event_code = EVENT_LBUTTONUP; - break; - - case MENUDOWN: - event->event_code = EVENT_RBUTTONDOWN; - break; - - case MENUUP: - event->event_code = EVENT_RBUTTONUP; - break; - - default: - ReplyMsg((Message *)ScummMsg); - return false; - } - event->mouse.x = newx; - event->mouse.y = newy; - break; - } - - case IDCMP_CLOSEWINDOW: - ReplyMsg((Message *)ScummMsg); - exit(0); - } - - if (ScummMsg) - ReplyMsg((Message *) ScummMsg); - - return true; - } - - return false; -} - -void OSystem_MorphOS::set_shake_pos(int shake_pos) -{ - ScummShakePos = shake_pos; - AddUpdateRect(0, 0, 320, 200); -} - -#define MOUSE_INTERSECTS(x, y, w, h) \ - (!((MouseOldX+MouseOldWidth <= x ) || (MouseOldX >= x+w) || \ - (MouseOldY+MouseOldHeight <= y) || (MouseOldY >= y+h))) - -/* Copy part of bitmap */ -void OSystem_MorphOS::copy_rect(const byte *src, int pitch, int x, int y, int w, int h) -{ - byte *dst; - - if (x < 0) { w+=x; src-=x; x = 0; } - if (y < 0) { h+=y; src-=y*pitch; y = 0; } - if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } - if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } - - if (w <= 0 || h <= 0) - return; - - if (MouseDrawn) - { - if (MOUSE_INTERSECTS(x, y, w, h)) - UndrawMouse(); - } - - AddUpdateRect(x, y, w, h); - - dst = (byte *)ScummBuffer+y*ScummBufferWidth + x; - if (DirtyBlocks) - { - int cx, cy; - int block = BLOCK_ID(x, y); - int line_block = block; - int start_block = BLOCKSIZE_X-(x % BLOCKSIZE_X); - int start_y_block = BLOCKSIZE_Y-(y % BLOCKSIZE_Y); - int next_block; - int next_y_block; - UWORD *block_cols = BlockColors[block]; - - if (start_block == 0) - start_block = BLOCKSIZE_X; - if (start_y_block == 0) - start_y_block = BLOCKSIZE_Y; - - next_block = start_block; - next_y_block = start_y_block; - for (cy = 0; cy < h; cy++) - { - for (cx = 0; cx < w; cx++) - { - UWORD old_pixel = *dst; - UWORD src_pixel = *src++; - if (old_pixel != src_pixel) - { - *dst++ = src_pixel; - block_cols[old_pixel]--; - block_cols[src_pixel]++; - } - else - dst++; - if (--next_block == 0) - { - block++; - block_cols = BlockColors[block]; - next_block = BLOCKSIZE_X; - } - } - if (--next_y_block == 0) - { - line_block += BLOCKS_X; - next_y_block = BLOCKSIZE_Y; - } - block = line_block; - block_cols = BlockColors[block]; - next_block = start_block; - dst += ScummBufferWidth-w; - src += pitch-w; - } - } - else - { - do - { - memcpy(dst, src, w); - dst += ScummBufferWidth; - src += pitch; - } while (--h); - } -} - -bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) -{ - if (x < 0) { w+=x; x = 0; } - if (y < 0) { h+=y; y = 0; } - if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } - if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } - - if (w <= 0 || h <= 0) - return false; - - Rectangle update_rect = { x, y, x+w, y+h }; - OrRectRegion(NewUpdateRegion, &update_rect); - ScreenChanged = true; - - return true; -} - -void OSystem_MorphOS::update_screen() -{ - DrawMouse(); - - if (!ScreenChanged) - return; - - OrRegionRegion(NewUpdateRegion, UpdateRegion); - - if (ScummShakePos) - { - RastPort rp; - - InitRastPort(&rp); - rp.BitMap = ScummRenderTo; - - uint32 src_y = 0; - uint32 dest_y = 0; - if (ScummShakePos < 0) - src_y = -ScummShakePos; - else - dest_y = ScummShakePos; - - if (!ScummScale) - { - if (ScummDepth == 8) - WritePixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, RECTFMT_LUT8); - else - WriteLUTPixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, ScummColors, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, CTABFMT_XRGB8); - } - else if (Scaler->Prepare(ScummRenderTo)) - { - Scaler->Scale(0, src_y, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y); - Scaler->Finish(); - } - - if (ScummShakePos < 0) - FillPixelArray(&rp, 0, (ScummBufferHeight-1) << ScummScale, ScummScrWidth, -ScummShakePos << ScummScale, 0); - else - FillPixelArray(&rp, 0, 0, ScummScrWidth, ScummShakePos << ScummScale, 0); - } - else if (!ScummScale) - { - RastPort rp; - - InitRastPort(&rp); - rp.BitMap = ScummRenderTo; - - uint32 src_x, src_y; - uint32 src_w, src_h; - uint32 reg_x, reg_y; - RegionRectangle *update_rect = UpdateRegion->RegionRectangle; - - reg_x = UpdateRegion->bounds.MinX; - reg_y = UpdateRegion->bounds.MinY; - while (update_rect) - { - src_x = update_rect->bounds.MinX; - src_y = update_rect->bounds.MinY; - src_w = update_rect->bounds.MaxX-src_x; - src_h = update_rect->bounds.MaxY-src_y; - src_x += reg_x; - src_y += reg_y; - - if (src_x) src_x--; - if (src_y) src_y--; - src_w += 2; - if (src_x+src_w >= ScummBufferWidth) - src_w = ScummBufferWidth-src_x; - src_h += 2; - if (src_y+src_h >= ScummBufferHeight) - src_h = ScummBufferHeight-src_y; - - if (ScummDepth == 8) - WritePixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, src_x, src_y, src_w, src_h, RECTFMT_LUT8); - else - WriteLUTPixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, ScummColors, src_x, src_y, src_w, src_h, CTABFMT_XRGB8); - - update_rect = update_rect->Next; - } - } - else - { - uint32 src_x, src_y; - uint32 src_w, src_h; - uint32 reg_x, reg_y; - RegionRectangle *update_rect = UpdateRegion->RegionRectangle; - - reg_x = UpdateRegion->bounds.MinX; - reg_y = UpdateRegion->bounds.MinY; - - if (!Scaler->Prepare(ScummRenderTo)) - update_rect = NULL; - - while (update_rect) - { - src_x = update_rect->bounds.MinX; - src_y = update_rect->bounds.MinY; - src_w = update_rect->bounds.MaxX-src_x; - src_h = update_rect->bounds.MaxY-src_y; - src_x += reg_x; - src_y += reg_y; - - if (src_x) src_x--; - if (src_y) src_y--; - src_w += 2; - if (src_x+src_w >= ScummBufferWidth) - src_w = ScummBufferWidth-src_x; - src_h += 2; - if (src_y+src_h >= ScummBufferHeight) - src_h = ScummBufferHeight-src_y; - - Scaler->Scale(src_x, src_y, src_x, src_y, src_w, src_h); - update_rect = update_rect->Next; - } - Scaler->Finish(); - } - - if (ScummScreen) - { - while (!ChangeScreenBuffer(ScummScreen, ScummScreenBuffer[ScummPaintBuffer])); - ScummPaintBuffer = !ScummPaintBuffer; - ScummRenderTo = ScummScreenBuffer[ScummPaintBuffer]->sb_BitMap; - } - else - { - int32 x = (UpdateRegion->bounds.MinX-1) << ScummScale; - int32 y = (UpdateRegion->bounds.MinY-1) << ScummScale; - if (x < 0) x = 0; - if (y < 0) y = 0; - int32 w = (UpdateRegion->bounds.MaxX << ScummScale)-x+(1 << ScummScale); - int32 h = (UpdateRegion->bounds.MaxY << ScummScale)-y+(1 << ScummScale); - if (x+w > ScummScrWidth) w = ScummScrWidth-x; - if (y+h > ScummScrHeight) h = ScummScrHeight-y; - BltBitMapRastPort(ScummRenderTo, x, y, ScummWindow->RPort, ScummWindow->BorderLeft+x, ScummWindow->BorderTop+y, w, h, ABNC | ABC); - WaitBlit(); - } - - Region *new_region_part = NewUpdateRegion; - NewUpdateRegion = UpdateRegion; - ClearRegion(NewUpdateRegion); - UpdateRegion = new_region_part; - - ScreenChanged = false; - memset(DirtyBlocks, 0, BLOCKS_X*BLOCKS_Y*sizeof (bool)); -} - -void OSystem_MorphOS::DrawMouse() -{ - int x,y; - byte *dst,*bak; - byte color; - - if (MouseDrawn || !MouseVisible) - return; - MouseDrawn = true; - - const int ydraw = MouseY - MouseHotspotY; - const int xdraw = MouseX - MouseHotspotX; - const int w = MouseWidth; - const int h = MouseHeight; - bak = MouseBackup; - byte *buf = MouseImage; - - MouseOldX = xdraw; - MouseOldY = ydraw; - MouseOldWidth = w; - MouseOldHeight = h; - - AddUpdateRect(xdraw, ydraw, w, h); - - dst = (byte*)ScummBuffer + ydraw*ScummBufferWidth + xdraw; - bak = MouseBackup; - - for (y = 0; y < h; y++, dst += ScummBufferWidth, bak += MAX_MOUSE_W, buf += w) - { - if ((uint)(ydraw+y) < ScummBufferHeight) - { - for( x = 0; x= 0; --b) - FreeVec(BlockColors[b]); - FreeVec(BlockColors); - BlockColors = NULL; - } - } - - if (!BlockColors) - { - FreeVec(DirtyBlocks); - DirtyBlocks = NULL; - } - } - - CreateScreen(CSDSPTYPE_KEEP); -} - diff --git a/morphos/morphos.h b/morphos/morphos.h deleted file mode 100644 index 75d2c79f7b..0000000000 --- a/morphos/morphos.h +++ /dev/null @@ -1,206 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 Rüdiger Hanke (MorphOS port) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * MorphOS-specific header file - * - * $Header$ - * - */ - -#ifndef MORPHOS_MORPHOS_H -#define MORPHOS_MORPHOS_H - -#include -#include -#include -#include -#include -#include - -#include "morphos_scaler.h" - -class OSystem_MorphOS : public OSystem -{ - public: - OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen); - virtual ~OSystem_MorphOS(); - - // Set colors of the palette - virtual void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - virtual void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - virtual void update_screen(); - - // Either show or hide the mouse cursor - virtual bool show_mouse(bool visible); - - // Set the position of the mouse cursor - virtual void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - virtual void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - virtual void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - virtual uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - virtual void delay_msecs(uint msecs); - - // Add a new callback timer - virtual void set_timer(int timer, int (*callback)(int)); - - // Mutex handling - virtual void *create_mutex(void); - virtual void lock_mutex(void *mutex); - virtual void unlock_mutex(void *mutex); - virtual void delete_mutex(void *mutex); - - // Create a thread - virtual void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - virtual bool poll_event(Event *event); - - // Set the function to be invoked whenever samples need to be generated - virtual bool set_sound_proc(void *param, SoundProc *proc, byte format); - void fill_sound (byte * stream, int len); - - virtual uint32 property(int param, Property *value); - - // Poll cdrom status - // Returns true if cd audio is playing - virtual bool poll_cdrom(); - - // Play cdrom audio track - virtual void play_cdrom(int track, int num_loops, int start_frame, int length); - - // Stop cdrom audio track - virtual void stop_cdrom(); - - // Update cdrom audio status - virtual void update_cdrom(); - - // Quit - virtual void quit(); - - static OSystem_MorphOS *create(int game_id, SCALERTYPE gfx_scaler, bool full_screen); - - static bool OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required = true); - - private: - typedef enum { CSDSPTYPE_WINDOWED, CSDSPTYPE_FULLSCREEN, CSDSPTYPE_TOGGLE, CSDSPTYPE_KEEP } CS_DSPTYPE; - - static const int MAX_MOUSE_W = 40; - static const int MAX_MOUSE_H = 40; - - void CreateScreen(CS_DSPTYPE dspType); - void SwitchScalerTo(SCALERTYPE newScaler); - bool AddUpdateRect(WORD x, WORD y, WORD w, WORD h); - - void DrawMouse(); - void UndrawMouse(); - - /* Display-related attributes */ - Screen *ScummScreen; - Window *ScummWindow; - char ScummWndTitle[125]; - APTR ScummBuffer; - int ScummBufferWidth; - int ScummBufferHeight; - ScreenBuffer *ScummScreenBuffer[2]; - BitMap *ScummRenderTo; - ULONG ScummPaintBuffer; - int ScummScrWidth; - int ScummScrHeight; - int ScummDepth; - bool Scumm16ColFmt16; - UWORD *ScummNoCursor; - ULONG ScummColors[256]; - USHORT ScummColors16[256]; - WORD ScummWinX; - WORD ScummWinY; - bool ScummDefaultMouse; - bool ScummOrigMouse; - int ScummShakePos; - bool FullScreenMode; - bool ScreenChanged; - UWORD **BlockColors; - bool *DirtyBlocks; - Region *UpdateRegion; - Region *NewUpdateRegion; - - /* Sound-related attributes */ - Process *ScummMusicThread; - Process *ScummSoundThread; - SoundProc *SoundProc; - void *SoundParam; - - /* CD-ROM related attributes */ - CDRIVEPTR CDrive; - ULONG CDDATrackOffset; - - /* Scaling-related attributes */ - SCALERTYPE ScummScaler; - int ScummScale; - MorphOSScaler *Scaler; - - /* Mouse cursor-related attributes */ - bool MouseVisible, MouseDrawn; - int MouseX, MouseY; - int MouseWidth, MouseHeight; - int MouseOldX, MouseOldY; - int MouseOldWidth, MouseOldHeight; - int MouseHotspotX, MouseHotspotY; - byte *MouseImage, MouseBackup[MAX_MOUSE_W*MAX_MOUSE_H]; - - /* Timer-related attributes */ - MsgPort *TimerMsgPort; - timerequest *TimerIORequest; - - /* Game-related attributes */ - int GameID; -}; - -int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType); -bool init_morphos_music(ULONG MidiUnit); -void exit_morphos_music(); - -int morphos_main(int argc, char *argv[]); - -extern OSystem_MorphOS *TheSystem; -extern SignalSemaphore ScummMusicThreadRunning; -extern SignalSemaphore ScummSoundThreadRunning; - -extern STRPTR ScummMusicDriver; -extern LONG ScummMidiUnit; -extern IOMidiRequest *ScummMidiRequest; -extern timerequest *MusicTimerIORequest; - -#endif - diff --git a/morphos/morphos_scaler.cpp b/morphos/morphos_scaler.cpp deleted file mode 100644 index dca4383016..0000000000 --- a/morphos/morphos_scaler.cpp +++ /dev/null @@ -1,823 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" - -#include -#include - -#include - -#include "morphos.h" -#include "morphos_scaler.h" - -#define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D)) -#define INTERPOLATE(A, B) (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)) -#define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask) -#define SWAP_WORD(word) word = ((word & 0xff) << 8) | (word >> 8) - -MorphOSScaler::GfxScaler MorphOSScaler::ScummScalers[11] - = { { "none", "normal", ST_NONE }, - { "Point", "2x", ST_POINT }, - { "AdvMame2x", "advmame2x", ST_ADVMAME2X }, - { "SuperEagle", "supereagle", ST_SUPEREAGLE }, - { "Super2xSaI", "super2xsai", ST_SUPER2XSAI }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - // This is the end marker ... do not assign a scaler to it! - { NULL, NULL, ST_INVALID } - }; - -MorphOSScaler::MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) -{ - dest = NULL; - handle = NULL; - - Buffer = buffer; - BufferWidth = width; - BufferHeight = height; - - ScummColors = col_table; - ScummColors16 = col_table16; - - /* Initialize scaling stuff */ - int minr, ming, minb; - ULONG depth = GetCyberMapAttr(bmap, CYBRMATTR_DEPTH); - - if (depth > 16) - { - minr = 1 << 16; - ming = 1 << 8; - minb = 1; - } - else - { - minr = 1 << ((depth == 15) ? 10 : 11); - ming = 1 << 5; - minb = 1; - } - - int pixfmt = GetCyberMapAttr(bmap, CYBRMATTR_PIXFMT); - - ScummPCMode = false; - if (pixfmt == PIXFMT_RGB15PC || pixfmt == PIXFMT_BGR15PC || - pixfmt == PIXFMT_RGB16PC || pixfmt == PIXFMT_BGR16PC) - ScummPCMode = true; - - colorMask = (MakeColor(pixfmt, 255, 0, 0) - minr) | (MakeColor(pixfmt, 0, 255, 0) - ming) | (MakeColor(pixfmt, 0, 0, 255) - minb); - lowPixelMask = minr | ming | minb; - qcolorMask = (MakeColor(pixfmt, 255, 0, 0) - 3*minr) | (MakeColor(pixfmt, 0, 255, 0) - 3*ming) | (MakeColor(pixfmt, 0, 0, 255) - 3*minb); - qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3); - redblueMask = MakeColor(pixfmt, 255, 0, 255); - greenMask = MakeColor(pixfmt, 0, 255, 0); - - PixelsPerMask = (depth <= 16) ? 2 : 1; - - if (PixelsPerMask == 2) - { - colorMask |= (colorMask << 16); - qcolorMask |= (qcolorMask << 16); - lowPixelMask |= (lowPixelMask << 16); - qlowpixelMask |= (qlowpixelMask << 16); - } -} - -MorphOSScaler::~MorphOSScaler() -{ - Finish(); -} - -MorphOSScaler *MorphOSScaler::Create(SCALERTYPE scaler_type, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) -{ - MorphOSScaler *new_scaler = NULL; - - switch (scaler_type) - { - case ST_POINT: - new_scaler = new PointScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_ADVMAME2X: - new_scaler = new AdvMame2xScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_SUPEREAGLE: - new_scaler = new SuperEagleScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_SUPER2XSAI: - new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - default: - warning("Invalid scaler requested - falling back to Super2xSaI"); - new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); - break; - } - - return new_scaler; -} - -bool MorphOSScaler::Prepare(BitMap *render_bmap) -{ - handle = LockBitMapTags(render_bmap, LBMI_BYTESPERPIX, &dest_bpp, - LBMI_BYTESPERROW, &dest_pitch, - LBMI_BASEADDRESS, &dest, - LBMI_PIXFMT, &dest_pixfmt, - TAG_DONE); - - return handle != NULL; -} - -void MorphOSScaler::Finish() -{ - if (handle) - { - UnLockBitMap(handle); - handle = NULL; - } -} - -uint32 MorphOSScaler::MakeColor(int pixfmt, int r, int g, int b) -{ - uint32 col = 0; - - switch (pixfmt) - { - case PIXFMT_RGB15: - case PIXFMT_RGB15PC: - col = (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); - break; - - case PIXFMT_BGR15: - case PIXFMT_BGR15PC: - col = (((b*31)/255) << 10) | (((g*31)/255) << 5) | ((r*31)/255); - break; - - case PIXFMT_RGB16: - case PIXFMT_RGB16PC: - col = (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255); - break; - - case PIXFMT_BGR16: - case PIXFMT_BGR16PC: - col = (((b*31)/255) << 11) | (((g*63)/255) << 5) | ((r*31)/255); - break; - - case PIXFMT_RGB24: - case PIXFMT_ARGB32: - col = (r << 16) | (g << 8) | b; - break; - - case PIXFMT_BGR24: - col = (b << 16) | (g << 8) | r; - break; - - case PIXFMT_BGRA32: - col = (b << 24) | (g << 16) | (r << 8); - break; - - case PIXFMT_RGBA32: - col = (r << 24) | (g << 16) | (b << 8); - break; - - default: - error("Unsupported pixel format: %d. Please contact author at tomjoad@muenster.de.", pixfmt); - } - - return col; -} - -void Super2xSaIScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - unsigned int x, y; - unsigned long color[16]; - byte *src; - - if (!handle) - return; - - src = ((byte *)Buffer)+src_y*BufferWidth+src_x; - - /* Point to the first 3 lines. */ - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - src_line[3] = src + BufferWidth * 2; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors16[*(sbp+1)]; color[7] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[*(sbp+1)]; color[11] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[*(sbp+1)]; color[15] = ScummColors16[*(sbp+2)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors[*(lbp+1)]; color[7] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[*(lbp+1)]; color[11] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[*(lbp+1)]; color[15] = ScummColors[*(lbp+2)]; - } - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - unsigned long product1a, product1b, product2a, product2b; - -//--------------------------------------- B0 B1 B2 B3 0 1 2 3 -// 4 5* 6 S2 -> 4 5* 6 7 -// 1 2 3 S1 8 9 10 11 -// A0 A1 A2 A3 12 13 14 15 -//-------------------------------------- - if (color[9] == color[6] && color[5] != color[10]) - { - product2b = color[9]; - product1b = product2b; - } - else if (color[5] == color[10] && color[9] != color[6]) - { - product2b = color[5]; - product1b = product2b; - } - else if (color[5] == color[10] && color[9] == color[6]) - { - int r = 0; - - r += GET_RESULT(color[6], color[5], color[8], color[13]); - r += GET_RESULT(color[6], color[5], color[4], color[1]); - r += GET_RESULT(color[6], color[5], color[14], color[11]); - r += GET_RESULT(color[6], color[5], color[2], color[7]); - - if (r > 0) - product1b = color[6]; - else if (r < 0) - product1b = color[5]; - else - product1b = INTERPOLATE(color[5], color[6]); - - product2b = product1b; - - } - else - { - if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12]) - product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]); - else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15]) - product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]); - else - product2b = INTERPOLATE(color[9], color[10]); - - if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0]) - product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]); - else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3]) - product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]); - else - product1b = INTERPOLATE(color[5], color[6]); - } - - if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14]) - product2a = INTERPOLATE(color[9], color[5]); - else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12]) - product2a = INTERPOLATE(color[9], color[5]); - else - product2a = color[9]; - - if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2]) - product1a = INTERPOLATE(color[9], color[5]); - else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0]) - product1a = INTERPOLATE(color[9], color[5]); - else - product1a = color[5]; - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(product1a); - SWAP_WORD(product1b); - SWAP_WORD(product2a); - SWAP_WORD(product2b); - } - *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; - *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; - } - else - { - *((unsigned long *) (&dst_line[0][x * 8])) = product1a; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; - *((unsigned long *) (&dst_line[1][x * 8])) = product2a; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; - } - - /* Move color matrix forward */ - color[0] = color[1]; color[4] = color[5]; color[8] = color[9]; color[12] = color[13]; - color[1] = color[2]; color[5] = color[6]; color[9] = color[10]; color[13] = color[14]; - color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15]; - - if (src_x+x < BufferWidth-3) - { - x += 3; - if (PixelsPerMask == 2) - { - color[3] = ScummColors16[*(src_line[0] + x) ]; - color[7] = ScummColors16[*(src_line[1] + x) ]; - color[11] = ScummColors16[*(src_line[2] + x) ]; - color[15] = ScummColors16[*(src_line[3] + x) ]; - } - else - { - color[3] = ScummColors[*(src_line[0] + x)]; - color[7] = ScummColors[*(src_line[1] + x)]; - color[11] = ScummColors[*(src_line[2] + x)]; - color[15] = ScummColors[*(src_line[3] + x)]; - } - x -= 3; - } - } - - /* We're done with one line, so we shift the source lines up */ - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - src_line[2] = src_line[3]; - - /* Read next line */ - if (src_y + y + 3 >= BufferHeight) - src_line[3] = src_line[2]; - else - src_line[3] = src_line[2] + BufferWidth; - - /* Then shift the color matrix up */ - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = ScummColors16[ *(sbp + 1) ]; color[3] = ScummColors16[*(sbp + 2)]; - sbp = src_line[1]; - color[4] = ScummColors16[*sbp]; color[5] = color[4]; color[6] = ScummColors16[ *(sbp + 1) ]; color[7] = ScummColors16[*(sbp + 2)]; - sbp = src_line[2]; - color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[ *(sbp + 1) ]; color[11] = ScummColors16[*(sbp + 2)]; - sbp = src_line[3]; - color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[ *(sbp + 1) ]; color[15] = ScummColors16[*(sbp + 2)]; - - if (src_x + x > 0) - { - color[0] = ScummColors16[src_line[0][-1]]; - color[4] = ScummColors16[src_line[1][-1]]; - color[8] = ScummColors16[src_line[2][-1]]; - color[12] = ScummColors16[src_line[3][-1]]; - } - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = ScummColors[ *(lbp + 1) ]; color[3] = ScummColors[*(lbp+2)]; - lbp = src_line[1]; - color[4] = ScummColors[*lbp]; color[5] = color[4]; color[6] = ScummColors[ *(lbp + 1) ]; color[7] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[ *(lbp + 1) ]; color[11] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[ *(lbp + 1) ]; color[15] = ScummColors[*(lbp+2)]; - } - - if (src_y + y < BufferHeight - 1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void SuperEagleScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - unsigned int x, y; - unsigned long color[12]; - byte *src; - - if (!handle) - return; - - src = (byte *)Buffer+src_y*BufferWidth+src_x; - - /* Point to the first 3 lines. */ - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - src_line[3] = src + BufferWidth * 2; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - x = 0, y = 0; - - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; - } - - for (y = 0; y < height; y++) - { - /* Todo: x = width - 2, x = width - 1 */ - - for (x = 0; x < width; x++) - { - unsigned long product1a, product1b, product2a, product2b; - -//--------------------------------------- B1 B2 0 1 -// 4 5 6 S2 -> 2 3 4 5 -// 1 2 3 S1 6 7 8 9 -// A1 A2 10 11 - - if (color[7] == color[4] && color[3] != color[8]) - { - product1b = product2a = color[7]; - - if ((color[6] == color[7]) || (color[4] == color[1])) - product1a = INTERPOLATE(color[7], INTERPOLATE(color[7], color[3])); - else - product1a = INTERPOLATE(color[3], color[4]); - - if ((color[4] == color[5]) || (color[7] == color[10])) - product2b = INTERPOLATE(color[7], INTERPOLATE(color[7], color[8])); - else - product2b = INTERPOLATE(color[7], color[8]); - } - else if (color[3] == color[8] && color[7] != color[4]) - { - product2b = product1a = color[3]; - - if ((color[0] == color[3]) || (color[5] == color[9])) - product1b = INTERPOLATE(color[3], INTERPOLATE(color[3], color[4])); - else - product1b = INTERPOLATE(color[3], color[1]); - - if ((color[8] == color[11]) || (color[2] == color[3])) - product2a = INTERPOLATE(color[3], INTERPOLATE(color[3], color[2])); - else - product2a = INTERPOLATE(color[7], color[8]); - - } - else if (color[3] == color[8] && color[7] == color[4]) - { - register int r = 0; - - r += GET_RESULT(color[4], color[3], color[6], color[10]); - r += GET_RESULT(color[4], color[3], color[2], color[0]); - r += GET_RESULT(color[4], color[3], color[11], color[9]); - r += GET_RESULT(color[4], color[3], color[1], color[5]); - - if (r > 0) - { - product1b = product2a = color[7]; - product1a = product2b = INTERPOLATE(color[3], color[4]); - } - else if (r < 0) - { - product2b = product1a = color[3]; - product1b = product2a = INTERPOLATE(color[3], color[4]); - } - else - { - product2b = product1a = color[3]; - product1b = product2a = color[7]; - } - } - else - { - product2b = product1a = INTERPOLATE(color[7], color[4]); - product2b = Q_INTERPOLATE(color[8], color[8], color[8], product2b); - product1a = Q_INTERPOLATE(color[3], color[3], color[3], product1a); - - product2a = product1b = INTERPOLATE(color[3], color[8]); - product2a = Q_INTERPOLATE(color[7], color[7], color[7], product2a); - product1b = Q_INTERPOLATE(color[4], color[4], color[4], product1b); - } - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(product1a); - SWAP_WORD(product1b); - SWAP_WORD(product2a); - SWAP_WORD(product2b); - } - *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; - *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; - } - else - { - *((unsigned long *) (&dst_line[0][x * 8])) = product1a; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; - *((unsigned long *) (&dst_line[1][x * 8])) = product2a; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; - } - - /* Move color matrix forward */ - color[0] = color[1]; - color[2] = color[3]; color[3] = color[4]; color[4] = color[5]; - color[6] = color[7]; color[7] = color[8]; color[8] = color[9]; - color[10] = color[11]; - - if (src_x+x < BufferWidth - 2) - { - x += 2; - if (PixelsPerMask == 2) - { - color[1] = ScummColors16[ *(src_line[0] + x) ]; - if (src_x+x < BufferWidth-1) - { - color[5] = ScummColors16[*(src_line[1]+x+1)]; - color[9] = ScummColors16[*(src_line[2]+x+1)]; - } - color[11] = ScummColors16[*(src_line[3]+x)]; - } - else - { - color[1] = ScummColors[*(src_line[0]+x)]; - if (src_x+x < BufferWidth-1) - { - color[5] = ScummColors[*(src_line[1]+x+1)]; - color[9] = ScummColors[ *(src_line[2]+x+1)]; - } - color[11] = ScummColors[*(src_line[3]+x)]; - } - x -= 2; - } - } - - /* We're done with one line, so we shift the source lines up */ - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - src_line[2] = src_line[3]; - - /* Read next line */ - if (src_y+y+3 >= BufferHeight) - src_line[3] = src_line[2]; - else - src_line[3] = src_line[2] + BufferWidth; - - /* Then shift the color matrix up */ - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = ScummColors16[*(sbp+1)]; - sbp = src_line[1]; - color[2] = ScummColors16[*sbp]; color[3] = color[2]; color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = ScummColors[*(lbp+1)]; - lbp = src_line[1]; - color[2] = ScummColors[*lbp]; color[3] = color[2]; color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; - } - - - if (src_y + y < BufferHeight - 1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void AdvMame2xScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - if (!handle) - return; - - byte *src = (byte *)Buffer+src_y*BufferWidth+src_x; - - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - uint32 B, D, E, F, H; - - if (PixelsPerMask == 2) - { - // short A = *(src + i - nextlineSrc - 1); - B = ScummColors16[src_line[0][x]]; - // short C = *(src + i - nextlineSrc + 1); - D = ScummColors16[src_line[1][x-1]]; - E = ScummColors16[src_line[1][x]]; - F = ScummColors16[src_line[1][x+1]]; - // short G = *(src + i + nextlineSrc - 1); - H = ScummColors16[src_line[2][x]]; - // short I = *(src + i + nextlineSrc + 1); - } - else - { - // short A = *(src + i - nextlineSrc - 1); - B = ScummColors[src_line[0][x]]; - // short C = *(src + i - nextlineSrc + 1); - D = ScummColors[src_line[1][x-1]]; - E = ScummColors[src_line[1][x]]; - F = ScummColors[src_line[1][x+1]]; - // short G = *(src + i + nextlineSrc - 1); - H = ScummColors[src_line[2][x]]; - // short I = *(src + i + nextlineSrc + 1); - } - - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(B); - SWAP_WORD(D); - SWAP_WORD(E); - SWAP_WORD(F); - SWAP_WORD(H); - } - *((unsigned long *) (&dst_line[0][x * 4])) = ((D == B && B != F && D != H ? D : E) << 16) | (B == F && B != D && F != H ? F : E); - *((unsigned long *) (&dst_line[1][x * 4])) = ((D == H && D != B && H != F ? D : E) << 16) | (H == F && D != H && B != F ? F : E); - } - else - { - *((unsigned long *) (&dst_line[0][x * 8])) = D == B && B != F && D != H ? D : E; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = B == F && B != D && F != H ? F : E; - *((unsigned long *) (&dst_line[1][x * 8])) = D == H && D != B && H != F ? D : E; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = H == F && D != H && B != F ? F : E; - } - } - - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - if (src_y+y+2 >= BufferHeight) - src_line[2] = src_line[1]; - else - src_line[2] = src_line[1] + BufferWidth; - - if (src_y+y < BufferHeight-1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void PointScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - byte *src; - uint32 color; - uint32 r, g, b; - uint32 x, y; - - if (!handle) - return; - - src = (byte *)Buffer+src_y*BufferWidth+src_x; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - r = (ScummColors[*(src+x)] >> 16) & 0xff; - g = (ScummColors[*(src+x)] >> 8) & 0xff; - b = ScummColors[*(src+x)] & 0xff; - - color = MakeColor(dest_pixfmt, r, g, b); - if (PixelsPerMask == 2) - { - if (ScummPCMode) - SWAP_WORD(color); - - *((unsigned long *) (&dst_line[0][x * 4])) = (color << 16) | color; - *((unsigned long *) (&dst_line[1][x * 4])) = (color << 16) | color; - } - else - { - *((unsigned long *) (&dst_line[0][x * 8])) = color; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = color; - *((unsigned long *) (&dst_line[1][x * 8])) = color; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = color; - } - } - - src += BufferWidth; - - if (src_y+y < BufferHeight-1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -SCALERTYPE MorphOSScaler::FindByName(const char *ScalerName) -{ - int scaler = 0; - - while (ScummScalers[scaler].gs_Name) - { - if (!stricmp(ScalerName, ScummScalers[scaler].gs_Name)) - return ScummScalers[scaler].gs_Type; - scaler++; - } - - if (ScummScalers[scaler].gs_Name == NULL) - { - puts("Invalid scaler name. Please use one of the following:"); - for (scaler = 0; ScummScalers[scaler].gs_Name != NULL; scaler++) - printf(" %s\n", ScummScalers[scaler].gs_Name); - } - - return ST_INVALID; -} - -SCALERTYPE MorphOSScaler::FindByIndex(int index) -{ - if (index >= 0 && index < 10 && ScummScalers[index].gs_Name) - return ScummScalers[index].gs_Type; - - return ST_INVALID; -} - -const char *MorphOSScaler::GetParamName(SCALERTYPE type) -{ - int scaler = 0; - - while (ScummScalers[scaler].gs_Name) - { - if (ScummScalers[scaler].gs_Type == type) - return ScummScalers[scaler].gs_ParamName; - scaler++; - } - - return NULL; -} - diff --git a/morphos/morphos_scaler.h b/morphos/morphos_scaler.h deleted file mode 100644 index c23de6cb8a..0000000000 --- a/morphos/morphos_scaler.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef MORPHOS_MORPHOSSCALER_H -#define MORPHOS_MORPHOSSCALER_H - -#include - -typedef enum { ST_INVALID = 0, ST_NONE, ST_POINT, ST_ADVMAME2X, ST_SUPEREAGLE, ST_SUPER2XSAI } SCALERTYPE; - -class MorphOSScaler -{ - public: - MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); - virtual ~MorphOSScaler(); - - bool Prepare(BitMap *render_bmap); - void Finish(); - - virtual void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) = 0; - - static MorphOSScaler *Create(SCALERTYPE st, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); - - static SCALERTYPE FindByName(const char *ScalerName); - static SCALERTYPE FindByIndex(int index); - static const char *GetParamName(SCALERTYPE type); - - protected: - struct GfxScaler - { - STRPTR gs_Name; - STRPTR gs_ParamName; - SCALERTYPE gs_Type; - }; - - static GfxScaler ScummScalers[11]; - - static uint32 MakeColor(int pixfmt, int r, int g, int b); - - byte *dest; - uint32 dest_bpp; - uint32 dest_pitch; - uint32 dest_pixfmt; - APTR handle; - - uint32 colorMask; - uint32 lowPixelMask; - uint32 qcolorMask; - uint32 qlowpixelMask; - uint32 redblueMask; - uint32 greenMask; - int PixelsPerMask; - byte *src_line[4]; - byte *dst_line[2]; - bool ScummPCMode; - - APTR Buffer; - int BufferWidth; - int BufferHeight; - ULONG *ScummColors; - USHORT *ScummColors16; -}; - -#define DECLARE_SCALER(scaler_name) class scaler_name ## Scaler : public MorphOSScaler \ - { public: scaler_name ## Scaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) : MorphOSScaler(buffer, width, height, col_table, col_table16, bmap) {} \ - void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height); \ - }; - - -DECLARE_SCALER(Point) -DECLARE_SCALER(AdvMame2x) -DECLARE_SCALER(SuperEagle) -DECLARE_SCALER(Super2xSaI) - -#endif - diff --git a/morphos/morphos_sound.cpp b/morphos/morphos_sound.cpp deleted file mode 100644 index 0585b8708b..0000000000 --- a/morphos/morphos_sound.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 Rüdiger Hanke - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * MorphOS sound support - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "morphos.h" - -#define AHI_BUF_SIZE (8*1024) - -SignalSemaphore ScummMusicThreadRunning; -SignalSemaphore ScummSoundThreadRunning; - -static MsgPort *ahiPort = NULL; -static AHIRequest *ahiReq[2] = { NULL, NULL }; -static UWORD ahiCurBuf = 0; -static bool ahiReqSent[2] = { false, false }; -static BYTE ahiDevice = -1; - UBYTE ahiUnit = AHI_DEFAULT_UNIT; -static char *ahiBuf[2] = { NULL, NULL }; - -static MsgPort *ScummMidiPort = NULL; - IOMidiRequest *ScummMidiRequest = NULL; -static MsgPort *MusicTimerMsgPort = NULL; - timerequest *MusicTimerIORequest = NULL; - -bool init_morphos_music(ULONG MidiUnit) -{ - if (ScummMusicDriver && !stricmp(ScummMusicDriver, "-eamidi")) // just as ugly as the line below ... - { - MidiUnit = ScummMidiUnit; // Ugly fix, but ... - ScummMidiPort = CreateMsgPort(); - if (ScummMidiPort) - { - ScummMidiRequest = (IOMidiRequest *) CreateIORequest(ScummMidiPort, sizeof (IOMidiRequest)); - if (ScummMidiRequest) - { - ScummMidiRequest->amr_Version = 2; - if (OpenDevice("amidi.device", MidiUnit, (IORequest *) ScummMidiRequest, AMIDIF_MIDISERVER)) - { - DeleteIORequest((IORequest *) ScummMidiRequest); - DeleteMsgPort(ScummMidiPort); - ScummMidiRequest = NULL; - ScummMidiPort = NULL; - } - } - else - { - DeleteMsgPort(ScummMidiPort); - ScummMidiPort = NULL; - } - } - - if (!ScummMidiRequest) - { - warning("Could not open AMidi - music will not play"); - return false; - } - } - - MusicTimerMsgPort = CreateMsgPort(); - if (MusicTimerMsgPort) - { - MusicTimerIORequest = (timerequest *) CreateIORequest(MusicTimerMsgPort, sizeof (timerequest)); - if (MusicTimerIORequest) - { - if (OpenDevice("timer.device", UNIT_MICROHZ, (IORequest *) MusicTimerIORequest, 0)) - { - DeleteIORequest((IORequest *) MusicTimerIORequest); - DeleteMsgPort(MusicTimerMsgPort); - MusicTimerIORequest = NULL; - MusicTimerMsgPort = NULL; - } - } - else - { - DeleteMsgPort(MusicTimerMsgPort); - MusicTimerMsgPort = NULL; - } - } - - if (!MusicTimerIORequest) - { - warning("Could not open timer device - music will not play"); - return false; - } - - return true; -} - - -void exit_morphos_music() -{ - if (ScummMidiRequest) - { - CloseDevice((IORequest *) ScummMidiRequest); - DeleteIORequest((IORequest *) ScummMidiRequest); - DeleteMsgPort(ScummMidiPort); - } - - if (MusicTimerIORequest) - { - CloseDevice((IORequest *) MusicTimerIORequest); - DeleteIORequest((IORequest *) MusicTimerIORequest); - DeleteMsgPort(MusicTimerMsgPort); - } -} - - -static bool init_morphos_sound() -{ - if (!(ahiPort = CreateMsgPort())) - return false; - - if (!(ahiReq[0] = (AHIRequest *) CreateIORequest(ahiPort, sizeof (AHIRequest)))) - { - DeleteMsgPort(ahiPort); - ahiPort = NULL; - return false; - } - - if (!(ahiReq[1] = (AHIRequest *) AllocVec(sizeof (AHIRequest), MEMF_PUBLIC))) - { - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiReq[0] = NULL; - ahiPort = NULL; - return false; - } - - if (!(ahiBuf[0] = (char *) AllocVec(2*AHI_BUF_SIZE, MEMF_PUBLIC))) - { - FreeVec(ahiReq[1]); - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiReq[0] = NULL; - ahiReq[1] = NULL; - ahiPort = NULL; - return false; - } - ahiBuf[1] = &ahiBuf[0][AHI_BUF_SIZE]; - - ahiReq[0]->ahir_Version = 4; - if (ahiDevice = OpenDevice(AHINAME, 0, (IORequest *) ahiReq[0], 0)) - { - FreeVec(ahiBuf[0]); - FreeVec(ahiReq[1]); - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiBuf[0] = NULL; - ahiReq[0] = NULL; - ahiReq[1] = NULL; - ahiPort = NULL; - return false; - } - - CopyMem(ahiReq[0], ahiReq[1], sizeof (AHIRequest)); - - ahiCurBuf = 0; - ahiReqSent[0] = FALSE; - ahiReqSent[1] = FALSE; - - return true; -} - - -static void exit_morphos_sound() -{ - if (ahiReq[1]) - FreeVec(ahiReq[1]); - - if (ahiReq[0]) - { - CloseDevice((IORequest *) ahiReq[0]); - DeleteIORequest(ahiReq[0]); - } - - if (ahiBuf[0]) - FreeVec((APTR) ahiBuf[0]); - - if (ahiPort) - DeleteMsgPort(ahiPort); -} - -int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType) -{ - ULONG signals; - bool initialized; - - ObtainSemaphore(&ScummSoundThreadRunning); - - initialized = init_morphos_sound(); - if (!initialized) - { - warning("Sound could not be initialized. The game may hang at some point (press Ctrl-z then)."); - Wait(SIGBREAKF_CTRL_C); - } - else - { - for (;;) - { - while (!ahiReqSent[ahiCurBuf] || CheckIO((IORequest *) ahiReq[ahiCurBuf])) - { - AHIRequest *req = ahiReq[ahiCurBuf]; - UWORD ahiOtherBuf = !ahiCurBuf; - - if (ahiReqSent[ahiCurBuf]) - WaitIO((IORequest *) req); - - syst->fill_sound((byte *) ahiBuf[ahiCurBuf], AHI_BUF_SIZE); - - req->ahir_Std.io_Message.mn_Node.ln_Pri = 0; - req->ahir_Std.io_Command = CMD_WRITE; - req->ahir_Std.io_Data = ahiBuf[ahiCurBuf]; - req->ahir_Std.io_Length = AHI_BUF_SIZE; - req->ahir_Type = SampleType; - req->ahir_Frequency = SAMPLES_PER_SEC; - req->ahir_Position = 0x8000; - req->ahir_Volume = 0x10000; - req->ahir_Link = (ahiReqSent[ahiOtherBuf] && !CheckIO((IORequest *) ahiReq[ahiOtherBuf])) ? ahiReq[ahiOtherBuf] : NULL; - SendIO((IORequest *)req); - - ahiReqSent[ahiCurBuf] = true; - ahiCurBuf = ahiOtherBuf; - } - - signals = Wait(SIGBREAKF_CTRL_C | (1 << ahiPort->mp_SigBit)); - - if (signals & SIGBREAKF_CTRL_C) - break; - } - - if (ahiReqSent[ahiCurBuf]) - { - AbortIO((IORequest *) ahiReq[ahiCurBuf]); - WaitIO((IORequest *) ahiReq[ahiCurBuf]); - ahiReqSent[ahiCurBuf] = false; - } - - if (ahiReqSent[!ahiCurBuf]) - { - AbortIO((IORequest *) ahiReq[!ahiCurBuf]); - WaitIO((IORequest *) ahiReq[!ahiCurBuf]); - ahiReqSent[!ahiCurBuf] = false; - } - } - - exit_morphos_sound(); - - ReleaseSemaphore(&ScummSoundThreadRunning); - RemTask(NULL); - return 0; -} - diff --git a/morphos/morphos_start.cpp b/morphos/morphos_start.cpp deleted file mode 100644 index d3305cbe14..0000000000 --- a/morphos/morphos_start.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 Rüdiger Hanke (MorphOS port) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * MorphOS startup handling - * - * $Header$ - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "stdafx.h" -#include "scumm.h" -#include "morphos.h" -#include "morphos_scaler.h" - -extern "C" WBStartup *_WBenchMsg; - -// For command line parsing -static STRPTR usageTemplate = "STORY/A,DATAPATH/K,WBWINDOW/S,SCALER/K,AMIGA/S,MIDIUNIT/K/N,MUSIC/K,MUSICVOL/K/N,SFXVOL/K/N,TEMPO/K/N,TALKSPEED/K/N,NOSUBTITLES=NST/S"; -typedef enum { USG_STORY = 0, USG_DATAPATH, USG_WBWINDOW, USG_SCALER, USG_AMIGA, USG_MIDIUNIT, USG_MUSIC, USG_MUSICVOL, USG_SFXVOL, USG_TEMPO, USG_TALKSPEED, USG_NOSUBTITLES } usageFields; -static LONG args[13] = { (ULONG) NULL, (ULONG) NULL, FALSE, (ULONG) NULL, false, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, false }; -static RDArgs *ScummArgs = NULL; - -static char*ScummStory = NULL; -static char*ScummPath = NULL; - STRPTR ScummMusicDriver = NULL; - LONG ScummMidiUnit = 0; -static LONG ScummMidiVolume = 0; -static LONG ScummMidiTempo = 0; -static LONG ScummSfxVolume = 0; -static LONG ScummTalkSpeed = 0; -static SCALERTYPE ScummGfxScaler = ST_INVALID; - -static BPTR OrigDirLock = 0; - -Library *CDDABase = NULL; -Device *TimerBase = NULL; - -OSystem_MorphOS *TheSystem = NULL; - -OSystem *OSystem_MorphOS_create(int game_id, int gfx_mode, bool full_screen) -{ - if (TheSystem) - delete TheSystem; - - SCALERTYPE gfx_scaler = ST_NONE; - switch (gfx_mode) - { - case GFX_DOUBLESIZE: - gfx_scaler = ST_POINT; - break; - - case GFX_SUPEREAGLE: - gfx_scaler = ST_SUPEREAGLE; - break; - - case GFX_SUPER2XSAI: - gfx_scaler = ST_SUPER2XSAI; - break; - } - - TheSystem = OSystem_MorphOS::create(game_id, gfx_scaler, full_screen); - return TheSystem; -} - -void close_resources() -{ - if (TheSystem) - delete TheSystem; - - if (g_scumm) - delete g_scumm; - - if (ScummPath) - FreeVec(ScummPath); - - if (ScummStory) - FreeVec(ScummStory); - - if (ScummArgs) - FreeArgs(ScummArgs); - - if (OrigDirLock) - CurrentDir(OrigDirLock); - - if (CDDABase) - CloseLibrary(CDDABase); -} - -static STRPTR FindMusicDriver(STRPTR argval) -{ - if (!stricmp(argval, "off")) return "-enull"; - if (!stricmp(argval, "midi")) return "-eamidi"; - if (!stricmp(argval, "midiemu")) return "-emidiemu"; - if (!stricmp(argval, "adlib")) return "-eadlib"; - - error("No such music driver supported. Possible values are off, Midi, MidiEmu and Adlib."); - return NULL; -} - -static void ReadToolTypes(WBArg *OfFile) -{ - DiskObject *dobj; - char *ToolValue; - char IconPath[256]; - - NameFromLock(OfFile->wa_Lock, IconPath, 256); - AddPart(IconPath, OfFile->wa_Name, 256); - - dobj = GetDiskObject(IconPath); - if (dobj == NULL) - return; - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "STORY")) - { - if (ScummStory) - FreeVec(ScummStory); - ScummStory = (char *) AllocVec(strlen(ToolValue)+1, MEMF_PUBLIC); - strcpy(ScummStory, ToolValue); - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "DATAPATH")) - { - if (ScummPath) - FreeVec(ScummPath); - ScummPath = (char *) AllocVec(strlen(ToolValue)+4, MEMF_PUBLIC); - strcpy(ScummPath, "-p"); - strcat(ScummPath, ToolValue); - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "WBWINDOW")) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_WBWINDOW] = TRUE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_WBWINDOW] = FALSE; - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SCALER")) - { - if ((ScummGfxScaler = MorphOSScaler::FindByName(ToolValue)) == ST_INVALID) - { - FreeDiskObject(dobj); - exit(1); - } - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSIC")) - { - if (!(ScummMusicDriver = FindMusicDriver(ToolValue))) - { - FreeDiskObject(dobj); - exit(1); - } - args[USG_MUSIC] = (ULONG) &ScummMusicDriver; - } - - if( ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MIDIUNIT")) - ScummMidiUnit = atoi(ToolValue); - - if( ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSICVOL")) - { - int vol = atoi(ToolValue); - if (vol >= 0 && vol <= 100) - { - ScummMidiVolume = vol; - args[USG_MUSICVOL] = (ULONG) &ScummMidiVolume; - } - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SFXVOL")) - { - int vol = atoi(ToolValue); - if (vol >= 0 && vol <= 255) - { - ScummSfxVolume = vol; - args[USG_SFXVOL] = (ULONG) &ScummSfxVolume; - } - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TEMPO")) - { - ScummMidiTempo = atoi(ToolValue); - args[USG_TEMPO] = (ULONG) &ScummMidiTempo; - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TALKSPEED")) - { - ScummTalkSpeed = atoi(ToolValue); - args[USG_TALKSPEED] = (ULONG) &ScummMidiTempo; - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SUBTITLES")) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_NOSUBTITLES] = FALSE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_NOSUBTITLES] = TRUE; - } - - if (ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "AMIGA")) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_AMIGA] = FALSE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_AMIGA] = TRUE; - } - - FreeDiskObject(dobj); -} - -#undef main - -int main() -{ - int delta; - int last_time, new_time; - char *argv[20]; - char musicvol[6], sfxvol[6], talkspeed[12], tempo[12], scaler[14]; - int argc = 0; - - InitSemaphore(&ScummSoundThreadRunning); - InitSemaphore(&ScummMusicThreadRunning); - - g_scumm = NULL; - atexit(&close_resources); - - if (_WBenchMsg == NULL) - { - /* Parse the command line here */ - ScummArgs = ReadArgs(usageTemplate, args, NULL); - if (ScummArgs == NULL) - { - puts("Error in command line - type \"ScummVM ?\" for usage."); - exit(1); - } - - if (args[USG_STORY]) - { - ScummStory = (char *) AllocVec(strlen((char *) args[USG_STORY])+1, MEMF_PUBLIC); - strcpy(ScummStory, (char *) args[USG_STORY]); - } - - if (args[USG_DATAPATH]) - { - ScummPath = (char *) AllocVec(strlen((char *) args[USG_DATAPATH])+4, MEMF_PUBLIC); - strcpy(ScummPath, "-p"); - strcat(ScummPath, (char *) args[USG_DATAPATH]); - } - - if (args[USG_SCALER]) - { - if ((ScummGfxScaler = MorphOSScaler::FindByName((char *) args[USG_SCALER])) == ST_INVALID) - exit(1); - } - - if (args[USG_MUSIC]) - { - if (!(ScummMusicDriver = FindMusicDriver((char *) args[USG_MUSIC]))) - exit(1); - } - - if (args[USG_MIDIUNIT]) - ScummMidiUnit = *((LONG *) args[USG_MIDIUNIT]); - - if (args[USG_TEMPO]) - ScummMidiTempo = *((LONG *) args[USG_TEMPO]); - - if (args[USG_MUSICVOL]) - ScummMidiVolume = *((LONG *) args[USG_MUSICVOL]); - - if (args[USG_SFXVOL]) - ScummSfxVolume = *((LONG *) args[USG_SFXVOL]); - - if (args[USG_TALKSPEED]) - ScummTalkSpeed = *((LONG *) args[USG_TALKSPEED]); - } - else - { - /* We've been started from Workbench */ - ReadToolTypes(&_WBenchMsg->sm_ArgList[0]); - if (_WBenchMsg->sm_NumArgs > 1) - { - ReadToolTypes(&_WBenchMsg->sm_ArgList[1]); - OrigDirLock = CurrentDir(_WBenchMsg->sm_ArgList[1].wa_Lock); - } - } - - if (ScummPath) - { - char c = ScummPath[strlen(ScummPath)-1]; - if (c != '/' && c != ':') - strcat(ScummPath, "/"); - } - - argv[argc++] = "ScummVM"; - if (ScummPath) argv[argc++] = ScummPath; - if (!args[ USG_WBWINDOW ]) argv[argc++] = "-f"; - if (args[ USG_NOSUBTITLES ]) argv[argc++] = "-n"; - if (args[ USG_AMIGA ]) argv[argc++] = "-a"; - if (args[ USG_MUSIC ]) argv[argc++] = ScummMusicDriver; - if (ScummGfxScaler != ST_INVALID) - { - sprintf(scaler, "-g%s", MorphOSScaler::GetParamName(ScummGfxScaler)); - argv[argc++] = scaler; - } - else - argv[argc++] = "-gsuper2xsai"; - if (args[USG_MUSICVOL] && ScummMidiVolume >= 0 && ScummMidiVolume <= 100) - { - sprintf(musicvol, "-m%d", ScummMidiVolume); - argv[argc++] = musicvol; - } - if (args[USG_SFXVOL] && ScummSfxVolume >= 0 && ScummSfxVolume <= 255) - { - sprintf(sfxvol, "-s%d", ScummSfxVolume); - argv[argc++] = sfxvol; - } - if (args[USG_TEMPO] && ScummMidiTempo > 0) - { - sprintf(tempo, "-t%lx", ScummMidiTempo); - argv[argc++] = tempo; - } - if (args[USG_TALKSPEED] && ScummTalkSpeed >= 0 && ScummTalkSpeed <= 255) - { - sprintf(talkspeed, "-y%d", ScummTalkSpeed); - argv[argc++] = talkspeed; - } - argv[argc++] = ScummStory; - - return morphos_main(argc, argv); -} - diff --git a/morphos/morphos_timer.cpp b/morphos/morphos_timer.cpp deleted file mode 100644 index d106b9a1a9..0000000000 --- a/morphos/morphos_timer.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "morphos.h" -#include "timer.h" - -static TagItem TimerServiceTags[] = { { NP_Entry, 0 }, - { NP_Name, (ULONG)"ScummVM Timer Service" }, - { NP_Priority, 20 }, - { TAG_DONE, 0 } - }; - -Timer::Timer(Scumm * system) -{ - static EmulFunc ThreadEmulFunc; - - InitSemaphore(&TimerServiceSemaphore); - - ThreadEmulFunc.Trap = TRAP_FUNC; - ThreadEmulFunc.Address = (ULONG) &TimerService; - ThreadEmulFunc.StackSize = 16000; - ThreadEmulFunc.Extension = 0; - ThreadEmulFunc.Arg1 = (ULONG) this; - TimerServiceTags[0].ti_Data = (ULONG) &ThreadEmulFunc; - TimerServiceThread = CreateNewProc(TimerServiceTags); -} - -Timer::~Timer() -{ - if (TimerServiceThread) - { - Signal((Task *) TimerServiceThread, SIGBREAKF_CTRL_C); - ObtainSemaphore(&TimerServiceSemaphore); - ReleaseSemaphore(&TimerServiceSemaphore); - } -} - -bool Timer::init() -{ - return TimerServiceThread != NULL; -} - -void Timer::release() -{ -} - -bool Timer::installProcedure(int ((*procedure)(int)), int32 interval) -{ - return SendMsg(TSM_MSGID_ADDTIMER, procedure, interval); -} - -void Timer::releaseProcedure(int ((*procedure)(int))) -{ - SendMsg(TSM_MSGID_REMTIMER, procedure, 0); -} - -bool Timer::SendMsg(ULONG msg_id, int ((*procedure)(int)), LONG interval) -{ - if (TimerServiceThread == NULL) - return false; - - TimerServiceMessage *tmsg = (TimerServiceMessage *) AllocVec(sizeof (TimerServiceMessage), MEMF_PUBLIC | MEMF_CLEAR); - if (tmsg == NULL) - return false; - - MsgPort *reply_port = CreateMsgPort(); - if (reply_port == NULL) - { - FreeVec(tmsg); - return false; - } - - tmsg->tsm_Message.mn_Node.ln_Type = NT_MESSAGE; - tmsg->tsm_Message.mn_ReplyPort = reply_port; - tmsg->tsm_Message.mn_Length = sizeof (TimerServiceMessage); - tmsg->tsm_MsgID = msg_id; - tmsg->tsm_Callback = procedure; - tmsg->tsm_Interval = interval; - PutMsg(&TimerServiceThread->pr_MsgPort, tmsg); - WaitPort(reply_port); - GetMsg(reply_port); - - FreeVec(tmsg); - DeleteMsgPort(reply_port); - - return true; -} - -void Timer::TimerService(Timer *this_ptr) -{ - MsgPort *port = &((Process *) FindTask(NULL))->pr_MsgPort; - ULONG port_bit = 1 << port->mp_SigBit; - ULONG signal_mask = SIGBREAKF_CTRL_C | port_bit; - ULONG timer_bits = 0, signals; - ULONG interval, t; - timeval start_callback, end_callback; - - ULONG timers = 0; - TimerSlot timer_slots[MAX_TIMERS]; - - ObtainSemaphore(&this_ptr->TimerServiceSemaphore); - - for (;;) - { - signals = Wait(signal_mask); - - GetSysTime(&start_callback); - - if (signals & port_bit) - { - TimerServiceMessage *tmsg; - - while (tmsg = (TimerServiceMessage *) GetMsg(port)) - { - if (tmsg->tsm_Message.mn_Length == sizeof (TimerServiceMessage)) - { - switch (tmsg->tsm_MsgID) - { - case TSM_MSGID_ADDTIMER: - if (timers < MAX_TIMERS) - { - ULONG unit = UNIT_MICROHZ; - - if (tmsg->tsm_Interval > 1000) - unit = UNIT_VBLANK; - if (OSystem_MorphOS::OpenATimer(&timer_slots[timers].ts_Port, (IORequest **) &timer_slots[timers].ts_IORequest, unit)) - { - timer_slots[timers].ts_Callback = tmsg->tsm_Callback; - timer_slots[timers].ts_Interval = tmsg->tsm_Interval; - timer_slots[timers].ts_SignalBit = 1 << timer_slots[timers].ts_Port->mp_SigBit; - - signal_mask |= timer_slots[timers].ts_SignalBit; - timer_bits |= timer_slots[timers].ts_SignalBit; - - timerequest *req = timer_slots[timers].ts_IORequest; - interval = timer_slots[timers].ts_Interval; - req->tr_node.io_Command = TR_ADDREQUEST; - req->tr_time.tv_secs = interval/1000; - req->tr_time.tv_micro = (interval%1000)*1000; - SendIO(req); - - timers++; - } - } - break; - - case TSM_MSGID_REMTIMER: - { - for (t = 0; t < timers; t++) - { - if (timer_slots[t].ts_Callback == tmsg->tsm_Callback) - { - AbortIO((IORequest *) timer_slots[t].ts_IORequest); - WaitIO((IORequest *) timer_slots[t].ts_IORequest); - signal_mask &= ~timer_slots[t].ts_SignalBit; - timer_bits &= ~timer_slots[t].ts_SignalBit; - DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); - DeleteMsgPort(timer_slots[t].ts_Port); - if (t < timers-1) - memmove(&timer_slots[t], &timer_slots[t+1], sizeof (TimerSlot)*(timers-t-1)); - timers--; - continue; - } - } - break; - } - - default: - warning("MorphOS TimerService received message of unknown type."); - } - } - - ReplyMsg((Message *) tmsg); - } - } - - if (signals & SIGBREAKF_CTRL_C) - break; - - if (signals & timer_bits) - { - for (t = 0; t < timers; t++) - { - if (signals & timer_slots[t].ts_SignalBit) - { - timerequest *req = timer_slots[t].ts_IORequest; - WaitIO((IORequest *) req); - interval = timer_slots[t].ts_Interval; - (*timer_slots[t].ts_Callback)(interval); - GetSysTime(&end_callback); - SubTime(&end_callback, &start_callback); - interval -= end_callback.tv_sec*1000+end_callback.tv_micro/1000+40; - - req->tr_node.io_Command = TR_ADDREQUEST; - req->tr_time.tv_secs = interval/1000; - req->tr_time.tv_micro = (interval%1000)*1000; - SendIO(req); - } - } - } - } - - for (t = 0; t < timers; t++) - { - AbortIO((IORequest *) timer_slots[t].ts_IORequest); - WaitIO((IORequest *) timer_slots[t].ts_IORequest); - DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); - DeleteMsgPort(timer_slots[t].ts_Port); - } - - ReleaseSemaphore(&this_ptr->TimerServiceSemaphore); - RemTask(NULL); -} - diff --git a/morphos/morphos_timer.h b/morphos/morphos_timer.h deleted file mode 100644 index 1593b29a5c..0000000000 --- a/morphos/morphos_timer.h +++ /dev/null @@ -1,86 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef MORPHOS_TIMER_H -#define MORPHOS_TIMER_H - -#ifndef TIMER_H -#include "timer.h" // for MAX_TIMER -#endif - -#ifndef EXEC_PORTS_H -#include -#endif - -#ifndef EXEC_IO_H -#include -#endif - -#ifndef EXEC_SEMAPHORES_H -#include -#endif - -#ifndef DOS_DOSEXTENS_H -#include -#endif - -class OSystem; - -#define TSM_MSGID_ADDTIMER 0 -#define TSM_MSGID_REMTIMER 1 - -struct TimerServiceMessage -{ - Message tsm_Message; - ULONG tsm_MsgID; - int ((*tsm_Callback)(int)); - LONG tsm_Interval; -}; - -class Timer -{ - public: - Timer(Scumm * system); - ~Timer(); - - bool init(); - void release(); - bool installProcedure(int ((*procedure)(int)), int32 interval); - void releaseProcedure(int ((*procedure)(int))); - - protected: - bool SendMsg(ULONG MsgID, int ((*procedure)(int)), LONG interval); - static void TimerService(Timer *); - - Process *TimerServiceThread; - SignalSemaphore TimerServiceSemaphore; - - struct TimerSlot - { - MsgPort *ts_Port; - timerequest *ts_IORequest; - ULONG ts_SignalBit; - int ((*ts_Callback)(int)); - LONG ts_Interval; - }; -}; - -#endif - diff --git a/newgui.cpp b/newgui.cpp deleted file mode 100644 index 8b4cca035a..0000000000 --- a/newgui.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" -#include "newgui.h" -#include "guimaps.h" -#include "gui/dialog.h" -#include "util.h" - -/* - * TODO list - * - implement the missing / incomplete dialogs - * - add more widgets - * - allow multi line (l/c/r aligned) text via StaticTextWidget ? - * - add "close" widget to all dialogs (with a flag to turn it off) ? - * - make dialogs "moveable" ? - * - come up with a new look&feel / theme for the GUI - * - ... - */ - -#define ABS(x) ((x) < 0 ? -(x) : (x)) - -NewGui::NewGui(Scumm *s) : _s(s), _use_alpha_blending(false), - _need_redraw(false),_prepare_for_gui(true), - _pauseDialog(0), _saveLoadDialog(0), _aboutDialog(0), _optionsDialog(0), - _currentKeyDown(0) -{ -} - -void NewGui::pauseDialog() -{ - if (!_pauseDialog) - _pauseDialog = new PauseDialog(this); - _pauseDialog->open(); -} - -void NewGui::saveloadDialog() -{ - if (!_saveLoadDialog) - _saveLoadDialog = new SaveLoadDialog(this); - _saveLoadDialog->open(); -} - -void NewGui::aboutDialog() -{ - if (!_aboutDialog) - _aboutDialog = new AboutDialog(this); - _aboutDialog->open(); -} - -void NewGui::optionsDialog() -{ - if (!_optionsDialog) - _optionsDialog = new OptionsDialog(this); - _optionsDialog->open(); -} - -void NewGui::soundDialog() -{ - if (!_soundDialog) - _soundDialog = new SoundDialog(this); - _soundDialog->open(); -} - -void NewGui::loop() -{ - Dialog *activeDialog = _dialogStack.top(); - int i; - - if (_prepare_for_gui) { - ClearBlendCache(_s->_currentPalette, 128); - saveState(); - if (_use_alpha_blending) - activeDialog->setupScreenBuf(); -#if 1 - // FIXME - hack to encode our own custom GUI colors. Since we have to live - // with a given 8 bit palette, the result is not always as nice as one - // would wish, but this is just an experiment after all. - _bgcolor = RGBMatch(_s->_currentPalette, 0, 0, 0); - - _color = RGBMatch(_s->_currentPalette, 80, 80, 80); - _shadowcolor = RGBMatch(_s->_currentPalette, 64, 64, 64); - - _textcolor = RGBMatch(_s->_currentPalette, 32, 192, 32); - _textcolorhi = RGBMatch(_s->_currentPalette, 0, 256, 0); -#endif - - _eventList.clear(); - _currentKeyDown = 0; - - _lastClick.x = _lastClick.y = 0; - _lastClick.time = 0; - _lastClick.count = 0; - - _prepare_for_gui = false; - } - - activeDialog->handleTickle(); - - if (_need_redraw) { - for (i = 0; i < _dialogStack.size(); i++) - _dialogStack[i]->draw(); - _need_redraw = false; - } - - _s->animateCursor(); - - if (_eventList.size() > 0) - { - OSystem::Event t; - - for (i = 0; i < _eventList.size(); i++) - { - t = _eventList[i]; - - switch(t.event_code) { - case OSystem::EVENT_KEYDOWN: - activeDialog->handleKeyDown(t.kbd.ascii, t.kbd.flags); - - // init continuous event stream - _currentKeyDown = t.kbd.ascii; - _currentKeyDownFlags = t.kbd.flags; - _keyRepeatEvenCount = 1; - _keyRepeatLoopCount = 0; - break; - case OSystem::EVENT_KEYUP: - activeDialog->handleKeyUp(t.kbd.ascii, t.kbd.flags); - if (t.kbd.ascii == _currentKeyDown) - // only stop firing events if it's the current key - _currentKeyDown = 0; - break; - case OSystem::EVENT_MOUSEMOVE: - activeDialog->handleMouseMoved(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 0); - break; - // We don't distinguish between mousebuttons (for now at least) - case OSystem::EVENT_LBUTTONDOWN: - case OSystem::EVENT_RBUTTONDOWN: { - uint32 time = _s->_system->get_msecs(); - if (_lastClick.count && (time < _lastClick.time + 1000) - && ABS(_lastClick.x - t.mouse.x) < 3 - && ABS(_lastClick.y - t.mouse.y) < 3) { - _lastClick.count++; - } else { - _lastClick.x = t.mouse.x; - _lastClick.y = t.mouse.y; - _lastClick.count = 1; - } - _lastClick.time = time; - } - activeDialog->handleMouseDown(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 1, _lastClick.count); - break; - case OSystem::EVENT_LBUTTONUP: - case OSystem::EVENT_RBUTTONUP: - activeDialog->handleMouseUp(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 1, _lastClick.count); - break; - } - } - - _eventList.clear(); - } - - // check if event should be sent again (keydown) - if (_currentKeyDown != 0) - { - // if only fired once, wait longer - if ( _keyRepeatLoopCount >= ((_keyRepeatEvenCount > 1) ? 2 : 4) ) - // ^ loops to wait first event - // ^ loops to wait after first event - { - // fire event - activeDialog->handleKeyDown(_currentKeyDown, _currentKeyDownFlags); - _keyRepeatEvenCount++; - _keyRepeatLoopCount = 0; - } - _keyRepeatLoopCount++; - } - - _s->drawDirtyScreenParts(); -} - -#pragma mark - - -void NewGui::saveState() -{ - _old_soundsPaused = _s->_sound->_soundsPaused; - _s->_sound->pauseSounds(true); - - // Backup old cursor - memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); - _old_cursorWidth = _s->_cursorWidth; - _old_cursorHeight = _s->_cursorHeight; - _old_cursorHotspotX = _s->_cursorHotspotX; - _old_cursorHotspotY = _s->_cursorHotspotY; - _old_cursor_mode = _s->_system->show_mouse(true); - - _s->_cursorAnimate++; - _s->gdi._cursorActive = 1; -} - -void NewGui::restoreState() -{ - _s->_fullRedraw = true; - _s->_completeScreenRedraw = true; - _s->_cursorAnimate--; - - // Restore old cursor - memcpy(_s->_grabbedCursor, _old_grabbedCursor, sizeof(_old_grabbedCursor)); - _s->_cursorWidth = _old_cursorWidth; - _s->_cursorHeight = _old_cursorHeight; - _s->_cursorHotspotX = _old_cursorHotspotX; - _s->_cursorHotspotY = _old_cursorHotspotY; - _s->updateCursor(); - - _s->_system->show_mouse(_old_cursor_mode); - - _s->_sound->pauseSounds(_old_soundsPaused); -} - -void NewGui::openDialog(Dialog *dialog) -{ - if (_dialogStack.empty()) - _prepare_for_gui = true; - else if (_use_alpha_blending) - dialog->setupScreenBuf(); - - _dialogStack.push(dialog); - _need_redraw = true; -} - -void NewGui::closeTopDialog() -{ - // Don't do anything if no dialog is open - if (_dialogStack.empty()) - return; - - // Tear down its screenBuf - if (_use_alpha_blending) - _dialogStack.top()->teardownScreenBuf(); - - // Remove the dialog from the stack - _dialogStack.pop(); - if (_dialogStack.empty()) - restoreState(); - else - _need_redraw = true; -} - -#pragma mark - - -const char *NewGui::queryResString(int stringno) -{ - char *result; - int string; - - if (stringno == 0) - return NULL; - - if (_s->_features & GF_AFTER_V7) - string = _s->_vars[string_map_table_v7[stringno - 1].num]; - else if (_s->_features & GF_AFTER_V6) - string = _s->_vars[string_map_table_v6[stringno - 1].num]; - else - string = string_map_table_v5[stringno - 1].num; - - result = (char *)_s->getStringAddress(string); - - if (!result) { // Gracelessly degrade to english :) - if (_s->_features & GF_AFTER_V6) - return string_map_table_v6[stringno - 1].string; - else - return string_map_table_v5[stringno - 1].string; - } - - return result; -} - -const char *NewGui::queryCustomString(int stringno) -{ - return string_map_table_custom[stringno]; -} - - -#pragma mark - - - -byte *NewGui::getBasePtr(int x, int y) -{ - VirtScreen *vs = _s->findVirtScreen(y); - - if (vs == NULL) - return NULL; - - return vs->screenPtr + x + (y - vs->topline) * 320 + - _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; -} - -void NewGui::box(int x, int y, int width, int height) -{ - hline(x + 1, y, x + width - 2, _color); - hline(x, y + 1, x + width - 1, _color); - vline(x, y + 1, y + height - 2, _color); - vline(x + 1, y, y + height - 1, _color); - - hline(x + 1, y + height - 2, x + width - 1, _shadowcolor); - hline(x + 1, y + height - 1, x + width - 2, _shadowcolor); - vline(x + width - 1, y + 1, y + height - 2, _shadowcolor); - vline(x + width - 2, y + 1, y + height - 1, _shadowcolor); -} - -void NewGui::line(int x, int y, int x2, int y2, byte color) -{ - byte *ptr; - - if (x2 < x) - x2 ^= x ^= x2 ^= x; // Swap x2 and x - - if (y2 < y) - y2 ^= y ^= y2 ^= y; // Swap y2 and y - - ptr = getBasePtr(x, y); - - if (ptr == NULL) - return; - - if (x == x2) { - /* vertical line */ - while (y++ <= y2) { - *ptr = color; - ptr += 320; - } - } else if (y == y2) { - /* horizontal line */ - while (x++ <= x2) { - *ptr++ = color; - } - } -} - -void NewGui::blendRect(int x, int y, int w, int h, byte color) -{ - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - while (h--) { - for (int i = 0; i < w; i++) { - ptr[i] = Blend(ptr[i], color, _s->_currentPalette); - } - ptr += 320; - } -} - -void NewGui::fillRect(int x, int y, int w, int h, byte color) -{ - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - while (h--) { - for (int i = 0; i < w; i++) { - ptr[i] = color; - } - ptr += 320; - } -} - -void NewGui::checkerRect(int x, int y, int w, int h, byte color) -{ - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - while (h--) { - for (int i = 0; i < w; i++) { - if ((h ^ i) & 1) - ptr[i] = color; - } - ptr += 320; - } -} - -void NewGui::frameRect(int x, int y, int w, int h, byte color) -{ - int i; - byte *ptr, *basePtr = getBasePtr(x, y); - if (basePtr == NULL) - return; - - ptr = basePtr; - for (i = 0; i < w; i++, ptr++) - *ptr = color; - ptr--; - for (i = 0; i < h; i++, ptr += 320) - *ptr = color; - ptr = basePtr; - for (i = 0; i < h; i++, ptr += 320) - *ptr = color; - ptr -= 320; - for (i = 0; i < w; i++, ptr++) - *ptr = color; -} - -void NewGui::addDirtyRect(int x, int y, int w, int h) -{ - VirtScreen *vs = _s->findVirtScreen(y); - - if (vs != NULL) - _s->setVirtscreenDirty(vs, x, y, x + w, y + h); -} - -void NewGui::drawChar(const char str, int xx, int yy) -{ - unsigned int buffer = 0, mask = 0, x, y; - byte *tmp; - int tempc = _color; - _color = _textcolor; - - tmp = &guifont[0]; - tmp += 224 + (str + 1) * 8; - - byte *ptr = getBasePtr(xx, yy); - if (ptr == NULL) - return; - - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) { - unsigned char color; - if ((mask >>= 1) == 0) { - buffer = *tmp++; - mask = 0x80; - } - color = ((buffer & mask) != 0); - if (color) - ptr[x] = _color; - } - ptr += 320; - } - _color = tempc; - -} - -void NewGui::drawString(const char *str, int x, int y, int w, byte color, int align) -{ - if (_s->_gameId) { /* If a game is active.. */ - StringTab *st = &_s->string[5]; - st->charset = 1; - st->center = (align == kTextAlignCenter); - st->color = color; - - if (align == kTextAlignLeft) - st->xpos = x; - else if (align == kTextAlignCenter) - st->xpos = x + w/2; - else if (align == kTextAlignRight) - st->xpos = x + w - _s->charset.getStringWidth(0, (byte *)str, 0); - - st->ypos = y; - st->right = x + w; - - _s->_messagePtr = (byte *)str; - _s->drawString(5); - } else { - // FIXME - support center/right align, use nicer custom font. - // Ultimately, we might want to *always* draw our messages this way, - // but only if we have a nice font. - uint len = strlen(str); - for (uint letter = 0; letter < len; letter++) - drawChar(str[letter], x + (letter * 8), y); - } -} - -/* - * Draw an 8x8 bitmap at location (x,y) - */ -void NewGui::drawBitmap(uint32 bitmap[8], int x, int y, byte color) -{ - byte *ptr = getBasePtr(x, y); - if (ptr == NULL) - return; - - for (int y2 = 0; y2 < 8; y2++) { - uint32 mask = 0xF0000000; - for (int x2 = 0; x2 < 8; x2++) { - if (bitmap[y2] & mask) - ptr[x2] = color; - mask >>= 4; - } - ptr += 320; - } -} - -void NewGui::blitTo(byte buffer[320*200], int x, int y, int w, int h) -{ - byte *dstPtr = buffer + x + y*320; - byte *srcPtr = getBasePtr(x, y); - if (srcPtr == NULL) - return; - - while (h--) { - for (int i = 0; i < w; i++) { - *dstPtr++ = *srcPtr++; - } - dstPtr += 320 - w; - srcPtr += 320 - w; - } -} - -void NewGui::blitFrom(byte buffer[320*200], int x, int y, int w, int h) -{ - byte *srcPtr = buffer + x + y*320; - byte *dstPtr = getBasePtr(x, y); - if (dstPtr == NULL) - return; - - while (h--) { - for (int i = 0; i < w; i++) { - *dstPtr++ = *srcPtr++; - } - dstPtr += 320 - w; - srcPtr += 320 - w; - } -} - diff --git a/newgui.h b/newgui.h deleted file mode 100644 index f78f31ee2d..0000000000 --- a/newgui.h +++ /dev/null @@ -1,151 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef NEWGUI_H -#define NEWGUI_H - -#include "scummsys.h" -#include "system.h" // For events -#include "util.h" - -class Dialog; -class Scumm; - -#define hline(x, y, x2, color) line(x, y, x2, y, color); -#define vline(x, y, y2, color) line(x, y, x, y2, color); - -enum { - kTextAlignLeft, - kTextAlignCenter, - kTextAlignRight, -}; - -// Extremly simple stack class, doesn't even do any error checking (for now) -class DialogStack { -protected: - Dialog *_stack[10]; // Anybody nesting dialogs deeper than 4 is mad anyway - int _size; -public: - DialogStack() : _size(0) {} - - bool empty() const { return _size <= 0; } - void push(Dialog *d) { _stack[_size++] = d; } - Dialog *top() const { return _stack[_size-1]; } - void pop() { if (_size > 0) _stack[--_size] = 0; } - int size() const { return _size; } - Dialog *operator [](int i) { return _stack[i]; } -}; - -typedef ScummVM::List EventList; - -// This class hopefully will replace the old Gui class completly one day -class NewGui { - friend class Dialog; -public: - byte _color, _shadowcolor; - byte _bgcolor; - byte _textcolor; - byte _textcolorhi; - - // Dialogs - void pauseDialog(); - void saveloadDialog(); - void aboutDialog(); - void optionsDialog(); - void soundDialog(); - - void loop(); - - bool isActive() { return ! _dialogStack.empty(); } - - NewGui(Scumm *s); - - void handleEvent(const OSystem::Event &event) { _eventList.push_back(event); } - - Scumm *getScumm() { return _s; } - -protected: - Scumm *_s; - bool _use_alpha_blending; - bool _need_redraw; - bool _prepare_for_gui; - DialogStack _dialogStack; - - Dialog *_pauseDialog; - Dialog *_saveLoadDialog; - Dialog *_aboutDialog; - Dialog *_optionsDialog; - Dialog *_soundDialog; - - // for continuous events (keyDown) - int _currentKeyDown, _currentKeyDownFlags; - int _keyRepeatLoopCount; - int _keyRepeatEvenCount; - - // sound state - bool _old_soundsPaused; - - // mouse cursor state - bool _old_cursor_mode; - int _old_cursorHotspotX, _old_cursorHotspotY, _old_cursorWidth, _old_cursorHeight; - byte _old_grabbedCursor[2048]; - - // position and time of last mouse click (used to detect double clicks) - struct { - int16 x, y; // Position of mouse when the click occured - uint32 time; // Time - int count; // How often was it already pressed? - } _lastClick; - - // List of events to be handled - EventList _eventList; - - void saveState(); - void restoreState(); - - void openDialog(Dialog *dialog); - void closeTopDialog(); - -public: - // Drawing - byte *getBasePtr(int x, int y); - void box(int x, int y, int width, int height); - void line(int x, int y, int x2, int y2, byte color); - void blendRect(int x, int y, int w, int h, byte color); - void fillRect(int x, int y, int w, int h, byte color); - void checkerRect(int x, int y, int w, int h, byte color); - void frameRect(int x, int y, int w, int h, byte color); - void addDirtyRect(int x, int y, int w, int h); - void drawChar(const char c, int x, int y); - void drawString(const char *str, int x, int y, int w, byte color, int align = kTextAlignLeft); - - void drawBitmap(uint32 bitmap[8], int x, int y, byte color); - void blitTo(byte buffer[320*200], int x, int y, int w, int h); - void blitFrom(byte buffer[320*200], int x, int y, int w, int h); - - // Query a string from the resources - const char *queryResString(int stringno); - - // Query a custom string. This is in a seperate method so that we - // can easily localize the messages in the future if we want to. - const char *queryCustomString(int stringno); -}; - -#endif diff --git a/object.cpp b/object.cpp deleted file mode 100644 index 319328c0ee..0000000000 --- a/object.cpp +++ /dev/null @@ -1,1326 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "object.h" -#include "resource.h" - -bool Scumm::getClass(int obj, int cls) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getClass"); - cls &= 0x7F; - checkRange(32, 1, cls, "Class %d out of range in getClass"); - - if (_features & GF_SMALL_HEADER) { - if (cls == 31) // CLASS_PLAYERONLY - cls = 23; - - if (cls == 32) // CLASS_TOUCHABLE - cls = 24; - } - return (_classData[obj] & (1 << (cls - 1))) != 0; -} - -void Scumm::putClass(int obj, int cls, bool set) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putClass"); - cls &= 0x7F; - checkRange(32, 1, cls, "Class %d out of range in putClass"); - - - if (_features & GF_SMALL_HEADER) { - if (cls == 31) // CLASS_PLAYERONLY - cls = 23; - - if (cls == 32) // CLASS_TOUCHABLE - cls = 24; - } - - if (set) - _classData[obj] |= (1 << (cls - 1)); - else - _classData[obj] &= ~(1 << (cls - 1)); - - if (1 <= obj && obj < NUM_ACTORS) { - _actors[obj].classChanged(cls, set); - } -} - -int Scumm::getOwner(int obj) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getOwner"); - return _objectOwnerTable[obj]; -} - -void Scumm::putOwner(int obj, int owner) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putOwner"); - checkRange(0xFF, 0, owner, "Owner %d out of range in putOwner"); - _objectOwnerTable[obj] = owner; -} - -int Scumm::getState(int obj) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getState"); - return _objectStateTable[obj]; -} - -void Scumm::putState(int obj, int state) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putState"); - checkRange(0xFF, 0, state, "State %d out of range in putState"); - _objectStateTable[obj] = state; -} - -int Scumm::getObjectRoom(int obj) -{ - checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getObjectRoom"); - return _objectRoomTable[obj]; -} - -int Scumm::getObjectIndex(int object) -{ - int i; - - /* OF_OWNER_ROOM should be 0xFF for full throttle, else 0xF */ - if (_objectOwnerTable[object] != OF_OWNER_ROOM) { - for (i = 0; i < _maxInventoryItems; i++) - if (_inventory[i] == object) - return i; - return -1; - } else { - for (i = _numObjectsInRoom; i > 0; i--) { - if (_objs[i].obj_nr == object) - return i; - } - return -1; - } -} - -int Scumm::whereIsObject(int object) -{ - int i; - - if (object >= _numGlobalObjects) - return WIO_NOT_FOUND; - - if (_objectOwnerTable[object] != OF_OWNER_ROOM) { - for (i = 0; i < _maxInventoryItems; i++) - if (_inventory[i] == object) - return WIO_INVENTORY; - return WIO_NOT_FOUND; - } - - for (i = _numObjectsInRoom; i > 0; i--) - if (_objs[i].obj_nr == object) { - if (_objs[i].fl_object_index) - return WIO_FLOBJECT; - return WIO_ROOM; - } - return WIO_NOT_FOUND; -} - -int Scumm::getObjectOrActorXY(int object, int &x, int &y) -{ - if (object < NUM_ACTORS) { - Actor *act = derefActorSafe(object, "getObjectOrActorXY"); - if (!act) - return 0; - else - return act->getActorXYPos(x, y); - } - - switch (whereIsObject(object)) { - case WIO_NOT_FOUND: - return -1; - case WIO_INVENTORY: - if (_objectOwnerTable[object] < NUM_ACTORS) - return derefActorSafe(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y); - else - return 0xFF; - } - getObjectXYPos(object, x, y); - return 0; -} - -/* Return the position of an object. - Returns X, Y and direction in angles - */ -void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) -{ - ObjectData *od = &_objs[getObjectIndex(object)]; - int state; - byte *ptr; - ImageHeader *imhd; - - if (!(_features & GF_SMALL_HEADER)) { - if (_features & GF_AFTER_V6) { - state = getState(object) - 1; - if (state < 0) - state = 0; - - if (od->fl_object_index) { - ptr = getResourceAddress(rtFlObject, od->fl_object_index); - ptr = findResource(MKID('OBIM'), ptr); - } else { - ptr = getResourceAddress(rtRoom, _roomResource); - ptr += od->offs_obim_to_room; - } - assert(ptr); - imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); - if (_features & GF_AFTER_V7) { - x = od->x_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].x); - y = od->y_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].y); - } else { - x = od->x_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].x); - y = od->y_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].y); - } - } else { - x = od->walk_x; - y = od->walk_y; - } - dir = oldDirToNewDir(od->actordir & 3); - } else { - x = od->walk_x; - y = od->walk_y; - dir = oldDirToNewDir(od->actordir & 3); - } -} - -int Scumm::getObjActToObjActDist(int a, int b) -{ - int x, y, x2, y2; - Actor *acta = NULL; - Actor *actb = NULL; - - if (a < NUM_ACTORS) - acta = derefActorSafe(a, "getObjActToObjActDist"); - - if (b < NUM_ACTORS) - actb = derefActorSafe(b, "getObjActToObjActDist(2)"); - - if (acta && actb && acta->getRoom() == actb->getRoom() && acta->getRoom() && !acta->isInCurrentRoom()) - return 0; - - if (getObjectOrActorXY(a, x, y) == -1) - return 0xFF; - - if (getObjectOrActorXY(b, x2, y2) == -1) - return 0xFF; - - if (acta) { - AdjustBoxResult r = acta->adjustXYToBeInBox(x2, y2, -1); - x2 = r.x; - y2 = r.y; - } - - y = abs(y - y2); - x = abs(x - x2); - - if (y > x) - x = y; - return x; -} - -int Scumm::findObject(int x, int y) -{ - int i, b; - byte a; - - for (i = 1; i <= _numObjectsInRoom; i++) { - if (!_objs[i].obj_nr || getClass(_objs[i].obj_nr, 32)) - continue; - b = i; - do { - a = _objs[b].parentstate; - b = _objs[b].parent; - if (b == 0) { - if (_objs[i].x_pos <= x && - _objs[i].width + _objs[i].x_pos > x && - _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) - return _objs[i].obj_nr; - break; - } - } while (_objs[b].state == a); - } - return 0; -} - -void Scumm::drawRoomObject(int i, int arg) -{ - ObjectData *od; - byte a; - - od = &_objs[i]; - if (!od->obj_nr || !od->state) - return; - - do { - a = od->parentstate; - if (!od->parent) { - drawObject(i, arg); - break; - } - od = &_objs[od->parent]; - } while (od->state == a); -} - -void Scumm::drawRoomObjects(int arg) -{ - int i; - - if (_features & GF_DRAWOBJ_OTHER_ORDER) { - for (i = 1; i <= _numObjectsInRoom; i++) - drawRoomObject(i, arg); - } else { - for (i = _numObjectsInRoom; i != 0; i--) - drawRoomObject(i, arg); - } -} - -const uint32 IMxx_tags[] = { - MKID('IM00'), - MKID('IM01'), - MKID('IM02'), - MKID('IM03'), - MKID('IM04'), - MKID('IM05'), - MKID('IM06'), - MKID('IM07'), - MKID('IM08'), - MKID('IM09'), - MKID('IM0A'), - MKID('IM0B'), - MKID('IM0C'), - MKID('IM0D'), - MKID('IM0E'), - MKID('IM0F') -}; - -void Scumm::drawObject(int obj, int arg) -{ - ObjectData *od; - int xpos, ypos, height, width; - byte *ptr; - int x, a, numstrip; - int tmp; - - if (_BgNeedsRedraw) - arg = 0; - - _curVirtScreen = &virtscr[0]; - - od = &_objs[obj]; - - xpos = od->x_pos >> 3; - ypos = od->y_pos; - - width = od->width >> 3; - height = od->height &= 0xF8; // Ender - - if (width == 0 || xpos > _screenEndStrip || xpos + width < _screenStartStrip) - return; - - if (od->fl_object_index) { - ptr = getResourceAddress(rtFlObject, od->fl_object_index); - ptr = findResource(MKID('OBIM'), ptr); - } else { - ptr = getResourceAddress(rtRoom, _roomResource); - ptr = ptr + od->offs_obim_to_room; - } - - if (_features & GF_SMALL_HEADER) - ptr += 8; - else - ptr = findResource(IMxx_tags[getState(od->obj_nr)], ptr); - if (!ptr) - return; - - x = 0xFFFF; - - for (a = numstrip = 0; a < width; a++) { - tmp = xpos + a; - if (arg == 1 && _screenStartStrip != tmp) - continue; - if (arg == 2 && _screenEndStrip != tmp) - continue; - if (tmp < _screenStartStrip || tmp > _screenEndStrip) - continue; - gfxUsageBits[tmp] |= 0x80000000; - if (tmp < x) - x = tmp; - numstrip++; - } - - if (numstrip != 0) { - byte flags = Gdi::dbAllowMaskOr; - if (_features & GF_AFTER_V7 && getClass(od->obj_nr, 22)) - flags |= Gdi::dbDrawMaskOnBoth; - gdi.drawBitmap(ptr, _curVirtScreen, x, ypos, height, x - xpos, numstrip, flags); - } -} - -void Scumm::loadRoomObjects() -{ - int i, j; - ObjectData *od; - byte *ptr; - uint16 obim_id; - byte *room, *searchptr; - ImageHeader *imhd; - RoomHeader *roomhdr; - CodeHeader *cdhd; - - CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); - roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); - - if (_features & GF_AFTER_V7) - _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->v7.numObjects)); - else - _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); - - if (_numObjectsInRoom == 0) - return; - - if (_numObjectsInRoom > _numLocalObjects) - error("More than %d objects in room %d", _numLocalObjects, _roomResource); - - od = &_objs[1]; - searchptr = room; - for (i = 0; i < _numObjectsInRoom; i++, od++) { - ptr = findResource(MKID('OBCD'), searchptr); - if (ptr == NULL) - error("Room %d missing object code block(s)", _roomResource); - - od->offs_obcd_to_room = ptr - room; - cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), ptr); - - if (_features & GF_AFTER_V7) - od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id)); - else if (_features & GF_AFTER_V6) - od->obj_nr = READ_LE_UINT16(&(cdhd->v6.obj_id)); - else - od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id)); - -#ifdef DUMP_SCRIPTS - do { - char buf[32]; - sprintf(buf, "roomobj-%d-", _roomResource); - dumpResource(buf, od->obj_nr, ptr); - } while (0); -#endif - searchptr = NULL; - } - - searchptr = room; - for (i = 0; i < _numObjectsInRoom; i++) { - ptr = findResource(MKID('OBIM'), searchptr); - if (ptr == NULL) - error("Room %d missing image blocks(s)", _roomResource); - - imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); - if (_features & GF_AFTER_V7) - obim_id = READ_LE_UINT16(&imhd->v7.obj_id); - else - obim_id = READ_LE_UINT16(&imhd->old.obj_id); - - for (j = 1; j <= _numObjectsInRoom; j++) { - if (_objs[j].obj_nr == obim_id) - _objs[j].offs_obim_to_room = ptr - room; - } - searchptr = NULL; - } - - od = &_objs[1]; - for (i = 1; i <= _numObjectsInRoom; i++, od++) { - setupRoomObject(od, room); - } - -CHECK_HEAP} - -void Scumm::loadRoomObjectsSmall() -{ - int i, j; - ObjectData *od; - byte *ptr; - uint16 obim_id; - byte *room, *searchptr; - RoomHeader *roomhdr; - - CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); - roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); - - _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); - - if (_numObjectsInRoom == 0) - return; - - if (_numObjectsInRoom > _numLocalObjects) - error("More than %d objects in room %d", _numLocalObjects, _roomResource); - - od = &_objs[1]; - searchptr = room; - for (i = 0; i < _numObjectsInRoom; i++, od++) { - ptr = findResourceSmall(MKID('OBCD'), searchptr); - if (ptr == NULL) - error("Room %d missing object code block(s)", _roomResource); - - od->offs_obcd_to_room = ptr - room; - od->obj_nr = READ_LE_UINT16(ptr + 6); - -#ifdef DUMP_SCRIPTS - do { - char buf[32]; - sprintf(buf, "roomobj-%d-", _roomResource); - dumpResource(buf, od->obj_nr, ptr); - } while (0); -#endif - searchptr = NULL; - } - - searchptr = room; - for (i = 0; i < _numObjectsInRoom; i++) { - ptr = findResourceSmall(MKID('OBIM'), searchptr); - if (ptr == NULL) - error("Room %d missing image blocks(s)", _roomResource); - - obim_id = READ_LE_UINT16(ptr + 6); - - for (j = 1; j <= _numObjectsInRoom; j++) { - if (_objs[j].obj_nr == obim_id) - _objs[j].offs_obim_to_room = ptr - room; - } - searchptr = NULL; - } - - od = &_objs[1]; - for (i = 1; i <= _numObjectsInRoom; i++, od++) { - setupRoomObject(od, room); - } - -CHECK_HEAP} - -void Scumm::setupRoomObject(ObjectData *od, byte *room) -{ - CodeHeader *cdhd; - ImageHeader *imhd; - - if (_features & GF_SMALL_HEADER) { - - byte *ptr = room + od->offs_obcd_to_room; - - od->obj_nr = READ_LE_UINT16(ptr + 6); // ok - - od->width = *(ptr + 11) << 3; // ok - od->x_pos = *(ptr + 9) << 3; // ok - - if (*(ptr + 10) & 0x80) { - od->parentstate = 1; // it's 0x10 in the original code - } else { - od->parentstate = 0; - } - - od->y_pos = ((*(ptr + 10)) & 0x7F) << 3; - - od->parent = *(ptr + 12); - od->walk_x = READ_LE_UINT16(ptr + 13); - - od->walk_y = READ_LE_UINT16(ptr + 15); - - od->actordir = (*(ptr + 17)) & 7; - od->height = *(ptr + 17); // ok - - - - return; - } - - cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), room + od->offs_obcd_to_room); - if (_features & GF_AFTER_V7) - od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id)); - else if (_features & GF_AFTER_V6) - od->obj_nr = READ_LE_UINT16(&(cdhd->v6.obj_id)); - else - od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id)); - - if (!(_features & GF_AFTER_V7)) { - if (_features & GF_AFTER_V6) { - od->width = READ_LE_UINT16(&cdhd->v6.w); - od->height = READ_LE_UINT16(&cdhd->v6.h); - od->x_pos = ((int16)READ_LE_UINT16(&cdhd->v6.x)); - od->y_pos = ((int16)READ_LE_UINT16(&cdhd->v6.y)); - if (cdhd->v6.flags == 0x80) { - od->parentstate = 1; - } else { - od->parentstate = (cdhd->v6.flags & 0xF); - } - od->parent = cdhd->v6.parent; - od->actordir = cdhd->v6.actordir; - } else { - od->width = cdhd->v5.w << 3; - od->height = cdhd->v5.h << 3; - od->x_pos = cdhd->v5.x << 3; - od->y_pos = cdhd->v5.y << 3; - if (cdhd->v5.flags == 0x80) { - od->parentstate = 1; - } else { - od->parentstate = (cdhd->v5.flags & 0xF); - } - od->parent = cdhd->v5.parent; - od->walk_x = READ_LE_UINT16(&cdhd->v5.walk_x); - od->walk_y = READ_LE_UINT16(&cdhd->v5.walk_y); - od->actordir = cdhd->v5.actordir; - } - } else { - od->parent = cdhd->v7.parent; - od->parentstate = cdhd->v7.parentstate; - - imhd = (ImageHeader *)findResourceData(MKID('IMHD'), room + od->offs_obim_to_room); - od->x_pos = READ_LE_UINT16(&imhd->v7.x_pos); - od->y_pos = READ_LE_UINT16(&imhd->v7.y_pos); - od->width = READ_LE_UINT16(&imhd->v7.width); - od->height = READ_LE_UINT16(&imhd->v7.height); - od->actordir = READ_LE_UINT16(&imhd->v7.actordir); - - } - od->fl_object_index = 0; -} - -void Scumm::fixObjectFlags() -{ - int i; - ObjectData *od = &_objs[1]; - for (i = 1; i <= _numObjectsInRoom; i++, od++) { - od->state = _objectStateTable[od->obj_nr]; - } -} - -void Scumm::processDrawQue() -{ - int i, j; - for (i = 0; i < _drawObjectQueNr; i++) { - j = _drawObjectQue[i]; - if (j) - drawObject(j, 0); - } - _drawObjectQueNr = 0; -} - -void Scumm::clearOwnerOf(int obj) -{ - int i, j; - uint16 *a; - - stopObjectScript(obj); - - if (getOwner(obj) == OF_OWNER_ROOM) { - i = 0; - do { - if (_objs[i].obj_nr == obj) { - if (!_objs[i].fl_object_index) - return; - nukeResource(rtFlObject, _objs[i].fl_object_index); - _objs[i].obj_nr = 0; - _objs[i].fl_object_index = 0; - } - } while (++i <= _numObjectsInRoom); - return; - } - - for (i = 1; i < _maxInventoryItems; i++) { - if (_inventory[i] == obj) { - j = whereIsObject(obj); - if (j == WIO_INVENTORY) { - nukeResource(rtInventory, i); - _inventory[i] = 0; - } - a = &_inventory[1]; - for (i = 1; i < _maxInventoryItems - 1; i++, a++) { - if (!a[0] && a[1]) { - a[0] = a[1]; - a[1] = 0; - _baseInventoryItems[i] = _baseInventoryItems[i + 1]; - _baseInventoryItems[i + 1] = NULL; - } - } - return; - } - } -} - -void Scumm::removeObjectFromRoom(int obj) -{ - int i, cnt; - uint32 *ptr; - - for (i = 1; i <= _numObjectsInRoom; i++) { - if (_objs[i].obj_nr == (uint16)obj) { - if (_objs[i].width != 0) { - ptr = &gfxUsageBits[_objs[i].x_pos >> 3]; - cnt = _objs[i].width >> 3; - do { - *ptr++ |= 0x80000000; - } while (--cnt); - } - _BgNeedsRedraw = true; - return; - } - } -} - -void Scumm::addObjectToDrawQue(int object) -{ - _drawObjectQue[_drawObjectQueNr++] = object; - if ((unsigned int)_drawObjectQueNr > sizeof(_drawObjectQue) / sizeof(_drawObjectQue[0])) - error("Draw Object Que overflow"); -} - -void Scumm::clearDrawObjectQueue() -{ - _drawObjectQueNr = 0; -} - -byte *Scumm::getObjOrActorName(int obj) -{ - byte *objptr; - int i; - - if (obj < NUM_ACTORS) - return derefActorSafe(obj, "getObjOrActorName")->getActorName(); - - if (_features & GF_SMALL_HEADER) { - byte offset = 0; - - objptr = getOBCDFromObject(obj); - if (objptr) - offset = READ_LE_UINT16(objptr + 18); - return (objptr + offset); - } - - if (_features & GF_AFTER_V6) { - for (i = 1; i < 50; i++) { - if (_newNames[i] == obj) { - debug(5, "Found new name for object %d at _newNames[i]", obj, i); - return getResourceAddress(rtObjectName, i); - break; - } - } - } - - objptr = getOBCDFromObject(obj); - if (objptr == NULL) - return (byte *)" "; - - return findResourceData(MKID('OBNA'), objptr); -} - -uint32 Scumm::getOBCDOffs(int object) -{ - int i; - - if (_objectOwnerTable[object] != OF_OWNER_ROOM) - return 0; - for (i = _numObjectsInRoom; i > 0; i--) { - if (_objs[i].obj_nr == object) { - if (_objs[i].fl_object_index != 0) - return 8; - return _objs[i].offs_obcd_to_room; - } - } - return 0; -} - -byte *Scumm::getOBCDFromObject(int obj) -{ - int i; - - if (_objectOwnerTable[obj] != OF_OWNER_ROOM) { - for (i = 0; i < _maxInventoryItems; i++) { - if (_inventory[i] == obj) - return getResourceAddress(rtInventory, i); - } - } else { - for (i = _numObjectsInRoom; i > 0; --i) { - if (_objs[i].obj_nr == obj) { - if (_objs[i].fl_object_index) - return getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; - return getResourceAddress(rtRoom, _roomResource) + _objs[i].offs_obcd_to_room; - } - } - } - return 0; -} - -void Scumm::addObjectToInventory(uint obj, uint room) -{ - int i, slot; - uint32 size; - byte *obcdptr, *ptr; - FindObjectInRoom foir; - - debug(1, "Adding object %d from room %d into inventory", obj, room); - - CHECK_HEAP if (whereIsObject(obj) == WIO_FLOBJECT) { - i = getObjectIndex(obj); - ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; - size = READ_BE_UINT32_UNALIGNED(ptr + 4); - slot = getInventorySlot(); - _inventory[slot] = obj; - createResource(rtInventory, slot, size); - ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; - memcpy(getResourceAddress(rtInventory, slot), ptr, size); - } else { - findObjectInRoom(&foir, foCodeHeader, obj, room); - if (_features & GF_SMALL_HEADER) - size = READ_LE_UINT32(foir.obcd); - else - size = READ_BE_UINT32_UNALIGNED(foir.obcd + 4); - slot = getInventorySlot(); - _inventory[slot] = obj; - createResource(rtInventory, slot, size); - obcdptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obcd; - memcpy(getResourceAddress(rtInventory, slot), obcdptr, size); - } - -CHECK_HEAP} - -void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) -{ - CodeHeader *cdhd; - int i, numobj; - byte *roomptr, *obcdptr, *obimptr, *searchptr; - RoomHeader *roomhdr; - ImageHeader *imhd; - int id2; - int id3; - - if (findWhat & foCheckAlreadyLoaded && getObjectIndex(id) != -1) { - fo->obcd = obcdptr = getOBCDFromObject(id); - assert((byte *)obcdptr > (byte *)256); - fo->obim = obimptr = obcdptr + RES_SIZE(obcdptr); - fo->cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); - fo->imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr); - return; - } - - fo->roomptr = roomptr = getResourceAddress(rtRoom, room); - if (!roomptr) - error("findObjectInRoom: failed getting roomptr to %d", room); - - roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr); - - if (_features & GF_AFTER_V7) - numobj = READ_LE_UINT16(&(roomhdr->v7.numObjects)); - else - numobj = READ_LE_UINT16(&(roomhdr->old.numObjects)); - - if (numobj == 0) - error("findObjectInRoom: No object found in room %d", room); - if (numobj > _numLocalObjects) - error("findObjectInRoom: More (%d) than %d objects in room %d", numobj, _numLocalObjects, room); - - if (findWhat & foCodeHeader) { - searchptr = roomptr; - for (i = 0;;) { - if (_features & GF_SMALL_HEADER) - obcdptr = findResourceSmall(MKID('OBCD'), searchptr); - else - obcdptr = findResource(MKID('OBCD'), searchptr); - if (obcdptr == NULL) - error("findObjectInRoom: Not enough code blocks in room %d", room); - if (_features & GF_SMALL_HEADER) { - if (READ_LE_UINT16(obcdptr + 6) == (uint16)id) { - fo->cdhd = NULL; - fo->obcd = obcdptr; - break; - } - } else { - cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); - if (_features & GF_AFTER_V7) - id2 = READ_LE_UINT16(&(cdhd->v7.obj_id)); - else if (_features & GF_AFTER_V6) - id2 = READ_LE_UINT16(&(cdhd->v6.obj_id)); - else - id2 = READ_LE_UINT16(&(cdhd->v5.obj_id)); - - if (id2 == (uint16)id) { - fo->cdhd = cdhd; - fo->obcd = obcdptr; - break; - } - } - if (++i == numobj) - error("findObjectInRoom: Object %d not found in room %d", id, room); - searchptr = NULL; - } - } - - if (findWhat & foImageHeader) { - searchptr = roomptr; - for (i = 0;;) { - if (_features & GF_SMALL_HEADER) - obimptr = findResourceSmall(MKID('OBIM'), searchptr); - else - obimptr = findResource(MKID('OBIM'), searchptr); - if (obimptr == NULL) - error("findObjectInRoom: Not enough image blocks in room %d", room); - imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr); - if (_features & GF_SMALL_HEADER) { - if (READ_LE_UINT16(obimptr + 6) == (uint16)id) { - fo->obim = obimptr; - fo->imhd = imhd; - break; - } - } else { - if (_features & GF_AFTER_V7) - id3 = READ_LE_UINT16(&imhd->v7.obj_id); - else - id3 = READ_LE_UINT16(&imhd->old.obj_id); - if (id3 == (uint16)id) { - fo->obim = obimptr; - fo->imhd = imhd; - break; - } - } - if (++i == numobj) - error("findObjectInRoom: Object %d image not found in room %d", id, room); - searchptr = NULL; - } - } -} - -int Scumm::getInventorySlot() -{ - int i; - for (i = 1; i <= _maxInventoryItems; i++) { - if (_inventory[i] == 0) - return i; - } - error("Inventory full, %d max items", _maxInventoryItems); - return -1; -} - -void Scumm::SamInventoryHack(int obj) -{ // FIXME: Sam and Max hack - int base = 6; - - while (base < 80) { - int value = readArray(178, 0, base); - if (value == obj) - return; - if (value == 0) { - _vars[179]++; - writeArray(178, 0, base, obj); - return; - } - base++; - } -} - -void Scumm::setOwnerOf(int obj, int owner) -{ - ScriptSlot *ss; - if (owner == 0) { - clearOwnerOf(obj); - ss = &vm.slot[_currentScript]; - if (ss->where == WIO_INVENTORY && _inventory[ss->number] == obj) { - putOwner(obj, 0); - runHook(0); - stopObjectCode(); - return; - } - } - if ((owner == 2) && (_gameId == GID_SAMNMAX)) - SamInventoryHack(obj); - - putOwner(obj, owner); - runHook(0); -} - -int Scumm::getObjX(int obj) -{ - if (obj < NUM_ACTORS) { - if (obj < 1) - return 0; /* fix for indy4's map */ - return derefActorSafe(obj, "getObjX")->x; - } else { - if (whereIsObject(obj) == WIO_NOT_FOUND) - return -1; - int x, y; - getObjectOrActorXY(obj, x, y); - return x; - } -} - -int Scumm::getObjY(int obj) -{ - if (obj < NUM_ACTORS) { - if (obj < 1) - return 0; /* fix for indy4's map */ - return derefActorSafe(obj, "getObjY")->y; - } else { - if (whereIsObject(obj) == WIO_NOT_FOUND) - return -1; - int x, y; - getObjectOrActorXY(obj, x, y); - return y; - } -} - -int Scumm::getObjOldDir(int obj) -{ - if (obj < NUM_ACTORS) { - return newDirToOldDir(derefActorSafe(obj, "getObjOldDir")->facing); - } else { - int x, y, dir; - getObjectXYPos(obj, x, y, dir); - return dir; - } -} - -int Scumm::getObjNewDir(int obj) -{ - if (obj < NUM_ACTORS) { - return derefActorSafe(obj, "getObjNewDir")->facing; - } else { - int x, y, dir; - getObjectXYPos(obj, x, y, dir); - return oldDirToNewDir(dir); - } -} - -int Scumm::findInventory(int owner, int idx) -{ - int count = 1, i, obj; - for (i = 0; i != _maxInventoryItems; i++) { - obj = _inventory[i]; - if (obj && getOwner(obj) == owner && count++ == idx) - return obj; - } - return 0; -} - -int Scumm::getInventoryCount(int owner) -{ - int i, obj; - int count = 0; - for (i = 0; i != _maxInventoryItems; i++) { - obj = _inventory[i]; - if (obj && getOwner(obj) == owner) - count++; - } - return count; -} - -void Scumm::setObjectState(int obj, int state, int x, int y) -{ - int i; - - i = getObjectIndex(obj); - if (i == -1) { - warning("setObjectState: no such object"); - return; - } - - if (x != -1) { - _objs[i].x_pos = x << 3; - _objs[i].y_pos = y << 3; - } - - addObjectToDrawQue(i); - putState(obj, state); -} - -static int getDist(int x, int y, int x2, int y2) -{ - int a = abs(y - y2); - int b = abs(x - x2); - if (a > b) - return a; - return b; -} - -int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f) -{ - int i, j; - int x, y; - int x2, y2; - - j = i = 0xFF; - - if (is_obj_1) { - if (getObjectOrActorXY(b, x, y) == -1) - return -1; - if (b < NUM_ACTORS) - i = derefActorSafe(b, "unkObjProc1")->scalex; - } else { - x = b; - y = c; - } - - if (is_obj_2) { - if (getObjectOrActorXY(e, x2, y2) == -1) - return -1; - if (e < NUM_ACTORS) - j = derefActorSafe(e, "unkObjProc1(2)")->scalex; - } else { - x2 = e; - y2 = f; - } - - return getDist(x, y, x2, y2) * 0xFF / ((i + j) >> 1); -} - -void Scumm::setCursorImg(uint img, uint room, uint imgindex) -{ - int w, h; - byte *dataptr, *bomp; - uint32 size; - FindObjectInRoom foir; - - if (room == (uint) - 1) - room = getObjectRoom(img); - - findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room); - - if (_features & GF_AFTER_V7) - setCursorHotspot2(READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x), - READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y)); - else - setCursorHotspot2(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x), - READ_LE_UINT16(&foir.imhd->old.hotspot[0].y)); - - - if (!(_features & GF_AFTER_V7)) { - w = READ_LE_UINT16(&foir.cdhd->v6.w) >> 3; - h = READ_LE_UINT16(&foir.cdhd->v6.h) >> 3; - } else { - w = READ_LE_UINT16(&foir.imhd->v7.width) >> 3; - h = READ_LE_UINT16(&foir.imhd->v7.height) >> 3; - } - - dataptr = findResource(IMxx_tags[imgindex], foir.obim); - if (dataptr == NULL) - error("setCursorImg: No such image"); - - size = READ_BE_UINT32_UNALIGNED(dataptr + 4); - if (size > sizeof(_grabbedCursor)) - error("setCursorImg: Cursor image too large"); - - if ((bomp = findResource(MKID('BOMP'), dataptr)) != NULL) - useBompCursor(bomp, w, h); - else - useIm01Cursor(dataptr, w, h); - -} - -void Scumm::nukeFlObjects(int min, int max) -{ - ObjectData *od; - int i; - - warning("nukeFlObjects(%d,%d)", min, max); - - for (i = _numObjectsInRoom, od = _objs; --i >= 0; od++) - if (od->fl_object_index && od->obj_nr >= min && od->obj_nr <= max) { - nukeResource(rtFlObject, od->fl_object_index); - od->obj_nr = 0; - od->fl_object_index = 0; - } -} - -void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, - int objectHeight, int f, int g, int image, int mode) -{ - BlastObject *eo; - ObjectData *od; - - if (_enqueuePos == sizeof(_enqueuedObjects) / sizeof(_enqueuedObjects[0])) - error("enqueueObject: overflow"); - - eo = &_enqueuedObjects[_enqueuePos++]; - eo->number = objectNumber; - eo->areaX = _enqueue_b; - eo->areaY = _enqueue_c; - eo->areaWidth = _enqueue_d; - eo->areaHeight = _enqueue_e; - eo->posX = objectX + (camera._cur.x & 7); - eo->posY = objectY + (camera._cur.y - 100); - if (objectWidth == 0) { - od = &_objs[getObjectIndex(objectNumber)]; - eo->width = od->width; - } else { - eo->width = objectWidth; - } - if (objectHeight == 0) { - od = &_objs[getObjectIndex(objectNumber)]; - eo->height = od->height; - } else { - eo->height = objectHeight; - } - - eo->unk3 = f; - eo->unk4 = g; - eo->image = image; - - eo->mode = mode; -} - -void Scumm::drawBlastObjects() -{ - BlastObject *eo; - int i; - - eo = _enqueuedObjects; - for (i = 0; i < _enqueuePos; i++, eo++) { - drawBlastObject(eo); - } -} - - -void Scumm::drawBlastObject(BlastObject *eo) -{ - VirtScreen *vs; - byte *bomp, *ptr, *img; - int idx; - BompDrawData bdd; - - vs = &virtscr[0]; - - _lastXstart = vs->xstart; - - checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d"); - - idx = _objs[getObjectIndex(eo->number)].fl_object_index; - - if (idx) { - ptr = getResourceAddress(rtFlObject, idx); - ptr = findResource(MKID('OBIM'), ptr); - } else { - idx = getObjectIndex(eo->number); - assert(idx != -1); - ptr = getResourceAddress(1, _roomResource) + _objs[idx].offs_obim_to_room; - } - if (!ptr) - error("BlastObject object %d image not found", eo->number); - - img = findResource(IMxx_tags[eo->image], ptr); - if (!img) - img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects - if (!img) - error("blast-object %d invalid image %d (1-x)", eo->number, eo->image); - - bomp = findResourceData(MKID('BOMP'), img); - if (!bomp) - error("object %d is not a blast object", eo->number); - - bdd.srcwidth = READ_LE_UINT16(&((BompHeader *)bomp)->width); - bdd.srcheight = READ_LE_UINT16(&((BompHeader *)bomp)->height); - - bdd.out = vs->screenPtr + vs->xstart; - bdd.outwidth = vs->width; - bdd.outheight = vs->height; - bdd.dataptr = bomp + 10; - bdd.x = eo->posX; - bdd.y = eo->posY; - bdd.scale_x = (unsigned char)eo->unk3; - bdd.scale_y = (unsigned char)eo->unk4; - - drawBomp(&bdd, 0, bdd.dataptr, 1, 0); - updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0); -} - -void Scumm::removeBlastObjects() -{ - BlastObject *eo; - int i; - - eo = _enqueuedObjects; - for (i = 0; i < _enqueuePos; i++, eo++) { - removeBlastObject(eo); - } - - clearEnqueue(); -} - -void Scumm::removeBlastObject(BlastObject *eo) -{ - restoreBG(eo->posX, eo->posY, eo->posX + eo->width, eo->posY + eo->height); -} - -int Scumm::findFlObjectSlot() -{ - int i; - for (i = 1; i < _maxFLObject; i++) { - if (_baseFLObject[i] == NULL) - return i; - } - error("findFlObjectSlot: Out of FLObject slots"); - return -1; -} - -void Scumm::loadFlObject(uint object, uint room) -{ - FindObjectInRoom foir; - int slot; - ObjectData *od; - byte *flob, *roomptr; - uint32 obcd_size, obim_size, flob_size; - - /* Don't load an already loaded object */ - if (whereIsObject(object) != WIO_NOT_FOUND) - return; - - /* Locate the object in the room resource */ - findObjectInRoom(&foir, foImageHeader | foCodeHeader, object, room); - - /* Add an entry for the new floating object in the local object table */ - if (++_numObjectsInRoom > _numLocalObjects) - error("loadFlObject: Local Object Table overflow"); - od = &_objs[_numObjectsInRoom]; - - /* Setup sizes */ - obcd_size = READ_BE_UINT32_UNALIGNED(foir.obcd + 4); - od->offs_obcd_to_room = 8; - od->offs_obim_to_room = obcd_size + 8; - obim_size = READ_BE_UINT32_UNALIGNED(foir.obim + 4); - flob_size = obcd_size + obim_size + 8; - - /* Allocate slot & memory for floating object */ - slot = findFlObjectSlot(); - createResource(rtFlObject, slot, flob_size); - - /* Copy object code + object image to floating object */ - roomptr = getResourceAddress(rtRoom, room); - flob = getResourceAddress(rtFlObject, slot); - ((uint32 *)flob)[0] = MKID('FLOB'); - ((uint32 *)flob)[1] = TO_BE_32(flob_size); - memcpy(flob + 8, roomptr - foir.roomptr + foir.obcd, obcd_size); - memcpy(flob + 8 + obcd_size, roomptr - foir.roomptr + foir.obim, obim_size); - - /* Setup local object flags */ - setupRoomObject(od, flob); - - od->fl_object_index = slot; -} diff --git a/object.h b/object.h deleted file mode 100644 index 39787ca0a3..0000000000 --- a/object.h +++ /dev/null @@ -1,122 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef OBJECT_H -#define OBJECT_H - -#if !defined(__GNUC__) - #pragma START_PACK_STRUCTS -#endif - -struct RoomHeader { - union { - struct { - uint32 version; - uint16 width, height; - uint16 numObjects; - } GCC_PACK v7; - struct { - uint16 width, height; - uint16 numObjects; - } GCC_PACK old; - } GCC_PACK; -} GCC_PACK; - -struct CodeHeader { - union { - struct { - uint16 obj_id; - byte x, y, w, h; - byte flags; - byte parent; - int16 walk_x; - int16 walk_y; - byte actordir; - } GCC_PACK v5; - - struct { - uint16 obj_id; - int16 x, y; - uint16 w, h; - byte flags, parent; - uint16 unk1; - uint16 unk2; - byte actordir; - } GCC_PACK v6; - - struct { - uint32 version; - uint16 obj_id; - byte parent; - byte parentstate; - } GCC_PACK v7; - - } GCC_PACK; -} GCC_PACK; - -struct ImageHeader { /* file format */ - union { - struct { - uint16 obj_id; - uint16 unk[5]; - uint16 width; - uint16 height; - uint16 unk_2; - struct { - int16 x, y; - } GCC_PACK hotspot[15]; - } GCC_PACK old; - - struct { - uint32 version; - uint16 obj_id; - uint16 unk[1]; - int16 x_pos, y_pos; - uint16 width, height; - byte unk2[3]; - byte actordir; - uint16 unk_2; - struct { - int16 x, y; - } GCC_PACK hotspot[15]; - } GCC_PACK v7; - } GCC_PACK; -} GCC_PACK; - -#if !defined(__GNUC__) - #pragma END_PACK_STRUCTS -#endif - -struct FindObjectInRoom { - CodeHeader *cdhd; - byte *obcd; - ImageHeader *imhd; - byte *obim; - byte *roomptr; -}; - -enum FindObjectWhat { - foCodeHeader = 1, - foImageHeader = 2, - foCheckAlreadyLoaded = 4 -}; - - -#endif diff --git a/readme.txt b/readme.txt deleted file mode 100644 index dd2a4e1527..0000000000 --- a/readme.txt +++ /dev/null @@ -1,560 +0,0 @@ -ScummVM README -Last updated: 2002-07-08 -Release version: 0.2.2 [CVS] ------------------------------------------------------------------------- - -For more information, compatibility lists, details on donating, the latest -release, progress reports and more, please visit the ScummVM home page -at: http://scummvm.sourceforge.net/ - - -About: ------- - -ScummVM is an implementation of the SCUMM (Script Creation Utility for -Maniac Mansion) engine used in various Lucas Arts games such as Monkey -Island and Day of the Tentacle. At this time ScummVM should be considered -ALPHA software, as it's still under heavy development. Be aware that while -many games will work with few major bugs, crashes can happen. Also note -that saved games can, and probably will, be incompatible between releases. - -Also ScummVM is capable of playing several non-SCUMM games, at the moment -this includes Simon The Sorcerer. - -If you enjoy ScummVM feel free to donate using the PayPal button on the -ScummVM homepage. This will help us buy utilities needed to develop ScummVM -easier and quicker. If you cannot donate, help and contribute a patch! - -Contacting: ------------ -The easiest way to contact the ScummVM team is by subitting bug reports or -commenting in our forums. You can also join and e-mail the scummvm-devel -mailing list, or chat with us on irc (#scummvm, irc.openprojects.net) - -Supported Games: ----------------- - -At the moment the following games have been reported to work, and should -be playable to the end: - - Loom (256 color CD version) [Game: loomcd] - Zak McKraken (256 color FM Towns version) [Game: zak256] - Monkey Island 1 (CD version) [Game: monkey1] - Monkey Island 2 [Game: monkey2] - Indiana Jones And The Fate Of Atlantis [Game: atlantis] - Day Of The Tentacle [Game: tentacle] - Sam & Max [Game: samnmax] - Simon The Sorcerer [Game: simon1dos/simon1win] - - -The following games should load, but are not yet fully playable. Play these at -your own risk, and please do not file bug reports about them. If you want -the latest updates on game compatibility, visit our web site and view the -compatibility chart. - - Monkey Island 1 (VGA floppy) [Game: monkeyvga] - Indiana Jones and the Last Crusade (256 color) [Game: indy3] - Full Throttle [Game: ft] - The Dig [Game: dig] - -The following games are SCUMM engine, but NOT supported by ScummVM (yet). - - Maniac Mansion - Zak McKraken (16 color floppy version) - Monkey Island 1 (EGA, 16 color floppy version) - Loom (16 color floppy version) - Curse of Monkey Island - -Please be aware that the engine may contains bugs and non-implemented- -features that sometimes make it impossible to finish the game. Save often, -and please file a bug report (details on submitted bug reports are below) -if you discover such a bug. - - -Supported Platforms: -------------------- - -ScummVM has been ported to run on many platforms and operating systems. -Links to these ports can be found either on the ScummVM web page or by a -Google search. Many thanks to the effort of porters. If you have a port of -ScummVM and wish to commit it into the main CVS, feel free to contact us! - - Windows - SDL - Windows CE - SDL (iPaq and other handheld devices) - Linux - SDL/X11 (includes iPaq devices running Linux) - Macintosh - SDL/CUSTOM (Including Classic and Mac OS X) - AmigaOS - SDL/AGA - MorphOS - SDL - BeOS - SDL - Acorn (RiscOS) - ??? - Dreamcast - ??? - UNIX - SDL (SDL may work on Solaris, IRIX, *BSD) - -Known Bugs: ------------ - -This release has the following known bugs. There is no need to report them, -although patches to fix them are welcome. If you discover a bug that is not -listed here, nor in the compatibility table on the web site, please see -the section on Reporting Bugs. - - Indy 4 (Fate Of Atlantis): - - Keyboard fighting does not work. ScummVM now defaults to - using mouse fighting. - - - Sam and Max: - - Subgames are not all fully functional. - - - Conroy singing in Bumpusville may work incorrectly. Eg, - music will overlap and Conroy will get stuck singing. Just - hit escape to skip the cutscene. This is due to SNM using - a different iMUSE implementation to previous games. - - - Zak McKracken Fm Towns: - - The Fm Towns 256 color version of Zak McKracken is rare, - And as the ScummVM team does not encourage piracy in any - way, we do not know where to buy or download a copy of this - game. Petition LucasArts to re-release it :) - - - No music or sound effects yet. - - - Loom (256 Talkie): - - If you are having random crashes, this is a Windows bug. - Try copying the data files from CD to your hard disk. - - - Bobbin may sometimes appear to walk backwards. - - - Monkey 1 (CD Version): - - If you are having random crashes, this is a Windows bug. - Try copying the data files from CD to your hard disk. - - -Reporting Bugs: ---------------- -To report a bug, please create a SourceForge account and follow the bugs -link from our homepage. Please make sure the bug is reproducible, and -still exists in the latest daily build/current CVS version. Also check the -compatibility listing for that game to ensure the issue is not already known. - -Do NOT report bugs listed as being completable above. - -Please include the following information: - - Game version (PLEASE test the latest CVS/Daily build) - - Bug details, including instructions on reproducing - - Language of game (English, German, etc) - - Version of game (Talkie, Floppy...) - - Platform and Compiler (Win32, Linux, etc) - - Attach a save game if possible - - If this bug only occurred recently, please note the last - version without the bug, and the first version including - the bug. That way we can fix it quicker by looking at the - changes made. - - -Compiling: ----------- - -You need SDL-1.2.2 or newer (older versions may work, but are unsupported), and -a supported compiler. Several compilers, including GCC, mingw and Microsoft -Visual C++ are supported. If you wish to use MP3-compressed CD tracks or -.SOU files, you will need to install the MAD library and define -COMPRESSED_SOUND_FILE. Tools for compressing .SOU files to .SO3 files can be -found in the 'tools' CVS module, or in the 'scummvm-tools' package. - -You can also comment/uncomment appropriate lines in the Makefile to use -sdl_gl.cpp instead of sdl.cpp. This allows hardware accelerated bilinear -filtering by using OpenGL textures. - -On Win9x/NT/XP you can define USE_WINDBG and attach WinDbg to browse debug -messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml). - - GCC: - * Type make (or gmake if that's what GNU make is called on your - system) and hopefully ScummVM will compile for you. - - Microsoft Visual C++: - * Open the workspace, scummwm.dsw - * Enter the path to the SDL include files in Tools|Options|Directories - * Now it should compile successfully. - - BeOS: - * Open the 'scummvm.proj' file in BeIDE. Compile as normal. - - PocketPC - Windows CE: - * Download the SDLAudio library: - http://arisme.free.fr/PocketScumm/sources/SDLAudio-1.2.3-src.zip - * Open and compile the SDLAudio WCEBuild/WCEBuild workspace in EVC++ - * Open the ScummVM wince/PocketScumm workspace - * Enter the SDLAudio directory to your includes path - * Enter the compiled SDLAudio.lib to your link libraries list - * Now it should compile successfully - - -Running: --------- - -Before you run the engine, you need to put the game's datafiles in a -directory. The filenames must be in lowercase on *nix systems -(monkey2.000 and monkey2.001). If you use a game with speech, the file -monster.sou must reside in the same directory as the datafiles. - -For example, to run a copy of Monkey Island installed in C:\Games\LucasArts -under Windows, you would make a shortcut calling this command: - - C:\Games\LucasArts\scummvm.exe -f -pC:\Games\LucasArts\monkey\ monkey - -Under BSD, Linux, or similar, the commandline would be: - /path/to/scummvm -f -p/games/LucasArts/monkey/ monkey - -Or, if you have, for example, Full Throttle on CD, and your CD drive is D:, -and you wish to disable subtitles and run in fullscreen: - - C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ ft - /path/to/scummvm -f -n -p/mnt/cdrom/resource/ ft - -Note that if you run the game once this way, and specify the -w commandline -parameter (or edit the config file manually), ScummVM will remember the -path, and other settings for this game. Documentation on the configuration -file can be found near the end of this readme. - -The short game name you see at the end of the command line is very -important. A short list is contained at the top of this file. You can also -get the current list of games and game names at: - http://scummvm.sourceforge.net/compatibility.php - -For the adventurous, who like to live on the edge... you can download daily -builds of Win32, Redhat, Debian and other packages here: - Daily builds - http://scummvm.sourceforge.net/daily/ - - -Command Line Options: ---------------------- - - scummvm [OPTIONS] [GAME] - - [GAME] - Short name of game to load. E.g. monkey for Monkey Island. - - -p - Path to where the game is installed. Default is Cwd. - -b - Start in room . - -c - Drive to play cd audio from. E.g., 0 is first drive. - -s - Set the sfx volume, 0-255. Default is '100' - -m - Set the music volume, 0-100. Default is '60' - -t - Set music tempo. Adlib default: 0x1F0000, Midi: 0x460000 - -e - Select sound engine. See below. - -g - Select graphics scaler. See below. - -f - Full-screen mode. - -n - Disable subtitles. Use with games that have voice. - -y - Set talk speed ('yak option'). Default is '60' - -a - Enable amiga pal conversion, for playing Amiga versions - -d[] - Set debug verbosity to - -w[] - Write configuration file - -l - Load alternate configration file - -In game Hot Keys: ------------------ - Ctrl 0-9 and Shift 0-9 - load and save games - Ctrl-Alt 1-7 - cycles between graphics filters - Ctrl-z OR Alt-x - quits - Ctrl-f - runs in fast mode. - Ctrl-g - runs in really REALLY fast mode. - Ctrl-d - starts the debugger. - Ctrl-s - shows memory consumption. - [ and ] - master volume, down/up - - and + - text speed, slower / faster - F5 - displays a save/load box. - Space - pauses - Period (.) - skips current line of text in some games - Alt-Enter - toggles full screen/windowed - Enter - Left Mouse Button Press - Tab - Right Mouse Button Press - Keyboard Arrow Keys - Mouse Movement - -Note that using ctrl-f and ctrl-g are not recommended: Games can crash when -being ran faster than their normal speed, as scripts will loose syncronisation - -Graphics filters: ------------------ -ScummVM offers several anti-aliasing filters to attempt to improve visual -quality. These are the same filters used in many other emulators, such as -MAME. - -They are: - -gnormal - No filtering, original 320x200 resolution. Fastest. - -g2x - No filtering, double screen/window size to 640x400 (default) - -g3x - No filtering, triple screen/window size to 800x600 - -g2xsai - 2xsai filtering, double screen/window size to 640x400 - -gsuper2xsai - Enhanced 2xsai filtering. 640x400 screen/window size - -gsupereagle - Less blurry than 2xsai, but slower. Also 640x400 - -gadvmame2x - 640x400 scaling. Doesn't rely on blurring like 2xSAI. - -Note that filters are very slow when ScummVM is compiled in a debug -configuration without optimizations. And there is always a speed impact when -using any form of anti-aliasing/linear filtering. Also note that the FmTowns -Zak (zak256 target) uses an original resolution of 320x480 - hence for this -game scalers will be 640x480 and 960x720. - -The alternative to these scalers is to try using the SDL_gl.cpp target. This -will allow you to use hardware accelerated functions, like bilinear filtering -and FSAA, on suitable OpenGL capable cards. - -Autosaves: ----------- - -Because ScummVM is still a beta product, it -can- crash and/or hang -occasionally. As such, every five minutes it will save a game in Slot 0. This -game can be loaded via Ctrl-0, or the F5 menu. This autosaving only applies to -Scumm games, not other games (such as Simon the Sorcerer) - - -Savegames: ----------- - -Savegames are by default put in the current directory. You can specify the save -in the config file by setting the savepath parameter. See the example config -file later in this readme. - -You can also use the environment variable SCUMMVM_SAVEPATH to specify where to -put save games. Don't forget the trailing directory separator. Also be aware -that saved games can, and probably WILL, break between ScummVM releases. - -Bash (Linux) Example: - export SCUMMVM_SAVEPATH=/tmp/scummvm_savegames/ - -Windows example: - set SCUMMVM_SAVEPATH=C:\saved_games\ - - -Music and Sound: ----------------- -By default, on most operating systems, ScummVM will automatically use ADLIB -emulation. However, some games do not include Adlib music - such as Sam and -Max. Note: MIDI may not be available on all operating systems or may need -manual configuration. - -If you ARE using MIDI, you have several different choices of output, -depending on your operating system and configuration. - - -eadlib - Uses internal Adlib Emulation (default) - -ewindows - Windows MIDI. Uses built-in sequencer, for Windows users - -emidiemu - Emulated midi music, for Sam and Max (BETA - BUGGY) - -eseq - Uses /dev/sequencer for MIDI, *nix users. See below. - -eqt - Quicktime sound, for Macintosh users. - -ecore - CoreAudio sound, for MacOS X users. - -eamidi - Uses the MorphOS MIDI system, for MorphOS users - -ealsa - Output using ALSA sequencer device. See below. - -enull - Null output. Don't play any music. - - -Playing sound with Adlib emulation: ------------------------------------ -By default an Adlib card will be emulated and ScummVM will output the music -as sampled waves. This is the default mode for most games, and offers the -best compatability between machines and games. However, Sam and Max does not -include Adlib emulation. - - -Playing sound with MIDI emulation: ----------------------------------- -Until recently, some games (particually Sam and Max) were only able to run -in MIDI mode. This prevented music for these games from working on platforms -that do not support MIDI, or soundcards that do not provide MIDI drivers (eg, -many soundcards will not play MIDI under Linux). We have recently added an -'emulated MIDI' technology. It can be accessed using the 'midiemu' option, -and is the default for Sam and Max on UNIX platforms. -HOWEVER-, it is still -very buggy and the emulation is not perfect. If you are capable of using -native midi, we recommend using one of the MIDI modes below, or Adlib if -your game includes music in the appropriate format. - - -Playing sound with Native MIDI: -------------------------------- -Use the appropriate -e command line option from the list above to -select your preferred MIDI device. For example, if you wish to use the -Windows MIDI driver, use the -ewindows option. - - -Playing sound with Sequencer MIDI: [UNIX ONLY] ----------------------------------- -If your soundcard driver supports a sequencer, you may set the environment -variable "SCUMMVM_MIDI" to your sequencer device - eg, /dev/sequencer - -If you have problems with not hearing audio in this configuration, it is -possible you will need to set the "SCUMMVM_MIDIPORT" variable to 1 or 2. This -selects the port on the selected sequencer to use. Then start scummvm with the --eseq parameter. This should work on several cards, and may offer better -performance and quality than Adlib or MIDI emulation. However, for those -systems where sequencer support does not work, you can always fall back on -either of those methods. - - -Playing sound with ALSA sequencer: [UNIX ONLY] ----------------------------------- -If you have installed the ALSA driver with the sequencer support, then -set the environment variable "SCUMMVM_PORT" to your sequencer port - eg 65:0 - -Here is a little howto on how to use the ALSA sequencer with your soundcard. -In all cases, to have a list of all the sequencer ports you have, try the -command "aconnect -o -l". On my system it gives me the output: -client 64: 'External MIDI 0' [type=kernel] - 0 'MIDI 0-0 ' -client 65: 'Emu10k1 WaveTable' [type=kernel] - 0 'Emu10k1 Port 0 ' - 1 'Emu10k1 Port 1 ' - 2 'Emu10k1 Port 2 ' - 3 'Emu10k1 Port 3 ' -client 128: 'Client-128' [type=user] - 0 'TiMidity port 0 ' - 1 'TiMidity port 1 ' - -It means the external MIDI output of my sound card is located on the -port 64:0, that I've got four WaveTable MIDI outputs in 65:0, 65:1, 65:2 -and 65:3, and that I've got two TiMidity ports, located at 128:0 and 128:1. - -If you have a FM-chip on your card, like the SB16, then you have to load -the soundfonts using the sbiload software. Example: - sbiload -p 65:0 /etc/std.o3 /etc/drums.o3 - -If you have a WaveTable capable sound card, you have to load a sbk or sf2 -soundfont using the sfxload software. If you manage to do so, please mail -me since I managed to get it working only once, and never again. - -If you don't have a MIDI capable soundcard, or if you want to take -advantage of your TiMidity samples, then you can ask TiMidity to become an -alsa sequencer output. Here is a quick way to do so: - timidity -iAqqq -B2,8 -Os1S -s 44100 & - -Then the TiMidity port will be visible from the 'aconnect -o -l' list. You -should launch it beeing as root, since it will try to set up some real time -priority. - - -Using MP3 files for CD audio: ------------------------------ -Use LAME or some other mp3 encoder to rip the cd audio tracks to files. Name -the files track1.mp3 track2.mp3 etc. ScummVM must be compiled with MAD support -to use this option. You'll need to rip the file from the CD as a WAV file, -then encode the MP3 files in Constant Bit Rate sampled at 22 kHz. This can -be done with the following LAME command line: - -lame -t -q 0 -b 96 --resample 22.05 track1.wav track1.mp3 - - -Compressing MONSTER.SOU with MP3:. ---------------------------------- -You need LAME, and our extract util from the tools dir to perform this task, -and ScummVM must be compiled with MAD support. - -Make a backup file of your MONSTER.SOU before attempting this. Copy your -MONSTER.SOU file to a temporary folder. Then run: - extract monster.sou - -In about 30 minutes or so, you will have a much smaller monster.so3 file, -copy this file to your game dir. You can safely remove the monter.sou file. - - -Coding style: ------------- -For ScummVM coding, we use hugging braces, and two-space tab indents. -We occasionally run the following 'indent' parameters to ensure everything -is kept standard: - --br -bap -nbc -lp -ce -cdw -brs -nbad -nbc -npsl -nip -ts2 -ncs -nbs --npcs -nbap -Tbyte -Tvoid -Tuint32 -Tuint8 -Tuint16 -Tint -Tint8 --Tint16 -Tint32 -TArrayHeader -TMemBlkHeader -TVerbSlot -TObjectData --TImageHeader -TRoomHeader -TCodeHeader -TResHdr -TBompHeader --TMidiChannelAdl -TGui -TScumm -TSoundEngine -TPart -TPlayer - - -Configuration file: -------------------- -By default, the configuration file is saved in, and loaded from: - - Windows: \scummvm.ini, - Linux: ~/.scummvmrc - Others: scummvm.ini in the current directory - -An example config file is as follows: - - [scummvm] - gfx_mode=supereagle - fullscreen=true - savepath=C:\saves\ - - [tentacle] - path=C:\tentacle\ - nosubtitles=true - master_volume=98 - music_volume=40 - sfx_volume=255 - - [loomcd] - cdrom=1 - path=C:\loom\ - talkspeed=55 - - [monkey2] - path=C:\amiga_mi2\ - music_driver=windows - amiga=true - - - -Credits: --------- - The core ScummVM team: - James Brown - Current lead developer, ScummVM - Vincent Hamm - Developer, ScummVM (inactive) - Max Horn - Developer, ScummVM, MacOS X port, new GUI - Jeremy Newman - Webmaster - Ludvig Strigeus - Original developer, Scumm and SimonVM. (Retired) - - Porters: - Lionel Ulmer - X11/Linux port - Nicolas Bacca - PocketPC/WinCE port - Mutwin Kraus - MacOS Carbon port (Retired) - Marcus Comstedt - Dreamcast port - Ruediger Hanke - MorphOS port - - Contributors: - Claudio Matsuoka - Daily Linux/BeOS builds (http://scummvm.sf.net/daily/) - Travis Howell - Daily Win32 builds - Janne Huttunen - V3 actor mask support, Dig/FT SMUSH audio - Jeroen Janssen - Numerous readability and bugfix patches - Gregory Montoir - AdvanceMAME Scale-2X implementation - Mikesch Nepomuk - MI1 VGA Floppy patches. - Edward Rudd - Fixes for playing MP3 versions of MI1/Loom Audio - Daniel Schepler - Final MI1 CD music support - Tim 'realmz' - Initial MI1 CD music support - Jonathan 'khalek' - Expert weaver in the Loom - Nicolas Noble - Config file and ALSA support - Pawel Kolodziejski - Added missing Dig SMUSH codecs - Felix Jakschitsc - His hard work on Zak256 - Andre Souza - SDL-based OpenGL renderer - Kovacs Endre Janos - Several fixes for Simon1 - Ralph Brorsen - Helped write the new GUI - - And to all the contributors, users, and beta testers we've missed. - Thanks! - - Special thanks to: - Sander Buskens - For his work on the initial reversing of Monkey2 - Jimmi Thogersen - For ScummRev, and much obscure code/documentation - Kevin Carnes - For Scumm16, the basis of ScummVM older gfx codecs - - Aric Wilmunder, Ron Gilbert, David Fox, Vince Lee, and all those at - LucasFilm/LucasArts who made SCUMM the insane mess to reimplement - that it is today. Feel free to drop us a line and tell us what you - think, guys! - - - - ------------------------------------------------------------------------- -Good Luck and Happy Adventuring! -The ScummVM team. -http://scummvm.sourceforge.net/ ------------------------------------------------------------------------- diff --git a/resource.cpp b/resource.cpp deleted file mode 100644 index 89e825481f..0000000000 --- a/resource.cpp +++ /dev/null @@ -1,1428 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "resource.h" - -#include - - -uint16 newTag2Old(uint32 oldTag); - - -/* Open a room */ -void Scumm::openRoom(int room) -{ - int room_offs, roomlimit; - char buf[256]; - - debug(9, "openRoom(%d)", room); - - /* Don't load the same room again */ - if (_lastLoadedRoom == room) - return; - _lastLoadedRoom = room; - - /* Room -1 means close file */ - if (room == -1) { - _encbyte = 0; - deleteRoomOffsets(); - fileClose(_fileHandle); - _fileHandle = NULL; - return; - } - - /* Either xxx.lfl or monkey.xxx file name */ - while (!_resFilePrefix) { - if (_features & GF_SMALL_NAMES) - roomlimit = 98; - else - roomlimit = 900; - if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) - room_offs = 0; - else - room_offs = room ? _roomFileOffsets[room] : 0; - - if (room_offs == (int)0xFFFFFFFF) - break; - - if (room_offs != 0 && room != 0) { - _fileOffset = _roomFileOffsets[room]; - return; - } - if (!(_features & GF_SMALL_HEADER)) { - - if (_features & GF_AFTER_V7) - sprintf(buf, "%s%s.la%d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); - else if (_features & GF_HUMONGOUS) - sprintf(buf, "%s%s.he%.1d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); - else - sprintf(buf, "%s%s.%.3d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); - - _encbyte = (_features & GF_USE_KEY) ? 0x69 : 0; - } else if (!(_features & GF_SMALL_NAMES)) { - if (room == 0 || room >= 900) { - sprintf(buf, "%s%.3d.lfl", _gameDataPath, room); - _encbyte = 0; - if (openResourceFile(buf)) { - return; - } - askForDisk(buf); - - } else { - sprintf(buf, "%sdisk%.2d.lec", _gameDataPath, res.roomno[rtRoom][room]); - _encbyte = 0x69; - } - } else { - sprintf(buf, "%s%.2d.lfl", _gameDataPath, room); - if (_features & GF_OLD_BUNDLE) - _encbyte = 0xFF; - else - _encbyte = 0; - } - - if (openResourceFile(buf)) { - if (room == 0) - return; - if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) - return; - readRoomsOffsets(); - _fileOffset = _roomFileOffsets[room]; - - if (_fileOffset != 8) - return; - - error("Room %d not in %s", room, buf); - return; - } - askForDisk(buf); - } - - do { - sprintf(buf, "%.3d.lfl", room); - _encbyte = 0; - if (openResourceFile(buf)) - break; - askForDisk(buf); - } while (1); - - deleteRoomOffsets(); - _fileOffset = 0; /* start of file */ -} - -/* Delete the currently loaded room offsets */ -void Scumm::deleteRoomOffsets() -{ - if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets) - return; - - for (int i = 0; i < _maxRooms; i++) { - if (_roomFileOffsets[i] != 0xFFFFFFFF) - _roomFileOffsets[i] = 0; - } -} - -/* Read room offsets */ -void Scumm::readRoomsOffsets() -{ - int num, room; - - debug(9, "readRoomOffsets()"); - - deleteRoomOffsets(); - if (_features & GF_SMALL_NAMES) - return; - - if (!(_features & GF_SMALL_HEADER)) { - if (!_dynamicRoomOffsets) - return; - - fileSeek(_fileHandle, 16, SEEK_SET); - } else { - fileSeek(_fileHandle, 12, SEEK_SET); // Directlry searching for the room offset block would be more generic... - } - - num = fileReadByte(); - while (num) { - num--; - - room = fileReadByte(); - if (_roomFileOffsets[room] != 0xFFFFFFFF) { - _roomFileOffsets[room] = fileReadDwordLE(); - } else { - fileReadDwordLE(); - } - } -} - -bool Scumm::openResourceFile(const char *filename) -{ - char buf[256]; - - debug(9, "openResourceFile(%s)", filename); - - if (_fileHandle != NULL) { - fileClose(_fileHandle); - _fileHandle = NULL; - } - - strcpy(buf, filename); - _fileHandle = fileOpen(buf, 1); - if (!_fileHandle) { - char *e = strrchr(buf, '/'); - if (!e) - e = buf; - do - *e = tolower(*e); - while (*e++); - _fileHandle = fileOpen(buf, 1); - } - - if (!_fileHandle) { - char *e = strrchr(buf, '/'); - if (!e) - e = buf; - do - *e = toupper(*e); - while (*e++); - _fileHandle = fileOpen(buf, 1); - } - - return _fileHandle != NULL; -} - -void Scumm::askForDisk(const char *filename) -{ - error("ask Cannot find '%s'", filename); -} - -void Scumm::readIndexFile() -{ - uint32 blocktype, itemsize; - int numblock = 0; - int num, i; - - debug(9, "readIndexFile()"); - - openRoom(-1); - openRoom(0); - - if (!(_features & GF_AFTER_V6)) { - /* Figure out the sizes of various resources */ - while (!fileEof(_fileHandle)) { - blocktype = fileReadDword(); - itemsize = fileReadDwordBE(); - if (fileReadFailed(_fileHandle)) - break; - switch (blocktype) { - case MKID('DOBJ'): - _numGlobalObjects = fileReadWordLE(); - itemsize -= 2; - break; - case MKID('DROO'): - _numRooms = fileReadWordLE(); - itemsize -= 2; - break; - - case MKID('DSCR'): - _numScripts = fileReadWordLE(); - itemsize -= 2; - break; - - case MKID('DCOS'): - _numCostumes = fileReadWordLE(); - itemsize -= 2; - break; - - case MKID('DSOU'): - _numSounds = fileReadWordLE(); - itemsize -= 2; - break; - } - fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); - } - clearFileReadFailed(_fileHandle); - fileSeek(_fileHandle, 0, SEEK_SET); - } - - while (1) { - blocktype = fileReadDword(); - - if (fileReadFailed(_fileHandle)) - break; - itemsize = fileReadDwordBE(); - - numblock++; - - switch (blocktype) { - case MKID('DCHR'): - readResTypeList(rtCharset, MKID('CHAR'), "charset"); - break; - - case MKID('DOBJ'): - if (_features & GF_AFTER_V8) - num = fileReadDwordLE(); - else - num = fileReadWordLE(); - assert(num == _numGlobalObjects); - - if (_features & GF_AFTER_V8) { /* FIXME: Not sure.. */ - for (i = 0; i < num; i++) { - fileSeek(_fileHandle, 40, SEEK_CUR); - _objectStateTable[i] = fileReadByte(); - _objectRoomTable[i] = fileReadByte(); - _classData[i] = fileReadDwordLE(); - } - memset(_objectOwnerTable, 0xFF, num); - } else if (_features & GF_AFTER_V7) { - fileRead(_fileHandle, _objectStateTable, num); - fileRead(_fileHandle, _objectRoomTable, num); - memset(_objectOwnerTable, 0xFF, num); - } else { - fileRead(_fileHandle, _objectOwnerTable, num); - for (i = 0; i < num; i++) { - _objectStateTable[i] = _objectOwnerTable[i] >> OF_STATE_SHL; - _objectOwnerTable[i] &= OF_OWNER_MASK; - } - } - - if (!(_features & GF_AFTER_V8)) { - fileRead(_fileHandle, _classData, num * sizeof(uint32)); - - // Swap flag endian where applicable -#if defined(SCUMM_BIG_ENDIAN) - for (i = 0; i != num; i++) - _classData[i] = FROM_LE_32(_classData[i]); -#endif - } - break; - - case MKID('RNAM'): - case MKID('ANAM'): - fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); - break; - - case MKID('DROO'): - readResTypeList(rtRoom, MKID('ROOM'), "room"); - break; - - case MKID('DRSC'): // FIXME: Verify - readResTypeList(rtRoomScripts, MKID('RMSC'), "room script"); - break; - - case MKID('DSCR'): - readResTypeList(rtScript, MKID('SCRP'), "script"); - break; - - case MKID('DCOS'): - readResTypeList(rtCostume, MKID('COST'), "costume"); - break; - - case MKID('MAXS'): - readMAXS(); - break; - - case MKID('DSOU'): - readResTypeList(rtSound, MKID('SOUN'), "sound"); - break; - - case MKID('AARY'): - readArrayFromIndexFile(); - break; - - default: - error("Bad ID %c%c%c%c found in directory!", blocktype & 0xFF, - blocktype >> 8, blocktype >> 16, blocktype >> 24); - return; - } - } - -// if (numblock!=9) -// error("Not enough blocks read from directory"); - - openRoom(-1); -} - -void Scumm::readArrayFromIndexFile() -{ - int num; - int a, b, c; - - while ((num = fileReadWordLE()) != 0) { - a = fileReadWordLE(); - b = fileReadWordLE(); - c = fileReadWordLE(); - if (c == 1) - defineArray(num, 1, a, b); - else - defineArray(num, 5, a, b); - } -} - -void Scumm::readResTypeList(int id, uint32 tag, const char *name) -{ - int num; - int i; - - debug(9, "readResTypeList(%s,%x,%s)", resTypeFromId(id), FROM_LE_32(tag), name); - - if (_features & GF_AFTER_V8) - num = fileReadDwordLE(); - else - num = fileReadWordLE(); - - if (1 || _features & GF_AFTER_V6) { - if (num != res.num[id]) { - error("Invalid number of %ss (%d) in directory", name, num); - } - } else { - if (num >= 0xFF) { - error("Too many %ss (%d) in directory", name, num); - } - allocResTypeData(id, tag, num, name, 1); - } - - if (_features & GF_SMALL_HEADER) { - for (i = 0; i < num; i++) { - res.roomno[id][i] = fileReadByte(); - res.roomoffs[id][i] = fileReadDword(); - } - } else { - fileRead(_fileHandle, res.roomno[id], num * sizeof(uint8)); - fileRead(_fileHandle, res.roomoffs[id], num * sizeof(uint32)); - } - -#if defined(SCUMM_BIG_ENDIAN) - for (i = 0; i < num; i++) - res.roomoffs[id][i] = FROM_LE_32(res.roomoffs[id][i]); -#endif -} - - -void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, int mode) -{ - debug(9, "allocResTypeData(%s/%s,%x,%d,%d)", resTypeFromId(id), name, FROM_LE_32(tag), num, mode); - assert(id >= 0 && id < (int)(sizeof(res.mode) / sizeof(res.mode[0]))); - - if (num >= 2000) { - error("Too many %ss (%d) in directory", name, num); - } - - res.mode[id] = mode; - res.num[id] = num; - res.tags[id] = tag; - res.name[id] = name; - res.address[id] = (byte **)calloc(num, sizeof(void *)); - res.flags[id] = (byte *)calloc(num, sizeof(byte)); - - if (mode) { - res.roomno[id] = (byte *)calloc(num, sizeof(byte)); - res.roomoffs[id] = (uint32 *)calloc(num, sizeof(uint32)); - } -} - -void Scumm::loadCharset(int no) -{ - int i; - byte *ptr; - - debug(9, "loadCharset(%d)", no); - - /* FIXME - hack around crash in Indy4 (occurs if you try to load after dieing) */ - if (_gameId == GID_INDY4 && no == 0) - no = 1; - - memset(_charsetData, 0, sizeof(_charsetData)); - - assert(no < (int)sizeof(_charsetData) / 16); - checkRange(_maxCharsets - 1, 1, no, "Loading illegal charset %d"); - -// ensureResourceLoaded(6, no); - ptr = getResourceAddress(6, no); - - for (i = 0; i < 15; i++) { - _charsetData[no][i + 1] = ptr[i + 14]; - } -} - -void Scumm::nukeCharset(int i) -{ - checkRange(_maxCharsets - 1, 1, i, "Nuking illegal charset %d"); - nukeResource(rtCharset, i); -} - -void Scumm::ensureResourceLoaded(int type, int i) -{ - void *addr; - - debug(9, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); - - if (type == rtRoom && i > 127) { - i = _resourceMapper[i & 127]; - } - - if (i == 0) - return; - - addr = res.address[type][i]; - if (addr) - return; - - loadResource(type, i); - - if (!(_features & GF_AFTER_V7) && !(_features & GF_SMALL_HEADER)) - if (type == rtRoom && i == _roomResource) - _vars[VAR_ROOM_FLAG] = 1; -} - -int Scumm::loadResource(int type, int idx) -{ - int roomNr, i; - uint32 fileOffs; - uint32 size, tag; - - // debug(1, "loadResource(%s,%d)", resTypeFromId(type),idx); - - if (type == rtCharset && (_features & GF_SMALL_HEADER)) { - loadCharset(idx); - return (1); - } - - roomNr = getResourceRoomNr(type, idx); - - if (idx >= res.num[type]) - error("%s %d undefined %d %d", res.name[type], idx, res.num[type], roomNr); - - if (roomNr == 0) - roomNr = _roomResource; - - if (type == rtRoom) { - fileOffs = 0; - } else { - fileOffs = res.roomoffs[type][idx]; - if (fileOffs == 0xFFFFFFFF) - return 0; - } - - do { - for (i = 0; i < 5; i++) { - openRoom(roomNr); - - fileSeek(_fileHandle, fileOffs + _fileOffset, SEEK_SET); - - if (_features & GF_SMALL_HEADER) { - if (!(_features & GF_SMALL_NAMES)) - fileSeek(_fileHandle, 8, SEEK_CUR); - size = fileReadDwordLE(); - tag = fileReadWordLE(); - fileSeek(_fileHandle, -6, SEEK_CUR); - } else { - if (type == rtSound) { - fileReadDwordLE(); - fileReadDwordLE(); - return readSoundResource(type, idx); - } - - tag = fileReadDword(); - - if (tag != res.tags[type]) { - error("%s %d not in room %d at %d+%d", res.name[type], type, roomNr, _fileOffset, fileOffs); - } - - size = fileReadDwordBE(); - fileSeek(_fileHandle, -8, SEEK_CUR); - } - fileRead(_fileHandle, createResource(type, idx, size), size); - - /* dump the resource */ -#ifdef DUMP_SCRIPTS - if (type == rtScript) { - dumpResource("script-", idx, getResourceAddress(rtScript, idx)); - } -#endif - - if (!fileReadFailed(_fileHandle)) { - return 1; - } - - nukeResource(type, idx); - } - - error("Cannot read resource"); - } while (1); -} - -int Scumm::readSoundResource(int type, int idx) -{ - uint32 pos, total_size, size, tag, basetag; - int pri, best_pri; - uint32 best_size = 0, best_offs = 0; - - debug(9, "readSoundResource(%s,%d)", resTypeFromId(type), idx); - - pos = 0; - - basetag = fileReadDword(); - total_size = fileReadDwordBE(); - - debug(8, " basetag: %c%c%c%c, total_size=%d", - (char)((basetag >> 24) & 0xff), - (char)((basetag >> 16) & 0xff), - (char)((basetag >> 8) & 0xff), (char)(basetag & 0xff), total_size); - - //if (_gameId == GID_SAMNMAX || _features & GF_AFTER_V7) { - if (basetag == MKID('MIDI') || basetag == MKID('iMUS')) { - fileSeek(_fileHandle, -8, SEEK_CUR); - fileRead(_fileHandle, createResource(type, idx, total_size + 8), total_size + 8); - return 1; - } else if (basetag == MKID('SOU ')) { - best_pri = -1; - while (pos < total_size) { - tag = fileReadDword(); - size = fileReadDwordBE() + 8; - pos += size; - - pri = -1; - - switch (tag) { - case MKID('SBL '): - pri = 15; - break; - case MKID('ADL '): - if (_use_adlib) - pri = 10; - break; - case MKID('ROL '): - if (!_use_adlib) - pri = 2; - break; - case MKID('GMD '): - if (!_use_adlib) - pri = 3; - break; - case MKID('MAC '): - if (!_use_adlib) - pri = 1; - break; - case MKID('SPK '): - if (!_use_adlib) - pri = 0; - break; - } - - debug(8, " tag: %c%c%c%c, total_size=%d, pri=%d", - (char)((tag >> 24) & 0xff), - (char)((tag >> 16) & 0xff), (char)((tag >> 8) & 0xff), (char)(tag & 0xff), size, pri); - - - if (pri > best_pri) { - best_pri = pri; - best_size = size; - best_offs = filePos(_fileHandle); - } - - fileSeek(_fileHandle, size - 8, SEEK_CUR); - } - - if (best_pri != -1) { - fileSeek(_fileHandle, best_offs - 8, SEEK_SET); - fileRead(_fileHandle, createResource(type, idx, best_size), best_size); - return 1; - } - } else if (FROM_LE_32(basetag) == 24) { - fileSeek(_fileHandle, -12, SEEK_CUR); - total_size = fileReadDwordBE(); - fileSeek(_fileHandle, -8, SEEK_CUR); - fileRead(_fileHandle, createResource(type, idx, total_size), total_size); - return 1; - } else if (basetag == MKID('Mac0')) { - debug(1, "Found base tag Mac0 in sound %d, size %d", idx, total_size); - debug(1, "It was at position %d", filePos(_fileHandle)); - - /* Offset - 0x14, 0x1C, 0x20, 0x24 - offsets of channel 1/2/3/4 chunk- - Each channel has tag "Chan", followed by its length. At the end - of each chan follows either an empty "Done" chunk (length 0) or an - empty "Loop" chunk. Maybe "Loop" indicates the song should be - played forever?!?. - - There can be various different subchunks it seems. The - following combinations appear in Monkey Island: - 100: ORGA, TROM, BASS, - 101: ORGA, SHAK, BASS, - 103: PIPE, PIPE, PIPE, - 104: VIBE, WHIS, BASS, - 108: ORGA, MARI, BASS, - 110: ORGA, SHAK, VIBE, - 111: MARI, SHAK, BASS, - 115: PLUC, SHAK, WHIS, - One guess is that these are instrument names: Organ, Marimba, Whistle... - Maybe there is a mapping table someplace? Maybe these are even mapped to - Mac1 type "instruments" ? - - What follows are four byte "commands" it seems, like this (hex): - 01 68 4F 49 - 01 68 00 40 - 01 68 4F 49 - ... - 01 68 00 40 - 02 1C 5B 40 - 00 B4 00 40 - ... - 01 68 37 3C - 00 18 37 38 - 04 20 3E 34 - 01 68 4A 3C - - More data: - 00 09 3E 10 - 01 5F 00 40 - 00 9C 36 40 - 00 CC 00 40 - 00 18 42 49 - 00 18 45 3C - 01 29 4A 3C - 00 0F 00 40 - - Maybe I am mistaken when I think it's four byte, some other parts - seem to suggest it's 2 byte oriented, or even variable length... - */ - fileSeek(_fileHandle, -12, SEEK_CUR); - total_size = fileReadDwordBE(); - fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); - return 1; - } else if (basetag == MKID('Mac1')) { - fileSeek(_fileHandle, -12, SEEK_CUR); - total_size = fileReadDwordBE(); - fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); - return 1; - } else if (basetag == MKID('DIGI')) { - // Use in Putt-Putt Demo - debug(1, "Found base tag DIGI in sound %d, size %d", idx, total_size); - debug(1, "It was at position %d", filePos(_fileHandle)); - - fileSeek(_fileHandle, -12, SEEK_CUR); - total_size = fileReadDwordBE(); - fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); - return 1; - } else if (basetag == MKID('Crea')) { - fileSeek(_fileHandle, -12, SEEK_CUR); - total_size = fileReadDwordBE(); - fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); - return 1; - } else { - fprintf(stderr, "WARNING: Unrecognized base tag 0x%08lx in sound %d\n", basetag, idx); - } - res.roomoffs[type][idx] = 0xFFFFFFFF; - return 0; -} - -int Scumm::getResourceRoomNr(int type, int idx) -{ - if (type == rtRoom) - return idx; - return res.roomno[type][idx]; -} - -byte *Scumm::getResourceAddress(int type, int idx) -{ - byte *ptr; - - - CHECK_HEAP validateResource("getResourceAddress", type, idx); - if (!res.address[type]) { - debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); - return NULL; - } - - if (res.mode[type] && !res.address[type][idx]) { - ensureResourceLoaded(type, idx); - } - - - if (!(ptr = (byte *)res.address[type][idx])) { - debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); - return NULL; - } - - setResourceCounter(type, idx, 1); - - debug(9, "getResourceAddress(%s,%d) == %ld", resTypeFromId(type), idx, ptr + sizeof(MemBlkHeader)); - return ptr + sizeof(MemBlkHeader); -} - -byte *Scumm::getStringAddress(int i) -{ - byte *b = getResourceAddress(rtString, i); - if (!b) - return b; - - if (_features & GF_NEW_OPCODES) - return ((ArrayHeader *)b)->data; - return b; -} - - - -byte *Scumm::getStringAddressVar(int i) -{ - byte *addr; - - addr = getResourceAddress(rtString, _vars[i]); - if (addr == NULL) - error("NULL string var %d slot %d", i, _vars[i]); - - if (_features & GF_NEW_OPCODES) - return ((ArrayHeader *)addr)->data; - - return (addr); -} - -void Scumm::setResourceCounter(int type, int idx, byte flag) -{ - res.flags[type][idx] &= ~RF_USAGE; - res.flags[type][idx] |= flag; -} - -/* 2 bytes safety area to make "precaching" of bytes in the gdi drawer easier */ -#define SAFETY_AREA 2 - -byte *Scumm::createResource(int type, int idx, uint32 size) -{ - byte *ptr; - - CHECK_HEAP debug(9, "createResource(%s,%d,%d)", resTypeFromId(type), idx, size); - - validateResource("allocating", type, idx); - nukeResource(type, idx); - - expireResources(size); - - CHECK_HEAP ptr = (byte *)calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); - if (ptr == NULL) { - error("Out of memory while allocating %d", size); - } - - _allocatedSize += size; - - res.address[type][idx] = ptr; - ((MemBlkHeader *)ptr)->size = size; - setResourceCounter(type, idx, 1); - return ptr + sizeof(MemBlkHeader); /* skip header */ -} - -void Scumm::validateResource(const char *str, int type, int idx) -{ - if (type < rtFirst || type > rtLast || (uint) idx >= (uint) res.num[type]) { - warning("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); - } -} - -void Scumm::nukeResource(int type, int idx) -{ - byte *ptr; - - - CHECK_HEAP if (!res.address[type]) - return; - - assert(idx >= 0 && idx < res.num[type]); - - if ((ptr = res.address[type][idx]) != NULL) { - debug(9, "nukeResource(%s,%d)", resTypeFromId(type), idx); - res.address[type][idx] = 0; - res.flags[type][idx] = 0; - _allocatedSize -= ((MemBlkHeader *)ptr)->size; - free(ptr); - } -} - -byte *Scumm::findResourceData(uint32 tag, byte *ptr) -{ - if (_features & GF_SMALL_HEADER) { - ptr = findResourceSmall(tag, ptr, 0); - if (ptr == NULL) - return NULL; - return ptr + 6; - } - - ptr = findResource(tag, ptr, 0); - if (ptr == NULL) - return NULL; - return ptr + 8; -} - -int Scumm::getResourceDataSize(byte *ptr) -{ - if (ptr == NULL) - return 0; - - if (_features & GF_SMALL_HEADER) - return READ_LE_UINT32(ptr) - 6; - else - return READ_BE_UINT32_UNALIGNED(ptr - 4) - 8; -} - -struct FindResourceState { - uint32 size, pos; - byte *ptr; -}; - -/* just O(N) complexity when iterating with this function */ -byte *findResource(uint32 tag, byte *searchin) -{ - uint32 size; - static FindResourceState frs; - FindResourceState *f = &frs; /* easier to make it thread safe like this */ - - if (searchin) { - f->size = READ_BE_UINT32_UNALIGNED(searchin + 4); - f->pos = 8; - f->ptr = searchin + 8; - goto StartScan; - } - - do { - size = READ_BE_UINT32_UNALIGNED(f->ptr + 4); - if ((int32)size <= 0) - return NULL; - - f->pos += size; - f->ptr += size; - - StartScan: - if (f->pos >= f->size) - return NULL; - } while (READ_UINT32_UNALIGNED(f->ptr) != tag); - - return f->ptr; -} - -byte *findResourceSmall(uint32 tag, byte *searchin) -{ - uint32 size; - static FindResourceState frs; - FindResourceState *f = &frs; /* easier to make it thread safe like this */ - uint16 smallTag; - - smallTag = newTag2Old(tag); - - if (searchin) { - f->size = READ_LE_UINT32(searchin); - f->pos = 6; - f->ptr = searchin + 6; - goto StartScan; - } - - do { - size = READ_LE_UINT32(f->ptr); - if ((int32)size <= 0) - return NULL; - - f->pos += size; - f->ptr += size; - - StartScan: - if (f->pos >= f->size) - return NULL; - } while (READ_LE_UINT16(f->ptr + 4) != smallTag); - - return f->ptr; -} - -byte *findResource(uint32 tag, byte *searchin, int idx) -{ - uint32 curpos, totalsize, size; - - assert(searchin); - - searchin += 4; - totalsize = READ_BE_UINT32_UNALIGNED(searchin); - curpos = 8; - searchin += 4; - - while (curpos < totalsize) { - if (READ_UINT32_UNALIGNED(searchin) == tag && !idx--) - return searchin; - - size = READ_BE_UINT32_UNALIGNED(searchin + 4); - if ((int32)size <= 0) { - error("(%c%c%c%c) Not found in %d... illegal block len %d", - tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF, 0, size); - return NULL; - } - - curpos += size; - searchin += size; - } - - return NULL; -} - -byte *findResourceSmall(uint32 tag, byte *searchin, int idx) -{ - uint32 curpos, totalsize, size; - uint16 smallTag; - - smallTag = newTag2Old(tag); - - assert(searchin); - - totalsize = READ_LE_UINT32(searchin); - searchin += 6; - curpos = 6; - - while (curpos < totalsize) { - size = READ_LE_UINT32(searchin); - - if (READ_LE_UINT16(searchin + 4) == smallTag && !idx--) - return searchin; - - if ((int32)size <= 0) { - error("(%c%c%c%c) Not found in %d... illegal block len %d", - tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF, 0, size); - return NULL; - } - - curpos += size; - searchin += size; - } - - return NULL; -} - -void Scumm::lock(int type, int i) -{ - validateResource("Locking", type, i); - res.flags[type][i] |= RF_LOCK; - -// debug(1, "locking %d,%d", type, i); -} - -void Scumm::unlock(int type, int i) -{ - validateResource("Unlocking", type, i); - res.flags[type][i] &= ~RF_LOCK; - -// debug(1, "unlocking %d,%d", type, i); -} - -bool Scumm::isResourceInUse(int type, int i) -{ - validateResource("isResourceInUse", type, i); - switch (type) { - case rtRoom: - return _roomResource == (byte)i; - case rtScript: - return isScriptInUse(i); - case rtCostume: - return isCostumeInUse(i); - case rtSound: - return _sound->isSoundRunning(i) != 0; - default: - return false; - } -} - -void Scumm::increaseResourceCounter() -{ - int i, j; - byte counter; - - for (i = rtFirst; i <= rtLast; i++) { - for (j = res.num[i]; --j >= 0;) { - counter = res.flags[i][j] & RF_USAGE; - if (counter && counter < RF_USAGE_MAX) { - setResourceCounter(i, j, counter + 1); - } - } - } -} - -void Scumm::expireResources(uint32 size) -{ - int i, j; - byte flag; - byte best_counter; - int best_type, best_res = 0; - uint32 oldAllocatedSize; - -// return; - - if (_expire_counter != 0xFF) { - _expire_counter = 0xFF; - increaseResourceCounter(); - } - - if (size + _allocatedSize < _maxHeapThreshold) - return; - - oldAllocatedSize = _allocatedSize; - - do { - best_type = 0; - best_counter = 2; - - for (i = rtFirst; i <= rtLast; i++) - if (res.mode[i]) { - for (j = res.num[i]; --j >= 0;) { - flag = res.flags[i][j]; - if (!(flag & 0x80) && flag >= best_counter && res.address[i][j] && !isResourceInUse(i, j)) { - best_counter = flag; - best_type = i; - best_res = j; - } - } - } - - if (!best_type) - break; - nukeResource(best_type, best_res); - } while (size + _allocatedSize > _minHeapThreshold); - - increaseResourceCounter(); - - debug(5, "Expired resources, mem %d -> %d", oldAllocatedSize, _allocatedSize); -} - -void Scumm::freeResources() -{ - int i, j; - for (i = rtFirst; i <= rtLast; i++) { - for (j = res.num[i]; --j >= 0;) { - if (isResourceLoaded(i, j)) - nukeResource(i, j); - } - free(res.address[i]); - free(res.flags[i]); - free(res.roomno[i]); - free(res.roomoffs[i]); - } -} - -void Scumm::loadPtrToResource(int type, int resindex, byte *source) -{ - byte *alloced; - int i, len; - - nukeResource(type, resindex); - - len = getStringLen(source); - - if (len <= 0) - return; - - alloced = createResource(type, resindex, len); - - if (!source) { - alloced[0] = fetchScriptByte(); - for (i = 1; i < len; i++) - alloced[i] = *_scriptPointer++; - } else { - for (i = 0; i < len; i++) - alloced[i] = source[i]; - } -} - -bool Scumm::isResourceLoaded(int type, int idx) -{ - validateResource("isLoaded", type, idx); - return res.address[type][idx] != NULL; -} - -void Scumm::resourceStats() -{ - int i, j; - uint32 lockedSize = 0, lockedNum = 0; - byte flag; - - for (i = rtFirst; i <= rtLast; i++) - for (j = res.num[i]; --j >= 0;) { - flag = res.flags[i][j]; - if (flag & 0x80 && res.address[i][j]) { - lockedSize += ((MemBlkHeader *)res.address[i][j])->size; - lockedNum++; - } - } - - printf("Total allocated size=%ld, locked=%ld(%ld)\n", _allocatedSize, lockedSize, lockedNum); -} - -void Scumm::heapClear(int mode) -{ -} - -void Scumm::unkHeapProc2(int a, int b) -{ -} - -void Scumm::readMAXS() -{ - if (_features & GF_AFTER_V8) { - fileSeek(_fileHandle, 50 + 50, SEEK_CUR); - _numVariables = fileReadDwordLE(); /* ? 1500 */ - _numBitVariables = fileReadDwordLE(); /* ? 2048 */ - fileReadDwordLE(); /* 40 */ - _numScripts = fileReadDwordLE(); - _numSounds = fileReadDwordLE(); - _numCharsets = fileReadDwordLE(); - _numCostumes = fileReadDwordLE(); - _numRooms = fileReadDwordLE(); - _numInventory = fileReadDwordLE(); - _numGlobalObjects = fileReadDwordLE(); - _numFlObject = fileReadDwordLE(); - _numLocalObjects = fileReadDwordLE(); - _numVerbs = fileReadDwordLE(); - _numNewNames = fileReadDwordLE(); - fileReadDwordLE(); - fileReadDwordLE(); - _numArray = fileReadDwordLE(); - - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - _numGlobalScripts = 2000; - - _shadowPaletteSize = NUM_SHADOW_PALETTE * 256; - } else if (_features & GF_AFTER_V7) { - fileSeek(_fileHandle, 50 + 50, SEEK_CUR); - _numVariables = fileReadWordLE(); - _numBitVariables = fileReadWordLE(); - fileReadWordLE(); - _numGlobalObjects = fileReadWordLE(); - _numLocalObjects = fileReadWordLE(); - _numNewNames = fileReadWordLE(); - _numVerbs = fileReadWordLE(); - _numFlObject = fileReadWordLE(); - _numInventory = fileReadWordLE(); - _numArray = fileReadWordLE(); - _numRooms = fileReadWordLE(); - _numScripts = fileReadWordLE(); - _numSounds = fileReadWordLE(); - _numCharsets = fileReadWordLE(); - _numCostumes = fileReadWordLE(); - - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - _numGlobalScripts = 2000; - - _shadowPaletteSize = NUM_SHADOW_PALETTE * 256; - } else if (_features & GF_AFTER_V6) { - _numVariables = fileReadWordLE(); - fileReadWordLE(); - _numBitVariables = fileReadWordLE(); - _numLocalObjects = fileReadWordLE(); - _numArray = fileReadWordLE(); - fileReadWordLE(); - _numVerbs = fileReadWordLE(); - _numFlObject = fileReadWordLE(); - _numInventory = fileReadWordLE(); - _numRooms = fileReadWordLE(); - _numScripts = fileReadWordLE(); - _numSounds = fileReadWordLE(); - _numCharsets = fileReadWordLE(); - _numCostumes = fileReadWordLE(); - _numGlobalObjects = fileReadWordLE(); - _numNewNames = 50; - - _objectRoomTable = NULL; - _numGlobalScripts = 200; - - _shadowPaletteSize = 256; - } else { - _numVariables = fileReadWordLE(); /* 800 */ - fileReadWordLE(); /* 16 */ - _numBitVariables = fileReadWordLE(); /* 2048 */ - _numLocalObjects = fileReadWordLE(); /* 200 */ - _numArray = 50; - _numVerbs = 100; - _numNewNames = 0; - _objectRoomTable = NULL; - - fileReadWordLE(); /* 50 */ - _numCharsets = fileReadWordLE(); /* 9 */ - fileReadWordLE(); /* 100 */ - fileReadWordLE(); /* 50 */ - _numInventory = fileReadWordLE(); /* 80 */ - _numGlobalScripts = 200; - - _shadowPaletteSize = 256; - - _numFlObject = 50; - } - - if (_shadowPaletteSize) - _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); - - allocateArrays(); - _dynamicRoomOffsets = 1; -} - -void Scumm::allocateArrays() -{ - // Note: Buffers are now allocated in scummMain to allow for - // early GUI init. - - _objectOwnerTable = (byte *)calloc(_numGlobalObjects, 1); - _objectStateTable = (byte *)calloc(_numGlobalObjects, 1); - _classData = (uint32 *)calloc(_numGlobalObjects, sizeof(uint32)); - _arrays = (byte *)calloc(_numArray, 1); - _newNames = (uint16 *)calloc(_numNewNames, sizeof(uint16)); - - _inventory = (uint16 *)calloc(_numInventory, sizeof(uint16)); - _verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot)); - _objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData)); - _vars = (int16 *)calloc(_numVariables, sizeof(int16)); - _bitVars = (byte *)calloc(_numBitVariables >> 3, 1); - - allocResTypeData(rtCostume, - (_features & GF_NEW_COSTUMES) ? MKID('AKOS') : - MKID('COST'), _numCostumes, "costume", 1); - - allocResTypeData(rtRoom, MKID('ROOM'), _numRooms, "room", 1); - allocResTypeData(rtRoomScripts, MKID('RMSC'), _numRooms, "room script", 1); - allocResTypeData(rtSound, MKID('SOUN'), _numSounds, "sound", 1); - allocResTypeData(rtScript, MKID('SCRP'), _numScripts, "script", 1); - allocResTypeData(rtCharset, MKID('CHAR'), _numCharsets, "charset", 1); - allocResTypeData(rtObjectName, MKID('NONE'), _numNewNames, "new name", 0); - allocResTypeData(rtInventory, MKID('NONE'), _numInventory, "inventory", 0); - allocResTypeData(rtTemp, MKID('NONE'), 10, "temp", 0); - allocResTypeData(rtScaleTable, MKID('NONE'), 5, "scale table", 0); - allocResTypeData(rtActorName, MKID('NONE'), NUM_ACTORS, "actor name", 0); - allocResTypeData(rtVerb, MKID('NONE'), _numVerbs, "verb", 0); - allocResTypeData(rtString, MKID('NONE'), _numArray, "array", 0); - allocResTypeData(rtFlObject, MKID('NONE'), _numFlObject, "flobject", 0); - allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0); -} - - - - -bool Scumm::isGlobInMemory(int type, int idx) -{ - validateResource("isGlobInMemory", type, idx); - - return res.address[type][idx] != NULL; -} - - -uint16 newTag2Old(uint32 oldTag) -{ - switch (oldTag) { - case (MKID('RMHD')): - return (0x4448); // HD - break; - case (MKID('IM00')): - return (0x4D42); // BM - break; - case (MKID('EXCD')): - return (0x5845); // EX - break; - case (MKID('ENCD')): - return (0x4E45); // EN - break; - case (MKID('SCAL')): - return (0x4153); // SA - break; - case (MKID('LSCR')): - return (0x534C); // LS - break; - case (MKID('OBCD')): - return (0x434F); // OC - break; - case (MKID('OBIM')): - return (0x494F); // OI - break; - case (MKID('SMAP')): - return (0x4D42); // BM - break; - case (MKID('CLUT')): - return (0x4150); // PA - break; - case (MKID('BOXD')): - return (0x5842); // BX - break; - default: - return (0); - } -} - - -char *Scumm::resTypeFromId(int id) -{ - static char buf[100]; - - switch (id) { - case rtRoom: - sprintf(buf, "Room"); - break; - case rtScript: - sprintf(buf, "Script"); - break; - case rtCostume: - sprintf(buf, "Costume"); - break; - case rtSound: - sprintf(buf, "Sound"); - break; - case rtInventory: - sprintf(buf, "Inventory"); - break; - case rtCharset: - sprintf(buf, "Charset"); - break; - case rtString: - sprintf(buf, "String"); - break; - case rtVerb: - sprintf(buf, "Verb"); - break; - case rtActorName: - sprintf(buf, "ActorName"); - break; - case rtBuffer: - sprintf(buf, "Buffer"); - break; - case rtScaleTable: - sprintf(buf, "ScaleTable"); - break; - case rtTemp: - sprintf(buf, "Temp"); - break; - case rtFlObject: - sprintf(buf, "FlObject"); - break; - case rtMatrix: - sprintf(buf, "Matrix"); - break; - case rtBox: - sprintf(buf, "Box"); - break; - case rtLast: - sprintf(buf, "Last"); - break; - case rtNumTypes: - sprintf(buf, "NumTypes"); - break; - default: - sprintf(buf, "%d", id); - } - return buf; -} diff --git a/resource.h b/resource.h deleted file mode 100644 index 0628189cb2..0000000000 --- a/resource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef RESOURCE_H -#define RESOURCE_H - -#if !defined(__GNUC__) - #pragma START_PACK_STRUCTS -#endif - -struct ResHdr { - uint32 tag, size; -} GCC_PACK; - -#if !defined(__GNUC__) - #pragma END_PACK_STRUCTS -#endif - -#define RES_DATA(x) (((byte*)x) + sizeof(ResHdr)) -#define RES_SIZE(x) (READ_BE_UINT32_UNALIGNED(&((ResHdr* )x)->size)) - -enum { - OF_OWNER_MASK = 0x0F, - OF_STATE_MASK = 0xF0, - - OF_STATE_SHL = 4 -}; - -enum { - RF_LOCK = 0x80, - RF_USAGE = 0x7F, - RF_USAGE_MAX = RF_USAGE -}; - - -byte *findResource(uint32 tag, byte *searchin, int index); -byte *findResourceSmall(uint32 tag, byte *searchin, int index); -byte *findResource(uint32 tag, byte *searchin); -byte *findResourceSmall(uint32 tag, byte *searchin); - -#endif diff --git a/saveload.cpp b/saveload.cpp deleted file mode 100644 index 16200bee9a..0000000000 --- a/saveload.cpp +++ /dev/null @@ -1,891 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "sound/mididrv.h" -#include "sound/imuse.h" -#include "actor.h" -#include "config-file.h" -#include "resource.h" -#include "saveload.h" - -struct SaveGameHeader { - uint32 type; - uint32 size; - uint32 ver; - char name[32]; -}; - -// Support for "old" savegames (made with 2501 CVS build) -// Can be useful for other ports too :) - -#define VER_V9 9 -#define VER_V8 8 -#define VER_V7 7 - -#define CURRENT_VER VER_V9 - -static uint32 _current_version = CURRENT_VER; - -bool Scumm::saveState(int slot, bool compat) -{ - char filename[256]; - SerializerStream out; - SaveGameHeader hdr; - Serializer ser; - - makeSavegameName(filename, slot, compat); - - if (!out.fopen(filename, "wb")) - return false; - - memcpy(hdr.name, _saveLoadName, sizeof(hdr.name)); - - hdr.type = MKID('SCVM'); - hdr.size = 0; - hdr.ver = TO_LE_32(_current_version); - - out.fwrite(&hdr, sizeof(hdr), 1); - - ser._saveLoadStream = out; - ser._saveOrLoad = true; - saveOrLoad(&ser); - - out.fclose(); - debug(1, "State saved as '%s'", filename); - return true; -} - -bool Scumm::loadState(int slot, bool compat) -{ - char filename[256]; - SerializerStream out; - int i, j; - SaveGameHeader hdr; - Serializer ser; - int sb, sh; - - makeSavegameName(filename, slot, compat); - if (!out.fopen(filename, "rb")) - return false; - - out.fread(&hdr, sizeof(hdr), 1); - if (hdr.type != MKID('SCVM')) { - warning("Invalid savegame '%s'", filename); - out.fclose(); - return false; - } - - if (hdr.ver < VER_V7 || hdr.ver > _current_version) - hdr.ver = TO_LE_32(hdr.ver); - if (hdr.ver < VER_V7 || hdr.ver > _current_version) - { - warning("Invalid version of '%s'", filename); - out.fclose(); - return false; - } - - _current_version = hdr.ver; - memcpy(_saveLoadName, hdr.name, sizeof(hdr.name)); - - _sound->pauseSounds(true); - - CHECK_HEAP openRoom(-1); - memset(_inventory, 0, sizeof(_inventory[0]) * _numInventory); - - /* Nuke all resources */ - for (i = rtFirst; i <= rtLast; i++) - if (i != rtTemp && i != rtBuffer) - for (j = 0; j < res.num[i]; j++) { - nukeResource(i, j); - res.flags[i][j] = 0; - } - - initScummVars(); - - ser._saveLoadStream = out; - ser._saveOrLoad = false; - saveOrLoad(&ser); - out.fclose(); - - sb = _screenB; - sh = _screenH; - - gdi._mask_left = -1; - - initScreens(0, 0, 320, 200); - - // Force a fade to black - int old_screenEffectFlag = _screenEffectFlag; - _screenEffectFlag = true; - fadeOut(129); - _screenEffectFlag = old_screenEffectFlag; - - initScreens(0, sb, 320, sh); - - _completeScreenRedraw = true; - setDirtyColors(0, 255); - - _lastCodePtr = NULL; - - _drawObjectQueNr = 0; - _verbMouseOver = 0; - - if (_features & GF_AFTER_V7) - cameraMoved(); - - initBGBuffers(_scrHeight); - - CHECK_HEAP debug(1, "State loaded from '%s'", filename); - - - _sound->pauseSounds(false); - - return true; -} - -void Scumm::makeSavegameName(char *out, int slot, bool compatible) -{ - const char *dir = getSavePath(); - - // snprintf should be used here, but it's not portable enough - sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c' : 's', slot); -} - -bool Scumm::getSavegameName(int slot, char *desc) -{ - char filename[256]; - SerializerStream out; - SaveGameHeader hdr; - int len; - - makeSavegameName(filename, slot, false); - if (!out.fopen(filename, "rb")) { - strcpy(desc, ""); - return false; - } - len = out.fread(&hdr, sizeof(hdr), 1); - out.fclose(); - - if (len != 1 || hdr.type != MKID('SCVM')) { - strcpy(desc, "Invalid savegame"); - return false; - } - - if (hdr.ver < VER_V7 || hdr.ver > _current_version) - hdr.ver = TO_LE_32(hdr.ver); - if (hdr.ver < VER_V7 || hdr.ver > _current_version) { - strcpy(desc, "Invalid version"); - return false; - } - - memcpy(desc, hdr.name, sizeof(hdr.name)); - desc[sizeof(hdr.name) - 1] = 0; - return true; -} - -#define OFFS(type,item) ((int)(&((type*)0)->item)) -#define SIZE(type,item) sizeof(((type*)0)->item) -#define MKLINE(type,item,saveas) {OFFS(type,item),saveas,SIZE(type,item)} -#define MKARRAY(type,item,saveas,num) {OFFS(type,item),128|saveas,SIZE(type,item)}, {num,0,0} -#define MKEND() {0xFFFF,0xFF,0xFF} - -void Scumm::saveOrLoad(Serializer *s) -{ - const SaveLoadEntry objectEntries[] = { - MKLINE(ObjectData, offs_obim_to_room, sleUint32), - MKLINE(ObjectData, offs_obcd_to_room, sleUint32), - MKLINE(ObjectData, walk_x, sleUint16), - MKLINE(ObjectData, walk_y, sleUint16), - MKLINE(ObjectData, obj_nr, sleUint16), - MKLINE(ObjectData, x_pos, sleInt16), - MKLINE(ObjectData, y_pos, sleInt16), - MKLINE(ObjectData, width, sleUint16), - MKLINE(ObjectData, height, sleUint16), - MKLINE(ObjectData, actordir, sleByte), - MKLINE(ObjectData, parentstate, sleByte), - MKLINE(ObjectData, parent, sleByte), - MKLINE(ObjectData, state, sleByte), - MKLINE(ObjectData, fl_object_index, sleByte), - MKEND() - }; - - const SaveLoadEntry actorEntries[] = { - MKLINE(Actor, x, sleInt16), - MKLINE(Actor, y, sleInt16), - MKLINE(Actor, top, sleInt16), - MKLINE(Actor, bottom, sleInt16), - MKLINE(Actor, elevation, sleInt16), - MKLINE(Actor, width, sleUint16), - MKLINE(Actor, facing, sleUint16), - MKLINE(Actor, costume, sleUint16), - MKLINE(Actor, room, sleByte), - MKLINE(Actor, talkColor, sleByte), - MKLINE(Actor, scalex, sleByte), - MKLINE(Actor, scaley, sleByte), - MKLINE(Actor, charset, sleByte), - MKARRAY(Actor, sound[0], sleByte, 8), - MKARRAY(Actor, animVariable[0], sleUint16, 8), - MKLINE(Actor, newDirection, sleUint16), - MKLINE(Actor, moving, sleByte), - MKLINE(Actor, ignoreBoxes, sleByte), - MKLINE(Actor, forceClip, sleByte), - MKLINE(Actor, initFrame, sleByte), - MKLINE(Actor, walkFrame, sleByte), - MKLINE(Actor, standFrame, sleByte), - MKLINE(Actor, talkFrame1, sleByte), - MKLINE(Actor, talkFrame2, sleByte), - MKLINE(Actor, speedx, sleUint16), - MKLINE(Actor, speedy, sleUint16), - MKLINE(Actor, cost.animCounter1, sleUint16), - MKLINE(Actor, cost.animCounter2, sleByte), - MKARRAY(Actor, palette[0], sleByte, 64), - MKLINE(Actor, mask, sleByte), - MKLINE(Actor, shadow_mode, sleByte), - MKLINE(Actor, visible, sleByte), - MKLINE(Actor, frame, sleByte), - MKLINE(Actor, animSpeed, sleByte), - MKLINE(Actor, animProgress, sleByte), - MKLINE(Actor, walkbox, sleByte), - MKLINE(Actor, needRedraw, sleByte), - MKLINE(Actor, needBgReset, sleByte), - MKLINE(Actor, costumeNeedsInit, sleByte), - - MKLINE(Actor, new_1, sleInt16), - MKLINE(Actor, new_2, sleInt16), - MKLINE(Actor, new_3, sleByte), - - MKLINE(Actor, layer, sleByte), - - MKLINE(Actor, talk_script, sleUint16), - MKLINE(Actor, walk_script, sleUint16), - - MKLINE(Actor, walkdata.destx, sleInt16), - MKLINE(Actor, walkdata.desty, sleInt16), - MKLINE(Actor, walkdata.destbox, sleByte), - MKLINE(Actor, walkdata.destdir, sleUint16), - MKLINE(Actor, walkdata.curbox, sleByte), - MKLINE(Actor, walkdata.x, sleInt16), - MKLINE(Actor, walkdata.y, sleInt16), - MKLINE(Actor, walkdata.newx, sleInt16), - MKLINE(Actor, walkdata.newy, sleInt16), - MKLINE(Actor, walkdata.XYFactor, sleInt32), - MKLINE(Actor, walkdata.YXFactor, sleInt32), - MKLINE(Actor, walkdata.xfrac, sleUint16), - MKLINE(Actor, walkdata.yfrac, sleUint16), - - MKARRAY(Actor, cost.active[0], sleByte, 16), - MKLINE(Actor, cost.stopped, sleUint16), - MKARRAY(Actor, cost.curpos[0], sleUint16, 16), - MKARRAY(Actor, cost.start[0], sleUint16, 16), - MKARRAY(Actor, cost.end[0], sleUint16, 16), - MKARRAY(Actor, cost.frame[0], sleUint16, 16), - MKEND() - }; - - const SaveLoadEntry verbEntries[] = { - MKLINE(VerbSlot, x, sleInt16), - MKLINE(VerbSlot, y, sleInt16), - MKLINE(VerbSlot, right, sleInt16), - MKLINE(VerbSlot, bottom, sleInt16), - MKLINE(VerbSlot, oldleft, sleInt16), - MKLINE(VerbSlot, oldtop, sleInt16), - MKLINE(VerbSlot, oldright, sleInt16), - MKLINE(VerbSlot, oldbottom, sleInt16), - MKLINE(VerbSlot, verbid, sleByte), - MKLINE(VerbSlot, color, sleByte), - MKLINE(VerbSlot, hicolor, sleByte), - MKLINE(VerbSlot, dimcolor, sleByte), - MKLINE(VerbSlot, bkcolor, sleByte), - MKLINE(VerbSlot, type, sleByte), - MKLINE(VerbSlot, charset_nr, sleByte), - MKLINE(VerbSlot, curmode, sleByte), - MKLINE(VerbSlot, saveid, sleByte), - MKLINE(VerbSlot, key, sleByte), - MKLINE(VerbSlot, center, sleByte), - MKLINE(VerbSlot, field_1B, sleByte), - MKLINE(VerbSlot, imgindex, sleUint16), - MKEND() - }; - - const SaveLoadEntry mainEntriesV9[] = { - MKLINE(Scumm, _scrWidth, sleUint16), - MKLINE(Scumm, _scrHeight, sleUint16), - MKLINE(Scumm, _ENCD_offs, sleUint32), - MKLINE(Scumm, _EXCD_offs, sleUint32), - MKLINE(Scumm, _IM00_offs, sleUint32), - MKLINE(Scumm, _CLUT_offs, sleUint32), - MKLINE(Scumm, _EPAL_offs, sleUint32), - MKLINE(Scumm, _PALS_offs, sleUint32), - MKLINE(Scumm, _curPalIndex, sleByte), - MKLINE(Scumm, _currentRoom, sleByte), - MKLINE(Scumm, _roomResource, sleByte), - MKLINE(Scumm, _numObjectsInRoom, sleByte), - MKLINE(Scumm, _currentScript, sleByte), - MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT), - MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17), - MKARRAY(Scumm, _resourceMapper[0], sleByte, 128), - MKARRAY(Scumm, charset._colorMap[0], sleByte, 16), - MKARRAY(Scumm, _charsetData[0][0], sleByte, 10 * 16), - MKLINE(Scumm, _curExecScript, sleUint16), - - MKLINE(Scumm, camera._dest.x, sleInt16), - MKLINE(Scumm, camera._dest.y, sleInt16), - MKLINE(Scumm, camera._cur.x, sleInt16), - MKLINE(Scumm, camera._cur.y, sleInt16), - MKLINE(Scumm, camera._last.x, sleInt16), - MKLINE(Scumm, camera._last.y, sleInt16), - MKLINE(Scumm, camera._accel.x, sleInt16), - MKLINE(Scumm, camera._accel.y, sleInt16), - MKLINE(Scumm, _screenStartStrip, sleInt16), - MKLINE(Scumm, _screenEndStrip, sleInt16), - MKLINE(Scumm, camera._mode, sleByte), - MKLINE(Scumm, camera._follows, sleByte), - MKLINE(Scumm, camera._leftTrigger, sleInt16), - MKLINE(Scumm, camera._rightTrigger, sleInt16), - MKLINE(Scumm, camera._movingToActor, sleUint16), - - MKLINE(Scumm, _actorToPrintStrFor, sleByte), - MKLINE(Scumm, _charsetColor, sleByte), - /* XXX Convert into word next time format changes */ - MKLINE(Scumm, charset._bufPos, sleByte), - MKLINE(Scumm, _haveMsg, sleByte), - MKLINE(Scumm, _useTalkAnims, sleByte), - - MKLINE(Scumm, _talkDelay, sleInt16), - MKLINE(Scumm, _defaultTalkDelay, sleInt16), - MKLINE(Scumm, _numInMsgStack, sleInt16), - MKLINE(Scumm, _sentenceNum, sleByte), - - MKLINE(Scumm, vm.cutSceneStackPointer, sleByte), - MKARRAY(Scumm, vm.cutScenePtr[0], sleUint32, 5), - MKARRAY(Scumm, vm.cutSceneScript[0], sleByte, 5), - MKARRAY(Scumm, vm.cutSceneData[0], sleInt16, 5), - MKLINE(Scumm, vm.cutSceneScriptIndex, sleInt16), - - /* nest */ - MKLINE(Scumm, _numNestedScripts, sleByte), - MKLINE(Scumm, _userPut, sleByte), - MKLINE(Scumm, _cursorState, sleByte), - MKLINE(Scumm, gdi._cursorActive, sleByte), - MKLINE(Scumm, gdi._currentCursor, sleByte), - - MKLINE(Scumm, _doEffect, sleByte), - MKLINE(Scumm, _switchRoomEffect, sleByte), - MKLINE(Scumm, _newEffect, sleByte), - MKLINE(Scumm, _switchRoomEffect2, sleByte), - MKLINE(Scumm, _BgNeedsRedraw, sleByte), - - MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 200), - MKLINE(Scumm, gdi._transparency, sleByte), - MKARRAY(Scumm, _currentPalette[0], sleByte, 768), - - MKARRAY(Scumm, _proc_special_palette[0], sleByte, 256), - /* virtscr */ - - MKARRAY(Scumm, charset._buffer[0], sleByte, 256), - - MKLINE(Scumm, _egoPositioned, sleByte), - - MKARRAY(Scumm, gdi._imgBufOffs[0], sleUint16, 4), - MKLINE(Scumm, gdi._numZBuffer, sleByte), - - MKLINE(Scumm, _screenEffectFlag, sleByte), - - MKLINE(Scumm, _randSeed1, sleUint32), - MKLINE(Scumm, _randSeed2, sleUint32), - - /* XXX: next time the save game format changes, - * convert _shakeEnabled to boolean and add a _shakeFrame field */ - MKLINE(Scumm, _shakeEnabled, sleInt16), - - MKLINE(Scumm, _keepText, sleByte), - - MKLINE(Scumm, _screenB, sleUint16), - MKLINE(Scumm, _screenH, sleUint16), - - MKLINE(Scumm, _cd_track, sleInt16), - MKLINE(Scumm, _cd_loops, sleInt16), - MKLINE(Scumm, _cd_frame, sleInt16), - MKLINE(Scumm, _cd_end, sleInt16), - - MKEND() - }; - - const SaveLoadEntry mainEntriesV8[] = { - MKLINE(Scumm, _scrWidth, sleUint16), - MKLINE(Scumm, _scrHeight, sleUint16), - MKLINE(Scumm, _ENCD_offs, sleUint32), - MKLINE(Scumm, _EXCD_offs, sleUint32), - MKLINE(Scumm, _IM00_offs, sleUint32), - MKLINE(Scumm, _CLUT_offs, sleUint32), - MKLINE(Scumm, _EPAL_offs, sleUint32), - MKLINE(Scumm, _PALS_offs, sleUint32), - MKLINE(Scumm, _curPalIndex, sleByte), - MKLINE(Scumm, _currentRoom, sleByte), - MKLINE(Scumm, _roomResource, sleByte), - MKLINE(Scumm, _numObjectsInRoom, sleByte), - MKLINE(Scumm, _currentScript, sleByte), - MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT), - MKARRAY(Scumm, vm.localvar[0][0], sleUint16, 25 * 17), - MKARRAY(Scumm, _resourceMapper[0], sleByte, 128), - MKARRAY(Scumm, charset._colorMap[0], sleByte, 16), - MKARRAY(Scumm, _charsetData[0][0], sleByte, 10 * 16), - MKLINE(Scumm, _curExecScript, sleUint16), - - MKLINE(Scumm, camera._dest.x, sleInt16), - MKLINE(Scumm, camera._dest.y, sleInt16), - MKLINE(Scumm, camera._cur.x, sleInt16), - MKLINE(Scumm, camera._cur.y, sleInt16), - MKLINE(Scumm, camera._last.x, sleInt16), - MKLINE(Scumm, camera._last.y, sleInt16), - MKLINE(Scumm, camera._accel.x, sleInt16), - MKLINE(Scumm, camera._accel.y, sleInt16), - MKLINE(Scumm, _screenStartStrip, sleInt16), - MKLINE(Scumm, _screenEndStrip, sleInt16), - MKLINE(Scumm, camera._mode, sleByte), - MKLINE(Scumm, camera._follows, sleByte), - MKLINE(Scumm, camera._leftTrigger, sleInt16), - MKLINE(Scumm, camera._rightTrigger, sleInt16), - MKLINE(Scumm, camera._movingToActor, sleUint16), - - MKLINE(Scumm, _actorToPrintStrFor, sleByte), - MKLINE(Scumm, _charsetColor, sleByte), - /* XXX Convert into word next time format changes */ - MKLINE(Scumm, charset._bufPos, sleByte), - MKLINE(Scumm, _haveMsg, sleByte), - MKLINE(Scumm, _useTalkAnims, sleByte), - - MKLINE(Scumm, _talkDelay, sleInt16), - MKLINE(Scumm, _defaultTalkDelay, sleInt16), - MKLINE(Scumm, _numInMsgStack, sleInt16), - MKLINE(Scumm, _sentenceNum, sleByte), - - MKLINE(Scumm, vm.cutSceneStackPointer, sleByte), - MKARRAY(Scumm, vm.cutScenePtr[0], sleUint32, 5), - MKARRAY(Scumm, vm.cutSceneScript[0], sleByte, 5), - MKARRAY(Scumm, vm.cutSceneData[0], sleInt16, 5), - MKLINE(Scumm, vm.cutSceneScriptIndex, sleInt16), - - /* nest */ - MKLINE(Scumm, _numNestedScripts, sleByte), - MKLINE(Scumm, _userPut, sleByte), - MKLINE(Scumm, _cursorState, sleByte), - MKLINE(Scumm, gdi._cursorActive, sleByte), - MKLINE(Scumm, gdi._currentCursor, sleByte), - - MKLINE(Scumm, _doEffect, sleByte), - MKLINE(Scumm, _switchRoomEffect, sleByte), - MKLINE(Scumm, _newEffect, sleByte), - MKLINE(Scumm, _switchRoomEffect2, sleByte), - MKLINE(Scumm, _BgNeedsRedraw, sleByte), - - MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 200), - MKLINE(Scumm, gdi._transparency, sleByte), - MKARRAY(Scumm, _currentPalette[0], sleByte, 768), - - MKARRAY(Scumm, _proc_special_palette[0], sleByte, 256), - /* virtscr */ - - MKARRAY(Scumm, charset._buffer[0], sleByte, 256), - - MKLINE(Scumm, _egoPositioned, sleByte), - - MKARRAY(Scumm, gdi._imgBufOffs[0], sleUint16, 4), - MKLINE(Scumm, gdi._numZBuffer, sleByte), - - MKLINE(Scumm, _screenEffectFlag, sleByte), - - MKLINE(Scumm, _randSeed1, sleUint32), - MKLINE(Scumm, _randSeed2, sleUint32), - - /* XXX: next time the save game format changes, - * convert _shakeEnabled to boolean and add a _shakeFrame field */ - MKLINE(Scumm, _shakeEnabled, sleInt16), - - MKLINE(Scumm, _keepText, sleByte), - - MKLINE(Scumm, _screenB, sleUint16), - MKLINE(Scumm, _screenH, sleUint16), - - MKEND() - }; - - const SaveLoadEntry scriptSlotEntries[] = { - MKLINE(ScriptSlot, offs, sleUint32), - MKLINE(ScriptSlot, delay, sleInt32), - MKLINE(ScriptSlot, number, sleUint16), - MKLINE(ScriptSlot, newfield, sleUint16), - MKLINE(ScriptSlot, status, sleByte), - MKLINE(ScriptSlot, where, sleByte), - MKLINE(ScriptSlot, unk1, sleByte), - MKLINE(ScriptSlot, unk2, sleByte), - MKLINE(ScriptSlot, freezeCount, sleByte), - MKLINE(ScriptSlot, didexec, sleByte), - MKLINE(ScriptSlot, cutsceneOverride, sleByte), - MKLINE(ScriptSlot, unk5, sleByte), - MKEND() - }; - - const SaveLoadEntry nestedScriptEntries[] = { - MKLINE(NestedScript, number, sleUint16), - MKLINE(NestedScript, where, sleByte), - MKLINE(NestedScript, slot, sleByte), - MKEND() - }; - - const SaveLoadEntry sentenceTabEntries[] = { - MKLINE(SentenceTab, unk5, sleUint8), - MKLINE(SentenceTab, unk2, sleUint8), - MKLINE(SentenceTab, unk4, sleUint16), - MKLINE(SentenceTab, unk3, sleUint16), - MKLINE(SentenceTab, unk, sleUint8), - MKEND() - }; - - const SaveLoadEntry stringTabEntries[] = { - MKLINE(StringTab, xpos, sleInt16), - MKLINE(StringTab, t_xpos, sleInt16), - MKLINE(StringTab, ypos, sleInt16), - MKLINE(StringTab, t_ypos, sleInt16), - MKLINE(StringTab, right, sleInt16), - MKLINE(StringTab, t_right, sleInt16), - MKLINE(StringTab, color, sleInt8), - MKLINE(StringTab, t_color, sleInt8), - MKLINE(StringTab, charset, sleInt8), - MKLINE(StringTab, t_charset, sleInt8), - MKLINE(StringTab, center, sleByte), - MKLINE(StringTab, t_center, sleByte), - MKLINE(StringTab, overhead, sleByte), - MKLINE(StringTab, t_overhead, sleByte), - MKLINE(StringTab, no_talk_anim, sleByte), - MKLINE(StringTab, t_no_talk_anim, sleByte), - MKEND() - }; - - const SaveLoadEntry colorCycleEntries[] = { - MKLINE(ColorCycle, delay, sleUint16), - MKLINE(ColorCycle, counter, sleUint16), - MKLINE(ColorCycle, flags, sleUint16), - MKLINE(ColorCycle, start, sleByte), - MKLINE(ColorCycle, end, sleByte), - MKEND() - }; - - int i, j; - int var120Backup; - int var98Backup; - - if (_mixer && !s->isSaving()) - _mixer->stop_all(); - - if (_current_version == VER_V9) - s->saveLoadEntries(this, mainEntriesV9); - else - s->saveLoadEntries(this, mainEntriesV8); - - s->saveLoadArrayOf(_actors, NUM_ACTORS, sizeof(_actors[0]), actorEntries); - - if (_current_version < VER_V9) - s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries); - else - s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries); - s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]), objectEntries); - s->saveLoadArrayOf(_verbs, _numVerbs, sizeof(_verbs[0]), verbEntries); - s->saveLoadArrayOf(vm.nest, 16, sizeof(vm.nest[0]), nestedScriptEntries); - s->saveLoadArrayOf(sentence, 6, sizeof(sentence[0]), sentenceTabEntries); - s->saveLoadArrayOf(string, 6, sizeof(string[0]), stringTabEntries); - s->saveLoadArrayOf(_colorCycle, 16, sizeof(_colorCycle[0]), colorCycleEntries); - - for (i = rtFirst; i <= rtLast; i++) - if (res.mode[i] == 0) - for (j = 1; j < res.num[i]; j++) - saveLoadResource(s, i, j); - - s->saveLoadArrayOf(_objectOwnerTable, _numGlobalObjects, sizeof(_objectOwnerTable[0]), sleByte); - s->saveLoadArrayOf(_objectStateTable, _numGlobalObjects, sizeof(_objectStateTable[0]), sleByte); - if (_objectRoomTable) - s->saveLoadArrayOf(_objectRoomTable, _numGlobalObjects, sizeof(_objectRoomTable[0]), sleByte); - - if (_shadowPaletteSize) - s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); - - s->saveLoadArrayOf(_classData, _numGlobalObjects, sizeof(_classData[0]), sleUint32); - - var120Backup = _vars[120]; - var98Backup = _vars[98]; - - s->saveLoadArrayOf(_vars, _numVariables, sizeof(_vars[0]), sleInt16); - - if (_gameId == GID_TENTACLE) // Maybe misplaced, but that's the main idea - _vars[120] = var120Backup; - if (_gameId == GID_INDY4) - _vars[98] = var98Backup;; - - s->saveLoadArrayOf(_bitVars, _numBitVariables >> 3, 1, sleByte); - - /* Save or load a list of the locked objects */ - if (s->isSaving()) { - for (i = rtFirst; i <= rtLast; i++) - for (j = 1; j < res.num[i]; j++) { - if (res.flags[i][j] & RF_LOCK) { - s->saveByte(i); - s->saveWord(j); - } - } - s->saveByte(0xFF); - } else { - int r; - while ((r = s->loadByte()) != 0xFF) { - res.flags[r][s->loadWord()] |= RF_LOCK; - } - } - - if (_imuse) - _imuse->save_or_load(s, this); -} - -void Scumm::saveLoadResource(Serializer *ser, int type, int idx) -{ - byte *ptr; - uint32 size; - - /* don't save/load these resource types */ - if (type == rtTemp || type == rtBuffer || res.mode[type]) - return; - - if (ser->isSaving()) { - ptr = res.address[type][idx]; - if (ptr == NULL) { - ser->saveUint32(0); - return; - } - - size = ((MemBlkHeader *)ptr)->size; - - ser->saveUint32(size); - ser->saveLoadBytes(ptr + sizeof(MemBlkHeader), size); - - if (type == rtInventory) { - ser->saveWord(_inventory[idx]); - } - } else { - size = ser->loadUint32(); - if (size) { - createResource(type, idx, size); - ser->saveLoadBytes(getResourceAddress(type, idx), size); - if (type == rtInventory) { - _inventory[idx] = ser->loadWord(); - } - } - } -} - -void Serializer::saveLoadBytes(void *b, int len) -{ - if (_saveOrLoad) - _saveLoadStream.fwrite(b, 1, len); - else - _saveLoadStream.fread(b, 1, len); -} - -#ifdef _WIN32_WCE - -// Perhaps not necessary anymore with latest checks - -bool Serializer::checkEOFLoadStream() -{ - if (!fseek(_saveLoadStream.out, 1, SEEK_CUR)) - return true; - if (feof(_saveLoadStream.out)) - return true; - fseek(_saveLoadStream.out, -1, SEEK_CUR); - return false; -} - -#endif - - -void Serializer::saveUint32(uint32 d) -{ - uint32 e = FROM_LE_32(d); - saveLoadBytes(&e, 4); -} - -void Serializer::saveWord(uint16 d) -{ - uint16 e = FROM_LE_16(d); - saveLoadBytes(&e, 2); -} - -void Serializer::saveByte(byte b) -{ - saveLoadBytes(&b, 1); -} - -uint32 Serializer::loadUint32() -{ - uint32 e; - saveLoadBytes(&e, 4); - return FROM_LE_32(e); -} - -uint16 Serializer::loadWord() -{ - uint16 e; - saveLoadBytes(&e, 2); - return FROM_LE_16(e); -} - -byte Serializer::loadByte() -{ - byte e; - saveLoadBytes(&e, 1); - return e; -} - -void Serializer::saveLoadArrayOf(void *b, int len, int datasize, byte filetype) -{ - byte *at = (byte *)b; - uint32 data; - - /* speed up byte arrays */ - if (datasize == 1 && filetype == sleByte) { - saveLoadBytes(b, len); - return; - } - - while (--len >= 0) { - if (_saveOrLoad) { - /* saving */ - if (datasize == 1) { - data = *(byte *)at; - at += 1; - } else if (datasize == 2) { - data = *(uint16 *)at; - at += 2; - } else if (datasize == 4) { - data = *(uint32 *)at; - at += 4; - } else { - error("saveLoadArrayOf: invalid size %d", datasize); - } - switch (filetype) { - case sleByte: - saveByte((byte)data); - break; - case sleUint16: - case sleInt16: - saveWord((int16)data); - break; - case sleInt32: - case sleUint32: - saveUint32(data); - break; - default: - error("saveLoadArrayOf: invalid filetype %d", filetype); - } - } else { - /* loading */ - switch (filetype) { - case sleByte: - data = loadByte(); - break; - case sleUint16: - data = loadWord(); - break; - case sleInt16: - data = (int16)loadWord(); - break; - case sleUint32: - data = loadUint32(); - break; - case sleInt32: - data = (int32)loadUint32(); - break; - default: - error("saveLoadArrayOf: invalid filetype %d", filetype); - } - if (datasize == 1) { - *(byte *)at = (byte)data; - at += 1; - } else if (datasize == 2) { - *(uint16 *)at = (uint16)data; - at += 2; - } else if (datasize == 4) { - *(uint32 *)at = data; - at += 4; - } else { - error("saveLoadArrayOf: invalid size %d", datasize); - } - } - } -} - -void Serializer::saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle) -{ - byte *data = (byte *)b; - - while (--num >= 0) { - saveLoadEntries(data, sle); - data += datasize; - } -} - - -void Serializer::saveLoadEntries(void *d, const SaveLoadEntry *sle) -{ - int replen; - byte type; - byte *at; - int size; - int num; - void *ptr; - - while (sle->offs != 0xFFFF) { - at = (byte *)d + sle->offs; - size = sle->size; - type = sle->type; - - if (size == 0xFF) { - if (_saveOrLoad) { - /* save reference */ - ptr = *((void **)at); - saveWord(ptr ? ((*_save_ref) (_ref_me, type, ptr) + 1) : 0); - } else { - /* load reference */ - num = loadWord(); - *((void **)at) = num ? (*_load_ref) (_ref_me, type, num - 1) : NULL; - } - } else { - replen = 1; - if (type & 128) { - sle++; - replen = sle->offs; - type &= ~128; - } - saveLoadArrayOf(at, replen, size, type); - } - sle++; - } -} diff --git a/saveload.h b/saveload.h deleted file mode 100644 index 8b715de3f6..0000000000 --- a/saveload.h +++ /dev/null @@ -1,101 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef SAVELOAD_H -#define SAVELOAD_H - -enum { - sleByte = 1, - sleUint8 = 1, - sleInt8 = 1, - sleInt16 = 2, - sleUint16 = 3, - sleInt32 = 4, - sleUint32 = 5 -}; - -struct SaveLoadEntry { - uint32 offs; - uint8 type; - uint8 size; -}; - -struct SerializerStream { -#ifdef NONSTANDARD_SAVE - void *context; - - bool fopen(const char *filename, const char *mode); - void fclose(); - int fread(void *buf, int size, int cnt); - int fwrite(void *buf, int size, int cnt); -#else - FILE *out; - - FILE *fopen(const char *filename, const char *mode) { - return out = ::fopen(filename, mode); - } - void fclose() { - ::fclose(out); - } - int fread(void *buf, int size, int cnt) { - return ::fread(buf, size, cnt, out); - } - int fwrite(void *buf, int size, int cnt) { - return ::fwrite(buf, size, cnt, out); - } -#endif -}; - -typedef int SerializerSaveReference(void *me, byte type, void *ref); -typedef void *SerializerLoadReference(void *me, byte type, int ref); - -struct Serializer { - SerializerStream _saveLoadStream; - - union { - SerializerSaveReference *_save_ref; - SerializerLoadReference *_load_ref; - void *_saveload_ref; - }; - void *_ref_me; - - bool _saveOrLoad; - - void saveLoadBytes(void *b, int len); - void saveLoadArrayOf(void *b, int len, int datasize, byte filetype); - void saveLoadEntries(void *d, const SaveLoadEntry *sle); - void saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle); - - void saveUint32(uint32 d); - void saveWord(uint16 d); - void saveByte(byte b); - - byte loadByte(); - uint16 loadWord(); - uint32 loadUint32(); - - bool isSaving() { return _saveOrLoad; } - - bool checkEOFLoadStream(); - -}; - -#endif diff --git a/scaler.cpp b/scaler.cpp deleted file mode 100644 index 3f6b3b9f09..0000000000 --- a/scaler.cpp +++ /dev/null @@ -1,814 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scummsys.h" -#include "scaler.h" - -/********** 2XSAI Filter *****************/ -static uint32 colorMask = 0xF7DEF7DE; -static uint32 lowPixelMask = 0x08210821; -static uint32 qcolorMask = 0xE79CE79C; -static uint32 qlowpixelMask = 0x18631863; -static uint32 redblueMask = 0xF81F; -static uint32 greenMask = 0x7E0; - -int Init_2xSaI(uint32 BitFormat) -{ - if (BitFormat == 565) { - colorMask = 0xF7DEF7DE; - lowPixelMask = 0x08210821; - qcolorMask = 0xE79CE79C; - qlowpixelMask = 0x18631863; - redblueMask = 0xF81F; - greenMask = 0x7E0; - } else if (BitFormat == 555) { - colorMask = 0x7BDE7BDE; - lowPixelMask = 0x04210421; - qcolorMask = 0x739C739C; - qlowpixelMask = 0x0C630C63; - redblueMask = 0x7C1F; - greenMask = 0x3E0; - } else { - return 0; - } - - return 1; -} - -static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r -= 1; - if (y <= 1) - r += 1; - return r; -} - -static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) -{ - int x = 0; - int y = 0; - int r = 0; - - if (A == C) - x += 1; - else if (B == C) - y += 1; - if (A == D) - x += 1; - else if (B == D) - y += 1; - if (x <= 1) - r += 1; - if (y <= 1) - r -= 1; - return r; -} - -static inline uint32 INTERPOLATE(uint32 A, uint32 B) -{ - if (A != B) { - return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)); - } else - return A; -} - -static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D) -{ - register uint32 x = ((A & qcolorMask) >> 2) + - ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2); - register uint32 y = (A & qlowpixelMask) + - (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask); - - y = (y >> 2) & qlowpixelMask; - return x + y; -} - -#define BLUE_MASK565 0x001F001F -#define RED_MASK565 0xF800F800 -#define GREEN_MASK565 0x07E007E0 - -#define BLUE_MASK555 0x001F001F -#define RED_MASK555 0x7C007C00 -#define GREEN_MASK555 0x03E003E0 - -void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, - uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height) -{ - uint16 *bP; - uint8 *dP; - uint32 inc_bP; - - { - uint32 Nextline = srcPitch >> 1; - inc_bP = 1; - - while (height--) { - bP = (uint16 *)srcPtr; - dP = (uint8 *)dstPtr; - - for (uint32 finish = width; finish; finish -= inc_bP) { - uint32 color4, color5, color6; - uint32 color1, color2, color3; - uint32 colorA0, colorA1, colorA2, colorA3, colorB0, colorB1, colorB2, colorB3, colorS1, colorS2; - uint32 product1a, product1b, product2a, product2b; - -//--------------------------------------- B1 B2 -// 4 5 6 S2 -// 1 2 3 S1 -// A1 A2 - - colorB0 = *(bP - Nextline - 1); - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - colorB3 = *(bP - Nextline + 2); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA0 = *(bP + Nextline + Nextline - 1); - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - colorA3 = *(bP + Nextline + Nextline + 2); - -//-------------------------------------- - if (color2 == color6 && color5 != color3) { - product2b = product1b = color2; - } else if (color5 == color3 && color2 != color6) { - product2b = product1b = color5; - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult(color6, color5, color1, colorA1); - r += GetResult(color6, color5, color4, colorB1); - r += GetResult(color6, color5, colorA2, colorS1); - r += GetResult(color6, color5, colorB2, colorS2); - - if (r > 0) - product2b = product1b = color6; - else if (r < 0) - product2b = product1b = color5; - else { - product2b = product1b = INTERPOLATE(color5, color6); - } - } else { - if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) - product2b = Q_INTERPOLATE(color3, color3, color3, color2); - else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3) - product2b = Q_INTERPOLATE(color2, color2, color2, color3); - else - product2b = INTERPOLATE(color2, color3); - - if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0) - product1b = Q_INTERPOLATE(color6, color6, color6, color5); - else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3) - product1b = Q_INTERPOLATE(color6, color5, color5, color5); - else - product1b = INTERPOLATE(color5, color6); - } - - if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2) - product2a = INTERPOLATE(color2, color5); - else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0) - product2a = INTERPOLATE(color2, color5); - else - product2a = color2; - - if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2) - product1a = INTERPOLATE(color2, color5); - else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0) - product1a = INTERPOLATE(color2, color5); - else - product1a = color5; - -#ifdef SCUMM_LITTLE_ENDIAN - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#endif - -#ifdef SCUMM_BIG_ENDIAN - product1a = product1b | (product1a << 16); - product2a = product2b | (product2a << 16); -#endif - *((uint32 *)dP) = product1a; - *((uint32 *)(dP + dstPitch)) = product2a; - - bP += inc_bP; - dP += sizeof(uint32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - deltaPtr += srcPitch; - } // while (height--) - } -} - -void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height) -{ - uint8 *dP; - uint16 *bP; - uint32 inc_bP; - - { - inc_bP = 1; - - uint32 Nextline = srcPitch >> 1; - - while (height--) { - bP = (uint16 *)srcPtr; - dP = dstPtr; - for (uint32 finish = width; finish; finish -= inc_bP) { - uint32 color4, color5, color6; - uint32 color1, color2, color3; - uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2; - uint32 product1a, product1b, product2a, product2b; - - colorB1 = *(bP - Nextline); - colorB2 = *(bP - Nextline + 1); - - color4 = *(bP - 1); - color5 = *(bP); - color6 = *(bP + 1); - colorS2 = *(bP + 2); - - color1 = *(bP + Nextline - 1); - color2 = *(bP + Nextline); - color3 = *(bP + Nextline + 1); - colorS1 = *(bP + Nextline + 2); - - colorA1 = *(bP + Nextline + Nextline); - colorA2 = *(bP + Nextline + Nextline + 1); - - // -------------------------------------- - if (color2 == color6 && color5 != color3) { - product1b = product2a = color2; - if ((color1 == color2) || (color6 == colorB2)) { - product1a = INTERPOLATE(color2, color5); - product1a = INTERPOLATE(color2, product1a); - } else { - product1a = INTERPOLATE(color5, color6); - } - - if ((color6 == colorS2) || (color2 == colorA1)) { - product2b = INTERPOLATE(color2, color3); - product2b = INTERPOLATE(color2, product2b); - } else { - product2b = INTERPOLATE(color2, color3); - } - } else if (color5 == color3 && color2 != color6) { - product2b = product1a = color5; - - if ((colorB1 == color5) || (color3 == colorS1)) { - product1b = INTERPOLATE(color5, color6); - product1b = INTERPOLATE(color5, product1b); - } else { - product1b = INTERPOLATE(color5, color6); - } - - if ((color3 == colorA2) || (color4 == color5)) { - product2a = INTERPOLATE(color5, color2); - product2a = INTERPOLATE(color5, product2a); - } else { - product2a = INTERPOLATE(color2, color3); - } - - } else if (color5 == color3 && color2 == color6) { - register int r = 0; - - r += GetResult(color6, color5, color1, colorA1); - r += GetResult(color6, color5, color4, colorB1); - r += GetResult(color6, color5, colorA2, colorS1); - r += GetResult(color6, color5, colorB2, colorS2); - - if (r > 0) { - product1b = product2a = color2; - product1a = product2b = INTERPOLATE(color5, color6); - } else if (r < 0) { - product2b = product1a = color5; - product1b = product2a = INTERPOLATE(color5, color6); - } else { - product2b = product1a = color5; - product1b = product2a = color2; - } - } else { - product2b = product1a = INTERPOLATE(color2, color6); - product2b = Q_INTERPOLATE(color3, color3, color3, product2b); - product1a = Q_INTERPOLATE(color5, color5, color5, product1a); - - product2a = product1b = INTERPOLATE(color5, color3); - product2a = Q_INTERPOLATE(color2, color2, color2, product2a); - product1b = Q_INTERPOLATE(color6, color6, color6, product1b); - } -#ifdef SCUMM_LITTLE_ENDIAN - product1a = product1a | (product1b << 16); - product2a = product2a | (product2b << 16); -#endif - -#ifdef SCUMM_BIG_ENDIAN - product1a = product1b | (product1a << 16); - product2a = product2b | (product2a << 16); -#endif - *((uint32 *)dP) = product1a; - *((uint32 *)(dP + dstPitch)) = product2a; - - bP += inc_bP; - dP += sizeof(uint32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - deltaPtr += srcPitch; - } // endof: while (height--) - } -} - -void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height) -{ - uint8 *dP; - uint16 *bP; - uint32 inc_bP; - - - { - inc_bP = 1; - - uint32 Nextline = srcPitch >> 1; - - while (height--) { - bP = (uint16 *)srcPtr; - dP = dstPtr; - - for (uint32 finish = width; finish; finish -= inc_bP) { - - register uint32 colorA, colorB; - uint32 colorC, colorD, - colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP; - uint32 product, product1, product2; - -//--------------------------------------- -// Map of the pixels: I|E F|J -// G|A B|K -// H|C D|L -// M|N O|P - colorI = *(bP - Nextline - 1); - colorE = *(bP - Nextline); - colorF = *(bP - Nextline + 1); - colorJ = *(bP - Nextline + 2); - - colorG = *(bP - 1); - colorA = *(bP); - colorB = *(bP + 1); - colorK = *(bP + 2); - - colorH = *(bP + Nextline - 1); - colorC = *(bP + Nextline); - colorD = *(bP + Nextline + 1); - colorL = *(bP + Nextline + 2); - - colorM = *(bP + Nextline + Nextline - 1); - colorN = *(bP + Nextline + Nextline); - colorO = *(bP + Nextline + Nextline + 1); - colorP = *(bP + Nextline + Nextline + 2); - - if ((colorA == colorD) && (colorB != colorC)) { - if (((colorA == colorE) && (colorB == colorL)) || ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) - && (colorB == colorJ))) { - product = colorA; - } else { - product = INTERPOLATE(colorA, colorB); - } - - if (((colorA == colorG) && (colorC == colorO)) || ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) - && (colorC == colorM))) { - product1 = colorA; - } else { - product1 = INTERPOLATE(colorA, colorC); - } - product2 = colorA; - } else if ((colorB == colorC) && (colorA != colorD)) { - if (((colorB == colorF) && (colorA == colorH)) || ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) - && (colorA == colorI))) { - product = colorB; - } else { - product = INTERPOLATE(colorA, colorB); - } - - if (((colorC == colorH) && (colorA == colorF)) || ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) - && (colorA == colorI))) { - product1 = colorC; - } else { - product1 = INTERPOLATE(colorA, colorC); - } - product2 = colorB; - } else if ((colorA == colorD) && (colorB == colorC)) { - if (colorA == colorB) { - product = colorA; - product1 = colorA; - product2 = colorA; - } else { - register int r = 0; - - product1 = INTERPOLATE(colorA, colorC); - product = INTERPOLATE(colorA, colorB); - - r += GetResult1(colorA, colorB, colorG, colorE, colorI); - r += GetResult2(colorB, colorA, colorK, colorF, colorJ); - r += GetResult2(colorB, colorA, colorH, colorN, colorM); - r += GetResult1(colorA, colorB, colorL, colorO, colorP); - - if (r > 0) - product2 = colorA; - else if (r < 0) - product2 = colorB; - else { - product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD); - } - } - } else { - product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD); - - if ((colorA == colorC) && (colorA == colorF) - && (colorB != colorE) && (colorB == colorJ)) { - product = colorA; - } else if ((colorB == colorE) && (colorB == colorD) - && (colorA != colorF) && (colorA == colorI)) { - product = colorB; - } else { - product = INTERPOLATE(colorA, colorB); - } - - if ((colorA == colorB) && (colorA == colorH) - && (colorG != colorC) && (colorC == colorM)) { - product1 = colorA; - } else if ((colorC == colorG) && (colorC == colorD) - && (colorA != colorH) && (colorA == colorI)) { - product1 = colorC; - } else { - product1 = INTERPOLATE(colorA, colorC); - } - } - -#ifdef SCUMM_LITTLE_ENDIAN - product = colorA | (product << 16); - product1 = product1 | (product2 << 16); -#endif - -#ifdef SCUMM_BIG_ENDIAN - product = (colorA << 16) | product; - product1 = (product1 << 16) | product2; -#endif - *((int32 *)dP) = product; - *((uint32 *)(dP + dstPitch)) = product1; - - bP += inc_bP; - dP += sizeof(uint32); - } // end of for ( finish= width etc..) - - srcPtr += srcPitch; - dstPtr += dstPitch * 2; - deltaPtr += srcPitch; - } // endof: while (height--) - } -} - -static uint32 Bilinear(uint32 A, uint32 B, uint32 x) -{ - unsigned long areaA, areaB; - unsigned long result; - - if (A == B) - return A; - - areaB = (x >> 11) & 0x1f; // reduce 16 bit fraction to 5 bits - areaA = 0x20 - areaB; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - - result = ((areaA * A) + (areaB * B)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); - -} - -static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x, uint32 y) -{ - unsigned long areaA, areaB, areaC, areaD; - unsigned long result, xy; - - x = (x >> 11) & 0x1f; - y = (y >> 11) & 0x1f; - xy = (x * y) >> 5; - - A = (A & redblueMask) | ((A & greenMask) << 16); - B = (B & redblueMask) | ((B & greenMask) << 16); - C = (C & redblueMask) | ((C & greenMask) << 16); - D = (D & redblueMask) | ((D & greenMask) << 16); - - areaA = 0x20 + xy - x - y; - areaB = x - xy; - areaC = y - xy; - areaD = xy; - - result = ((areaA * A) + (areaB * B) + (areaC * C) + (areaD * D)) >> 5; - - return (result & redblueMask) | ((result >> 16) & greenMask); -} - -void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 * /* deltaPtr */ , - uint8 *dstPtr, uint32 dstPitch, - uint32 dstWidth, uint32 dstHeight, int width, int height) -{ - uint8 *dP; - uint16 *bP; - - uint32 w; - uint32 h; - uint32 dw; - uint32 dh; - uint32 hfinish; - uint32 wfinish; - - uint32 Nextline = srcPitch >> 1; - - wfinish = (width - 1) << 16; // convert to fixed point - dw = wfinish / (dstWidth - 1); - hfinish = (height - 1) << 16; // convert to fixed point - dh = hfinish / (dstHeight - 1); - - for (h = 0; h < hfinish; h += dh) { - uint32 y1, y2; - - y1 = h & 0xffff; // fraction part of fixed point - bP = (uint16 *)(srcPtr + ((h >> 16) * srcPitch)); - dP = dstPtr; - y2 = 0x10000 - y1; - - w = 0; - - for (; w < wfinish;) { - uint32 A, B, C, D; - uint32 E, F, G, H; - uint32 I, J, K, L; - uint32 x1, x2, a1, f1, f2; - uint32 position, product1; - - position = w >> 16; - A = bP[position]; // current pixel - B = bP[position + 1]; // next pixel - C = bP[position + Nextline]; - D = bP[position + Nextline + 1]; - E = bP[position - Nextline]; - F = bP[position - Nextline + 1]; - G = bP[position - 1]; - H = bP[position + Nextline - 1]; - I = bP[position + 2]; - J = bP[position + Nextline + 2]; - K = bP[position + Nextline + Nextline]; - L = bP[position + Nextline + Nextline + 1]; - - x1 = w & 0xffff; // fraction part of fixed point - x2 = 0x10000 - x1; - - /*0 */ - if (A == B && C == D && A == C) - product1 = A; - else - /*1 */ - if (A == D && B != C) { - f1 = (x1 >> 1) + (0x10000 >> 2); - f2 = (y1 >> 1) + (0x10000 >> 2); - if (y1 <= f1 && A == J && A != E) // close to B - { - a1 = f1 - y1; - product1 = Bilinear(A, B, a1); - } else if (y1 >= f1 && A == G && A != L) // close to C - { - a1 = y1 - f1; - product1 = Bilinear(A, C, a1); - } else if (x1 >= f2 && A == E && A != J) // close to B - { - a1 = x1 - f2; - product1 = Bilinear(A, B, a1); - } else if (x1 <= f2 && A == L && A != G) // close to C - { - a1 = f2 - x1; - product1 = Bilinear(A, C, a1); - } else if (y1 >= x1) // close to C - { - a1 = y1 - x1; - product1 = Bilinear(A, C, a1); - } else if (y1 <= x1) // close to B - { - a1 = x1 - y1; - product1 = Bilinear(A, B, a1); - } - } else - /*2 */ - if (B == C && A != D) { - f1 = (x1 >> 1) + (0x10000 >> 2); - f2 = (y1 >> 1) + (0x10000 >> 2); - if (y2 >= f1 && B == H && B != F) // close to A - { - a1 = y2 - f1; - product1 = Bilinear(B, A, a1); - } else if (y2 <= f1 && B == I && B != K) // close to D - { - a1 = f1 - y2; - product1 = Bilinear(B, D, a1); - } else if (x2 >= f2 && B == F && B != H) // close to A - { - a1 = x2 - f2; - product1 = Bilinear(B, A, a1); - } else if (x2 <= f2 && B == K && B != I) // close to D - { - a1 = f2 - x2; - product1 = Bilinear(B, D, a1); - } else if (y2 >= x1) // close to A - { - a1 = y2 - x1; - product1 = Bilinear(B, A, a1); - } else if (y2 <= x1) // close to D - { - a1 = x1 - y2; - product1 = Bilinear(B, D, a1); - } - } - /*3 */ - else { - product1 = Bilinear4(A, B, C, D, x1, y1); - } - -//end First Pixel - *(uint32 *)dP = product1; - dP += 2; - w += dw; - } - dstPtr += dstPitch; - } -} - -void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, - int width, int height) -{ - unsigned int nextlineSrc = srcPitch / sizeof(short); - short *p = (short *)srcPtr; - - unsigned nextlineDst = dstPitch / sizeof(short); - short *q = (short *)dstPtr; - - while (height--) { - for (int i = 0; i < width; ++i) { - // short A = *(p + i - nextlineSrc - 1); - short B = *(p + i - nextlineSrc); - // short C = *(p + i - nextlineSrc + 1); - short D = *(p + i - 1); - short E = *(p + i); - short F = *(p + i + 1); - // short G = *(p + i + nextlineSrc - 1); - short H = *(p + i + nextlineSrc); - // short I = *(p + i + nextlineSrc + 1); - - *(q + (i << 1)) = D == B && B != F && D != H ? D : E; - *(q + (i << 1) + 1) = B == F && B != D && F != H ? F : E; - *(q + (i << 1) + nextlineDst) = D == H && D != B && H != F ? D : E; - *(q + (i << 1) + nextlineDst + 1) = H == F && D != H && B != F ? F : E; - } - p += nextlineSrc; - q += nextlineDst << 1; - } -} - - -/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ -void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, - int width, int height) -{ - uint8 *r; - - while (height--) { - r = dstPtr; - for (int i = 0; i < width; ++i, ++r) { - uint8 color = *(srcPtr + i); - - *r = color; - } - srcPtr += srcPitch; - dstPtr += dstPitch; - } -} - -/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ -void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, - int width, int height) -{ - uint8 *r; - - while (height--) { - r = dstPtr; - for (int i = 0; i < width; ++i, r += 2) { - uint8 color = *(srcPtr + i); - - *(r) = color; - *(r + 1) = color; - *(r + dstPitch) = color; - *(r + dstPitch + 1) = color; - } - srcPtr += srcPitch; - dstPtr += dstPitch << 1; - } -} - -/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ -void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, - int width, int height) -{ - uint8 *r; - uint32 dstPitch2 = dstPitch << 1; - - while (height--) { - r = dstPtr; - for (int i = 0; i < width; ++i, r += 3) { - uint8 color = *(srcPtr + i); - - *(r + 0) = color; - *(r + 1) = color; - *(r + 2) = color; - *(r + 0 + dstPitch) = color; - *(r + 1 + dstPitch) = color; - *(r + 2 + dstPitch) = color; - *(r + 0 + dstPitch2) = color; - *(r + 1 + dstPitch2) = color; - *(r + 2 + dstPitch2) = color; - } - srcPtr += srcPitch; - dstPtr += dstPitch * 3; - } -} diff --git a/scaler.h b/scaler.h deleted file mode 100644 index f3675ccdce..0000000000 --- a/scaler.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef SCALER_H -#define SCALER_H - -extern int Init_2xSaI (uint32 BitFormat); -extern void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr, - uint32 dstPitch, int width, int height); -extern void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height); -extern void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height); -extern void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, - uint8 *dstPtr, uint32 dstPitch, int width, int height); -extern void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, - uint8 *dstPtr, uint32 dstPitch, int width, int height); -extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, - uint8 *dstPtr, uint32 dstPitch, int width, int height); -extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, - uint8 *dstPtr, uint32 dstPitch, int width, int height); - -#endif diff --git a/script.cpp b/script.cpp deleted file mode 100644 index f46bd4bb24..0000000000 --- a/script.cpp +++ /dev/null @@ -1,1113 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "resource.h" - -/* Script status type (slot.status) */ -enum { - ssDead = 0, - ssPaused = 1, - ssRunning = 2 -}; - - -/* Start executing script 'script' with parameters 'a' and 'b' */ -void Scumm::runScript(int script, int a, int b, int16 *lvarptr) -{ - byte *scriptPtr; - uint32 scriptOffs; - byte scriptType; - int slot; - ScriptSlot *s; - - - if (script == 0) - return; - - if (b == 0) - stopScriptNr(script); - - if (script < _numGlobalScripts) { - scriptPtr = getResourceAddress(rtScript, script); - scriptOffs = _resourceHeaderSize; - scriptType = WIO_GLOBAL; - } else { - scriptOffs = _localScriptList[script - _numGlobalScripts]; - if (scriptOffs == 0) - error("Local script %d is not in room %d", script, _roomResource); - scriptType = WIO_LOCAL; - } - - slot = getScriptSlot(); - - s = &vm.slot[slot]; - s->number = script; - s->offs = scriptOffs; - s->status = 2; - s->where = scriptType; - s->unk1 = a; - s->unk2 = b; - s->freezeCount = 0; - - initializeLocals(slot, lvarptr); - - runScriptNested(slot); -} - -/* Stop script 'script' */ -void Scumm::stopScriptNr(int script) -{ - ScriptSlot *ss; - NestedScript *nest; - int i, num; - - if (script == 0) - return; - - ss = &vm.slot[1]; - - for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (script != ss->number || ss->where != WIO_GLOBAL && ss->where != WIO_LOCAL || ss->status == 0) - continue; - - if (ss->cutsceneOverride) - error("Script %d stopped with active cutscene/override", script); - ss->number = 0; - ss->status = ssDead; - if (_currentScript == i) - _currentScript = 0xFF; - } - - if (_numNestedScripts == 0) - return; - - nest = &vm.nest[0]; - num = _numNestedScripts; - - do { - if (nest->number == script && (nest->where == WIO_GLOBAL || nest->where == WIO_LOCAL)) { - nest->number = 0xFF; - nest->slot = 0xFF; - nest->where = 0xFF; - } - } while (nest++, --num); -} - -/* Stop an object script 'script'*/ -void Scumm::stopObjectScript(int script) -{ - ScriptSlot *ss; - NestedScript *nest; - int i, num; - - if (script == 0) - return; - - ss = &vm.slot[1]; - - for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (script == ss->number && (ss->where == WIO_ROOM || - ss->where == WIO_INVENTORY || ss->where == WIO_FLOBJECT) - && ss->status != 0) { - if (ss->cutsceneOverride) - error("Object %d stopped with active cutscene/override", script); - ss->number = 0; - ss->status = ssDead; - if (_currentScript == i) - _currentScript = 0xFF; - } - } - - if (_numNestedScripts == 0) - return; - - nest = &vm.nest[0]; - num = _numNestedScripts; - - do { - if (nest->number == script && - (nest->where == WIO_ROOM || nest->where == WIO_FLOBJECT || nest->where == WIO_INVENTORY)) { - nest->number = 0xFF; - nest->slot = 0xFF; - nest->where = 0xFF; - } - } while (nest++, --num); -} - -/* Return a free script slot */ -int Scumm::getScriptSlot() -{ - ScriptSlot *ss; - int i; - ss = &vm.slot[1]; - - for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (ss->status == 0) - return i; - } - error("Too many scripts running, %d max", NUM_SCRIPT_SLOT); - return -1; -} - -/* Run script 'script' nested - eg, within the parent script.*/ -void Scumm::runScriptNested(int script) -{ - NestedScript *nest; - ScriptSlot *slot; - - updateScriptPtr(); - - nest = &vm.nest[_numNestedScripts]; - - if (_currentScript == 0xFF) { - nest->number = 0xFF; - nest->where = 0xFF; - } else { - slot = &vm.slot[_currentScript]; - nest->number = slot->number; - nest->where = slot->where; - nest->slot = _currentScript; - } - - if (++_numNestedScripts > sizeof(vm.nest) / sizeof(vm.nest[0])) - error("Too many nested scripts"); - - _currentScript = script; - - getScriptBaseAddress(); - getScriptEntryPoint(); - executeScript(); - - _numNestedScripts--; - - nest = &vm.nest[_numNestedScripts]; - - if (nest->number != 0xFF) { - slot = &vm.slot[nest->slot]; - if (slot->number == nest->number && slot->where == nest->where && - slot->status != 0 && slot->freezeCount == 0) { - _currentScript = nest->slot; - getScriptBaseAddress(); - getScriptEntryPoint(); - return; - } - } - _currentScript = 0xFF; -} - -void Scumm::updateScriptPtr() -{ - if (_currentScript == 0xFF) - return; - - vm.slot[_currentScript].offs = _scriptPointer - _scriptOrgPointer; -} - -/* Get the code pointer to a script */ -void Scumm::getScriptBaseAddress() -{ - ScriptSlot *ss; - int idx; - - if (_currentScript == 0xFF) - return; - - ss = &vm.slot[_currentScript]; - switch (ss->where) { - case WIO_INVENTORY: /* inventory script * */ - idx = getObjectIndex(ss->number); - _scriptOrgPointer = getResourceAddress(rtInventory, idx); - _lastCodePtr = &_baseInventoryItems[idx]; - break; - - case 3: - case WIO_ROOM: /* room script */ - _scriptOrgPointer = getResourceAddress(rtRoom, _roomResource); - _lastCodePtr = &_baseRooms[_roomResource]; - break; - - case WIO_GLOBAL: /* global script */ - _scriptOrgPointer = getResourceAddress(rtScript, ss->number); - _lastCodePtr = &_baseScripts[ss->number]; - break; - - case WIO_FLOBJECT: /* flobject script */ - idx = getObjectIndex(ss->number); - _scriptOrgPointer = getResourceAddress(rtFlObject, _objs[idx].fl_object_index); - _lastCodePtr = &_baseFLObject[ss->number]; - break; - default: - error("Bad type while getting base address"); - } -} - - -void Scumm::getScriptEntryPoint() -{ - if (_currentScript == 0xFF) - return; - _scriptPointer = _scriptOrgPointer + vm.slot[_currentScript].offs; -} - -/* Execute a script - Read opcode, and execute it from the table */ -void Scumm::executeScript() -{ - - OpcodeProc op; - while (_currentScript != 0xFF) { - _opcode = fetchScriptByte(); - _scriptPointerStart = _scriptPointer; - vm.slot[_currentScript].didexec = 1; - debug(8, "Script %d: [%X] %s()", vm.slot[_currentScript].number, _opcode, _opcodes_lookup[_opcode]); - op = getOpcode(_opcode); - (this->*op) (); - } -CHECK_HEAP} - -byte Scumm::fetchScriptByte() -{ - if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { - uint32 oldoffs = _scriptPointer - _scriptOrgPointer; - getScriptBaseAddress(); - _scriptPointer = _scriptOrgPointer + oldoffs; - } - return *_scriptPointer++; -} - -int Scumm::fetchScriptWord() -{ - int a; - if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { - uint32 oldoffs = _scriptPointer - _scriptOrgPointer; - getScriptBaseAddress(); - _scriptPointer = _scriptOrgPointer + oldoffs; - } - a = READ_LE_UINT16(_scriptPointer); - _scriptPointer += 2; - return a; -} - -#ifndef BYPASS_COPY_PROT -#define BYPASS_COPY_PROT -#endif - -int Scumm::readVar(uint var) -{ - int a; -#ifdef BYPASS_COPY_PROT - static byte copyprotbypassed; -#endif - debug(9, "readvar=%d", var); - if (!(var & 0xF000)) { -#if defined(BYPASS_COPY_PROT) - if (var == 490 && _gameId == GID_MONKEY2 && !copyprotbypassed) { - copyprotbypassed = true; - var = 518; - } -#endif - checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); - return _vars[var]; - } - - if (var & 0x2000 && !(_features & GF_NEW_OPCODES)) { - a = fetchScriptWord(); - if (a & 0x2000) - var = (var + readVar(a & ~0x2000)) & ~0x2000; - else - var = (var + (a & 0xFFF)) & ~0x2000; - } - - if (!(var & 0xF000)) - return _vars[var]; - - if (var & 0x8000) { - if (_gameId == GID_ZAK256) { - // Emulate a wierd hack in Zak256 to read individual - // bits of a normal global - int b = (var & 0x000F); - var &= 0x0FFF; - var >>= 4; - checkRange(_numVariables - 1, 0, var, "Variable %d out of range(rzb)"); - return (_vars[ var ] & ( 1 << b ) ) ? 1 : 0; - } - - var &= 0x7FFF; - checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(r)"); - return (_bitVars[var >> 3] & (1 << (var & 7))) ? 1 : 0; - } - - if (var & 0x4000) { - var &= 0xFFF; - checkRange(0x10, 0, var, "Local variable %d out of range(r)"); - return vm.localvar[_currentScript][var]; - } - - error("Illegal varbits (r)"); - return -1; -} - -void Scumm::writeVar(uint var, int value) -{ - if (!(var & 0xF000)) { - checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)"); - - // FIXME: Find some better place to put this. - if (var == VAR_CHARINC) - _vars[VAR_CHARINC] = _defaultTalkDelay / 20; - else - _vars[var] = value; - - if ((_varwatch == (int)var) || (_varwatch == 0)) { - if (vm.slot[_currentScript].number < 100) - debug(0, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); - else - debug(0, "vars[%d] = %d (via room-%d-%d)", var, value, _currentRoom, - vm.slot[_currentScript].number); - } - return; - } - - if (var & 0x8000) { - if (_gameId == GID_ZAK256) { - // Emulate a wierd hack in Zak256 to read individual - // bits of a normal global - int b = (var & 0x000F); - var &= 0x7FFF; - var >>= 4; - checkRange(_numVariables - 1, 0, var, "Variable %d out of range(wzb)"); - if(value) - _vars[ var ] |= ( 1 << b ); - else - _vars[ var ] &= ~( 1 << b ); - return; - } - var &= 0x7FFF; - checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(w)"); - - /* FIXME: Enable Indy4 mousefighting by default. - is there a better place to put this? */ - if (_gameId == GID_INDY4 && var == 107 && vm.slot[_currentScript].number == 1) - value = 1; - - if (value) - _bitVars[var >> 3] |= (1 << (var & 7)); - else - _bitVars[var >> 3] &= ~(1 << (var & 7)); - return; - } - - if (var & 0x4000) { - var &= 0xFFF; - checkRange(0x10, 0, var, "Local variable %d out of range(w)"); - vm.localvar[_currentScript][var] = value; - return; - } - - error("Illegal varbits (w)"); -} - -void Scumm::getResultPos() -{ - int a; - - _resultVarNumber = fetchScriptWord(); - if (_resultVarNumber & 0x2000) { - a = fetchScriptWord(); - if (a & 0x2000) { - _resultVarNumber += readVar(a & ~0x2000); - } else { - _resultVarNumber += a & 0xFFF; - } - _resultVarNumber &= ~0x2000; - } -} - -void Scumm::setResult(int value) -{ - writeVar(_resultVarNumber, value); -} - -void Scumm::drawBox(int x, int y, int x2, int y2, int color) -{ - int top, bottom, count; - VirtScreen *vs; - byte *backbuff, *bgbuff; - - if ((vs = findVirtScreen(y)) == NULL) - return; - - top = vs->topline; - bottom = top + vs->height; - - if (x > x2) - SWAP(x, x2); - - if (y > y2) - SWAP(y, y2); - - x2++; - y2++; - - if (x > 319) - return; - if (x < 0) - x = 0; - if (y < 0) - y = 0; - if (x2 < 0) - return; - if (x2 > 320) - x2 = 320; - if (y2 > bottom) - y2 = bottom; - - updateDirtyRect(vs->number, x, x2, y - top, y2 - top, 0); - - backbuff = vs->screenPtr + vs->xstart + (y - top) * 320 + x; - - if (color == -1) { - if (vs->number != 0) - error("can only copy bg to main window"); - bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * 320 + x; - blit(backbuff, bgbuff, x2 - x, y2 - y); - } else { - count = y2 - y; - while (count) { - memset(backbuff, color, x2 - x); - backbuff += 320; - count--; - } - } -} - - -void Scumm::stopObjectCode() -{ - ScriptSlot *ss; - - ss = &vm.slot[_currentScript]; - if (ss->cutsceneOverride == 255) { /* FIXME: What does this? */ - warning("Cutscene for script %d has overflown. Resetting.", ss->number); - ss->cutsceneOverride = 0; - } - - if (ss->where != WIO_GLOBAL && ss->where != WIO_LOCAL) { - if (ss->cutsceneOverride) { - warning("Object %d ending with active cutscene/override", ss->number); - ss->cutsceneOverride = 0; - } - } else { - if (ss->cutsceneOverride) { - warning("Script %d ending with active cutscene/override (%d)", ss->number, ss->cutsceneOverride); - ss->cutsceneOverride = 0; - } - } - ss->number = 0; - ss->status = 0; - _currentScript = 0xFF; -} - -bool Scumm::isScriptInUse(int script) -{ - ScriptSlot *ss; - int i; - - ss = vm.slot; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (ss->number == script) - return true; - } - return false; -} - - -void Scumm::runHook(int i) -{ - int16 tmp[16]; - tmp[0] = i; - if (_vars[VAR_HOOK_SCRIPT]) { - runScript(_vars[VAR_HOOK_SCRIPT], 0, 0, tmp); - } -} - -void Scumm::freezeScripts(int flag) -{ - int i; - - for (i = 1; i < NUM_SCRIPT_SLOT; i++) { - if (_currentScript != i && vm.slot[i].status != ssDead && (vm.slot[i].unk1 == 0 || flag >= 0x80)) { - vm.slot[i].status |= 0x80; - vm.slot[i].freezeCount++; - } - } - - for (i = 0; i < 6; i++) - sentence[i].unk++; - - if (vm.cutSceneScriptIndex != 0xFF) { - vm.slot[vm.cutSceneScriptIndex].status &= 0x7F; - vm.slot[vm.cutSceneScriptIndex].freezeCount = 0; - } -} - -void Scumm::unfreezeScripts() -{ - int i; - for (i = 1; i < NUM_SCRIPT_SLOT; i++) { - if (vm.slot[i].status & 0x80) { - if (!--vm.slot[i].freezeCount) { - vm.slot[i].status &= 0x7F; - } - } - } - - for (i = 0; i < 6; i++) { - if (((int8)--sentence[i].unk) < 0) - sentence[i].unk = 0; - } -} - -void Scumm::runAllScripts() -{ - int i; - - for (i = 0; i < NUM_SCRIPT_SLOT; i++) - vm.slot[i].didexec = 0; - - _currentScript = 0xFF; - for (_curExecScript = 0; _curExecScript < NUM_SCRIPT_SLOT; _curExecScript++) { - if (vm.slot[_curExecScript].status == ssRunning && vm.slot[_curExecScript].didexec == 0) { - _currentScript = (char)_curExecScript; - getScriptBaseAddress(); - getScriptEntryPoint(); - executeScript(); - } - } -} - -void Scumm::runExitScript() -{ - if (_vars[VAR_EXIT_SCRIPT]) - runScript(_vars[VAR_EXIT_SCRIPT], 0, 0, 0); - if (_EXCD_offs) { - int slot = getScriptSlot(); - vm.slot[slot].status = ssRunning; - vm.slot[slot].number = 10001; - vm.slot[slot].where = WIO_ROOM; - vm.slot[slot].offs = _EXCD_offs; - vm.slot[slot].unk1 = 0; - vm.slot[slot].unk2 = 0; - vm.slot[slot].freezeCount = 0; - runScriptNested(slot); - } - if (_vars[VAR_EXIT_SCRIPT2]) - runScript(_vars[VAR_EXIT_SCRIPT2], 0, 0, 0); -} - -void Scumm::runEntryScript() -{ - if (_vars[VAR_ENTRY_SCRIPT]) - runScript(_vars[VAR_ENTRY_SCRIPT], 0, 0, 0); - if (_ENCD_offs) { - int slot = getScriptSlot(); - vm.slot[slot].status = ssRunning; - vm.slot[slot].number = 10002; - vm.slot[slot].where = WIO_ROOM; - vm.slot[slot].offs = _ENCD_offs; - vm.slot[slot].unk1 = 0; - vm.slot[slot].unk2 = 0; - vm.slot[slot].freezeCount = 0; - runScriptNested(slot); - } - if (_vars[VAR_ENTRY_SCRIPT2]) - runScript(_vars[VAR_ENTRY_SCRIPT2], 0, 0, 0); -} - -void Scumm::killScriptsAndResources() -{ - ScriptSlot *ss; - int i; - - ss = &vm.slot[1]; - - for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (ss->where == WIO_ROOM || ss->where == WIO_FLOBJECT) { - if (ss->cutsceneOverride) - error("Object %d stopped with active cutscene/override in exit", ss->number); - ss->status = 0; - } else if (ss->where == WIO_LOCAL) { - if (ss->cutsceneOverride) - error("Script %d stopped with active cutscene/override in exit", ss->number); - ss->status = 0; - } - } - - /* Nuke FL objects */ - i = 0; - do { - if (_objs[i].fl_object_index) - nukeResource(rtFlObject, _objs[i].fl_object_index); - } while (++i <= _numObjectsInRoom); - - /* Nuke local object names */ - if (_newNames) { - for (i = 0; i < _numNewNames; i++) { - int j = _newNames[i]; - if (j && getOwner(j) == 0) { - _newNames[i] = 0; - nukeResource(rtObjectName, i); - } - } - } -} - -void Scumm::checkAndRunVar33() -{ - int i; - ScriptSlot *ss; - - memset(_localParamList, 0, sizeof(_localParamList)); - if (isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) { - ss = vm.slot; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) - if (ss->number == _vars[VAR_SENTENCE_SCRIPT] && ss->status != 0 && ss->freezeCount == 0) - return; - } - - if (!_sentenceNum || sentence[_sentenceNum - 1].unk) - return; - - _sentenceNum--; - - if (!(_features & GF_AFTER_V7)) - if (sentence[_sentenceNum].unk2 && sentence[_sentenceNum].unk3 == sentence[_sentenceNum].unk4) - return; - - _localParamList[0] = sentence[_sentenceNum].unk5; - _localParamList[1] = sentence[_sentenceNum].unk4; - _localParamList[2] = sentence[_sentenceNum].unk3; - _currentScript = 0xFF; - if (_vars[VAR_SENTENCE_SCRIPT]) - runScript(_vars[VAR_SENTENCE_SCRIPT], 0, 0, _localParamList); -} - -void Scumm::runInputScript(int a, int cmd, int mode) -{ - int16 args[16]; - memset(args, 0, sizeof(args)); - args[0] = a; - args[1] = cmd; - args[2] = mode; - if (_vars[VAR_VERB_SCRIPT]) - runScript(_vars[VAR_VERB_SCRIPT], 0, 0, args); -} - -void Scumm::decreaseScriptDelay(int amount) -{ - ScriptSlot *ss = &vm.slot[0]; - int i; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (ss->status == 1) { - ss->delay -= amount; - if (ss->delay < 0) { - ss->status = 2; - ss->delay = 0; - } - } - } -} - -void Scumm::runVerbCode(int object, int entry, int a, int b, int16 *vars) -{ - uint32 obcd; - int slot, where, offs; - - if (!object) - return; - if (!b) - stopObjectScript(object); - - where = whereIsObject(object); - - if (where == WIO_NOT_FOUND) { - warning("Code for object %d not in room %d", object, _roomResource); - return; - } - - obcd = getOBCDOffs(object); - slot = getScriptSlot(); - - offs = getVerbEntrypoint(object, entry); - if (offs == 0) - return; - - vm.slot[slot].number = object; - vm.slot[slot].offs = obcd + offs; - vm.slot[slot].status = ssRunning; - vm.slot[slot].where = where; - vm.slot[slot].unk1 = a; - vm.slot[slot].unk2 = b; - vm.slot[slot].freezeCount = 0; - vm.slot[slot].newfield = 0; - - initializeLocals(slot, vars); - - runScriptNested(slot); -} - -void Scumm::initializeLocals(int slot, int16 *vars) -{ - int i; - if (!vars) { - for (i = 0; i < 16; i++) - vm.localvar[slot][i] = 0; - } else { - for (i = 0; i < 16; i++) - vm.localvar[slot][i] = vars[i]; - } -} - -int Scumm::getVerbEntrypoint(int obj, int entry) -{ - byte *objptr, *verbptr; - int verboffs; - - if (whereIsObject(obj) == WIO_NOT_FOUND) - return 0; - - objptr = getOBCDFromObject(obj); - assert(objptr); - - if (_features & GF_SMALL_HEADER) - verbptr = objptr + 19; - else - verbptr = findResource(MKID('VERB'), objptr); - - if (verbptr == NULL) - error("No verb block in object %d", obj); - - verboffs = verbptr - objptr; - - if (!(_features & GF_SMALL_HEADER)) - verbptr += _resourceHeaderSize; - - do { - if (!*verbptr) - return 0; - if (*verbptr == entry || *verbptr == 0xFF) - break; - verbptr += 3; - } while (1); - - if (_features & GF_SMALL_HEADER) - return READ_LE_UINT16(verbptr + 1); - else - return verboffs + READ_LE_UINT16(verbptr + 1); -} - - -void Scumm::push(int a) -{ - assert(_scummStackPos >= 0 && (unsigned int)_scummStackPos <= ARRAYSIZE(_scummStack)); - _scummStack[_scummStackPos++] = a; -} - -int Scumm::pop() -{ - assert(_scummStackPos > 0 && (unsigned int)_scummStackPos <= ARRAYSIZE(_scummStack)); - return _scummStack[--_scummStackPos]; -} - - -void Scumm::endCutscene() -{ - ScriptSlot *ss = &vm.slot[_currentScript]; - uint32 *csptr; - int16 args[16]; - - memset(args, 0, sizeof(args)); - - if (ss->cutsceneOverride > 0) // Only terminate if active - ss->cutsceneOverride--; - - args[0] = vm.cutSceneData[vm.cutSceneStackPointer]; - _vars[VAR_OVERRIDE] = 0; - - csptr = &vm.cutScenePtr[vm.cutSceneStackPointer]; - if (*csptr && (ss->cutsceneOverride > 0)) // Only terminate if active - ss->cutsceneOverride--; - - vm.cutSceneScript[vm.cutSceneStackPointer] = 0; - *csptr = 0; - vm.cutSceneStackPointer--; - - if (_vars[VAR_CUTSCENE_END_SCRIPT]) - runScript(_vars[VAR_CUTSCENE_END_SCRIPT], 0, 0, args); -} - -void Scumm::cutscene(int16 *args) -{ - int scr = _currentScript; - vm.slot[scr].cutsceneOverride++; - - if (++vm.cutSceneStackPointer > sizeof(vm.cutSceneData) / sizeof(vm.cutSceneData[0])) - error("Cutscene stack overflow"); - - vm.cutSceneData[vm.cutSceneStackPointer] = args[0]; - vm.cutSceneScript[vm.cutSceneStackPointer] = 0; - vm.cutScenePtr[vm.cutSceneStackPointer] = 0; - - vm.cutSceneScriptIndex = scr; - if (_vars[VAR_CUTSCENE_START_SCRIPT]) - runScript(_vars[VAR_CUTSCENE_START_SCRIPT], 0, 0, args); - vm.cutSceneScriptIndex = 0xFF; -} - -void Scumm::faceActorToObj(int act, int obj) -{ - int x, x2, y, dir; - - if (getObjectOrActorXY(act, x, y) == -1) - return; - - if (getObjectOrActorXY(obj, x2, y) == -1) - return; - - dir = (x2 > x) ? 90 : 270; - derefActorSafe(act, "faceActorToObj")->turnToDirection(dir); -} - -bool Scumm::isScriptRunning(int script) -{ - int i; - ScriptSlot *ss = vm.slot; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) - if (ss->number == script && (ss->where == WIO_GLOBAL || ss->where == WIO_LOCAL) && ss->status) - return true; - return false; -} - -bool Scumm::isRoomScriptRunning(int script) -{ - int i; - ScriptSlot *ss = vm.slot; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) - if (ss->number == script && ss->where == WIO_ROOM && ss->status) - return true; - return false; - -} - - -void Scumm::beginOverride() -{ - int idx; - uint32 *ptr; - - idx = vm.cutSceneStackPointer; - ptr = &vm.cutScenePtr[idx]; - - *ptr = _scriptPointer - _scriptOrgPointer; - vm.cutSceneScript[idx] = _currentScript; - - fetchScriptByte(); - fetchScriptWord(); - _vars[VAR_OVERRIDE] = 0; -} - -void Scumm::endOverride() -{ - int idx; - uint32 *ptr; - - idx = vm.cutSceneStackPointer; - ptr = &vm.cutScenePtr[idx]; - - *ptr = 0; - vm.cutSceneScript[idx] = 0; - _vars[VAR_OVERRIDE] = 0; -} - - -int Scumm::defineArray(int array, int type, int dim2, int dim1) -{ - int id; - int size; - ArrayHeader *ah; - - if (type != 5 && type != 4) - type = 5; - - nukeArray(array); - - id = getArrayId(); - - if (array & 0x4000) { - _arrays[id] = (char)vm.slot[_currentScript].number; - } - - if (array & 0x8000) { - error("Can't define bit variable as array pointer"); - } - - writeVar(array, id); - - size = (type == 5) ? 16 : 8; - size *= dim2 + 1; - size *= dim1 + 1; - size >>= 3; - - ah = (ArrayHeader *)createResource(rtString, id, size + sizeof(ArrayHeader)); - - ah->type = type; - ah->dim1_size = dim1 + 1; - ah->dim2_size = dim2 + 1; - - return id; -} - -void Scumm::nukeArray(int a) -{ - int data; - - data = readVar(a); - - if (data) - nukeResource(rtString, data); - _arrays[data] = 0; - - writeVar(a, 0); -} - -int Scumm::getArrayId() -{ - byte **addr = _baseArrays; - int i; - - for (i = 1; i < _numArray; i++) { - if (!addr[i]) - return i; - } - error("Out of array pointers, %d max", _numArray); - return -1; -} - -void Scumm::arrayop_1(int a, byte *ptr) -{ - ArrayHeader *ah; - int r; - int len = getStringLen(ptr); - - r = defineArray(a, 4, 0, len); - ah = (ArrayHeader *)getResourceAddress(rtString, r); - copyString(ah->data, ptr, len); -} - -void Scumm::copyString(byte *dst, byte *src, int len) -{ - if (!src) { - while (--len >= 0) - *dst++ = fetchScriptByte(); - } else { - while (--len >= 0) - *dst++ = *src++; - } -} - -int Scumm::getStringLen(byte *ptr) -{ - int len; - byte c; - if (!ptr) - ptr = _scriptPointer; - len = 0; - do { - c = *ptr++; - if (!c) - break; - len++; - if (c == 0xFF) - ptr += 3, len += 3; - } while (1); - return len + 1; -} - -void Scumm::exitCutscene() -{ - uint32 offs = vm.cutScenePtr[vm.cutSceneStackPointer]; - if (offs) { - ScriptSlot *ss = &vm.slot[vm.cutSceneScript[vm.cutSceneStackPointer]]; - ss->offs = offs; - ss->status = 2; - ss->freezeCount = 0; - - if (ss->cutsceneOverride > 0) - ss->cutsceneOverride--; - - _vars[VAR_OVERRIDE] = 1; - vm.cutScenePtr[vm.cutSceneStackPointer] = 0; - } -} -void Scumm::doSentence(int c, int b, int a) -{ - if (_features & GF_AFTER_V7) { - SentenceTab *st; - - if (b == a) - return; - - st = &sentence[_sentenceNum - 1]; - - if (_sentenceNum && st->unk5 == c && st->unk4 == b && st->unk3 == a) - return; - - _sentenceNum++; - st++; - - st->unk5 = c; - st->unk4 = b; - st->unk3 = a; - st->unk = 0; - - warning("dosentence(%d,%d,%d)", c, b, a); - - } else { - - SentenceTab *st; - - st = &sentence[_sentenceNum++]; - - st->unk5 = c; - st->unk4 = b; - st->unk3 = a; - - if (!(st->unk3 & 0xFF00)) - st->unk2 = 0; - else - st->unk2 = 1; - - st->unk = 0; - } -} diff --git a/script_v1.cpp b/script_v1.cpp deleted file mode 100644 index 333b35120c..0000000000 --- a/script_v1.cpp +++ /dev/null @@ -1,2799 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" - -void Scumm::setupOpcodes() -{ - static const OpcodeProc opcode_list[] = { - /* 00 */ - &Scumm::o5_stopObjectCode, - &Scumm::o5_putActor, - &Scumm::o5_startMusic, - &Scumm::o5_getActorRoom, - /* 04 */ - &Scumm::o5_isGreaterEqual, - &Scumm::o5_drawObject, - &Scumm::o5_getActorElevation, - &Scumm::o5_setState, - /* 08 */ - &Scumm::o5_isNotEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, - /* 0C */ - &Scumm::o5_resourceRoutines, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_getObjectState, - /* 10 */ - &Scumm::o5_getObjectOwner, - &Scumm::o5_animateActor, - &Scumm::o5_panCameraTo, - &Scumm::o5_actorSet, - /* 14 */ - &Scumm::o5_print, - &Scumm::o5_actorFromPos, - &Scumm::o5_getRandomNr, - &Scumm::o5_and, - /* 18 */ - &Scumm::o5_jumpRelative, - &Scumm::o5_doSentence, - &Scumm::o5_move, - &Scumm::o5_multiply, - /* 1C */ - &Scumm::o5_startSound, - &Scumm::o5_ifClassOfIs, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, - /* 20 */ - &Scumm::o5_stopMusic, - &Scumm::o5_putActor, - &Scumm::o5_getAnimCounter, - &Scumm::o5_getActorY, - /* 24 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_setVarRange, - &Scumm::o5_stringOps, - /* 28 */ - &Scumm::o5_equalZero, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_delayVariable, - /* 2C */ - &Scumm::o5_cursorCommand, - &Scumm::o5_putActorInRoom, - &Scumm::o5_delay, - &Scumm::o5_getObjectState, - /* 30 */ - &Scumm::o5_matrixOps, - &Scumm::o5_getInventoryCount, - &Scumm::o5_setCameraAt, - &Scumm::o5_roomOps, - /* 34 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, - /* 38 */ - &Scumm::o5_lessOrEqual, - &Scumm::o5_doSentence, - &Scumm::o5_subtract, - &Scumm::o5_getActorScale, - /* 3C */ - &Scumm::o5_stopSound, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, - /* 40 */ - &Scumm::o5_cutscene, - &Scumm::o5_putActor, - &Scumm::o5_chainScript, - &Scumm::o5_getActorX, - /* 44 */ - &Scumm::o5_isLess, - &Scumm::o5_drawObject, - &Scumm::o5_increment, - &Scumm::o5_setState, - /* 48 */ - &Scumm::o5_isEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, - /* 4C */ - &Scumm::o5_soundKludge, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_badOpcode, - /* 50 */ - &Scumm::o5_pickupObjectOld, - &Scumm::o5_animateActor, - &Scumm::o5_actorFollowCamera, - &Scumm::o5_actorSet, - /* 54 */ - &Scumm::o5_setObjectName, - &Scumm::o5_actorFromPos, - &Scumm::o5_getActorMoving, - &Scumm::o5_or, - /* 58 */ - &Scumm::o5_overRide, - &Scumm::o5_doSentence, - &Scumm::o5_add, - &Scumm::o5_divide, - /* 5C */ - &Scumm::o5_oldRoomEffect, - &Scumm::o5_setClass, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, - /* 60 */ - &Scumm::o5_freezeScripts, - &Scumm::o5_putActor, - &Scumm::o5_stopScript, - &Scumm::o5_getActorFacing, - /* 64 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_getClosestObjActor, - &Scumm::o5_dummy, - /* 68 */ - &Scumm::o5_getScriptRunning, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_debug, - /* 6C */ - &Scumm::o5_getActorWidth, - &Scumm::o5_putActorInRoom, - &Scumm::o5_stopObjectScript, - &Scumm::o5_badOpcode, - /* 70 */ - &Scumm::o5_lights, - &Scumm::o5_getActorCostume, - &Scumm::o5_loadRoom, - &Scumm::o5_roomOps, - /* 74 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, - /* 78 */ - &Scumm::o5_isGreater, /* less? */ - &Scumm::o5_doSentence, - &Scumm::o5_verbOps, - &Scumm::o5_getActorWalkBox, - /* 7C */ - &Scumm::o5_isSoundRunning, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, - /* 80 */ - &Scumm::o5_breakHere, - &Scumm::o5_putActor, - &Scumm::o5_startMusic, - &Scumm::o5_getActorRoom, - /* 84 */ - &Scumm::o5_isGreaterEqual, /* less equal? */ - &Scumm::o5_drawObject, - &Scumm::o5_getActorElevation, - &Scumm::o5_setState, - /* 88 */ - &Scumm::o5_isNotEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, - /* 8C */ - &Scumm::o5_resourceRoutines, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_getObjectState, - /* 90 */ - &Scumm::o5_getObjectOwner, - &Scumm::o5_animateActor, - &Scumm::o5_panCameraTo, - &Scumm::o5_actorSet, - /* 94 */ - &Scumm::o5_print, - &Scumm::o5_actorFromPos, - &Scumm::o5_getRandomNr, - &Scumm::o5_and, - /* 98 */ - &Scumm::o5_quitPauseRestart, - &Scumm::o5_doSentence, - &Scumm::o5_move, - &Scumm::o5_multiply, - /* 9C */ - &Scumm::o5_startSound, - &Scumm::o5_ifClassOfIs, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, - /* A0 */ - &Scumm::o5_stopObjectCode, - &Scumm::o5_putActor, - &Scumm::o5_getAnimCounter, - &Scumm::o5_getActorY, - /* A4 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_setVarRange, - &Scumm::o5_dummy, - /* A8 */ - &Scumm::o5_notEqualZero, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_saveRestoreVerbs, - /* AC */ - &Scumm::o5_expression, - &Scumm::o5_putActorInRoom, - &Scumm::o5_wait, - &Scumm::o5_badOpcode, - /* B0 */ - &Scumm::o5_matrixOps, - &Scumm::o5_getInventoryCount, - &Scumm::o5_setCameraAt, - &Scumm::o5_roomOps, - /* B4 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, - /* B8 */ - &Scumm::o5_lessOrEqual, - &Scumm::o5_doSentence, - &Scumm::o5_subtract, - &Scumm::o5_getActorScale, - /* BC */ - &Scumm::o5_stopSound, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, - /* C0 */ - &Scumm::o5_endCutscene, - &Scumm::o5_putActor, - &Scumm::o5_chainScript, - &Scumm::o5_getActorX, - /* C4 */ - &Scumm::o5_isLess, - &Scumm::o5_drawObject, - &Scumm::o5_decrement, - &Scumm::o5_setState, - /* C8 */ - &Scumm::o5_isEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, - /* CC */ - &Scumm::o5_pseudoRoom, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_badOpcode, - /* D0 */ - &Scumm::o5_pickupObjectOld, - &Scumm::o5_animateActor, - &Scumm::o5_actorFollowCamera, - &Scumm::o5_actorSet, - /* D4 */ - &Scumm::o5_setObjectName, - &Scumm::o5_actorFromPos, - &Scumm::o5_getActorMoving, - &Scumm::o5_or, - /* D8 */ - &Scumm::o5_printEgo, - &Scumm::o5_doSentence, - &Scumm::o5_add, - &Scumm::o5_divide, - /* DC */ - &Scumm::o5_oldRoomEffect, - &Scumm::o5_setClass, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, - /* E0 */ - &Scumm::o5_freezeScripts, - &Scumm::o5_putActor, - &Scumm::o5_stopScript, - &Scumm::o5_getActorFacing, - /* E4 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_getClosestObjActor, - &Scumm::o5_dummy, - /* E8 */ - &Scumm::o5_getScriptRunning, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_debug, - /* EC */ - &Scumm::o5_getActorWidth, - &Scumm::o5_putActorInRoom, - &Scumm::o5_stopObjectScript, - &Scumm::o5_badOpcode, - /* F0 */ - &Scumm::o5_lights, - &Scumm::o5_getActorCostume, - &Scumm::o5_loadRoom, - &Scumm::o5_roomOps, - /* F4 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, - /* F8 */ - &Scumm::o5_isGreater, - &Scumm::o5_doSentence, - &Scumm::o5_verbOps, - &Scumm::o5_getActorWalkBox, - /* FC */ - &Scumm::o5_isSoundRunning, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox - }; - - static const char *opcode_lookup[] = { - /* 00 */ - "o5_stopObjectCode", - "o5_putActor", - "o5_startMusic", - "o5_getActorRoom", - /* 04 */ - "o5_isGreaterEqual", - "o5_drawObject", - "o5_getActorElevation", - "o5_setState", - /* 08 */ - "o5_isNotEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 0C */ - "o5_resourceRoutines", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_getObjectState", - /* 10 */ - "o5_getObjectOwner", - "o5_animateActor", - "o5_panCameraTo", - "o5_actorSet", - /* 14 */ - "o5_print", - "o5_actorFromPos", - "o5_getRandomNr", - "o5_and", - /* 18 */ - "o5_jumpRelative", - "o5_doSentence", - "o5_move", - "o5_multiply", - /* 1C */ - "o5_startSound", - "o5_ifClassOfIs", - "o5_walkActorTo", - "o5_isActorInBox", - /* 20 */ - "o5_stopMusic", - "o5_putActor", - "o5_getAnimCounter", - "o5_getActorY", - /* 24 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_setVarRange", - "o5_stringOps", - /* 28 */ - "o5_equalZero", - "o5_setOwnerOf", - "o5_startScript", - "o5_delayVariable", - /* 2C */ - "o5_cursorCommand", - "o5_putActorInRoom", - "o5_delay", - "o5_badOpcode", - /* 30 */ - "o5_matrixOps", - "o5_getInventoryCount", - "o5_setCameraAt", - "o5_roomOps", - /* 34 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* 38 */ - "o5_lessOrEqual", - "o5_doSentence", - "o5_subtract", - "o5_getActorScale", - /* 3C */ - "o5_stopSound", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* 40 */ - "o5_cutscene", - "o5_putActor", - "o5_chainScript", - "o5_getActorX", - /* 44 */ - "o5_isLess", - "o5_badOpcode", - "o5_increment", - "o5_setState", - /* 48 */ - "o5_isEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 4C */ - "o5_soundKludge", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_badOpcode", - /* 50 */ - "o5_pickupObjectOld", - "o5_animateActor", - "o5_actorFollowCamera", - "o5_actorSet", - /* 54 */ - "o5_setObjectName", - "o5_actorFromPos", - "o5_getActorMoving", - "o5_or", - /* 58 */ - "o5_overRide", - "o5_doSentence", - "o5_add", - "o5_divide", - /* 5C */ - "o5_oldRoomEffect", - "o5_setClass", - "o5_walkActorTo", - "o5_isActorInBox", - /* 60 */ - "o5_freezeScripts", - "o5_putActor", - "o5_stopScript", - "o5_getActorFacing", - /* 64 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_getClosestObjActor", - "o5_dummy", - /* 68 */ - "o5_getScriptRunning", - "o5_setOwnerOf", - "o5_startScript", - "o5_debug", - /* 6C */ - "o5_getActorWidth", - "o5_putActorInRoom", - "o5_stopObjectScript", - "o5_badOpcode", - /* 70 */ - "o5_lights", - "o5_getActorCostume", - "o5_loadRoom", - "o5_roomOps", - /* 74 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* 78 */ - "o5_isGreater", /* less? */ - "o5_doSentence", - "o5_verbOps", - "o5_getActorWalkBox", - /* 7C */ - "o5_isSoundRunning", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* 80 */ - "o5_breakHere", - "o5_putActor", - "o5_startMusic", - "o5_getActorRoom", - /* 84 */ - "o5_isGreaterEqual", /* less equal? */ - "o5_drawObject", - "o5_getActorElevation", - "o5_setState", - /* 88 */ - "o5_isNotEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 8C */ - "o5_resourceRoutines", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_getObjectState", - /* 90 */ - "o5_getObjectOwner", - "o5_animateActor", - "o5_panCameraTo", - "o5_actorSet", - /* 94 */ - "o5_print", - "o5_actorFromPos", - "o5_getRandomNr", - "o5_and", - /* 98 */ - "o5_quitPauseRestart", - "o5_doSentence", - "o5_move", - "o5_multiply", - /* 9C */ - "o5_startSound", - "o5_ifClassOfIs", - "o5_walkActorTo", - "o5_isActorInBox", - /* A0 */ - "o5_stopObjectCode", - "o5_putActor", - "o5_getAnimCounter", - "o5_getActorY", - /* A4 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_setVarRange", - "o5_dummy", - /* A8 */ - "o5_notEqualZero", - "o5_setOwnerOf", - "o5_startScript", - "o5_saveRestoreVerbs", - /* AC */ - "o5_expression", - "o5_putActorInRoom", - "o5_wait", - "o5_badOpcode", - /* B0 */ - "o5_matrixOps", - "o5_getInventoryCount", - "o5_setCameraAt", - "o5_roomOps", - /* B4 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* B8 */ - "o5_lessOrEqual", - "o5_doSentence", - "o5_subtract", - "o5_getActorScale", - /* BC */ - "o5_stopSound", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* C0 */ - "o5_endCutscene", - "o5_putActor", - "o5_chainScript", - "o5_getActorX", - /* C4 */ - "o5_isLess", - "o5_badOpcode", - "o5_decrement", - "o5_setState", - /* C8 */ - "o5_isEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* CC */ - "o5_pseudoRoom", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_badOpcode", - /* D0 */ - "o5_pickupObjectOld", - "o5_animateActor", - "o5_actorFollowCamera", - "o5_actorSet", - /* D4 */ - "o5_setObjectName", - "o5_actorFromPos", - "o5_getActorMoving", - "o5_or", - /* D8 */ - "o5_printEgo", - "o5_doSentence", - "o5_add", - "o5_divide", - /* DC */ - "o5_oldRoomEffect", - "o5_setClass", - "o5_walkActorTo", - "o5_isActorInBox", - /* E0 */ - "o5_freezeScripts", - "o5_putActor", - "o5_stopScript", - "o5_getActorFacing", - /* E4 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_getClosestObjActor", - "o5_dummy", - /* E8 */ - "o5_getScriptRunning", - "o5_setOwnerOf", - "o5_startScript", - "o5_debug", - /* EC */ - "o5_getActorWidth", - "o5_putActorInRoom", - "o5_stopObjectScript", - "o5_badOpcode", - /* F0 */ - "o5_lights", - "o5_getActorCostume", - "o5_loadRoom", - "o5_roomOps", - /* F4 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* F8 */ - "o5_isGreater", - "o5_doSentence", - "o5_verbOps", - "o5_getActorWalkBox", - /* FC */ - "o5_isSoundRunning", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - }; - - - _opcodes = opcode_list; - _opcodes_lookup = opcode_lookup; -} - -void Scumm::o5_actorFollowCamera() -{ - actorFollowCamera(getVarOrDirectByte(0x80)); -} - -void Scumm::o5_actorFromPos() -{ - int x, y; - getResultPos(); - x = getVarOrDirectWord(0x80); - y = getVarOrDirectWord(0x40); - setResult(getActorFromPos(x, y)); -} - -void Scumm::o5_actorSet() -{ - static const byte convertTable[20] = - { 1, 0, 0, 2, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20 }; - int act = getVarOrDirectByte(0x80); - Actor *a; - int i, j; - - if (act == 0) - act = 1; - - a = derefActorSafe(act, "actorSet"); - - while ((_opcode = fetchScriptByte()) != 0xFF) { - if (_features & GF_SMALL_HEADER) - _opcode = (_opcode & 0xE0) | convertTable[(_opcode & 0x1F) - 1]; - - if (!a) - return; - - switch (_opcode & 0x1F) { - case 0: /* dummy case */ - getVarOrDirectByte(0x80); - break; - case 1: /* costume */ - a->setActorCostume(getVarOrDirectByte(0x80)); - break; - case 2: /* walkspeed */ - i = getVarOrDirectByte(0x80); - j = getVarOrDirectByte(0x40); - a->setActorWalkSpeed(i, j); - break; - case 3: /* sound */ - a->sound[0] = getVarOrDirectByte(0x80); - break; - case 4: /* walkanim */ - a->walkFrame = getVarOrDirectByte(0x80); - break; - case 5: /* talkanim */ - a->talkFrame1 = getVarOrDirectByte(0x80); - a->talkFrame2 = getVarOrDirectByte(0x40); - break; - case 6: /* standanim */ - a->standFrame = getVarOrDirectByte(0x80); - break; - case 7: /* ignore */ - getVarOrDirectByte(0x80); - getVarOrDirectByte(0x40); - getVarOrDirectByte(0x20); - break; - case 8: /* init */ - a->initActor(0); - break; - case 9: /* elevation */ - a->elevation = getVarOrDirectWord(0x80); - a->needRedraw = true; - a->needBgReset = true; - break; - case 10: /* defaultanims */ - a->initFrame = 1; - a->walkFrame = 2; - a->standFrame = 3; - a->talkFrame1 = 4; - a->talkFrame2 = 5; - break; - case 11: /* palette */ - i = getVarOrDirectByte(0x80); - j = getVarOrDirectByte(0x40); - checkRange(31, 0, i, "Illegal palet slot %d"); - a->palette[i] = j; - a->needRedraw = true; - break; - case 12: /* talk color */ - a->talkColor = getVarOrDirectByte(0x80); - break; - case 13: /* name */ - loadPtrToResource(rtActorName, a->number, NULL); - break; - case 14: /* initanim */ - a->initFrame = getVarOrDirectByte(0x80); - break; - case 15: /* unk */ - error("o5_actorset:unk not implemented"); -#if 0 - int16 args[16] = - { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - }; - getWordVararg(args); - for (i = 0; i < 16; i++) - if (args[i] != 0xFF) - a->palette[i] = args[i]; -#endif - break; - case 16: /* width */ - a->width = getVarOrDirectByte(0x80); - break; - case 17: /* scale */ - if (_gameId == GID_MONKEY_VGA) { - a->scalex = a->scaley = getVarOrDirectByte(0x80); - } else { - a->scalex = getVarOrDirectByte(0x80); - a->scaley = getVarOrDirectByte(0x40); - } - - if (a->scalex > 255 || a->scaley > 255) - error("Setting an bad actor scale!"); - a->needRedraw = true; - a->needBgReset = true; - break; - case 18: /* neverzclip */ - a->forceClip = 0; - break; - case 19: /* setzclip */ - a->forceClip = getVarOrDirectByte(0x80); - break; - case 20: /* ignoreboxes */ - case 21: /* followboxes */ - a->ignoreBoxes = !(_opcode & 1); - a->forceClip = 0; - if (a->isInCurrentRoom()) - a->putActor(a->x, a->y, a->room); - break; - - case 22: /* animspeed */ - a->animSpeed = getVarOrDirectByte(0x80); - a->animProgress = 0; - break; - case 23: /* unk2 */ - a->shadow_mode = getVarOrDirectByte(0x80); /* shadow mode */ - break; - default: - warning("o5_actorSet: default case"); - } - } -} - -void Scumm::o5_setClass() -{ - int obj = getVarOrDirectWord(0x80); - int newClass; - - while ((_opcode = fetchScriptByte()) != 0xFF) { - newClass = getVarOrDirectWord(0x80); - if (newClass == 0) { - _classData[obj] = 0; - if ((_features & GF_SMALL_HEADER) && obj <= NUM_ACTORS) { - Actor *a; - a = derefActorSafe(obj, "setClass"); - a->ignoreBoxes = 0; - a->forceClip = 0; - } - continue; - } - - if (_gameId == GID_INDY3_256) - newClass--; - - putClass(obj, newClass, (newClass & 0x80)); - } -} - -void Scumm::o5_add() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - setResult(readVar(_resultVarNumber) + a); -} - -void Scumm::o5_and() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - setResult(readVar(_resultVarNumber) & a); -} - -void Scumm::o5_animateActor() -{ - int act = getVarOrDirectByte(0x80); - int anim = getVarOrDirectByte(0x40); - - Actor *a = derefActorSafe(act, "o5_animateActor"); - if (!a) - return; - - a->animateActor(anim); -} - -void Scumm::o5_badOpcode() -{ - error("Scumm opcode %d illegal", _opcode); -} - -void Scumm::o5_breakHere() -{ - updateScriptPtr(); - _currentScript = 0xFF; -} - -void Scumm::o5_chainScript() -{ - int16 vars[16]; - int data; - int cur; - - data = getVarOrDirectByte(0x80); - - getWordVararg(vars); - - cur = _currentScript; - - vm.slot[cur].number = 0; - vm.slot[cur].status = 0; - _currentScript = 0xFF; - - runScript(data, vm.slot[cur].unk1, vm.slot[cur].unk2, vars); -} - -void Scumm::o5_cursorCommand() -{ - int i, j, k; - int16 table[16]; - switch ((_opcode = fetchScriptByte()) & 0x1F) { - case 1: /* cursor show */ - _cursorState = 1; - verbMouseOver(0); - break; - case 2: /* cursor hide */ - _cursorState = 0; - verbMouseOver(0); - break; - case 3: /* userput on */ - _userPut = 1; - break; - case 4: /* userput off */ - _userPut = 0; - break; - case 5: /* cursor soft on */ - _cursorState++; - verbMouseOver(0); - break; - case 6: /* cursor soft off */ - _cursorState--; - verbMouseOver(0); - break; - case 7: /* userput soft on */ - _userPut++; - break; - case 8: /* userput soft off */ - _userPut--; - break; - case 10: /* set cursor img */ - i = getVarOrDirectByte(0x80); - j = getVarOrDirectByte(0x40); - if (_gameId != GID_LOOM256) - setCursorImg(i, j, 1); - break; - case 11: /* set cursor hotspot */ - i = getVarOrDirectByte(0x80); - j = getVarOrDirectByte(0x40); - k = getVarOrDirectByte(0x20); - setCursorHotspot2(j, k); - break; - - case 12: /* init cursor */ - setCursor(getVarOrDirectByte(0x80)); - break; - case 13: /* init charset */ - initCharset(getVarOrDirectByte(0x80)); - break; - case 14: /* unk */ - getWordVararg(table); - for (i = 0; i < 16; i++) - charset._colorMap[i] = _charsetData[string[1].t_charset][i] = (unsigned char)table[i]; - break; - } - - _vars[VAR_CURSORSTATE] = _cursorState; - _vars[VAR_USERPUT] = _userPut; -} - -void Scumm::o5_cutscene() -{ - int16 args[16]; - getWordVararg(args); - cutscene(args); -} - -void Scumm::o5_endCutscene() -{ - endCutscene(); -} - -void Scumm::o5_debug() -{ - getVarOrDirectWord(0x80); -} - -void Scumm::o5_decrement() -{ - getResultPos(); - setResult(readVar(_resultVarNumber) - 1); -} - -void Scumm::o5_delay() -{ - int delay = fetchScriptByte(); - delay |= fetchScriptByte() << 8; - delay |= fetchScriptByte() << 16; - vm.slot[_currentScript].delay = delay; - vm.slot[_currentScript].status = 1; - - o5_breakHere(); -} - -void Scumm::o5_delayVariable() -{ - vm.slot[_currentScript].delay = readVar(fetchScriptWord()); - vm.slot[_currentScript].status = 1; - o5_breakHere(); -} - -void Scumm::o5_divide() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - if (a == 0) { - error("Divide by zero"); - setResult(0); - } else - setResult(readVar(_resultVarNumber) / a); -} - -void Scumm::o5_doSentence() -{ - int a, b; - SentenceTab *st; - - a = getVarOrDirectByte(0x80); - if (a == 0xFE) { - _sentenceNum = 0; - stopScriptNr(_vars[VAR_SENTENCE_SCRIPT]); - clearClickedStatus(); - return; - } - - st = &sentence[_sentenceNum++]; - - st->unk5 = a; - st->unk4 = getVarOrDirectWord(0x40); - b = st->unk3 = getVarOrDirectWord(0x20); - if (b == 0) { - st->unk2 = 0; - } else { - st->unk2 = 1; - } - st->unk = 0; -} - -void Scumm::o5_drawBox() -{ - int x, y, x2, y2, color; - - x = getVarOrDirectWord(0x80); - y = getVarOrDirectWord(0x40); - - _opcode = fetchScriptByte(); - x2 = getVarOrDirectWord(0x80); - y2 = getVarOrDirectWord(0x40); - color = getVarOrDirectByte(0x20); - - drawBox(x, y, x2, y2, color); -} - -void Scumm::o5_drawObject() -{ - int state, obj, idx, i; - ObjectData *od; - uint16 x, y, w, h; - int xpos, ypos; - - state = 1; - xpos = ypos = 255; - obj = getVarOrDirectWord(0x80); - - if (_features & GF_SMALL_HEADER) { - xpos = getVarOrDirectWord(0x40); - ypos = getVarOrDirectWord(0x20); - } else { - switch ((_opcode = fetchScriptByte()) & 0x1F) { - case 1: /* draw at */ - xpos = getVarOrDirectWord(0x80); - ypos = getVarOrDirectWord(0x40); - break; - case 2: /* set state */ - state = getVarOrDirectWord(0x80); - break; - case 0x1F: /* neither */ - break; - default: - error("o5_drawObject: default case"); - } - } - - idx = getObjectIndex(obj); - if (idx == -1) - return; - - od = &_objs[idx]; - if (xpos != 0xFF) { - od->walk_x += (xpos << 3) - od->x_pos; - od->x_pos = xpos << 3; - od->walk_y += (ypos << 3) - od->y_pos; - od->y_pos = ypos << 3; - } - addObjectToDrawQue(idx); - - x = od->x_pos; - y = od->y_pos; - w = od->width; - h = od->height; - - i = _numObjectsInRoom; - do { - if (_objs[i].x_pos == x && _objs[i].y_pos == y && _objs[i].width == w && _objs[i].height == h) - putState(_objs[i].obj_nr, 0); - } while (--i); - - putState(obj, state); -} - -void Scumm::o5_dummy() -{ - /* nothing */ -} - - -void Scumm::o5_expression() -{ - int dst, i; - - _scummStackPos = 0; - getResultPos(); - dst = _resultVarNumber; - - while ((_opcode = fetchScriptByte()) != 0xFF) { - switch (_opcode & 0x1F) { - case 1: /* varordirect */ - push(getVarOrDirectWord(0x80)); - break; - case 2: /* add */ - i = pop(); - push(i + pop()); - break; - case 3: /* sub */ - i = pop(); - push(pop() - i); - break; - case 4: /* mul */ - i = pop(); - push(i * pop()); - break; - case 5: /* div */ - i = pop(); - if (i == 0) - error("Divide by zero"); - push(pop() / i); - break; - case 6: /* normal opcode */ - _opcode = fetchScriptByte(); - (this->*(getOpcode(_opcode))) (); - push(_vars[0]); - break; - } - } - - _resultVarNumber = dst; - setResult(pop()); -} - -void Scumm::o5_faceActor() -{ - int act, obj; - act = getVarOrDirectByte(0x80); - obj = getVarOrDirectWord(0x40); - faceActorToObj(act, obj); -} - -void Scumm::o5_findInventory() -{ - int t; - getResultPos(); - t = getVarOrDirectByte(0x80); - setResult(findInventory(t, getVarOrDirectByte(0x40))); -} - -void Scumm::o5_findObject() -{ - int t; - getResultPos(); - t = getVarOrDirectWord(0x80); - setResult(findObject(t, getVarOrDirectWord(0x40))); -} - -void Scumm::o5_freezeScripts() -{ - int scr = getVarOrDirectByte(0x80); - - if (scr != 0) - freezeScripts(scr); - else - unfreezeScripts(); -} - -void Scumm::o5_getActorCostume() -{ - getResultPos(); - setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorCostume")->costume); -} - -void Scumm::o5_getActorElevation() -{ - getResultPos(); - setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorElevation")->elevation); -} - -void Scumm::o5_getActorFacing() -{ - getResultPos(); - setResult(newDirToOldDir(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorFacing")->facing)); -} - -void Scumm::o5_getActorMoving() -{ - getResultPos(); - setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorMoving")->moving); -} - -void Scumm::o5_getActorRoom() -{ - int temp; - Actor *act; - getResultPos(); - temp = getVarOrDirectByte(0x80); - - act = derefActorSafe(temp, "o5_getActorRoom"); - if (!act) - return; - - setResult(act->room); -} - -void Scumm::o5_getActorScale() -{ - if (_gameId == GID_INDY3_256) { - getVarOrDirectByte(0x80); /*FIXME: missing stuff here */ - return; - } - getResultPos(); - setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorScale")->scalex); -} - -void Scumm::o5_getActorWalkBox() -{ - Actor *a; - getResultPos(); - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorWalkbox"); - if (a) // FIXME - bug 572977 workaround - setResult(a->walkbox); - else - setResult(0); -} - -void Scumm::o5_getActorWidth() -{ - getResultPos(); - setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorWidth")->width); -} - -void Scumm::o5_getActorX() -{ - int a; - getResultPos(); - - if (_gameId == GID_INDY3_256) - a = getVarOrDirectByte(0x80); - else - a = getVarOrDirectWord(0x80); - - setResult(getObjX(a)); -} - -void Scumm::o5_getActorY() -{ - int a; - getResultPos(); - - if (_gameId == GID_INDY3_256) - a = getVarOrDirectByte(0x80); - else - a = getVarOrDirectWord(0x80); - - setResult(getObjY(a)); -} - -void Scumm::o5_getAnimCounter() -{ - Actor *a; - getResultPos(); - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorAnimCounter"); - - if (a) // FIXME - setResult(a->cost.animCounter1); - else - setResult(0); -} - -void Scumm::o5_getClosestObjActor() -{ - int obj; - int act; - int closest_obj = 0xFF, closest_dist = 0xFF; - int dist; - - getResultPos(); - - act = getVarOrDirectWord(0x80); - obj = _vars[VAR_V5_OBJECT_HI]; - - do { - dist = getObjActToObjActDist(act, obj); - if (dist < closest_dist) { - closest_dist = dist; - closest_obj = obj; - } - } while (--obj >= _vars[VAR_V5_OBJECT_LO]); - - setResult(closest_dist); -} - -void Scumm::o5_getDist() -{ - int o1, o2; - int r; - getResultPos(); - o1 = getVarOrDirectWord(0x80); - o2 = getVarOrDirectWord(0x40); - r = getObjActToObjActDist(o1, o2); - - /* FIXME: MI2 race workaround, see bug 597022 */ - if (_gameId == GID_MONKEY2 && vm.slot[_currentScript].number == 40 && r < 60) - r = 60; - - setResult(r); -} - -void Scumm::o5_getInventoryCount() -{ - getResultPos(); - setResult(getInventoryCount(getVarOrDirectByte(0x80))); -} - -void Scumm::o5_getObjectOwner() -{ - getResultPos(); - setResult(getOwner(getVarOrDirectWord(0x80))); -} - -void Scumm::o5_getObjectState() -{ - if (_features & GF_SMALL_HEADER) { - int a = getVarOrDirectWord(0x80); - int b = getVarOrDirectByte(0x40); - - if ((getState(a) & 0xF0 >> 4) != b) - o5_jumpRelative(); - else - ignoreScriptWord(); - } else { - getResultPos(); - setResult(getState(getVarOrDirectWord(0x80))); - } -} - -void Scumm::o5_getRandomNr() -{ - getResultPos(); - setResult(getRandomNumber(getVarOrDirectByte(0x80))); -} - -void Scumm::o5_getScriptRunning() -{ - getResultPos(); - setResult(isScriptRunning(getVarOrDirectByte(0x80))); -} - -void Scumm::o5_getVerbEntrypoint() -{ - int a, b; - getResultPos(); - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - - setResult(getVerbEntrypoint(a, b)); -} - -void Scumm::o5_ifClassOfIs() -{ - int act, cls, b = 0; - bool cond = true; - - act = getVarOrDirectWord(0x80); - - while ((_opcode = fetchScriptByte()) != 0xFF) { - cls = getVarOrDirectWord(0x80); - - if (!cls) // FIXME: Ender can't remember why this is here, - b=false; // but it fixes an oddball zak256 crash - else - b = getClass(act, cls); - - if (cls & 0x80 && !b || !(cls & 0x80) && b) - cond = false; - } - if (cond) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_increment() -{ - getResultPos(); - setResult(readVar(_resultVarNumber) + 1); -} - -void Scumm::o5_isActorInBox() -{ - int box; - Actor *a; - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_isActorInBox"); - box = getVarOrDirectByte(0x40); - - if (!checkXYInBoxBounds(box, a->x, a->y)) - o5_jumpRelative(); - else - ignoreScriptWord(); -} - -void Scumm::o5_isEqual() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - if (b == a) - ignoreScriptWord(); - else - o5_jumpRelative(); - -} - -void Scumm::o5_isGreater() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - if (b > a) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_isGreaterEqual() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - if (b >= a) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_isLess() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - - if (b < a) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_lessOrEqual() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - if (b <= a) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_isNotEqual() -{ - int16 a = readVar(fetchScriptWord()); - int16 b = getVarOrDirectWord(0x80); - if (b != a) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_notEqualZero() -{ - int a = readVar(fetchScriptWord()); - if (a != 0) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_equalZero() -{ - int a = readVar(fetchScriptWord()); - if (a == 0) - ignoreScriptWord(); - else - o5_jumpRelative(); -} - -void Scumm::o5_isSoundRunning() -{ - int snd; - getResultPos(); - snd = getVarOrDirectByte(0x80); - if (snd) - snd = _sound->isSoundRunning(snd); - setResult(snd); -} - -void Scumm::o5_jumpRelative() -{ - _scriptPointer += (int16)fetchScriptWord(); -} - -void Scumm::o5_lights() -{ - int a, b, c; - - a = getVarOrDirectByte(0x80); - b = fetchScriptByte(); - c = fetchScriptByte(); - - if (c == 0) - _vars[VAR_CURRENT_LIGHTS] = a; - else if (c == 1) { - _flashlightXStrips = a; - _flashlightYStrips = b; - } - _fullRedraw = 1; -} - -void Scumm::o5_loadRoom() -{ - int room; - - room = getVarOrDirectByte(0x80); - startScene(room, 0, 0); - _fullRedraw = 1; -} - -void Scumm::o5_loadRoomWithEgo() -{ - Actor *a; - int obj, room, x, y; - - obj = getVarOrDirectWord(0x80); - room = getVarOrDirectByte(0x40); - - a = derefActorSafe(_vars[VAR_EGO], "o5_loadRoomWithEgo"); - - a->putActor(0, 0, room); - _egoPositioned = false; - - x = (int16)fetchScriptWord(); - y = (int16)fetchScriptWord(); - - _vars[VAR_WALKTO_OBJ] = obj; - startScene(a->room, a, obj); - _vars[VAR_WALKTO_OBJ] = 0; - - camera._dest.x = camera._cur.x = a->x; - setCameraAt(a->x, a->y); - setCameraFollows(a); - - _fullRedraw = 1; - - if (x != -1) { - a->startWalkActor(x, y, -1); - } -} - -void Scumm::o5_matrixOps() -{ - int a, b; - - if (_features & GF_OLD256) { - a = getVarOrDirectByte(0x80); - b = fetchScriptByte(); - setBoxFlags(a, b); - return; - } - - _opcode = fetchScriptByte(); - switch (_opcode & 0x1F) { - case 1: - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - setBoxFlags(a, b); - break; - case 2: - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - setBoxScale(a, b); - break; - case 3: - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - setBoxScale(a, (b - 1) | 0x8000); - break; - case 4: - createBoxMatrix(); - break; - } -} - -void Scumm::o5_move() -{ - getResultPos(); - setResult(getVarOrDirectWord(0x80)); -} - -void Scumm::o5_multiply() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - setResult(readVar(_resultVarNumber) * a); -} - - -void Scumm::o5_or() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - setResult(readVar(_resultVarNumber) | a); -} - -void Scumm::o5_overRide() -{ - if (fetchScriptByte() != 0) - beginOverride(); - else - endOverride(); -} - -void Scumm::o5_panCameraTo() -{ - panCameraTo(getVarOrDirectWord(0x80), 0); -} - -void Scumm::o5_pickupObject() -{ - int obj, room; - if (_features & GF_OLD256) { - o5_drawObject(); - return; - } - - obj = getVarOrDirectWord(0x80); - room = getVarOrDirectByte(0x40); - if (room == 0) - room = _roomResource; - addObjectToInventory(obj, room); - putOwner(obj, _vars[VAR_EGO]); - putClass(obj, 32, 1); - putState(obj, 1); - removeObjectFromRoom(obj); - clearDrawObjectQueue(); - runHook(1); -} - -void Scumm::o5_print() -{ - _actorToPrintStrFor = getVarOrDirectByte(0x80); - decodeParseString(); -} - -void Scumm::o5_printEgo() -{ - _actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; - decodeParseString(); -} - -void Scumm::o5_pseudoRoom() -{ - int i = fetchScriptByte(), j; - while ((j = fetchScriptByte()) != 0) { - if (j >= 0x80) { - _resourceMapper[j & 0x7F] = i; - } - } -} - -void Scumm::o5_putActor() -{ - int x, y; - Actor *a; - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActor"); - if (!a) - return; - x = getVarOrDirectWord(0x40); - y = getVarOrDirectWord(0x20); - - a->putActor(x, y, a->room); -} - - -void Scumm::o5_putActorAtObject() -{ - int obj, x, y; - Actor *a; - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActorAtObject"); - obj = getVarOrDirectWord(0x40); - if (whereIsObject(obj) != WIO_NOT_FOUND) - getObjectXYPos(obj, x, y); - else { - x = 240; - y = 120; - } - a->putActor(x, y, a->room); -} - -void Scumm::o5_putActorInRoom() -{ - int room; - Actor *a; - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActorInRoom"); - room = getVarOrDirectByte(0x40); - if (a->visible && _currentRoom != room && _vars[VAR_TALK_ACTOR] == a->number) { - clearMsgQueue(); - } - a->room = room; - if (!room) - a->putActor(0, 0, 0); -} - -void Scumm::o5_quitPauseRestart() -{ - switch (fetchScriptByte()) { - case 1: - pauseGame(false); - break; - case 3: - shutDown(0); - break; - } -} - -void Scumm::o5_resourceRoutines() -{ - int resid = 0; - - _opcode = fetchScriptByte(); - if (_opcode != 17) - resid = getVarOrDirectByte(0x80); - if (_features & GF_OLD256) /*FIXME: find a better way to implement this */ - _opcode &= 0x3F; - switch (_opcode & 0x1F) { - case 1: /* load script */ - ensureResourceLoaded(rtScript, resid); - break; - case 2: /* load sound */ - ensureResourceLoaded(rtSound, resid); - break; - case 3: /* load costume */ - ensureResourceLoaded(rtCostume, resid); - break; - case 4: /* load room */ - if (_features & GF_OLD256) - ensureResourceLoaded(rtScript, resid & 0x7F); /*FIXME: missing stuff... */ - else - ensureResourceLoaded(rtRoom, resid); - break; - case 5: /* nuke script */ - setResourceCounter(rtScript, resid, 0x7F); - break; - case 6: /* nuke sound */ - setResourceCounter(rtSound, resid, 0x7F); - break; - case 7: /* nuke costume */ - setResourceCounter(rtCostume, resid, 0x7F); - break; - case 8: /* nuke room */ - setResourceCounter(rtRoom, resid, 0x7F); - break; - case 9: /* lock script */ - if (resid >= _numGlobalScripts) - break; - lock(rtScript, resid); - break; - case 10: /* lock sound */ - lock(rtSound, resid); - break; - case 11: /* lock costume */ - lock(rtCostume, resid); - break; - case 12: /* lock room */ - if (resid > 0x7F) - resid = _resourceMapper[resid & 0x7F]; - lock(rtRoom, resid); - break; - case 13: /* unlock script */ - if (resid >= _numGlobalScripts) - break; - unlock(rtScript, resid); - break; - case 14: /* unlock sound */ - unlock(rtSound, resid); - break; - case 15: /* unlock costume */ - unlock(rtCostume, resid); - break; - case 16: /* unlock room */ - if (resid > 0x7F) - resid = _resourceMapper[resid & 0x7F]; - unlock(rtRoom, resid); - break; - case 17: /* clear heap */ - heapClear(0); - unkHeapProc2(0, 0); - break; - case 18: /* load charset */ - loadCharset(resid); - break; - case 19: /* nuke charset */ - nukeCharset(resid); - break; - case 20: /* load fl object */ - loadFlObject(getVarOrDirectWord(0x40), resid); - break; - default: - warning("Unknown o5_resourcesroutine: %d", _opcode & 0x1F); - break; - } -} - -void Scumm::o5_roomOps() -{ - int a = 0, b = 0, c, d, e; - - if (_features & GF_OLD256) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - - _opcode = fetchScriptByte(); - - switch (_opcode & 0x1F) { - case 1: /* room scroll */ - if (!(_features & GF_OLD256)) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - if (a < 160) - a = 160; - if (b < 160) - b = 160; - if (a > _scrWidth - 160) - a = _scrWidth - 160; - if (b > _scrWidth - 160) - b = _scrWidth - 160; - _vars[VAR_CAMERA_MIN_X] = a; - _vars[VAR_CAMERA_MAX_X] = b; - break; - case 2: /* room color */ - if (_features & GF_SMALL_HEADER) { - if (!(_features & GF_OLD256)) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); - _currentPalette[a] = b; - _fullRedraw = 1; - } else { - error("room-color is no longer a valid command"); - } - break; - - case 3: /* set screen */ - if (!(_features & GF_OLD256)) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - initScreens(0, a, 320, b); - break; - case 4: /* set palette color */ - if (_features & GF_SMALL_HEADER) { - if (!(_features & GF_OLD256)) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); - _shadowPalette[b] = a; - setDirtyColors(b, b); - } else { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - c = getVarOrDirectWord(0x20); - _opcode = fetchScriptByte(); - d = getVarOrDirectByte(0x80); - setPalColor(d, a, b, c); /* index, r, g, b */ - } - break; - case 5: /* shake on */ - setShake(1); - break; - case 6: /* shake off */ - setShake(0); - break; - case 7: /* room scale for old games */ - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - _opcode = fetchScriptByte(); - c = getVarOrDirectByte(0x80); - d = getVarOrDirectByte(0x40); - _opcode = fetchScriptByte(); - e = getVarOrDirectByte(0x40); - setScaleItem(e - 1, b, a, d, c); - break; - case 8: /* room scale? */ - if (_features & GF_SMALL_HEADER) { - if (!(_features & GF_OLD256)) { - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - } - c = getVarOrDirectWord(0x20); - } else { - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - c = getVarOrDirectByte(0x20); - } - darkenPalette(b, c, a, a, a); - break; - case 9: /* ? */ - _saveLoadFlag = getVarOrDirectByte(0x80); - _saveLoadSlot = getVarOrDirectByte(0x40); - _saveLoadSlot = 99; /* use this slot */ - _saveLoadCompatible = true; - break; - case 10: /* ? */ - a = getVarOrDirectWord(0x80); - if (a) { - _switchRoomEffect = (byte)a; - _switchRoomEffect2 = (byte)(a >> 8); - } else { - fadeIn(_newEffect); - } - break; - case 11: /* ? */ - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - c = getVarOrDirectWord(0x20); - _opcode = fetchScriptByte(); - d = getVarOrDirectByte(0x80); - e = getVarOrDirectByte(0x40); - darkenPalette(d, e, a, b, c); - break; - case 12: /* ? */ - a = getVarOrDirectWord(0x80); - b = getVarOrDirectWord(0x40); - c = getVarOrDirectWord(0x20); - _opcode = fetchScriptByte(); - d = getVarOrDirectByte(0x80); - e = getVarOrDirectByte(0x40); - unkRoomFunc3(d, e, a, b, c); - break; - - case 13:{ /* save-string */ - char buf[256], *s; - FILE *out; - - a = getVarOrDirectByte(0x80); - - // FIXME - check for buffer overflow - strcpy(buf, getSavePath()); - s = buf + strlen(buf); - while ((*s++ = fetchScriptByte())); - - // Use buf as filename - out = fopen(buf, "wb"); - if (out) { - byte *ptr; - ptr = getResourceAddress(rtString, a); - fwrite(ptr, getStringLen(ptr) + 1, 1, out); - fclose(out); - } - break; - } - case 14:{ /* load-string */ - char buf[256], *s; - FILE *in; - - a = getVarOrDirectByte(0x80); - - // FIXME - check for buffer overflow - strcpy(buf, getSavePath()); - s = buf + strlen(buf); - while ((*s++ = fetchScriptByte())); - - // Use buf as filename - in = fopen(buf, "rb"); - if (in) { - byte *ptr; - int len; - fseek(in, 0, SEEK_END); - len = ftell(in); // Determine file size - ptr = (byte *)calloc(len + 1, 1); // Create a zero terminated buffer - fseek(in, 0, SEEK_SET); - fread(ptr, len, 1, in); // Read in the data - fclose(in); - loadPtrToResource(rtString, a, ptr); - free(ptr); - } - break; - } - case 15: /* palmanip */ - a = getVarOrDirectByte(0x80); - _opcode = fetchScriptByte(); - b = getVarOrDirectByte(0x80); - c = getVarOrDirectByte(0x40); - _opcode = fetchScriptByte(); - d = getVarOrDirectByte(0x80); - palManipulate(b, c, a, d, 1); - break; - - case 16: - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - if (a < 1) - a = 1; /* FIXME: ZAK256 */ - checkRange(16, 1, a, "o5_roomOps: 16: color cycle out of range (%d)"); - _colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0; - break; - } -} - -void Scumm::o5_saveRestoreVerbs() -{ - int a, b, c, slot, slot2; - - _opcode = fetchScriptByte(); - - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - c = getVarOrDirectByte(0x20); - - switch (_opcode) { - case 1: /* hide verbs */ - while (a <= b) { - slot = getVerbSlot(a, 0); - if (slot && _verbs[slot].saveid == 0) { - _verbs[slot].saveid = c; - drawVerb(slot, 0); - verbMouseOver(0); - } - a++; - } - break; - case 2: /* show verbs */ - while (a <= b) { - slot = getVerbSlot(a, c); - if (slot) { - slot2 = getVerbSlot(a, 0); - if (slot2) - killVerb(slot2); - slot = getVerbSlot(a, c); - _verbs[slot].saveid = 0; - drawVerb(slot, 0); - verbMouseOver(0); - } - a++; - } - break; - case 3: /* kill verbs */ - while (a <= b) { - slot = getVerbSlot(a, c); - if (slot) - killVerb(slot); - a++; - } - break; - default: - error("o5_saveRestoreVerbs: invalid opcode"); - } -} - -void Scumm::o5_setCameraAt() -{ - setCameraAtEx(getVarOrDirectWord(0x80)); -} - -void Scumm::o5_setObjectName() -{ - int obj = getVarOrDirectWord(0x80); - int size; - int a; - int i = 0; - byte *name = NULL; - unsigned char work[255]; - - // Read in new name - while ((a = fetchScriptByte()) != 0) { - work[i++] = a; - if (a == 0xFF) { - work[i++] = fetchScriptByte(); - work[i++] = fetchScriptByte(); - work[i++] = fetchScriptByte(); - } - } - work[i] = 0; - - if (obj < NUM_ACTORS) - error("Can't set actor %d name with new-name-of", obj); - - if (!getOBCDFromObject(obj)) { - // FIXME: Bug 587553. This is an odd one and looks more like - // an actual bug in the original script. Usually we would error - warning("Can't find OBCD to rename object %d to %s", obj, work); - return; - } - - name = getObjOrActorName(obj); - - if (_features & GF_SMALL_HEADER) { - // FIXME this is hack to make MonkeyVGA work. needed at least for the german - // version but possibly for others as well. There is no apparent other - // way to determine the available space that works in all cases... - byte *objptr; - byte offset = 0; - - objptr = getOBCDFromObject(obj); - offset = READ_LE_UINT16(objptr + 18); - size = READ_LE_UINT16(objptr) - offset; - } else { - size = getResourceDataSize(name); - } - - if (i >= size) { - warning("New name of object %d too long (old *%s* new *%s*)", obj, name, work); - i = size - 1; - } - - strcpy((char *)name, (char *)work); - runHook(0); -} - -void Scumm::o5_setOwnerOf() -{ - int obj, owner; - - obj = getVarOrDirectWord(0x80); - owner = getVarOrDirectByte(0x40); - - setOwnerOf(obj, owner); -} - -void Scumm::o5_setState() -{ - int obj, state; - obj = getVarOrDirectWord(0x80); - state = getVarOrDirectByte(0x40); - putState(obj, state); - removeObjectFromRoom(obj); - if (_BgNeedsRedraw) - clearDrawObjectQueue(); -} - -void Scumm::o5_setVarRange() -{ - int a, b; - - getResultPos(); - a = fetchScriptByte(); - do { - if (_opcode & 0x80) - b = fetchScriptWord(); - else - b = fetchScriptByte(); - - setResult(b); - _resultVarNumber++; - } while (--a); -} - -void Scumm::o5_soundKludge() -{ - int16 items[15]; - int i; - - if (_features & GF_SMALL_HEADER) // Is dummy function in - return; // SCUMM V3 - - for (i = 0; i < 15; i++) - items[i] = 0; - - getWordVararg(items); - - _sound->soundKludge(items); -} - -void Scumm::o5_startMusic() -{ - _sound->addSoundToQueue(getVarOrDirectByte(0x80)); -} - -void Scumm::o5_startObject() -{ - int obj, script; - int16 data[16]; - - obj = getVarOrDirectWord(0x80); - script = getVarOrDirectByte(0x40); - - getWordVararg(data); - runVerbCode(obj, script, 0, 0, data); -} - -void Scumm::o5_startScript() -{ - int op, script; - int16 data[16]; - int a, b; - - op = _opcode; - script = getVarOrDirectByte(0x80); - - getWordVararg(data); - - a = b = 0; - if (op & 0x40) - b = 1; - if (op & 0x20) - a = 1; - - runScript(script, a, b, data); -} - -void Scumm::o5_startSound() -{ - - _vars[VAR_MUSIC_FLAG] = 0; - - _sound->addSoundToQueue(getVarOrDirectByte(0x80)); -} - -void Scumm::o5_stopMusic() -{ - _sound->stopAllSounds(); -} - -void Scumm::o5_stopObjectCode() -{ - stopObjectCode(); -} - -void Scumm::o5_stopObjectScript() -{ - stopObjectScript(getVarOrDirectWord(0x80)); -} - -void Scumm::o5_stopScript() -{ - int script; - - script = getVarOrDirectByte(0x80); - if (!script) - stopObjectCode(); - else - stopScriptNr(script); -} - -void Scumm::o5_stopSound() -{ - _sound->stopSound(getVarOrDirectByte(0x80)); -} - -void Scumm::o5_stringOps() -{ - int a, b, c, i; - byte *ptr; - - _opcode = fetchScriptByte(); - switch (_opcode & 0x1F) { - case 1: /* loadstring */ - loadPtrToResource(rtString, getVarOrDirectByte(0x80), NULL); - break; - case 2: /* copystring */ - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - nukeResource(rtString, a); - ptr = getResourceAddress(rtString, b); - if (ptr) - loadPtrToResource(rtString, a, ptr); - break; - case 3: /* set string char */ - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - ptr = getResourceAddress(rtString, a); - if (!(_gameId == GID_LOOM256)) { /* FIXME - LOOM256 */ - if (ptr == NULL) - error("String %d does not exist", a); - c = getVarOrDirectByte(0x20); - ptr[b] = c; - } else - getVarOrDirectByte(0x20); - - break; - - case 4: /* get string char */ - getResultPos(); - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - ptr = getResourceAddress(rtString, a); - if (ptr == NULL) - error("String %d does not exist", a); - setResult(ptr[b]); - break; - - case 5: /* create empty string */ - a = getVarOrDirectByte(0x80); - b = getVarOrDirectByte(0x40); - nukeResource(rtString, a); - if (b) { - ptr = createResource(rtString, a, b); - if (ptr) { - for (i = 0; i < b; i++) - ptr[i] = 0; - } - } - break; - } -} - -void Scumm::o5_subtract() -{ - int a; - getResultPos(); - a = getVarOrDirectWord(0x80); - setResult(readVar(_resultVarNumber) - a); -} - -void Scumm::o5_verbOps() -{ - int verb, slot; - VerbSlot *vs; - int a, b; - byte *ptr; - - verb = getVarOrDirectByte(0x80); - - slot = getVerbSlot(verb, 0); - checkRange(_maxVerbs - 1, 0, slot, "Illegal new verb slot %d"); - - vs = &_verbs[slot]; - vs->verbid = verb; - - while ((_opcode = fetchScriptByte()) != 0xFF) { - switch (_opcode & 0x1F) { - case 1: /* load image */ - a = getVarOrDirectWord(0x80); - if (slot) { - setVerbObject(_roomResource, a, slot); - vs->type = 1; - } - break; - case 2: /* load from code */ - loadPtrToResource(rtVerb, slot, NULL); - if (slot == 0) - nukeResource(rtVerb, slot); - vs->type = 0; - vs->imgindex = 0; - break; - case 3: /* color */ - vs->color = getVarOrDirectByte(0x80); - break; - case 4: /* set hi color */ - vs->hicolor = getVarOrDirectByte(0x80); - break; - case 5: /* set xy */ - vs->x = getVarOrDirectWord(0x80); - vs->y = getVarOrDirectWord(0x40); - // FIXME: hack loom notes into right spot - if (_gameId == GID_LOOM256) { - if ((verb >= 90) && (verb <= 97)) { // Notes - switch (verb) { - case 90: - case 91: - vs->y -= 7; - break; - case 92: - vs->y -= 6; - break; - case 93: - vs->y -= 4; - break; - case 94: - vs->y -= 3; - break; - case 95: - vs->y -= 1; - break; - case 97: - vs->y -= 5; - } - } - } - break; - case 6: /* set on */ - vs->curmode = 1; - break; - case 7: /* set off */ - vs->curmode = 0; - break; - case 8: /* delete */ - killVerb(slot); - break; - case 9: /* new */ - slot = getVerbSlot(verb, 0); - if (slot == 0) { - for (slot = 1; slot < _maxVerbs; slot++) { - if (_verbs[slot].verbid == 0) - break; - } - if (slot == _maxVerbs) - error("Too many verbs"); - } - vs = &_verbs[slot]; - vs->verbid = verb; - vs->color = 2; - vs->hicolor = 0; - vs->dimcolor = 8; - vs->type = 0; - vs->charset_nr = string[0].t_charset; - vs->curmode = 0; - vs->saveid = 0; - vs->key = 0; - vs->center = 0; - vs->imgindex = 0; - break; - - case 16: /* set dim color */ - vs->dimcolor = getVarOrDirectByte(0x80); - break; - case 17: /* dim */ - vs->curmode = 2; - break; - case 18: /* set key */ - vs->key = getVarOrDirectByte(0x80); - break; - case 19: /* set center */ - vs->center = 1; - break; - case 20: /* set to string */ - ptr = getResourceAddress(rtString, getVarOrDirectWord(0x80)); - if (!ptr) - nukeResource(rtVerb, slot); - else { - loadPtrToResource(rtVerb, slot, ptr); - } - if (slot == 0) - nukeResource(rtVerb, slot); - vs->type = 0; - vs->imgindex = 0; - break; - case 22: /* assign object */ - a = getVarOrDirectWord(0x80); - b = getVarOrDirectByte(0x40); - if (slot && vs->imgindex != a) { - setVerbObject(b, a, slot); - vs->type = 1; - vs->imgindex = a; - } - break; - case 23: /* set back color */ - vs->bkcolor = getVarOrDirectByte(0x80); - break; - } - } - drawVerb(slot, 0); - verbMouseOver(0); -} - -void Scumm::o5_wait() -{ - byte *oldaddr; - - - oldaddr = _scriptPointer - 1; - - if (_opcode == 0xAE && _gameId == GID_INDY3_256) { - _opcode = 2; - } else - _opcode = fetchScriptByte(); - - switch (_opcode & 0x1F) { - case 1: /* wait for actor */ - if (derefActorSafe(getVarOrDirectByte(0x80), "o5_wait")->moving) - break; - return; - case 2: /* wait for message */ - if (_vars[VAR_HAVE_MSG]) - break; - return; - case 3: /* wait for camera */ - if (camera._cur.x >> 3 != camera._dest.x >> 3) - break; - return; - case 4: /* wait for sentence */ - if (_sentenceNum) { - if (sentence[_sentenceNum - 1].unk && !isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) - return; - break; - } - if (!isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) - return; - break; - default: - error("o5_wait: default case"); - return; - } - - _scriptPointer = oldaddr; - o5_breakHere(); -} - -void Scumm::o5_walkActorTo() -{ - int x, y; - Actor *a; - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorTo"); - x = getVarOrDirectWord(0x40); - y = getVarOrDirectWord(0x20); - a->startWalkActor(x, y, -1); -} - -void Scumm::o5_walkActorToActor() -{ - int b, x, y; - Actor *a, *a2; - int nr; - int nr2 = getVarOrDirectByte(0x80); - a = derefActorSafe(nr2, "o5_walkActorToActor"); - if (!a) - return; - - if (!a->isInCurrentRoom()) { - getVarOrDirectByte(0x40); - fetchScriptByte(); - return; - } - - nr = getVarOrDirectByte(0x40); - if (nr == 106 && _gameId == GID_INDY4) { - warning("Bypassing Indy4 bug"); - fetchScriptByte(); - return; - } - // warning("walk actor %d to actor %d", nr, nr2); - a2 = derefActorSafe(nr, "o5_walkActorToActor(2)"); - if (!a2) - return; - - if (!a2->isInCurrentRoom()) { - fetchScriptByte(); - return; - } - b = fetchScriptByte(); /* distance from actor */ - if (b == 0xFF) { - b = a2->scalex * a->width / 0xFF; - b = b + b / 2; - } - x = a2->x; - y = a2->y; - if (x < a->x) - x += b; - else - x -= b; - - a->startWalkActor(x, y, -1); -} - -void Scumm::o5_walkActorToObject() -{ - int obj; - Actor *a; - - // warning("walk object to object"); - - a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject"); - obj = getVarOrDirectWord(0x40); - if (whereIsObject(obj) != WIO_NOT_FOUND) { - int x, y, dir; - getObjectXYPos(obj, x, y, dir); - a->startWalkActor(x, y, dir); - } -} - -int Scumm::getWordVararg(int16 *ptr) -{ - int i; - - for (i = 0; i < 15; i++) - ptr[i] = 0; - - i = 0; - while ((_opcode = fetchScriptByte()) != 0xFF) { - ptr[i++] = getVarOrDirectWord(0x80); - } - return i; -} - -int Scumm::getVarOrDirectWord(byte mask) -{ - if (_opcode & mask) - return readVar(fetchScriptWord()); - return (int16)fetchScriptWord(); -} - -int Scumm::getVarOrDirectByte(byte mask) -{ - if (_opcode & mask) - return readVar(fetchScriptWord()); - return fetchScriptByte(); -} - -void Scumm::decodeParseString() -{ - int textSlot; - - switch (_actorToPrintStrFor) { - case 252: - textSlot = 3; - break; - case 253: - textSlot = 2; - break; - case 254: - textSlot = 1; - break; - default: - textSlot = 0; - } - - string[textSlot].xpos = string[textSlot].t_xpos; - string[textSlot].ypos = string[textSlot].t_ypos; - string[textSlot].center = string[textSlot].t_center; - string[textSlot].overhead = string[textSlot].t_overhead; - string[textSlot].right = string[textSlot].t_right; - string[textSlot].color = string[textSlot].t_color; - string[textSlot].charset = string[textSlot].t_charset; - - while ((_opcode = fetchScriptByte()) != 0xFF) { - switch (_opcode & 0xF) { - case 0: /* set string xy */ - string[textSlot].xpos = getVarOrDirectWord(0x80); - string[textSlot].ypos = getVarOrDirectWord(0x40); - string[textSlot].overhead = false; - break; - case 1: /* color */ - string[textSlot].color = getVarOrDirectByte(0x80); - break; - case 2: /* right */ - string[textSlot].right = getVarOrDirectWord(0x80); - break; - case 4: /* center */ - string[textSlot].center = true; - string[textSlot].overhead = false; - break; - case 6: /* left */ - string[textSlot].center = false; - string[textSlot].overhead = false; - break; - case 7: /* overhead */ - string[textSlot].overhead = true; - break; - case 8:{ /* play loom talkie sound - use in other games ? */ - int x = getVarOrDirectWord(0x80); - int offset; - int delay; - - if (x != 0) - offset = (int)((x & 0xffff) * 7.5 - 22650); - else - offset = 0; - delay = (int)((getVarOrDirectWord(0x40) & 0xffff) * 7.5); - if (_gameId == GID_LOOM256) { - _vars[VAR_MI1_TIMER] = 0; - if (offset == 0 && delay == 0) { -#ifdef COMPRESSED_SOUND_FILE - if (_sound->stopMP3CD() == -1) -#endif - _system->stop_cdrom(); - } else { -#ifdef COMPRESSED_SOUND_FILE - if (_sound->playMP3CDTrack(1, 0, offset, delay) == -1) -#endif - _system->play_cdrom(1, 0, offset, delay); - } - } else { - warning("parseString: 8"); - } - } - break; - case 15: - _messagePtr = _scriptPointer; - switch (textSlot) { - case 0: - actorTalk(); - break; - case 1: - drawString(1); - break; - case 2: - unkMessage1(); - break; - case 3: - unkMessage2(); - break; - } - _scriptPointer = _messagePtr; - return; - default: - return; - } - } - - string[textSlot].t_xpos = string[textSlot].xpos; - string[textSlot].t_ypos = string[textSlot].ypos; - string[textSlot].t_center = string[textSlot].center; - string[textSlot].t_overhead = string[textSlot].overhead; - string[textSlot].t_right = string[textSlot].right; - string[textSlot].t_color = string[textSlot].color; - string[textSlot].t_charset = string[textSlot].charset; -} - -void Scumm::o5_oldRoomEffect() -{ - int a; - - _opcode = fetchScriptByte(); - if ((_opcode & 0x1F) == 3) { - a = getVarOrDirectWord(0x80); - if (a) { - _switchRoomEffect = (byte)a; - _switchRoomEffect2 = (byte)(a >> 8); - } else { - fadeIn(_newEffect); - } - } -} - -void Scumm::o5_pickupObjectOld() -{ - int obj = getVarOrDirectWord(0x80); - - // FIXME: Zak256 (Zaire): Why does this happen at all? - if (obj < 1) { - warning("pickupObjectOld received negative index %d (0x%02x)", obj, obj); - return; - } - - if (getObjectIndex(obj) == -1) - return; - - if (whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */ - return; /* object twice */ - - // warning("adding %d from %d to inventoryOld", obj, _currentRoom); - addObjectToInventory(obj, _roomResource); - removeObjectFromRoom(obj); - putOwner(obj, _vars[VAR_EGO]); - putClass(obj, 32, 1); - putState(obj, 1); - clearDrawObjectQueue(); - runHook(1); -} diff --git a/script_v2.cpp b/script_v2.cpp deleted file mode 100644 index e402495943..0000000000 --- a/script_v2.cpp +++ /dev/null @@ -1,3141 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" -#include "smush.h" - -#include "sound/mididrv.h" -#include "sound/imuse.h" - -void Scumm::setupOpcodes2() -{ - static const OpcodeProc opcode_list[256] = { - /* 00 */ - &Scumm::o6_pushByte, - &Scumm::o6_pushWord, - &Scumm::o6_pushByteVar, - &Scumm::o6_pushWordVar, - /* 04 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayRead, - &Scumm::o6_wordArrayRead, - /* 08 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayIndexedRead, - &Scumm::o6_wordArrayIndexedRead, - /* 0C */ - &Scumm::o6_dup, - &Scumm::o6_zero, - &Scumm::o6_eq, - &Scumm::o6_neq, - /* 10 */ - &Scumm::o6_gt, - &Scumm::o6_lt, - &Scumm::o6_le, - &Scumm::o6_ge, - /* 14 */ - &Scumm::o6_add, - &Scumm::o6_sub, - &Scumm::o6_mul, - &Scumm::o6_div, - /* 18 */ - &Scumm::o6_land, - &Scumm::o6_lor, - &Scumm::o6_kill, - &Scumm::o6_invalid, - /* 1C */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 20 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 24 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 28 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 2C */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 30 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 34 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 38 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 3C */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* 40 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_writeByteVar, - &Scumm::o6_writeWordVar, - /* 44 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayWrite, - &Scumm::o6_wordArrayWrite, - /* 48 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayIndexedWrite, - &Scumm::o6_wordArrayIndexedWrite, - /* 4C */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteVarInc, - &Scumm::o6_wordVarInc, - /* 50 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayInc, - &Scumm::o6_wordArrayInc, - /* 54 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteVarDec, - &Scumm::o6_wordVarDec, - /* 58 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_byteArrayDec, - &Scumm::o6_wordArrayDec, - /* 5C */ - &Scumm::o6_jumpTrue, - &Scumm::o6_jumpFalse, - &Scumm::o6_startScriptEx, - &Scumm::o6_startScript, - /* 60 */ - &Scumm::o6_startObject, - &Scumm::o6_setObjectState, - &Scumm::o6_setObjectXY, - &Scumm::o6_drawBlastObject, - /* 64 */ - &Scumm::o6_setBlastObjectWindow, - &Scumm::o6_stopObjectCode, - &Scumm::o6_stopObjectCode, - &Scumm::o6_endCutscene, - /* 68 */ - &Scumm::o6_cutScene, - &Scumm::o6_stopMusic, - &Scumm::o6_freezeUnfreeze, - &Scumm::o6_cursorCommand, - /* 6C */ - &Scumm::o6_breakHere, - &Scumm::o6_ifClassOfIs, - &Scumm::o6_setClass, - &Scumm::o6_getState, - /* 70 */ - &Scumm::o6_setState, - &Scumm::o6_setOwner, - &Scumm::o6_getOwner, - &Scumm::o6_jump, - /* 74 */ - &Scumm::o6_startSound, - &Scumm::o6_stopSound, - &Scumm::o6_startMusic, - &Scumm::o6_stopObjectScript, - /* 78 */ - &Scumm::o6_panCameraTo, - &Scumm::o6_actorFollowCamera, - &Scumm::o6_setCameraAt, - &Scumm::o6_loadRoom, - /* 7C */ - &Scumm::o6_stopScript, - &Scumm::o6_walkActorToObj, - &Scumm::o6_walkActorTo, - &Scumm::o6_putActorInRoom, - /* 80 */ - &Scumm::o6_putActorAtObject, - &Scumm::o6_faceActor, - &Scumm::o6_animateActor, - &Scumm::o6_doSentence, - /* 84 */ - &Scumm::o6_pickupObject, - &Scumm::o6_loadRoomWithEgo, - &Scumm::o6_invalid, - &Scumm::o6_getRandomNumber, - /* 88 */ - &Scumm::o6_getRandomNumberRange, - &Scumm::o6_invalid, - &Scumm::o6_getActorMoving, - &Scumm::o6_getScriptRunning, - /* 8C */ - &Scumm::o6_getActorRoom, - &Scumm::o6_getObjectX, - &Scumm::o6_getObjectY, - &Scumm::o6_getObjectOldDir, - /* 90 */ - &Scumm::o6_getActorWalkBox, - &Scumm::o6_getActorCostume, - &Scumm::o6_findInventory, - &Scumm::o6_getInventoryCount, - /* 94 */ - &Scumm::o6_getVerbFromXY, - &Scumm::o6_beginOverride, - &Scumm::o6_endOverride, - &Scumm::o6_setObjectName, - /* 98 */ - &Scumm::o6_isSoundRunning, - &Scumm::o6_setBoxFlags, - &Scumm::o6_createBoxMatrix, - &Scumm::o6_resourceRoutines, - /* 9C */ - &Scumm::o6_roomOps, - &Scumm::o6_actorSet, - &Scumm::o6_verbOps, - &Scumm::o6_getActorFromXY, - /* A0 */ - &Scumm::o6_findObject, - &Scumm::o6_pseudoRoom, - &Scumm::o6_getActorElevation, - &Scumm::o6_getVerbEntrypoint, - /* A4 */ - &Scumm::o6_arrayOps, - &Scumm::o6_saveRestoreVerbs, - &Scumm::o6_drawBox, - &Scumm::o6_invalid, - /* A8 */ - &Scumm::o6_getActorWidth, - &Scumm::o6_wait, - &Scumm::o6_getActorScaleX, - &Scumm::o6_getActorAnimCounter1, - /* AC */ - &Scumm::o6_soundKludge, - &Scumm::o6_isAnyOf, - &Scumm::o6_quitPauseRestart, - &Scumm::o6_isActorInBox, - /* B0 */ - &Scumm::o6_delay, - &Scumm::o6_delayLonger, - &Scumm::o6_delayVeryLong, - &Scumm::o6_stopSentence, - /* B4 */ - &Scumm::o6_print_0, - &Scumm::o6_print_1, - &Scumm::o6_print_2, - &Scumm::o6_print_3, - /* B8 */ - &Scumm::o6_printActor, - &Scumm::o6_printEgo, - &Scumm::o6_talkActor, - &Scumm::o6_talkEgo, - /* BC */ - &Scumm::o6_dim, - &Scumm::o5_dummy, - &Scumm::o6_runVerbCodeQuick, - &Scumm::o6_runScriptQuick, - /* C0 */ - &Scumm::o6_dim2, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* C4 */ - &Scumm::o6_abs, - &Scumm::o6_distObjectObject, - &Scumm::o6_distObjectPt, - &Scumm::o6_distPtPt, - /* C8 */ - &Scumm::o6_kernelFunction, - &Scumm::o6_miscOps, - &Scumm::o6_breakMaybe, - &Scumm::o6_pickOneOf, - /* CC */ - &Scumm::o6_pickOneOfDefault, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* D0 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_getAnimateVariable, - &Scumm::o6_invalid, - /* D4 */ - &Scumm::o6_invalid, - &Scumm::o6_jumpToScript, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* D8 */ - &Scumm::o6_isRoomScriptRunning, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* DC */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* E0 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* E4 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* E8 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* EC */ - &Scumm::o6_getActorPriority, - &Scumm::o6_getObjectNewDir, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* F0 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* F4 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* F8 */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - /* FC */ - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - &Scumm::o6_invalid, - }; - - static const char *opcode_lookup[] = { - /* 00 */ - "o6_pushByte", - "o6_pushWord", - "o6_pushByteVar", - "o6_pushWordVar", - /* 04 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayRead", - "o6_wordArrayRead", - /* 08 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayIndexedRead", - "o6_wordArrayIndexedRead", - /* 0C */ - "o6_dup", - "o6_zero", - "o6_eq", - "o6_neq", - /* 10 */ - "o6_gt", - "o6_lt", - "o6_le", - "o6_ge", - /* 14 */ - "o6_add", - "o6_sub", - "o6_mul", - "o6_div", - /* 18 */ - "o6_land", - "o6_lor", - "o6_kill", - "o6_invalid", - /* 1C */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 20 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 24 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 28 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 2C */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 30 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 34 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 38 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 3C */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* 40 */ - "o6_invalid", - "o6_invalid", - "o6_writeByteVar", - "o6_writeWordVar", - /* 44 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayWrite", - "o6_wordArrayWrite", - /* 48 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayIndexedWrite", - "o6_wordArrayIndexedWrite", - /* 4C */ - "o6_invalid", - "o6_invalid", - "o6_byteVarInc", - "o6_wordVarInc", - /* 50 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayInc", - "o6_wordArrayInc", - /* 54 */ - "o6_invalid", - "o6_invalid", - "o6_byteVarDec", - "o6_wordVarDec", - /* 58 */ - "o6_invalid", - "o6_invalid", - "o6_byteArrayDec", - "o6_wordArrayDec", - /* 5C */ - "o6_jumpTrue", - "o6_jumpFalse", - "o6_startScriptEx", - "o6_startScript", - /* 60 */ - "o6_startObject", - "o6_setObjectState", - "o6_setObjectXY", - "o6_drawBlastObject", - /* 64 */ - "o6_invalid", - "o6_stopObjectCode", - "o6_stopObjectCode", - "o6_endCutscene", - /* 68 */ - "o6_cutScene", - "o6_stopMusic", - "o6_freezeUnfreeze", - "o6_cursorCommand", - /* 6C */ - "o6_breakHere", - "o6_ifClassOfIs", - "o6_setClass", - "o6_getState", - /* 70 */ - "o6_setState", - "o6_setOwner", - "o6_getOwner", - "o6_jump", - /* 74 */ - "o6_startSound", - "o6_stopSound", - "o6_startMusic", - "o6_stopObjectScript", - /* 78 */ - "o6_panCameraTo", - "o6_actorFollowCamera", - "o6_setCameraAt", - "o6_loadRoom", - /* 7C */ - "o6_stopScript", - "o6_walkActorToObj", - "o6_walkActorTo", - "o6_putActorInRoom", - /* 80 */ - "o6_putActorAtObject", - "o6_faceActor", - "o6_animateActor", - "o6_doSentence", - /* 84 */ - "o6_pickupObject", - "o6_loadRoomWithEgo", - "o6_invalid", - "o6_getRandomNumber", - /* 88 */ - "o6_getRandomNumberRange", - "o6_invalid", - "o6_getActorMoving", - "o6_getScriptRunning", - /* 8C */ - "o6_getActorRoom", - "o6_getObjectX", - "o6_getObjectY", - "o6_getObjectOldDir", - /* 90 */ - "o6_getActorWalkBox", - "o6_getActorCostume", - "o6_findInventory", - "o6_getInventoryCount", - /* 94 */ - "o6_getVerbFromXY", - "o6_beginOverride", - "o6_endOverride", - "o6_setObjectName", - /* 98 */ - "o6_isSoundRunning", - "o6_setBoxFlags", - "o6_createBoxMatrix", - "o6_resourceRoutines", - /* 9C */ - "o6_roomOps", - "o6_actorSet", - "o6_verbOps", - "o6_getActorFromXY", - /* A0 */ - "o6_findObject", - "o6_pseudoRoom", - "o6_getActorElevation", - "o6_getVerbEntrypoint", - /* A4 */ - "o6_arrayOps", - "o6_saveRestoreVerbs", - "o6_drawBox", - "o6_invalid", - /* A8 */ - "o6_getActorWidth", - "o6_wait", - "o6_getActorScaleX", - "o6_getActorAnimCounter1", - /* AC */ - "o6_soundKludge", - "o6_isAnyOf", - "o6_quitPauseRestart", - "o6_isActorInBox", - /* B0 */ - "o6_delay", - "o6_delayLonger", - "o6_delayVeryLong", - "o6_stopSentence", - /* B4 */ - "o6_print_0", - "o6_print_1", - "o6_print_2", - "o6_print_3", - /* B8 */ - "o6_printActor", - "o6_printEgo", - "o6_talkActor", - "o6_talkEgo", - /* BC */ - "o6_dim", - "o6_invalid", - "o6_runVerbCodeQuick", - "o6_runScriptQuick", - /* C0 */ - "o6_dim2", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* C4 */ - "o6_abs", - "o6_distObjectObject", - "o6_distObjectPt", - "o6_distPtPt", - /* C8 */ - "o6_kernelFunction", - "o6_miscOps", - "o6_breakMaybe", - "o6_pickOneOf", - /* CC */ - "o6_pickOneOfDefault", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* D0 */ - "o6_invalid", - "o6_invalid", - "o6_getAnimateVariable", - "o6_invalid", - /* D4 */ - "o6_invalid", - "o6_jumpToScript", - "o6_invalid", - "o6_invalid", - /* D8 */ - "o6_isRoomScriptRunning", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* DC */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* E0 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* E4 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* E8 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* EC */ - "o6_invalid", - "o6_getObjectNewDir", - "o6_invalid", - "o6_invalid", - /* F0 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* F4 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* F8 */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid", - /* FC */ - "o6_invalid", - "o6_invalid", - "o6_invalid", - "o6_invalid" - }; - - _opcodes = opcode_list; - _opcodes_lookup = opcode_lookup; -} -void Scumm::o6_setBlastObjectWindow() -{ // Set BOMP processing window - int a, b, c, d; - - d = pop(); - c = pop(); - b = pop(); - a = pop(); - - warning("o6_bompWindow(%d, %d, %d, %d)", a, b, c, d); - // sub_274EF(a, b, c, d); -} - -int Scumm::popRoomAndObj(int *room) -{ - int obj; - - if (_features & GF_HAS_ROOMTABLE) { - obj = pop(); - *room = getObjectRoom(obj); - } else { - *room = pop(); - obj = pop(); - } - - return obj; -} - - -int Scumm::readArray(int array, int idx, int base) -{ - ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); - - if (ah == NULL) { - error("readArray: invalid array %d (%d)", array, readVar(array)); - } - - base += idx * ah->dim1_size; - - assert(base >= 0 && base < ah->dim1_size * ah->dim2_size); - - if (ah->type == 4) { - return ah->data[base]; - } else { - return (int16)READ_LE_UINT16(ah->data + base * 2); - } -} - -void Scumm::writeArray(int array, int idx, int base, int value) -{ - ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); - assert(ah); - base += idx * ah->dim1_size; - - assert(base >= 0 && base < ah->dim1_size * ah->dim2_size); - - if (ah->type == 4) { - ah->data[base] = value; - } else { - ((uint16 *)ah->data)[base] = TO_LE_16(value); - } -} - -int Scumm::getStackList(int16 *args, uint maxnum) -{ - uint num, i; - - for (i = 0; i < maxnum; i++) - args[i] = 0; - - num = pop(); - - if (num > maxnum) - error("Too many items %d in stack list, max %d", num, maxnum); - - i = num; - while (((int)--i) >= 0) { - args[i] = pop(); - } - - return num; -} - -void Scumm::o6_pushByte() -{ - push(fetchScriptByte()); -} - -void Scumm::o6_pushWord() -{ - push((int16)fetchScriptWord()); -} - -void Scumm::o6_pushByteVar() -{ - push(readVar(fetchScriptByte())); -} - -void Scumm::o6_pushWordVar() -{ - push(readVar(fetchScriptWord())); -} - -void Scumm::o6_invalid() -{ - error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); -} - -void Scumm::o6_byteArrayRead() -{ - int base = pop(); - push(readArray(fetchScriptByte(), 0, base)); -} - -void Scumm::o6_wordArrayRead() -{ - int base = pop(); - push(readArray(fetchScriptWord(), 0, base)); -} - -void Scumm::o6_byteArrayIndexedRead() -{ - int base = pop(); - int idx = pop(); - push(readArray(fetchScriptByte(), idx, base)); -} - -void Scumm::o6_wordArrayIndexedRead() -{ - int base = pop(); - int idx = pop(); - push(readArray(fetchScriptWord(), idx, base)); -} - -void Scumm::o6_dup() -{ - int a = pop(); - push(a); - push(a); -} - -void Scumm::o6_zero() -{ - push(pop() == 0); -} - -void Scumm::o6_eq() -{ - push(pop() == pop()); -} - -void Scumm::o6_neq() -{ - push(pop() != pop()); -} - -void Scumm::o6_gt() -{ - int a = pop(); - push(pop() > a); -} - -void Scumm::o6_lt() -{ - int a = pop(); - push(pop() < a); -} - -void Scumm::o6_le() -{ - int a = pop(); - push(pop() <= a); -} - -void Scumm::o6_ge() -{ - int a = pop(); - push(pop() >= a); -} - -void Scumm::o6_add() -{ - int a = pop(); - push(pop() + a); -} - -void Scumm::o6_sub() -{ - int a = pop(); - push(pop() - a); -} - -void Scumm::o6_mul() -{ - int a = pop(); - push(pop() * a); -} - -void Scumm::o6_div() -{ - int a = pop(); - if (a == 0) - error("division by zero"); - push(pop() / a); -} - -void Scumm::o6_land() -{ - int a = pop(); - push(pop() && a); -} - -void Scumm::o6_lor() -{ - int a = pop(); - push(pop() || a); -} - -void Scumm::o6_kill() -{ - pop(); -} - -void Scumm::o6_writeByteVar() -{ - writeVar(fetchScriptByte(), pop()); -} - -void Scumm::o6_writeWordVar() -{ - writeVar(fetchScriptWord(), pop()); -} - -void Scumm::o6_byteArrayWrite() -{ - int a = pop(); - writeArray(fetchScriptByte(), 0, pop(), a); -} - -void Scumm::o6_wordArrayWrite() -{ - int a = pop(); - writeArray(fetchScriptWord(), 0, pop(), a); -} - -void Scumm::o6_byteArrayIndexedWrite() -{ - int val = pop(); - int base = pop(); - writeArray(fetchScriptByte(), pop(), base, val); -} - -void Scumm::o6_wordArrayIndexedWrite() -{ - int val = pop(); - int base = pop(); - writeArray(fetchScriptWord(), pop(), base, val); -} - -void Scumm::o6_byteVarInc() -{ - int var = fetchScriptByte(); - writeVar(var, readVar(var) + 1); -} - -void Scumm::o6_wordVarInc() -{ - int var = fetchScriptWord(); - writeVar(var, readVar(var) + 1); -} - -void Scumm::o6_byteArrayInc() -{ - int var = fetchScriptByte(); - int base = pop(); - writeArray(var, 0, base, readArray(var, 0, base) + 1); -} - -void Scumm::o6_wordArrayInc() -{ - int var = fetchScriptWord(); - int base = pop(); - writeArray(var, 0, base, readArray(var, 0, base) + 1); -} - - -void Scumm::o6_byteVarDec() -{ - int var = fetchScriptByte(); - writeVar(var, readVar(var) - 1); -} - -void Scumm::o6_wordVarDec() -{ - int var = fetchScriptWord(); - writeVar(var, readVar(var) - 1); -} - -void Scumm::o6_byteArrayDec() -{ - int var = fetchScriptByte(); - int base = pop(); - writeArray(var, 0, base, readArray(var, 0, base) - 1); -} - -void Scumm::o6_wordArrayDec() -{ - int var = fetchScriptWord(); - int base = pop(); - writeArray(var, 0, base, readArray(var, 0, base) - 1); -} - -void Scumm::o6_jumpTrue() -{ - if (pop()) - o6_jump(); - else - fetchScriptWord(); -} - -void Scumm::o6_jumpFalse() -{ - if (!pop()) - o6_jump(); - else - fetchScriptWord(); -} - -void Scumm::o6_jump() -{ - _scriptPointer += (int16)fetchScriptWord(); -} - -void Scumm::o6_startScriptEx() -{ - int16 args[16]; - int script, flags; - - getStackList(args, sizeof(args) / sizeof(args[0])); - script = pop(); - flags = pop(); - runScript(script, flags & 1, flags & 2, args); -} - -void Scumm::o6_jumpToScript() -{ - int16 args[16]; - int script, flags; - - getStackList(args, sizeof(args) / sizeof(args[0])); - script = pop(); - flags = pop(); - o6_stopObjectCode(); - runScript(script, flags & 1, flags & 2, args); -} - -void Scumm::o6_startScript() -{ - int16 args[16]; - int script; - getStackList(args, sizeof(args) / sizeof(args[0])); - script = pop(); - runScript(script, 0, 0, args); -} - -void Scumm::o6_startObject() -{ - int16 args[16]; - int script, entryp; - int flags; - getStackList(args, sizeof(args) / sizeof(args[0])); - entryp = pop(); - script = pop(); - flags = pop(); - runVerbCode(script, entryp, flags & 1, flags & 2, args); -} - -void Scumm::o6_setObjectState() -{ - int a = pop(); - int b = pop(); - if (a == 0) - a = 1; -// debug(1, "setObjectState(%d,%d)", a, b); - - setObjectState(b, a, -1, -1); -} - -void Scumm::o6_setObjectXY() -{ - int y = pop(); - int x = pop(); - int obj = pop(); -// debug(1, "setObjectXY(%d,%d,%d)", obj, x, y); - setObjectState(obj, 1, x, y); -} - -void Scumm::o6_stopObjectCode() -{ - stopObjectCode(); -} - -void Scumm::o6_endCutscene() -{ - endCutscene(); -} - -void Scumm::o6_cutScene() -{ - int16 args[16]; - getStackList(args, sizeof(args) / sizeof(args[0])); - cutscene(args); -} - -void Scumm::o6_stopMusic() -{ - _sound->stopAllSounds(); -} - -void Scumm::o6_freezeUnfreeze() -{ - int a = pop(); - if (a) - freezeScripts(a); - else - unfreezeScripts(); -} - -void Scumm::o6_cursorCommand() -{ - int a, i; - int16 args[16]; - - switch (fetchScriptByte()) { - case 0x90: - _cursorState = 1; - verbMouseOver(0); - break; - case 0x91: - _cursorState = 0; - verbMouseOver(0); - break; - case 0x92: - _userPut = 1; - break; - case 0x93: - _userPut = 0; - break; - case 0x94: - _cursorState++; - if (_cursorState > 1) - error("Cursor state greater than 1 in script"); - verbMouseOver(0); - break; - case 0x95: - _cursorState--; - verbMouseOver(0); - break; - case 0x96: - _userPut++; - break; - case 0x97: - _userPut--; - break; - case 0x99:{ - int room, obj = popRoomAndObj(&room); - setCursorImg(obj, room, 1); - break; - } - case 0x9A: - a = pop(); - setCursorHotspot2(pop(), a); - break; - case 0x9C: /* init charset */ - initCharset(pop()); - break; - case 0x9D: /* set charset colors */ - getStackList(args, sizeof(args) / sizeof(args[0])); - for (i = 0; i < 16; i++) - charset._colorMap[i] = _charsetData[string[1].t_charset][i] = (unsigned char)args[i]; - break; - case 0xD6: - makeCursorColorTransparent(pop()); - break; - default: - error("o6_cursorCommand: default case"); - } - - _vars[VAR_CURSORSTATE] = _cursorState; - _vars[VAR_USERPUT] = _userPut; -} - -void Scumm::o6_breakHere() -{ - updateScriptPtr(); - _currentScript = 0xFF; -} - -void Scumm::o6_ifClassOfIs() -{ - int16 args[16]; - int num, obj, cls; - bool b; - int cond = 1; - - num = getStackList(args, sizeof(args) / sizeof(args[0])); - obj = pop(); - - while (--num >= 0) { - cls = args[num]; - b = getClass(obj, cls); - if (cls & 0x80 && !b || !(cls & 0x80) && b) - cond = 0; - } - push(cond); -} - -void Scumm::o6_setClass() -{ - int16 args[16]; - int num, obj, cls; - - num = getStackList(args, sizeof(args) / sizeof(args[0])); - obj = pop(); - - while (--num >= 0) { - cls = args[num]; - if (cls == 0) - _classData[num] = 0; - else if (cls & 0x80) - putClass(obj, cls, 1); - else - putClass(obj, cls, 0); - } -} - -void Scumm::o6_getState() -{ - push(getState(pop())); -} - -void Scumm::o6_setState() -{ - int state = pop(); - int obj = pop(); - -// debug(1, "setState(%d,%d)", obj, state); - - putState(obj, state); - removeObjectFromRoom(obj); - if (_BgNeedsRedraw) - clearDrawObjectQueue(); -} - -void Scumm::o6_setOwner() -{ - int owner = pop(); - int obj = pop(); - - setOwnerOf(obj, owner); -} - -void Scumm::o6_getOwner() -{ - push(getOwner(pop())); -} - -void Scumm::o6_startSound() -{ - _sound->addSoundToQueue(pop()); -} - -void Scumm::o6_stopSound() -{ - _sound->stopSound(pop()); -} - -void Scumm::o6_startMusic() -{ - _sound->addSoundToQueue(pop()); -} - -void Scumm::o6_stopObjectScript() -{ - stopObjectScript(pop()); -} - -void Scumm::o6_panCameraTo() -{ - if (_features & GF_AFTER_V7) { - int y = pop(); - int x = pop(); - panCameraTo(x, y); - } else { - panCameraTo(pop(), 0); - } -} - -void Scumm::o6_actorFollowCamera() -{ - if (_features & GF_AFTER_V7) - setCameraFollows(derefActorSafe(pop(), "actorFollowCamera")); - else - actorFollowCamera(pop()); - -} - -void Scumm::o6_setCameraAt() -{ - if (_features & GF_AFTER_V7) { - int x, y; - - camera._follows = 0; - - y = pop(); - x = pop(); - - setCameraAt(x, y); - } else { - setCameraAtEx(pop()); - } -} - -void Scumm::o6_loadRoom() -{ - int room; - /* Begin: Autosave - _saveLoadSlot = 0; - sprintf(_saveLoadName, "Autosave", _saveLoadSlot); - _saveLoadFlag = 1; - _saveLoadCompatible = false; - End: Autosave */ - - room = pop(); - startScene(room, 0, 0); - _fullRedraw = 1; -} - -void Scumm::o6_stopScript() -{ - int script = pop(); - if (script == 0) - stopObjectCode(); - else - stopScriptNr(script); -} - -void Scumm::o6_walkActorToObj() -{ - int obj, dist; - Actor *a, *a2; - int x; - - dist = pop(); - obj = pop(); - a = derefActorSafe(pop(), "o6_walkActorToObj"); - if (!a) - return; - - if (obj >= NUM_ACTORS) { - if (whereIsObject(obj) == WIO_NOT_FOUND) - return; - int x, y, dir; - getObjectXYPos(obj, x, y, dir); - a->startWalkActor(x, y, dir); - } else { - a2 = derefActorSafe(obj, "o6_walkActorToObj(2)"); - if (!a2) - return; - if (!a->isInCurrentRoom() || !a2->isInCurrentRoom()) - return; - if (dist == 0) { - dist = a2->scalex * a2->width / 0xFF; - dist += dist >> 1; - } - x = a2->x; - if (x < a->x) - x += dist; - else - x -= dist; - a->startWalkActor(x, a2->y, -1); - } -} - -void Scumm::o6_walkActorTo() -{ - int x, y; - y = pop(); - x = pop(); - derefActorSafe(pop(), "o6_walkActorTo")->startWalkActor(x, y, -1); -} - -void Scumm::o6_putActorInRoom() -{ - int room, x, y; - Actor *a; - - room = pop(); - y = pop(); - x = pop(); - a = derefActorSafe(pop(), "o6_putActorInRoom"); - if (!a) - return; - - if (room == 0xFF) { - room = a->room; - } else { - if (a->visible && _currentRoom != room && _vars[VAR_TALK_ACTOR] == a->number) { - clearMsgQueue(); - } - if (room != 0) - a->room = room; - } - a->putActor(x, y, room); -} - - -void Scumm::o6_putActorAtObject() -{ - int room, obj, x, y; - Actor *a; - - obj = popRoomAndObj(&room); - - a = derefActorSafe(pop(), "o6_putActorAtObject"); - if (whereIsObject(obj) != WIO_NOT_FOUND) { - getObjectXYPos(obj, x, y); - } else { - x = 160; - y = 120; - } - if (room == 0xFF) - room = a->room; - a->putActor(x, y, room); -} - -void Scumm::o6_faceActor() -{ - int act, obj; - obj = pop(); - act = pop(); - faceActorToObj(act, obj); -} - -void Scumm::o6_animateActor() -{ - int anim = pop(); - int act = pop(); - - Actor *a = derefActorSafe(act, "o6_animateActor"); - if (!a) - return; - - a->animateActor(anim); -} - -void Scumm::o6_doSentence() -{ - int a, b, c; - - a = pop(); - pop(); //dummy pop - b = pop(); - c = pop(); - - doSentence(c, b, a); -} - -void Scumm::o6_pickupObject() -{ - int obj, room; - int i; - - obj = popRoomAndObj(&room); - if (room == 0) - room = _roomResource; - - for (i = 1; i < _maxInventoryItems; i++) { - if (_inventory[i] == (uint16)obj) { - putOwner(obj, _vars[VAR_EGO]); - runHook(obj); - return; - } - } - - addObjectToInventory(obj, room); - putOwner(obj, _vars[VAR_EGO]); - putClass(obj, 32, 1); - putState(obj, 1); - removeObjectFromRoom(obj); - clearDrawObjectQueue(); - runHook(obj); /* Difference */ -} - -void Scumm::o6_loadRoomWithEgo() -{ - Actor *a; - int obj, room, x, y; - - y = pop(); - x = pop(); - - obj = popRoomAndObj(&room); - - a = derefActorSafe(_vars[VAR_EGO], "o6_loadRoomWithEgo"); - - a->putActor(0, 0, room); - _egoPositioned = false; - - _vars[VAR_WALKTO_OBJ] = obj; - startScene(a->room, a, obj); - _vars[VAR_WALKTO_OBJ] = 0; - - /* startScene maybe modifies VAR_EGO, i hope not */ - - if (!(_features & GF_AFTER_V7)) { - setCameraAt(a->x, a->y); - setCameraFollows(a); - } - - _fullRedraw = 1; - - if (x != -1) { - a->startWalkActor(x, y, -1); - } -} - -void Scumm::o6_getRandomNumber() -{ - int rnd; - rnd = getRandomNumber(pop()); - _vars[VAR_V6_RANDOM_NR] = rnd; - push(rnd); -} - -void Scumm::o6_getRandomNumberRange() -{ - int max = pop(); - int min = pop(); - int rnd = getRandomNumberRng(min, max); - _vars[VAR_V6_RANDOM_NR] = rnd; - push(rnd); -} - -void Scumm::o6_getActorMoving() -{ - push(derefActorSafe(pop(), "o6_getActorMoving")->moving); -} - -void Scumm::o6_getScriptRunning() -{ - push(isScriptRunning(pop())); -} - -void Scumm::o6_isRoomScriptRunning() -{ - push(isRoomScriptRunning(pop())); -} - -void Scumm::o6_getActorRoom() -{ - push(derefActorSafe(pop(), "o6_getActorRoom")->room); -} - -void Scumm::o6_getObjectX() -{ - push(getObjX(pop())); -} - -void Scumm::o6_getObjectY() -{ - push(getObjY(pop())); -} - -void Scumm::o6_getObjectOldDir() -{ - push(getObjOldDir(pop())); -} - -void Scumm::o6_getObjectNewDir() -{ - push(getObjNewDir(pop())); -} - -void Scumm::o6_getActorWalkBox() -{ - Actor *a = derefActorSafe(pop(), "o6_getActorWalkBox"); - push(a->ignoreBoxes ? 0 : a->walkbox); -} - -void Scumm::o6_getActorCostume() -{ - push(derefActorSafe(pop(), "o6_getActorCostume")->costume); -} - -void Scumm::o6_findInventory() -{ - int idx = pop(); - int owner = pop(); - push(findInventory(owner, idx)); -} - -void Scumm::o6_getInventoryCount() -{ - push(getInventoryCount(pop())); -} - -void Scumm::o6_getVerbFromXY() -{ - int y = pop(); - int x = pop(); - int over = checkMouseOver(x, y); - if (over) - over = _verbs[over].verbid; - push(over); -} - -void Scumm::o6_beginOverride() -{ - beginOverride(); -} - -void Scumm::o6_endOverride() -{ - endOverride(); -} - -void Scumm::o6_setObjectName() -{ - int obj = pop(); - int i; - - if (obj < NUM_ACTORS) - error("Can't set actor %d name with new-name-of", obj); - - if (!(_features & GF_AFTER_V7) && !getOBCDFromObject(obj)) - error("Can't set name of object %d", obj); - - for (i = 1; i < 50; i++) { - if (_newNames[i] == obj) { - nukeResource(rtObjectName, i); - _newNames[i] = 0; - break; - } - } - - for (i = 1; i < 50; i++) { - if (_newNames[i] == 0) { - loadPtrToResource(rtObjectName, i, NULL); - _newNames[i] = obj; - runHook(0); - return; - } - } - - error("New name of %d overflows name table (max = %d)", obj, 50); -} - -void Scumm::o6_isSoundRunning() -{ - int snd = pop(); - - // FIXME: This fixes wak-a-rat until we correctly implement - // sam and max iMUSE - if (_gameId == GID_SAMNMAX && _currentRoom == 18 && snd == 23) { - _sound->stopSound(snd); - push(0); - return; - } - - if (snd) - snd = _sound->isSoundRunning(snd); - - push(snd); -} - -void Scumm::o6_setBoxFlags() -{ - int16 table[65]; - int num, value; - - value = pop(); - num = getStackList(table, sizeof(table) / sizeof(table[0])); - - while (--num >= 0) { - setBoxFlags(table[num], value); - } -} - -void Scumm::o6_createBoxMatrix() -{ - createBoxMatrix(); -} - -void Scumm::o6_resourceRoutines() -{ - int resid; - - switch (fetchScriptByte()) { - case 100: /* load script */ - resid = pop(); - if (_features & GF_AFTER_V7) - if (resid >= _numGlobalScripts) - break; - ensureResourceLoaded(rtScript, resid); - break; - case 101: /* load sound */ - resid = pop(); - ensureResourceLoaded(rtSound, resid); - break; - case 102: /* load costume */ - resid = pop(); - ensureResourceLoaded(rtCostume, resid); - break; - case 103: /* load room */ - resid = pop(); - ensureResourceLoaded(rtRoom, resid); - break; - case 104: /* nuke script */ - resid = pop(); - if (_features & GF_AFTER_V7) - if (resid >= _numGlobalScripts) - break; - setResourceCounter(rtScript, resid, 0x7F); - debug(5, "nuke script %d", resid); - break; - case 105: /* nuke sound */ - resid = pop(); - setResourceCounter(rtSound, resid, 0x7F); - break; - case 106: /* nuke costume */ - resid = pop(); - setResourceCounter(rtCostume, resid, 0x7F); - break; - case 107: /* nuke room */ - resid = pop(); - setResourceCounter(rtRoom, resid, 0x7F); - break; - case 108: /* lock script */ - resid = pop(); - if (resid >= _numGlobalScripts) - break; - lock(rtScript, resid); - break; - case 109: /* lock sound */ - resid = pop(); - lock(rtSound, resid); - break; - case 110: /* lock costume */ - resid = pop(); - lock(rtCostume, resid); - break; - case 111: /* lock room */ - resid = pop(); - if (resid > 0x7F) - resid = _resourceMapper[resid & 0x7F]; - lock(rtRoom, resid); - break; - case 112: /* unlock script */ - resid = pop(); - if (resid >= _numGlobalScripts) - break; - unlock(rtScript, resid); - break; - case 113: /* unlock sound */ - resid = pop(); - unlock(rtSound, resid); - break; - case 114: /* unlock costume */ - resid = pop(); - unlock(rtCostume, resid); - break; - case 115: /* unlock room */ - resid = pop(); - if (resid > 0x7F) - resid = _resourceMapper[resid & 0x7F]; - unlock(rtRoom, resid); - break; - case 116: /* clear heap */ - /* this is actually a scumm message */ - error("clear heap not working yet"); - break; - case 117: /* load charset */ - resid = pop(); - loadCharset(resid); - break; - case 118: /* nuke charset */ - resid = pop(); - nukeCharset(resid); - break; - case 119:{ /* load fl object */ - int room, obj = popRoomAndObj(&room); - loadFlObject(obj, room); - break; - } - default: - error("o6_resourceRoutines: default case"); - } -} - -void Scumm::o6_roomOps() -{ - int a, b, c, d, e; - - switch (fetchScriptByte()) { - case 172: /* room scroll */ - b = pop(); - a = pop(); - if (a < 160) - a = 160; - if (b < 160) - b = 160; - if (a > _scrWidth - 160) - a = _scrWidth - 160; - if (b > _scrWidth - 160) - b = _scrWidth - 160; - _vars[VAR_CAMERA_MIN_X] = a; - _vars[VAR_CAMERA_MAX_X] = b; - break; - - case 174: /* set screen */ - b = pop(); - a = pop(); - initScreens(0, a, 320, b); - break; - - case 175: /* set palette color */ - d = pop(); - c = pop(); - b = pop(); - a = pop(); - setPalColor(d, a, b, c); - break; - - case 176: /* shake on */ - setShake(1); - break; - - case 177: /* shake off */ - setShake(0); - break; - - case 179: - c = pop(); - b = pop(); - a = pop(); - darkenPalette(b, c, a, a, a); - break; - - case 180: - _saveLoadCompatible = true; - _saveLoadSlot = pop(); - _saveLoadFlag = pop(); - warning("o6_roomops:180: partially unimplemented"); - break; - - case 181: - a = pop(); - if (a) { - _switchRoomEffect = (byte)(a); - _switchRoomEffect2 = (byte)(a >> 8); - } else { - fadeIn(_newEffect); - } - break; - - case 182: - e = pop(); - d = pop(); - c = pop(); - b = pop(); - a = pop(); - darkenPalette(d, e, a, b, c); - break; - - case 183: - e = pop(); - d = pop(); - c = pop(); - b = pop(); - a = pop(); - unkRoomFunc3(d, e, a, b, c); - break; - - case 184: - error("save string not implemented"); - break; - - case 185: - error("load string not implemented"); - break; - - case 186: /* palmanip? */ - d = pop(); - c = pop(); - b = pop(); - a = pop(); - palManipulate(a, b, c, d, 1); - break; - - case 187: /* color cycle delay */ - b = pop(); - a = pop(); - checkRange(16, 1, a, "o6_roomOps: 187: color cycle out of range (%d)"); - _colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0; - break; - - case 213: /* set palette */ - // One case where this is used is to turn off Sam & Max film - // noir mode. Unfortunately it only restores color to the - // palette, it doesn't take palette manipulation (darkening, - // etc.) into account. So, for instance, if you turn on film - // noir mode in Sam & Max's office, turn off the light and turn - // off film noir mode, the room will no longer look dark. - // - // This bug is present in the original interpreter, so it may - // not be worth the trouble fixing it. - setPalette(pop()); - break; - - default: - error("o6_roomOps: default case"); - } -} - -void Scumm::o6_actorSet() -{ - Actor *a; - int i, j, k; - int16 args[8]; - byte b; - - b = fetchScriptByte(); - if (b == 197) { - _curActor = pop(); - return; - } - - a = derefActorSafe(_curActor, "o6_actorSet"); - if (!a) - return; - - switch (b) { - case 76: /* actor-costume */ - a->setActorCostume(pop()); - break; - case 77: /* actor-speed */ - j = pop(); - i = pop(); - a->setActorWalkSpeed(i, j); - break; - case 78: /* actor-sound */ - k = getStackList(args, sizeof(args) / sizeof(args[0])); - for (i = 0; i < k; i++) - a->sound[i] = args[i]; - break; - case 79: /* actor-walkframe */ - a->walkFrame = pop(); - break; - case 80: /* actor-talkframe */ - a->talkFrame2 = pop(); - a->talkFrame1 = pop(); - break; - case 81: /* actor-standframe */ - a->standFrame = pop(); - break; - case 82: - pop(); - pop(); - pop(); - break; - case 83: - a->initActor(0); - break; - case 84: /* actor-elevation */ - a->elevation = pop(); - a->needRedraw = true; - a->needBgReset = true; - break; - case 85: /* actor-defaultanims */ - a->initFrame = 1; - a->walkFrame = 2; - a->standFrame = 3; - a->talkFrame1 = 4; - a->talkFrame2 = 5; - break; - case 86: /* actor-palette */ - j = pop(); - i = pop(); - checkRange(31, 0, i, "Illegal palet slot %d"); - a->palette[i] = j; - a->needRedraw = true; - break; - case 87: /* actor-talkcolor */ - a->talkColor = pop(); - break; - case 88: /* actor-name */ - loadPtrToResource(rtActorName, a->number, NULL); - break; - case 89: /* actor-initframe */ - a->initFrame = pop(); - break; - case 91: - a->width = pop(); - break; - case 92: - a->scalex = a->scaley = pop(); - a->needRedraw = true; - a->needBgReset = true; - break; - case 93: - a->forceClip = 0; - break; - case 225: - case 94: - a->forceClip = pop(); - break; - case 95: - a->ignoreBoxes = 1; - if (_features & GF_AFTER_V7) // yazoo: I don't know if it's supposed to be 100 in other games too... - a->forceClip = 100; - else - a->forceClip = 0; - FixRooms:; - if (a->isInCurrentRoom()) - a->putActor(a->x, a->y, a->room); - break; - case 96: - a->ignoreBoxes = 0; - if (_features & GF_AFTER_V7) // yazoo: I don't know if it's supposed to be 100 in other games too... - a->forceClip = 100; - else - a->forceClip = 0; - goto FixRooms; - case 97: - a->animSpeed = pop(); - a->animProgress = 0; - break; - case 98: - a->shadow_mode = pop(); - break; - case 99: - a->new_1 = pop(); - a->new_2 = pop(); - break; - case 198: /* set anim variable */ - i = pop(); /* value */ - a->setAnimVar(pop(), i); - break; - case 215: - a->new_3 = 1; - break; - case 216: - a->new_3 = 0; - break; - case 217: - a->initActor(2); - break; - case 227: /* actor_layer */ - a->layer = pop(); - break; - case 228: /* walk script */ - a->walk_script = pop(); - break; - case 235: /* talk_script */ - a->talk_script = pop(); - break; - case 229: /* stand */ - a->stopActorMoving(); - a->startAnimActor(a->standFrame); - break; - case 230: /* set direction */ - a->moving &= ~MF_TURN; - a->setDirection(pop()); - break; - case 231: /* turn to direction */ - a->turnToDirection(pop()); - break; - case 233: /* freeze actor */ - a->moving |= 0x80; - break; - case 234: /* unfreeze actor */ - a->moving &= ~0x7f; - break; - default: - error("o6_actorset: default case %d", b); - } -} - -void Scumm::o6_verbOps() -{ - int slot, a, b; - VerbSlot *vs; - byte *ptr, op; - - op = fetchScriptByte(); - if (op == 196) { - _curVerb = pop(); - _curVerbSlot = getVerbSlot(_curVerb, 0); - checkRange(_maxVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d"); - return; - } - vs = &_verbs[_curVerbSlot]; - slot = _curVerbSlot; - switch (op) { - case 124: /* load img */ - a = pop(); - if (_curVerbSlot) { - setVerbObject(_roomResource, a, slot); - vs->type = 1; - } - break; - case 125: - loadPtrToResource(rtVerb, slot, NULL); - vs->type = 0; - vs->imgindex = 0; - break; - case 126: - vs->color = pop(); - break; - case 127: - vs->hicolor = pop(); - break; - case 128: - vs->y = pop(); - vs->x = pop(); - break; - case 129: - vs->curmode = 1; - break; - case 130: - vs->curmode = 0; - break; - case 131: - killVerb(slot); - break; - case 132: - slot = getVerbSlot(_curVerb, 0); - if (slot == 0) { - for (slot = 1; slot < _maxVerbs; slot++) { - if (_verbs[slot].verbid == 0) - break; - } - if (slot == _maxVerbs) - error("Too many verbs"); - _curVerbSlot = slot; - } - vs = &_verbs[slot]; - vs->verbid = _curVerb; - vs->color = 2; - vs->hicolor = 0; - vs->dimcolor = 8; - vs->type = 0; - vs->charset_nr = string[0].t_charset; - vs->curmode = 0; - vs->saveid = 0; - vs->key = 0; - vs->center = 0; - vs->imgindex = 0; - break; - case 133: - vs->dimcolor = pop(); - break; - case 134: - vs->curmode = 2; - break; - case 135: - vs->key = pop(); - break; - case 136: - vs->center = 1; - break; - case 137: - a = pop(); - if (a == 0) { - ptr = (byte *)""; - } else { - ptr = getStringAddress(a); - } - loadPtrToResource(rtVerb, slot, ptr); - vs->type = 0; - vs->imgindex = 0; - break; - case 139: - b = pop(); - a = pop(); - if (slot && a != vs->imgindex) { - setVerbObject(b, a, slot); - vs->type = 1; - vs->imgindex = a; - } - break; - case 140: - vs->bkcolor = pop(); - break; - case 255: - drawVerb(slot, 0); - verbMouseOver(0); - break; - default: - error("o6_verbops: default case"); - } -} - -void Scumm::o6_getActorFromXY() -{ - int y = pop(); - int x = pop(); - push(getActorFromPos(x, y)); -} - -void Scumm::o6_findObject() -{ - int y = pop(); - int x = pop(); - int r = findObject(x, y); - push(r); -} - -void Scumm::o6_pseudoRoom() -{ - int16 list[100]; - int num, a, value; - - num = getStackList(list, sizeof(list) / sizeof(list[0])); - value = pop(); - - while (--num >= 0) { - a = list[num]; - if (a > 0x7F) - _resourceMapper[a & 0x7F] = value; - } -} - -void Scumm::o6_getActorElevation() -{ - push(derefActorSafe(pop(), "o6_getActorElevation")->elevation); -} - -void Scumm::o6_getVerbEntrypoint() -{ - int e = pop(); - int v = pop(); - push(getVerbEntrypoint(v, e)); -} - -void Scumm::o6_arrayOps() -{ - int a, b, c, d, num; - int16 list[128]; - - switch (fetchScriptByte()) { - case 205: - a = fetchScriptWord(); - pop(); - arrayop_1(a, NULL); - break; - case 208: - a = fetchScriptWord(); - b = pop(); - c = pop(); - d = readVar(a); - if (d == 0) { - defineArray(a, 5, 0, b + c); - } - while (c--) { - writeArray(a, 0, b + c, pop()); - } - break; - case 212: - a = fetchScriptWord(); - b = pop(); - num = getStackList(list, sizeof(list) / sizeof(list[0])); - d = readVar(a); - if (d == 0) - error("Must DIM a two dimensional array before assigning"); - c = pop(); - while (--num >= 0) { - writeArray(a, c, b + num, list[num]); - } - break; - default: - error("o6_arrayOps: default case"); - } -} - -void Scumm::o6_saveRestoreVerbs() -{ - int a, b, c; - int slot, slot2; - - c = pop(); - b = pop(); - a = pop(); - - switch (fetchScriptByte()) { - case 141: - while (a <= b) { - slot = getVerbSlot(a, 0); - if (slot && _verbs[slot].saveid == 0) { - _verbs[slot].saveid = c; - drawVerb(slot, 0); - verbMouseOver(0); - } - a++; - } - break; - case 142: - while (a <= b) { - slot = getVerbSlot(a, c); - if (slot) { - slot2 = getVerbSlot(a, 0); - if (slot2) - killVerb(slot2); - slot = getVerbSlot(a, c); - _verbs[slot].saveid = 0; - drawVerb(slot, 0); - verbMouseOver(0); - } - a++; - } - break; - case 143: - while (a <= b) { - slot = getVerbSlot(a, c); - if (slot) - killVerb(slot); - a++; - } - break; - default: - error("o6_saveRestoreVerbs: default case"); - } -} - -void Scumm::o6_drawBox() -{ - int x, y, x2, y2, color; - color = pop(); - y2 = pop(); - x2 = pop(); - y = pop(); - x = pop(); - drawBox(x, y, x2, y2, color); -} - -void Scumm::o6_getActorWidth() -{ - push(derefActorSafe(pop(), "o6_getActorWidth")->width); -} - -void Scumm::o6_wait() -{ - switch (fetchScriptByte()) { - case 168:{ - int offs = (int16)fetchScriptWord(); - if (derefActorSafe(pop(), "o6_wait")->moving) { - _scriptPointer += offs; - o6_breakHere(); - } - return; - } - case 169: - //printf("waiting for message: %d\n", _vars[VAR_HAVE_MSG]); - - if (_vars[VAR_HAVE_MSG]) - break; - return; - case 170: - if (!(_features & GF_AFTER_V7)) { - if (camera._cur.x >> 3 != camera._dest.x >> 3) - break; - } else { - if (camera._dest.x != camera._cur.x || camera._dest.y != camera._cur.y) - break; - } - - return; - case 171: - printf("wait for sentence"); - if (_sentenceNum) { - if (sentence[_sentenceNum - 1].unk && !isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) - return; - break; - } - if (!isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) - return; - break; - case 226:{ /* wait until actor drawn */ - Actor *a = derefActorSafe(pop(), "o6_wait:226"); - int offs = (int16)fetchScriptWord(); - if (a && a->isInCurrentRoom() && a->needRedraw) { - _scriptPointer += offs; - o6_breakHere(); - } - return; - } - case 232:{ /* wait until actor stops turning */ - Actor *a = derefActorSafe(pop(), "o6_wait:226"); - int offs = (int16)fetchScriptWord(); - if (a && a->isInCurrentRoom() && a->moving & MF_TURN) { - _scriptPointer += offs; - o6_breakHere(); - } - return; - } - default: - error("o6_wait: default case"); - } - - _scriptPointer -= 2; - o6_breakHere(); -} - -void Scumm::o6_getActorScaleX() -{ - push(derefActorSafe(pop(), "o6_getActorScale")->scalex); -} - -void Scumm::o6_getActorAnimCounter1() -{ - push(derefActorSafe(pop(), "o6_getActorAnimCounter")->cost.animCounter1); -} - -void Scumm::o6_getAnimateVariable() -{ - int var = pop(); - push(derefActorSafe(pop(), "o6_getAnimateVariable")->getAnimVar(var)); -} - -void Scumm::o6_soundKludge() -{ - int16 list[16]; - getStackList(list, sizeof(list) / sizeof(list[0])); - - /* (yazoo): I don't know enought about the sound code to - * fix the looping sound bug. FIXME !*/ - - if (list[1] == 163 && _gameId == GID_DIG) - return; - - _sound->soundKludge(list); -} - -void Scumm::o6_isAnyOf() -{ - int16 list[100]; - int num; - int16 val; - - num = getStackList(list, sizeof(list) / sizeof(list[0])); - val = pop(); - - while (--num >= 0) { - if (list[num] == val) { - push(1); - return; - } - } - push(0); - return; -} - -void Scumm::o6_quitPauseRestart() -{ - switch (fetchScriptByte()) { - case 158: - pauseGame(false); - break; - case 160: - shutDown(0); - break; - default: - error("o6_quitPauseRestart: invalid case"); - } -} - -void Scumm::o6_isActorInBox() -{ - int box = pop(); - Actor *a = derefActorSafe(pop(), "o6_isActorInBox"); - push(checkXYInBoxBounds(box, a->x, a->y)); -} - -void Scumm::o6_delay() -{ - uint32 delay = (uint16)pop(); - vm.slot[_currentScript].delay = delay; - vm.slot[_currentScript].status = 1; - o6_breakHere(); -} - -void Scumm::o6_delayLonger() -{ - uint32 delay = (uint16)pop() * 60; - vm.slot[_currentScript].delay = delay; - vm.slot[_currentScript].status = 1; - o6_breakHere(); -} - -void Scumm::o6_delayVeryLong() -{ - uint32 delay = (uint16)pop() * 3600; - vm.slot[_currentScript].delay = delay; - vm.slot[_currentScript].status = 1; - o6_breakHere(); -} - -void Scumm::o6_stopSentence() -{ - _sentenceNum = 0; - stopScriptNr(_vars[VAR_SENTENCE_SCRIPT]); - clearClickedStatus(); -} - -void Scumm::o6_print_0() -{ - _actorToPrintStrFor = 0xFF; - decodeParseString2(0, 0); -} - -void Scumm::o6_print_1() -{ - decodeParseString2(1, 0); -} - -void Scumm::o6_print_2() -{ - decodeParseString2(2, 0); -} - -void Scumm::o6_print_3() -{ - decodeParseString2(3, 0); -} - -void Scumm::o6_printActor() -{ - decodeParseString2(0, 1); -} - -void Scumm::o6_printEgo() -{ - push(_vars[VAR_EGO]); - decodeParseString2(0, 1); -} - -void Scumm::o6_talkActor() -{ - _actorToPrintStrFor = pop(); - _messagePtr = _scriptPointer; - - if (_scriptPointer[0] == '/') { - char *pointer = strtok((char *)_scriptPointer, "/"); - int bunsize = strlen(pointer) + 2; - _sound->playBundleSound(pointer); - _scriptPointer += bunsize; - _messagePtr = _scriptPointer; - } - - setStringVars(0); - actorTalk(); - _scriptPointer = _messagePtr; -} - -void Scumm::o6_talkEgo() -{ - _actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; - _messagePtr = _scriptPointer; - - if (_scriptPointer[0] == '/') { - char *pointer = strtok((char *)_scriptPointer, "/"); - int bunsize = strlen(pointer) + 2; - _sound->playBundleSound(pointer); - _scriptPointer += bunsize; - _messagePtr = _scriptPointer; - } - - setStringVars(0); - actorTalk(); - _scriptPointer = _messagePtr; -} - -void Scumm::o6_dim() -{ - int data; - - switch (fetchScriptByte()) { - case 199: - data = 5; - break; - case 200: - data = 1; - break; - case 201: - data = 2; - break; - case 202: - data = 3; - break; - case 203: - data = 4; - break; - case 204: - nukeArray(fetchScriptWord()); - return; - default: - error("o6_dim : default case"); - } - - defineArray(fetchScriptWord(), data, 0, pop()); -} - -void Scumm::o6_runVerbCodeQuick() -{ - int16 args[16]; - int script, entryp; - getStackList(args, sizeof(args) / sizeof(args[0])); - entryp = pop(); - script = pop(); - runVerbCode(script, entryp, 0, 1, args); -} - -void Scumm::o6_runScriptQuick() -{ - int16 args[16]; - int script; - getStackList(args, sizeof(args) / sizeof(args[0])); - script = pop(); - runScript(script, 0, 1, args); -} - -void Scumm::o6_dim2() -{ - int a, b, data; - switch (fetchScriptByte()) { - case 199: - data = 5; - break; - case 200: - data = 1; - break; - case 201: - data = 2; - break; - case 202: - data = 3; - break; - case 203: - data = 4; - break; - default: - error("o6_dim2: default case"); - } - - b = pop(); - a = pop(); - defineArray(fetchScriptWord(), data, a, b); -} - -void Scumm::o6_abs() -{ - push(abs(pop())); -} - - -void Scumm::o6_distObjectObject() -{ - int a, b; - b = pop(); - a = pop(); - push(getDistanceBetween(true, a, 0, true, b, 0)); -} - -void Scumm::o6_distObjectPt() -{ - int a, b, c; - c = pop(); - b = pop(); - a = pop(); - push(getDistanceBetween(true, a, 0, false, b, c)); -} - -void Scumm::o6_distPtPt() -{ - int a, b, c, d; - d = pop(); - c = pop(); - b = pop(); - a = pop(); - push(getDistanceBetween(false, a, b, false, c, d)); -} - -void Scumm::o6_dummy_stacklist() -{ - error("opcode o6_dummy_stacklist invalid"); -} - -void Scumm::o6_drawBlastObject() -{ - int16 args[16]; - int a, b, c, d, e; - - getStackList(args, sizeof(args) / sizeof(args[0])); - e = pop(); - d = pop(); - c = pop(); - b = pop(); - a = pop(); - enqueueObject(a, b, c, d, e, 0xFF, 0xFF, 1, 0); -} - -void Scumm::o6_miscOps() -{ - int16 args[30]; - int i; - Actor *a; - - IMuse *se = _imuse; //yazoo: not very nice - SmushPlayer * sp; - - getStackList(args, sizeof(args) / sizeof(args[0])); - - if (_features & GF_AFTER_V7) { - switch (args[0]) { - case 4: - grabCursor(args[1], args[2], args[3], args[4]); - break; - case 6: - sp = new SmushPlayer(this); - sp->startVideo(args[1], getStringAddressVar(VAR_VIDEONAME)); - delete sp; - break; - case 7: - warning("o6_miscOps: stub7()"); - break; - case 10: - warning("o6_miscOps: stub10(%d,%d,%d,%d)", args[1], args[2], args[3], args[4]); - break; - case 11: - warning("o6_miscOps: stub11(%d)", args[1]); - break; - case 12: - setCursorImg(args[1], (uint) - 1, args[2]); - break; - case 13: - derefActorSafe(args[1], "o6_miscOps:14")->remapActorPalette(args[2], args[3], args[4], -1); - break; - case 14: - derefActorSafe(args[1], "o6_miscOps:14")->remapActorPalette(args[2], args[3], args[4], args[5]); - break; - case 15: - _insaneFlag = args[1]; - break; - case 16: - if (_gameId == GID_DIG) { - _msgPtrToAdd = charset._buffer; - addMessageToStack(getStringAddressVar(VAR_STRING2DRAW)); - i = 0; - while (charset._buffer[i] != 0) { - if (charset._buffer[i] == '/') { - charset._bufPos = i + 1; - } - i++; - } - description(); - } - break; - case 17: - warning("o6_miscOps: stub17(%d,%d,%d,%d)", args[1], args[2], args[3], args[4]); - break; - case 18: - warning("o6_miscOps: stub18(%d,%d)", args[1], args[2]); - break; - case 107: - a = derefActorSafe(args[1], "o6_miscops: 107"); - a->scalex = (unsigned char)args[2]; - a->needBgReset = true; - a->needRedraw = true; - break; - case 108: - setupShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]); - break; - case 109: - setupShadowPalette(0, args[1], args[2], args[3], args[4], args[5]); - break; - case 114: - warning("o6_miscOps: stub114()"); - break; - case 117: - freezeScripts(2); - break; - case 118: - enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 3); - break; - case 119: - enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0); - break; - case 120: - warning("o6_miscOps: stub120(%d,%d)", args[1], args[2]); - break; - case 124: - warning("o6_miscOps: stub124(%d)", args[1]); - break; - } - } else { - switch (args[0]) { - case 3: - warning("o6_miscOps: nothing in 3"); - break; - case 4: - grabCursor(args[1], args[2], args[3], args[4]); - break; - case 5: - fadeOut(args[1]); - break; - case 6: - _fullRedraw = 1; - redrawBGAreas(); - for (i = 0; i < NUM_ACTORS; i++) - derefActor(i)->needRedraw = true; - processActors(); - fadeIn(args[1]); - break; - case 8: - startManiac(); - break; - case 9: - unkMiscOp9(); - break; - - case 104: /* samnmax */ - nukeFlObjects(args[2], args[3]); - break; - - case 106: - error("stub o6_miscOps_106()"); - break; - - case 107: /* set actor scale */ - a = derefActorSafe(args[1], "o6_miscops: 107"); - a->scalex = (unsigned char)args[2]; - a->needBgReset = true; - a->needRedraw = true; - break; - - case 108: /* create proc_special_palette */ - case 109: - - createSpecialPalette(args[1], args[2], args[3], args[4], args[5], 0, 256); - break; - - case 110: - gdi.clearUpperMask(); - break; - - case 111: - a = derefActorSafe(args[1], "o6_miscops: 111"); - a->shadow_mode = args[2] + args[3]; - break; - - case 112: /* palette shift? */ - createSpecialPalette(args[1], args[2], args[3], args[4], args[5], args[6], args[7]); - break; - - case 114: - // Sam & Max film noir mode - if (_gameId == GID_SAMNMAX) { - // At this point ScummVM will already have set - // variable 0x8000 to indicate that the game is - // in film noir mode. All we have to do here is - // to mark the palette as "dirty", and the next - // call to updatePalette() will take care of - // the rest. - // - // Actually, for extra bug-compatibility we - // should call desaturatePalette() here only, - // instead of in updatePalette(). To see the - // difference in behaviour, try turning on film - // noir mode in Sam & Max's office. The - // background will be grayscale, but Sam and - // Max themselves will be in color. - setDirtyColors(0, 255); - } else - warning("stub o6_miscOps_114()"); - break; - - case 117: - warning("stub o6_miscOps_117()"); - break; - - case 118: - error("stub o6_miscOps_118(%d,%d,%d,%d,%d,%d,%d)", - args[1], args[2], args[3], args[4], args[5], args[6], args[7]); - break; - - case 119: - enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0); - break; - - case 120: - swapPalColors(args[1], args[2]); - break; - - case 121: - error("stub o6_miscOps_121(%d)", args[1]); - break; - - case 122: - - _vars[VAR_SOUNDRESULT] = - (short)se->do_command(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8] - ); - break; - - case 123: - swapPalColors(args[1], args[2]); - break; - - case 124: /* samnmax */ - warning("o6_miscOps: _saveSound=%d", args[1]); - _saveSound = args[1]; - break; - - default: - error("o6_miscOps: default case %d", args[0]); - } - } -} - -void Scumm::o6_kernelFunction() -{ - int16 args[30]; - int i; - Actor *a; - - getStackList(args, sizeof(args) / sizeof(args[0])); - - switch (args[0]) { - case 113: - // Do something to [1] x [2] (x/y) - warning("o6_kernelFunction: stub113(%d,%d)", args[1], args[2]); - push(0); - break; - case 115: - push(getSpecialBox(args[1], args[2])); - break; - case 116: - push(checkXYInBoxBounds(args[3], args[1], args[2])); - break; - case 206: - push(remapPaletteColor(args[1], args[2], args[3], (uint) - 1)); - break; - case 207: - i = getObjectIndex(pop()); - push(_objs[i].x_pos); - break; - case 208: - i = getObjectIndex(pop()); - push(_objs[i].y_pos); - break; - case 209: - i = getObjectIndex(pop()); - push(_objs[i].width); - break; - case 210: - i = getObjectIndex(pop()); - push(_objs[i].height); - break; - case 211: - warning("o6_kernelFunction: getInput(%d)", args[1]); - /* - 13 = thrust - 336 = thrust - 328 = thrust - 27 = abord - 97 = left - 331 = left - 115 = right - 333 = tight - */ - push(0); - break; - case 212: - a = derefActorSafe(args[1], "o6_kernelFunction:212"); - push(a->frame); - break; - case 215: - if (_extraBoxFlags[args[1]] & 0x00FF == 0x00C0) { - push(_extraBoxFlags[args[1]]); - } else { - byte *temp = (byte *)getBoxBaseAddr(args[1]); - push((byte)(*(temp + 17))); - } - break; - default: - error("o6_kernelFunction: default case %d", args[0]); - } -} - -void Scumm::o6_breakMaybe() -{ - ScriptSlot *ss = &vm.slot[_currentScript]; - if (ss->newfield == 0) { - ss->newfield = pop(); - } else { - ss->newfield--; - } - if (ss->newfield) { - _scriptPointer--; - o6_breakHere(); - } -} - -void Scumm::o6_pickOneOf() -{ - int16 args[100]; - int i, num; - - num = getStackList(args, sizeof(args) / sizeof(args[0])); - i = pop(); - if (i < 0 || i >= num) - error("o6_pickOneOf: out of range"); - push(args[i]); -} - -void Scumm::o6_pickOneOfDefault() -{ - int16 args[100]; - int i, num, def; - - def = pop(); - num = getStackList(args, sizeof(args) / sizeof(args[0])); - i = pop(); - if (i < 0 || i >= num) - i = def; - else - i = args[i]; - push(i); -} - -void Scumm::o6_getActorPriority() -{ - Actor *a; - - a = derefActorSafe(pop(), "getActorPriority"); - - push(a->layer); -} - -void Scumm::decodeParseString2(int m, int n) -{ - byte b; - - b = fetchScriptByte(); - - switch (b) { - case 65: - string[m].ypos = pop(); - string[m].xpos = pop(); - string[m].overhead = false; - break; - case 66: - string[m].color = pop(); - break; - case 67: - string[m].right = pop(); - break; - case 69: - string[m].center = true; - string[m].overhead = false; - break; - case 71: - string[m].center = false; - string[m].overhead = false; - break; - case 72: - string[m].overhead = true; - string[m].no_talk_anim = false; - break; - case 73: - error("decodeParseString2: case 73"); - break; - case 74: - string[m].no_talk_anim = true; - break; - case 75:{ - _messagePtr = _scriptPointer; - - if (_scriptPointer[0] == '/') { - char *pointer = strtok((char *)_scriptPointer, "/"); - int bunsize = strlen(pointer) + 2; - _sound->playBundleSound(pointer); - _scriptPointer += bunsize; - _messagePtr = _scriptPointer; - } - - switch (m) { - case 0: - actorTalk(); - break; - case 1: - drawString(1); - break; - case 2: - unkMessage1(); - break; - case 3: - unkMessage2(); - break; - } - _scriptPointer = _messagePtr; - return; - } - case 0xFE: - setStringVars(m); - if (n) - _actorToPrintStrFor = pop(); - return; - case 0xFF: - string[m].t_xpos = string[m].xpos; - string[m].t_ypos = string[m].ypos; - string[m].t_center = string[m].center; - string[m].t_overhead = string[m].overhead; - string[m].t_no_talk_anim = string[m].no_talk_anim; - string[m].t_right = string[m].right; - string[m].t_color = string[m].color; - string[m].t_charset = string[m].charset; - return; - default: - error("decodeParseString: default case"); - } -} - -void Scumm::setupShadowPalette(int slot, int rfact, int gfact, int bfact, int from, int to) -{ - byte *table; - int i, num; - byte *curpal; - - if (slot < 0 || slot > 7) - error("setupShadowPalette: invalid slot %d", slot); - - if (from < 0 || from > 255 || to < 0 || from > 255 || to < from) - error("setupShadowPalette: invalid range from %d to %d", from, to); - - table = _shadowPalette + slot * 256; - for (i = 0; i < 256; i++) - table[i] = i; - - table += from; - curpal = _currentPalette + from * 3; - num = to - from + 1; - do { - *table++ = remapPaletteColor((curpal[0] * rfact) >> 8, - curpal[1] * gfact >> 8, curpal[2] * bfact >> 8, (uint) - 1); - curpal += 3; - } while (--num); -} diff --git a/scumm.h b/scumm.h deleted file mode 100644 index 930d25e5d5..0000000000 --- a/scumm.h +++ /dev/null @@ -1,1414 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef SCUMM_H -#define SCUMM_H - -#include "engine.h" -#include "bundle.h" -#include "timer.h" -#include "sound.h" - -#define SCUMMVM_VERSION "0.2.2 CVS" -#define SCUMMVM_CVS "2002-08-03" - -#define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0) -#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) - -class GameDetector; -class Gui; -class NewGui; -class Scumm; -class IMuse; -class Actor; -struct ScummDebugger; -struct Serializer; -struct FindObjectInRoom; - -typedef void (Scumm::*OpcodeProc)(); - -// Use g_scumm from error() ONLY -extern Scumm *g_scumm; - -/* System Wide Constants */ -enum { - NUM_MIXER = 4, - NUM_SCRIPT_SLOT = 40, - NUM_LOCALSCRIPT = 60, - NUM_SHADOW_PALETTE = 8, - MAX_ACTORS = 30, - KEY_SET_OPTIONS = 3456 // WinCE -}; - -enum { - kDefaultMasterVolume = 192, - kDefaultSFXVolume = 192, - kDefaultMusicVolume = 192 -}; - -struct ScummPoint { - int x, y; -}; - -struct MemBlkHeader { - uint32 size; -}; - -struct VerbSlot { - int16 x, y; - int16 right, bottom; - int16 oldleft, oldtop, oldright, oldbottom; - uint8 verbid; - uint8 color, hicolor, dimcolor, bkcolor, type; - uint8 charset_nr, curmode; - uint8 saveid; - uint8 key; - bool center; - uint8 field_1B; - uint16 imgindex; -}; - -class ObjectData { -public: - uint32 offs_obim_to_room; - uint32 offs_obcd_to_room; - int16 walk_x, walk_y; - uint16 obj_nr; - int16 x_pos; - int16 y_pos; - uint16 width; - uint16 height; - byte actordir; - byte parent; - byte parentstate; - byte state; - byte fl_object_index; -}; - -struct ScriptSlot { - uint32 offs; - int32 delay; - uint16 number; - uint16 newfield; - byte status; - byte where; - byte unk1, unk2, freezeCount, didexec; - byte cutsceneOverride; - byte unk5; -}; - -struct NestedScript { - uint16 number; - uint8 where; - uint8 slot; -}; - -enum ResTypes { - rtFirst = 1, - rtRoom = 1, - rtScript = 2, - rtCostume = 3, - rtSound = 4, - rtInventory = 5, - rtCharset = 6, - rtString = 7, - rtVerb = 8, - rtActorName = 9, - rtBuffer = 10, - rtScaleTable = 11, - rtTemp = 12, - rtFlObject = 13, - rtMatrix = 14, - rtBox = 15, - rtObjectName = 16, - rtRoomScripts = 17, - rtLast = 17, - rtNumTypes = 18 -}; - -enum { - LIGHTMODE_dark = 0, - LIGHTMODE_actor_base = 1, - LIGHTMODE_screen = 2, - LIGHTMODE_flashlight = 4, - LIGHTMODE_actor_color = 8 -}; - -enum { - MBS_LEFT_CLICK = 0x8000, - MBS_RIGHT_CLICK = 0x4000, - MBS_MOUSE_MASK = (MBS_LEFT_CLICK | MBS_RIGHT_CLICK), - MBS_MAX_KEY = 0x0200 -}; - -#define _maxRooms res.num[rtRoom] -#define _maxScripts res.num[rtScript] -#define _maxCostumes res.num[rtCostume] -#define _maxInventoryItems res.num[rtInventory] -#define _maxCharsets res.num[rtCharset] -#define _maxStrings res.num[rtString] -#define _maxVerbs res.num[rtVerb] -#define _maxActorNames res.num[rtActorName] -#define _maxBuffer res.num[rtBuffer] -#define _maxScaleTable res.num[rtScaleTable] -#define _maxTemp res.num[rtTemp] -#define _maxFLObject res.num[rtFlObject] -#define _maxMatrixes res.num[rtMatrix] -#define _maxBoxes res.num[rtBox] - -#define _baseRooms res.address[rtRoom] -#define _baseScripts res.address[rtScript] -#define _baseInventoryItems res.address[rtInventory] -#define _baseFLObject res.address[rtFlObject] -#define _baseArrays res.address[rtString] - -#define _roomFileOffsets res.roomoffs[rtRoom] - -struct CharsetRenderer { - Scumm *_vm; - int _top; - int _drawTop; - int _left, _left2; - byte _center; - int _right; - byte _color; - bool _hasMask; - bool _blitAlso; - - int _strLeft, _strRight, _strTop, _strBottom; - byte _curId; - - int _xpos2, _ypos2; - - int _bufPos; - byte _unk12, _disableOffsX; - byte *_ptr; - byte _unk2, _bpp; - byte _invNumBits; - uint32 _charOffs; - byte *_charPtr; - int _width, _height; - int _offsX, _offsY; - byte _bitMask, _revBitMask; - int _bottom; - int _virtScreenHeight; - - byte _ignoreCharsetMask; - - byte *_backbuff_ptr, *_bgbak_ptr; - byte *_mask_ptr; - byte *_dest_ptr; - - byte _colorMap[16]; - byte _buffer[512]; - - void drawBits(); - void printChar(int chr); - void printCharOld(int chr); - int getSpacing(char chr); - int getStringWidth(int a, byte *str, int pos); - void addLinebreaks(int a, byte *str, int pos, int maxwidth); -}; - -#define ARRAY_HDR_SIZE 6 -struct ArrayHeader { - int16 dim1_size; - int16 type; - int16 dim2_size; - byte data[1]; -}; - -struct SentenceTab { - byte unk5; - byte unk2; - uint16 unk4; - uint16 unk3; - byte unk; - byte pad; -}; - -struct StringTab { - int16 t_xpos, t_ypos; - int16 t_right; - int16 xpos, ypos; - int16 right; - byte color, t_color; - byte charset, t_charset; - bool center, t_center; - bool overhead, t_overhead; - bool no_talk_anim, t_no_talk_anim; -}; - -enum GameId { - GID_TENTACLE = 1, - GID_MONKEY2 = 2, - GID_INDY4 = 3, - GID_MONKEY = 4, - GID_SAMNMAX = 5, - GID_MONKEY_EGA = 6, - GID_LOOM256 = 7, - GID_ZAK256 = 8, - GID_INDY3_256 = 9, - GID_LOOM = 10, - GID_FT = 11, - GID_DIG = 12, - GID_MONKEY_VGA = 13, - GID_CMI = 14, - - /* Simon the Sorcerer */ - GID_SIMON_FIRST = 20, - GID_SIMON_LAST = GID_SIMON_FIRST + 3, -}; - -enum GameFeatures { - GF_NEW_OPCODES = 1, - GF_AFTER_V6 = 2, - GF_AFTER_V7 = 4, - GF_HAS_ROOMTABLE = GF_AFTER_V7, - GF_USE_KEY = 8, - GF_NEW_COSTUMES = GF_AFTER_V7, - GF_USE_ANGLES = GF_AFTER_V7, - GF_DRAWOBJ_OTHER_ORDER = 16, - - GF_DEFAULT = GF_USE_KEY, - - GF_SMALL_HEADER = 32, - GF_EXTERNAL_CHARSET = GF_SMALL_HEADER, - GF_SMALL_NAMES = 64, - GF_OLD_BUNDLE = 128, - GF_16COLOR = 256, - GF_OLD256 = 512, - GF_AUDIOTRACKS = 1024, - GF_NO_SCALLING = 2048, - GF_ADLIB_DEFAULT = 4096, - GF_AMIGA = 8192, - GF_HUMONGOUS = 16384, - GF_AFTER_V8 = 32768 -}; - -enum WhereIsObject { - WIO_NOT_FOUND = -1, - WIO_INVENTORY = 0, - WIO_ROOM = 1, - WIO_GLOBAL = 2, - WIO_LOCAL = 3, - WIO_FLOBJECT = 4 -}; - -enum MouseButtonStatus { - msDown = 1, - msClicked = 2 -}; - -#include "gfx.h" -#include "boxes.h" - -class Scumm : public Engine { -public: - /* Put often used variables at the top. - * That results in a shorter form of the opcode - * on some architectures. */ - IMuse *_imuse; - Gui *_gui; - NewGui *_newgui; - uint32 _features; - VerbSlot *_verbs; - ObjectData *_objs; - ScummDebugger *_debugger; - Bundle * _bundle; - Timer * _timer; - Sound * _sound; - - struct { - byte mode[rtNumTypes]; - uint16 num[rtNumTypes]; - uint32 tags[rtNumTypes]; - const char *name[rtNumTypes]; - byte **address[rtNumTypes]; - byte *flags[rtNumTypes]; - byte *roomno[rtNumTypes]; - uint32 *roomoffs[rtNumTypes]; - } res; - - struct { - uint32 cutScenePtr[5]; - byte cutSceneScript[5]; - int16 cutSceneData[5]; - int16 cutSceneScriptIndex; - byte cutSceneStackPointer; - ScriptSlot slot[NUM_SCRIPT_SLOT]; - NestedScript nest[15]; - int16 localvar[NUM_SCRIPT_SLOT][17]; - } vm; - - struct { - int16 x, y; - } mouse; - - /* Init functions, etc */ - byte _fastMode; - char *getGameName(); - - /* video buffer */ - byte *_videoBuffer; - - /* system call object */ - - /* Scumm main loop */ - - void mainRun(); - - /* _insane vars */ - - int _insaneFlag; - int _insaneState; - int videoFinished; - - - void scummInit(); - void scummMain(int argc, char **argv); // is it still used ? - int scummLoop(int delta); - void initScummVars(); - - void pauseGame(bool user); - void shutDown(int i); - void setOptions(void); - - void main(); - void parseCommandLine(int argc, char **argv); - void showHelpAndExit(); - bool detectGame(); - void processKbd(); - void clear_fullRedraw(); - - int checkKeyHit(); - void convertKeysToClicks(); - - /* Random number generation */ - uint32 _randSeed1, _randSeed2; - void initRandSeeds(); - uint getRandomNumber(uint max); - uint getRandomNumberRng(uint min, uint max); - - /* Core variable definitions */ - byte _gameId; - const char *_gameText; - - /* Core class/array definitions */ - Gdi gdi; - - Actor *_actors; // Has MAX_ACTORS elements - - uint16 *_inventory; - byte *_arrays; - uint16 *_newNames; - int16 *_vars; - int16 _varwatch; - byte *_bitVars; - - /* Global resource tables */ - int _numVariables, _numBitVariables, _numLocalObjects; - int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; - int _numInventory, _numRooms, _numScripts, _numSounds; - int _numCharsets, _numCostumes, _numNewNames, _numGlobalScripts; - int NUM_ACTORS; - - /* Current objects - can go in their respective classes */ - byte _curActor; - int _curVerb; - int _curVerbSlot; - int _curPalIndex; - byte _currentRoom; - VirtScreen *_curVirtScreen; - - bool _egoPositioned; - int _keyPressed; - uint16 _lastKeyHit; - uint16 _mouseButStat; - byte _leftBtnPressed, _rightBtnPressed; - - int16 _virtual_mouse_x, _virtual_mouse_y, _bootParam; - uint16 _debugMode, _currentDrive, _soundCardType; - byte _mousePresent; - - /* Not sure where this stuff goes */ - byte isMaskActiveAt(int l, int t, int r, int b, byte *mem); - void startScene(int room, Actor *a, int b); - void setupScummVarsOld(); // Both of these will simply be one - void setupScummVarsNew(); // 'setupScummVars' in each Scumm_Vx - byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable; - byte _numObjectsInRoom; - int8 _userPut; - int _resourceHeaderSize; - void unkRoomFunc3(int a, int b, int c, int d, int e); - void palManipulate(int a, int b, int c, int d, int e); - void setScaleItem(int slot, int a, int b, int c, int d); - void clearClickedStatus(); - void startManiac(); - - /* GUI class */ - void drawString(int a); - int getKeyInput(int a); - - /* Save/Load class - some of this may be GUI */ - byte _saveLoadFlag, _saveLoadSlot; - bool _doAutosave; - bool _saveLoadCompatible; - char _saveLoadName[32]; - - bool saveState(int slot, bool compat); - bool loadState(int slot, bool compat); - void saveOrLoad(Serializer *s); - - bool getSavegameName(int slot, char *desc); - void makeSavegameName(char *out, int slot, bool compatible); - void saveLoadResource(Serializer *ser, int type, int index); - - /* Heap and memory management */ - uint32 _maxHeapThreshold, _minHeapThreshold; - void checkRange(int max, int min, int no, const char *str); - void lock(int type, int i); - void unlock(int type, int i); - void heapClear(int mode); - void unkHeapProc2(int a, int b); - - /* Script VM - should be in Script class */ - uint32 _localScriptList[NUM_LOCALSCRIPT]; - byte *_scriptPointer, *_scriptOrgPointer, *_scriptPointerStart; - byte _opcode, _numNestedScripts, _currentScript; - uint16 _curExecScript; - const OpcodeProc *_opcodes; - const char **_opcodes_lookup; - byte **_lastCodePtr; - int _resultVarNumber, _scummStackPos; - int16 _localParamList[16], _scummStack[150]; - - OpcodeProc getOpcode(int i) { return _opcodes[i]; } - void initializeLocals(int slot, int16 *vars); - int getScriptSlot(); - void runScript(int script, int a, int b, int16 *lvarptr); - void stopScriptNr(int script); - void runScriptNested(int script); - void executeScript(); - void updateScriptPtr(); - void getScriptBaseAddress(); - void getScriptEntryPoint(); - byte fetchScriptByte(); - int fetchScriptWord(); - void ignoreScriptWord() { fetchScriptWord(); } - void ignoreScriptByte() { fetchScriptByte(); } - int getVarOrDirectWord(byte mask); - int getVarOrDirectByte(byte mask); - void getResultPos(); - void setResult(int result); - int readVar(uint var); - void writeVar(uint var, int value); - void push(int a); - int pop(); - void runHook(int i); - bool isScriptInUse(int script); - int getStringLen(byte *ptr); - - void freezeScripts(int scr); - void unfreezeScripts(); - void runAllScripts(); - void setupOpcodes(); - void setupOpcodes2(); - void cutscene(int16 *args); - void endCutscene(); - void exitCutscene(); - void runExitScript(); - void runEntryScript(); - - void beginOverride(); - void endOverride(); - void killScriptsAndResources(); - void checkAndRunVar33(); - void decreaseScriptDelay(int amount); - bool isScriptRunning(int script); - bool isRoomScriptRunning(int script); - void arrayop_1(int a, byte *ptr); - void copyString(byte *dst, byte *src, int len); - void doSentence(int c, int b, int a); - int popRoomAndObj(int *room); - int getWordVararg(int16 *ptr); - void decodeParseString(); - void decodeParseString2(int a, int b); - - /* Script VM or Object class? */ - void stopObjectCode(); - void stopObjectScript(int script); - - /* Should be in Resource class */ - byte _encbyte; - void *_fileHandle; - char *_resFilePrefix, *_resFilePath; - uint32 _fileOffset; - char *_exe_name; - bool _dynamicRoomOffsets; - byte _resourceMapper[128]; - uint32 _allocatedSize; - byte _expire_counter; - - void allocateArrays(); - void openRoom(int room); - void deleteRoomOffsets(); - void readRoomsOffsets(); - void askForDisk(const char *filename); - bool openResourceFile(const char *filename); - void loadPtrToResource(int type, int i, byte *ptr); - void readResTypeList(int id, uint32 tag, const char *name); - char *resTypeFromId(int id); - void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); - byte *createResource(int type, int index, uint32 size); - void nukeResource(int type, int i); - byte *getResourceAddress(int type, int i); - byte *getStringAddress(int i); - byte *getStringAddressVar(int i); - void ensureResourceLoaded(int type, int i); - int loadResource(int type, int i); - int getResourceRoomNr(int type, int index); - int readSoundResource(int type, int index); - void setResourceCounter(int type, int index, byte flag); - void validateResource(const char *str, int type, int index); - void increaseResourceCounter(); - bool isResourceInUse(int type, int i); - bool isResourceLoaded(int type, int index); - void initRoomSubBlocks(); - void loadRoomObjects(); - void loadRoomObjectsSmall(); - void readArrayFromIndexFile(); - void readMAXS(); - bool isGlobInMemory(int type, int index); - virtual void readIndexFile(); - virtual void loadCharset(int i); - void nukeCharset(int i); - - bool fileReadFailed(void *handle); - void clearFileReadFailed(void *handle); - - int _lastLoadedRoom, _roomResource; - byte _resFilePathId, _fileReadFailed; - byte *findResourceData(uint32 tag, byte *ptr); - int getResourceDataSize(byte *ptr); - - int getArrayId(); - void nukeArray(int a); - int defineArray(int a, int b, int c, int d); - int readArray(int array, int index, int base); - void writeArray(int array, int index, int base, int value); - - void resourceStats(); - void expireResources(uint32 size); - void freeResources(); - void destroy(); - void dumpResource(char *tag, int index, byte *ptr); - - - /* Should be in Object class */ - byte OF_OWNER_ROOM; - int getInventorySlot(); - void SamInventoryHack(int obj); // FIXME: Sam and Max hack - int findInventory(int owner, int index); - int getInventoryCount(int owner); - - void setupRoomObject(ObjectData *od, byte *room); - void removeObjectFromRoom(int obj); - void loadFlObject(uint object, uint room); - void nukeFlObjects(int min, int max); - int findFlObjectSlot(); - void addObjectToInventory(uint obj, uint room); - void fixObjectFlags(); - bool getClass(int obj, int cls); - void putClass(int obj, int cls, bool set); - int getState(int obj); - void putState(int obj, int state); - void setObjectState(int obj, int state, int x, int y); - int getOwner(int obj); - void putOwner(int obj, int owner); - void setOwnerOf(int obj, int owner); - void clearOwnerOf(int obj); - int getObjectRoom(int obj); - int getObjX(int obj); - int getObjY(int obj); - void getObjectXYPos(int object, int &x, int &y) { int dir; getObjectXYPos(object, x, y, dir); } - void getObjectXYPos(int object, int &x, int &y, int &dir); - int getObjOldDir(int obj); - int getObjNewDir(int obj); - int getObjectIndex(int object); - int whereIsObject(int object); - int findObject(int x, int y); - void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room); - int getObjectOrActorXY(int object, int &x, int &y); // Object and Actor... - int getObjActToObjActDist(int a, int b); // Not sure how to handle - byte *getObjOrActorName(int obj); // these three.. - - void addObjectToDrawQue(int object); - void clearDrawObjectQueue(); - void processDrawQue(); - - uint32 getOBCDOffs(int object); - byte *getOBCDFromObject(int obj); - int getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f); - - /* Should be in Costume class */ - void cost_decodeData(Actor *a, int frame, uint usemask); - int cost_frameToAnim(Actor *a, int frame); - - - /* Should be in Verb class */ - uint16 _verbMouseOver; - int _inventoryOffset; - void redrawVerbs(); - void checkExecVerbs(); - void verbMouseOver(int verb); - int checkMouseOver(int x, int y); - void drawVerb(int verb, int mode); - void runInputScript(int a, int cmd, int mode); - void restoreVerbBG(int verb); - void drawVerbBitmap(int verb, int x, int y); - int getVerbEntrypoint(int obj, int entry); - int getVerbSlot(int id, int mode); - void killVerb(int slot); - void runVerbCode(int script, int entry, int a, int b, int16 *vars); - void setVerbObject(uint room, uint object, uint verb); - - /* Should be in Actor class */ - Actor *derefActor(int id); - Actor *derefActorSafe(int id, const char *errmsg); - Actor *getFirstActor() { return _actors; } - void showActors(); - - uint32 *_classData; - - int getAngleFromPos(int x, int y); - - void walkActors(); - void playActorSounds(); - void setActorRedrawFlags(); - void resetActorBgs(); - void processActors(); - int getActorFromPos(int x, int y); - void faceActorToObj(int act, int obj); - void actorFollowCamera(int act); - - bool isCostumeInUse(int i); - - /* Actor talking stuff */ - byte _actorToPrintStrFor; - int _sentenceNum; - SentenceTab sentence[6]; - StringTab string[6]; - void actorTalk(); - void stopTalk(); - - /* Akos Class */ - - bool akos_increaseAnims(byte *akos, Actor *a); - bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo); - - void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2); - bool akos_compare(int a, int b, byte cmd); - void akos_decodeData(Actor *a, int frame, uint usemask); - int akos_frameToAnim(Actor *a, int frame); - bool akos_hasManyDirections(Actor *a); - - - /* Should be in Graphics class? */ - uint16 _screenB, _screenH; - int _scrHeight, _scrWidth, _realHeight, _realWidth; - VirtScreen virtscr[4]; // Virtual screen areas - CameraData camera; // 'Camera' - viewport - ColorCycle _colorCycle[16]; // Palette cycles - - uint32 _ENCD_offs, _EXCD_offs; - uint32 _CLUT_offs, _EPAL_offs; - uint32 _IM00_offs, _PALS_offs; - - //ender: fullscreen - bool _fullRedraw, _BgNeedsRedraw, _shakeEnabled; - bool _screenEffectFlag, _completeScreenRedraw; - - int _cursorHotspotX, _cursorHotspotY, _cursorWidth, _cursorHeight; - byte _cursorAnimate, _cursorAnimateIndex, _grabbedCursor[2048]; - int8 _cursorState; - - byte _newEffect, _switchRoomEffect2, _switchRoomEffect; - bool _doEffect; - - uint16 _flashlightXStrips, _flashlightYStrips; - bool _flashlightIsDrawn; - - void getGraphicsPerformance(); - void initScreens(int a, int b, int w, int h); - void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool fourextra); - void initBGBuffers(int height); - void initCycl(byte *ptr); // Color cycle - - void createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax); - - void drawObject(int obj, int arg); - void drawRoomObjects(int arg); - void drawRoomObject(int i, int arg); - void drawBox(int x, int y, int x2, int y2, int color); - void drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, int param3); - - void restoreBG(int left, int top, int right, int bottom); - void redrawBGStrip(int start, int num); - void redrawBGAreas(); - - void moveCamera(); - void cameraMoved(); - void setCameraAtEx(int at); - void setCameraAt(int pos_x, int pos_y); - void panCameraTo(int x, int y); - void setCameraFollows(Actor *a); - void clampCameraPos(ScummPoint *pt); - - byte *getPalettePtr(); - void setPalette(int pal); - void setPaletteFromPtr(byte *ptr); - void setPaletteFromRes(); - void setPalColor(int index, int r, int g, int b); - void setDirtyColors(int min, int max); - byte *findPalInPals(byte *pal, int index); - void swapPalColors(int a, int b); - void cyclePalette(); - void stopCycle(int i); - void palManipulate(); - int remapPaletteColor(int r, int g, int b, uint threshold); - void moveMemInPalRes(int start, int end, byte direction); - void setupShadowPalette(int slot, int rfact, int gfact, int bfact, int from, int to); - void darkenPalette(int a, int b, int c, int d, int e); - void desaturatePalette(); - - void setShake(int mode); - - void setCursor(int cursor); - void setCursorImg(uint img, uint room, uint imgindex); - void setCursorHotspot2(int x, int y); - void grabCursor(int x, int y, int w, int h); - void grabCursor(byte *ptr, int width, int height); - void makeCursorColorTransparent(int a); - void setupCursor() { _cursorAnimate = 1; } - void decompressDefaultCursor(int index); - void useIm01Cursor(byte *im, int w, int h); - void useBompCursor(byte *im, int w, int h); - - - void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits); - void setDirtyRange(int slot, int a, int height); - void drawDirtyScreenParts(); - void updateDirtyScreen(int slot); - - VirtScreen *findVirtScreen(int y); - static void setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom); - - void drawFlashlight(); - - void fadeIn(int effect); - void fadeOut(int effect); - - void unkScreenEffect1(); - void unkScreenEffect2(); - void unkScreenEffect3(); - void unkScreenEffect4(); - void unkScreenEffect5(int a); - void unkScreenEffect6(); - void transitionEffect(int a); // former unkScreenEffect7 - - void decompressBomp(byte *dst, byte *src, int w, int h); - uint _shakeFrame; - int _screenStartStrip, _screenEndStrip; - int _screenLeft, _screenTop; - uint16 _enqueue_b, _enqueue_c, _enqueue_d, _enqueue_e; - int _enqueuePos; - BlastObject _enqueuedObjects[32]; - - void enqueueObject(int a, int b, int c, int d, int e, int f, int g, int h, int mode); - void clearEnqueue() { _enqueuePos = 0; } - void drawBlastObjects(); - void drawBlastObject(BlastObject *eo); - void removeBlastObjects(); - void removeBlastObject(BlastObject *eo); - - int _drawObjectQueNr; - byte _drawObjectQue[200]; - int16 _palManipStart, _palManipEnd, _palManipCounter; - uint32 gfxUsageBits[200]; - byte *_shadowPalette; - int _shadowPaletteSize; - byte _currentPalette[0x300]; - - byte _proc_special_palette[256]; - int _palDirtyMin, _palDirtyMax; - byte _bkColor; - uint16 _lastXstart; - - byte _haveMsg; - bool _useTalkAnims; - uint16 _defaultTalkDelay; - bool _use_adlib; - int tempMusic; - int _saveSound; - uint16 _soundParam, _soundParam2, _soundParam3; - int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end; - - /* Walkbox / Navigation class */ - int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem; - byte *_boxMatrixPtr4, *_boxMatrixPtr1, *_boxMatrixPtr3; - - uint16 _extraBoxFlags[65]; - - PathNode *unkMatrixProc2(PathVertex *vtx, int i); - bool areBoxesNeighbours(int i, int j); - void addToBoxMatrix(byte b); - bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3); - void *addToBoxVertexHeap(int size); - PathVertex *addPathVertex(); - bool checkXYInBoxBounds(int box, int x, int y); - uint distanceFromPt(int x, int y, int ptx, int pty); - ScummPoint closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); - void getBoxCoordinates(int boxnum, BoxCoords *bc); - byte getMaskFromBox(int box); - Box *getBoxBaseAddr(int box); - byte getBoxFlags(int box); - int getBoxScale(int box); - byte getNumBoxes(); - byte *getBoxMatrixBaseAddr(); - int getPathToDestBox(byte from, byte to); - bool findPathTowards(Actor *a, byte box, byte box2, byte box3, int16 &foundPathX, int16 &foundPathY); - void findPathTowardsOld(Actor *a, byte box, byte box2, byte box3, ScummPoint gateLoc[5]); - void getGates(int trap1, int trap2, ScummPoint gateA[2], ScummPoint gateB[2]); - bool inBoxQuickReject(int box, int x, int y, int threshold); - AdjustBoxResult getClosestPtOnBox(int box, int x, int y); - int getSpecialBox(int param1, int param2); - - void setBoxFlags(int box, int val); - void setBoxScale(int box, int b); - void createBoxMatrix(); - - - /* String class */ - CharsetRenderer charset; - byte _charsetColor; - uint16 _noSubtitles; // Skip all subtitles? - byte _charsetData[15][16]; - void initCharset(int charset); - void restoreCharsetBg(); - int hasCharsetMask(int x, int y, int x2, int y2); - void CHARSET_1(); - void description(); - byte *_msgPtrToAdd; - byte *addMessageToStack(byte *msg); - void unkAddMsgToStack2(int var); - void unkAddMsgToStack3(int var); - void unkAddMsgToStack4(int var); - void unkAddMsgToStack5(int var); - void unkMessage1(); - void unkMessage2(); - void clearMsgQueue(); - int _numInMsgStack; - byte *_messagePtr; - int16 _talkDelay; - bool _keepText; - - - /* Should be in System class */ - void fileClose(void *file); - void *fileOpen(const char *filename, int mode); - void fileSeek(void *file, long offs, int whence); - void fileRead(void *handle, void *ptr, uint32 size); - bool fileEof(void *handle); - uint32 filePos(void *handle); - bool checkFixedDisk(); - int _cdrom; - - int fileReadByte(); - uint32 fileReadDwordLE(); - uint32 fileReadDwordBE(); - int fileReadByte(void *handle); - uint32 fileReadDwordLE(void *handle); - uint32 fileReadDwordBE(void *handle); - -#if defined(SCUMM_LITTLE_ENDIAN) - uint32 fileReadDword() { return fileReadDwordLE(); } - uint32 fileReadDword(void *handle) { return fileReadDwordLE(handle); } -#elif defined(SCUMM_BIG_ENDIAN) - uint32 fileReadDword() { return fileReadDwordBE(); } - uint32 fileReadDword(void *handle) { return fileReadDwordBE(handle); } -#endif - uint fileReadWordLE(); - uint fileReadWordBE(); - uint fileReadWordLE(void *handle); - uint fileReadWordBE(void *handle); - - /* Version 5 script opcodes */ - void o5_actorFollowCamera(); - void o5_actorFromPos(); - void o5_actorSet(); - void o5_add(); - void o5_and(); - void o5_animateActor(); - void o5_badOpcode(); - void o5_breakHere(); - void o5_chainScript(); - void o5_cursorCommand(); - void o5_cutscene(); - void o5_debug(); - void o5_decrement(); - void o5_delay(); - void o5_delayVariable(); - void o5_divide(); - void o5_doSentence(); - void o5_drawBox(); - void o5_drawObject(); - void o5_dummy(); - void o5_endCutscene(); - void o5_equalZero(); - void o5_expression(); - void o5_faceActor(); - void o5_findInventory(); - void o5_findObject(); - void o5_freezeScripts(); - void o5_getActorCostume(); - void o5_getActorElevation(); - void o5_getActorFacing(); - void o5_getActorMoving(); - void o5_getActorRoom(); - void o5_getActorScale(); - void o5_getActorWalkBox(); - void o5_getActorWidth(); - void o5_getActorX(); - void o5_getActorY(); - void o5_getAnimCounter(); - void o5_getClosestObjActor(); - void o5_getDist(); - void o5_getInventoryCount(); - void o5_getObjectOwner(); - void o5_getObjectState(); - void o5_getRandomNr(); - void o5_getScriptRunning(); - void o5_getVerbEntrypoint(); - void o5_ifClassOfIs(); - void o5_increment(); - void o5_isActorInBox(); - void o5_isEqual(); - void o5_isGreater(); - void o5_isGreaterEqual(); - void o5_isLess(); - void o5_isNotEqual(); - void o5_isSoundRunning(); - void o5_jumpRelative(); - void o5_lessOrEqual(); - void o5_lights(); - void o5_loadRoom(); - void o5_loadRoomWithEgo(); - void o5_matrixOps(); - void o5_move(); - void o5_multiply(); - void o5_notEqualZero(); - void o5_or(); - void o5_overRide(); - void o5_panCameraTo(); - void o5_pickupObject(); - void o5_print(); - void o5_printEgo(); - void o5_pseudoRoom(); - void o5_putActor(); - void o5_putActorAtObject(); - void o5_putActorInRoom(); - void o5_quitPauseRestart(); - void o5_resourceRoutines(); - void o5_roomOps(); - void o5_saveRestoreVerbs(); - void o5_setCameraAt(); - void o5_setClass(); - void o5_setObjectName(); - void o5_setOwnerOf(); - void o5_setState(); - void o5_setVarRange(); - void o5_soundKludge(); - void o5_startMusic(); - void o5_startObject(); - void o5_startScript(); - void o5_startSound(); - void o5_stopMusic(); - void o5_stopObjectCode(); - void o5_stopObjectScript(); - void o5_stopScript(); - void o5_stopSound(); - void o5_stringOps(); - void o5_subtract(); - void o5_verbOps(); - void o5_wait(); - void o5_walkActorTo(); - void o5_walkActorToActor(); - void o5_walkActorToObject(); - void o5_oldRoomEffect(); - void o5_pickupObjectOld(); - - /* Version 6 script opcodes */ - int getStackList(int16 *args, uint maxnum); - void setStringVars(int i); - void unkMiscOp9(); - - void o6_setBlastObjectWindow(); - void o6_pushByte(); - void o6_pushWord(); - void o6_pushByteVar(); - void o6_pushWordVar(); - void o6_invalid(); - void o6_byteArrayRead(); - void o6_wordArrayRead(); - void o6_byteArrayIndexedRead(); - void o6_wordArrayIndexedRead(); - void o6_dup(); - void o6_zero(); - void o6_eq(); - void o6_neq(); - void o6_gt(); - void o6_lt(); - void o6_le(); - void o6_ge(); - void o6_add(); - void o6_sub(); - void o6_mul(); - void o6_div(); - void o6_land(); - void o6_lor(); - void o6_kill(); - void o6_writeByteVar(); - void o6_writeWordVar(); - void o6_byteArrayWrite(); - void o6_wordArrayWrite(); - void o6_byteArrayIndexedWrite(); - void o6_wordArrayIndexedWrite(); - void o6_byteVarInc(); - void o6_wordVarInc(); - void o6_byteArrayInc(); - void o6_wordArrayInc(); - void o6_byteVarDec(); - void o6_wordVarDec(); - void o6_byteArrayDec(); - void o6_wordArrayDec(); - void o6_jumpTrue(); - void o6_jumpFalse(); - void o6_jump(); - void o6_startScriptEx(); - void o6_startScript(); - void o6_startObject(); - void o6_setObjectState(); - void o6_setObjectXY(); - void o6_stopObjectCode(); - void o6_endCutscene(); - void o6_cutScene(); - void o6_stopMusic(); - void o6_freezeUnfreeze(); - void o6_cursorCommand(); - void o6_breakHere(); - void o6_ifClassOfIs(); - void o6_setClass(); - void o6_getState(); - void o6_setState(); - void o6_setOwner(); - void o6_getOwner(); - void o6_startSound(); - void o6_stopSound(); - void o6_startMusic(); - void o6_stopObjectScript(); - void o6_panCameraTo(); - void o6_actorFollowCamera(); - void o6_setCameraAt(); - void o6_loadRoom(); - void o6_stopScript(); - void o6_walkActorToObj(); - void o6_walkActorTo(); - void o6_putActorInRoom(); - void o6_putActorAtObject(); - void o6_faceActor(); - void o6_animateActor(); - void o6_doSentence(); - void o6_pickupObject(); - void o6_loadRoomWithEgo(); - void o6_getRandomNumber(); - void o6_getRandomNumberRange(); - void o6_getActorMoving(); - void o6_getScriptRunning(); - void o6_getActorRoom(); - void o6_getObjectX(); - void o6_getObjectY(); - void o6_getObjectOldDir(); - void o6_getObjectNewDir(); - void o6_getActorWalkBox(); - void o6_getActorCostume(); - void o6_findInventory(); - void o6_getInventoryCount(); - void o6_getVerbFromXY(); - void o6_beginOverride(); - void o6_endOverride(); - void o6_setObjectName(); - void o6_isSoundRunning(); - void o6_setBoxFlags(); - void o6_createBoxMatrix(); - void o6_resourceRoutines(); - void o6_roomOps(); - void o6_actorSet(); - void o6_verbOps(); - void o6_getActorFromXY(); - void o6_findObject(); - void o6_pseudoRoom(); - void o6_getActorElevation(); - void o6_getVerbEntrypoint(); - void o6_arrayOps(); - void o6_saveRestoreVerbs(); - void o6_drawBox(); - void o6_getActorWidth(); - void o6_wait(); - void o6_getActorScaleX(); - void o6_getActorAnimCounter1(); - void o6_soundKludge(); - void o6_isAnyOf(); - void o6_quitPauseRestart(); - void o6_isActorInBox(); - void o6_delay(); - void o6_delayLonger(); - void o6_delayVeryLong(); - void o6_stopSentence(); - void o6_print_0(); - void o6_print_1(); - void o6_print_2(); - void o6_print_3(); - void o6_printActor(); - void o6_printEgo(); - void o6_talkActor(); - void o6_talkEgo(); - void o6_dim(); - void o6_runVerbCodeQuick(); - void o6_runScriptQuick(); - void o6_dim2(); - void o6_abs(); - void o6_distObjectObject(); - void o6_distObjectPt(); - void o6_distPtPt(); - void o6_dummy_stacklist(); - void o6_miscOps(); - void o6_breakMaybe(); - void o6_pickOneOf(); - void o6_pickOneOfDefault(); - void o6_jumpToScript(); - void o6_isRoomScriptRunning(); - void o6_kernelFunction(); - void o6_getAnimateVariable(); - void o6_drawBlastObject(); - void o6_getActorPriority(); - - /* Scumm Vars */ - byte VAR_EGO; - byte VAR_CAMERA_POS_X; - byte VAR_HAVE_MSG; - byte VAR_ROOM; - byte VAR_OVERRIDE; - byte VAR_MACHINE_SPEED; - byte VAR_ME; - byte VAR_NUM_ACTOR; - byte VAR_CURRENT_LIGHTS; - byte VAR_CURRENTDRIVE; - byte VAR_TMR_1; - byte VAR_TMR_2; - byte VAR_TMR_3; - byte VAR_MUSIC_FLAG; - byte VAR_ACTOR_RANGE_MIN; - byte VAR_ACTOR_RANGE_MAX; - byte VAR_CAMERA_MIN_X; - byte VAR_CAMERA_MAX_X; - byte VAR_TIMER_NEXT; - byte VAR_VIRT_MOUSE_X; - byte VAR_VIRT_MOUSE_Y; - byte VAR_ROOM_RESOURCE; - byte VAR_LAST_SOUND; - byte VAR_CUTSCENEEXIT_KEY; - byte VAR_OPTIONS_KEY; - byte VAR_TALK_ACTOR; - byte VAR_CAMERA_FAST_X; - byte VAR_SCROLL_SCRIPT; - byte VAR_ENTRY_SCRIPT; - byte VAR_ENTRY_SCRIPT2; - byte VAR_EXIT_SCRIPT; - byte VAR_EXIT_SCRIPT2; - byte VAR_VERB_SCRIPT; - byte VAR_SENTENCE_SCRIPT; - byte VAR_HOOK_SCRIPT; - byte VAR_CUTSCENE_START_SCRIPT; - byte VAR_CUTSCENE_END_SCRIPT; - byte VAR_CHARINC; - byte VAR_WALKTO_OBJ; - byte VAR_DEBUGMODE; - byte VAR_HEAPSPACE; - byte VAR_RESTART_KEY; - byte VAR_PAUSE_KEY; - byte VAR_MOUSE_X; - byte VAR_MOUSE_Y; - byte VAR_TIMER; - byte VAR_TMR_4; - byte VAR_SOUNDCARD; - byte VAR_VIDEOMODE; - byte VAR_SAVELOADDIALOG_KEY; - byte VAR_FIXEDDISK; - byte VAR_CURSORSTATE; - byte VAR_USERPUT; - byte VAR_SOUNDRESULT; - byte VAR_TALKSTOP_KEY; - byte VAR_59; - - byte VAR_SOUNDPARAM; - byte VAR_SOUNDPARAM2; - byte VAR_SOUNDPARAM3; - byte VAR_MOUSEPRESENT; - byte VAR_PERFORMANCE_1; - byte VAR_PERFORMANCE_2; - byte VAR_ROOM_FLAG; - byte VAR_GAME_LOADED; - byte VAR_NEW_ROOM; - byte VAR_VERSION; - - byte VAR_V5_DRAWFLAGS; - byte VAR_MI1_TIMER; - byte VAR_V5_OBJECT_LO; - byte VAR_V5_OBJECT_HI; - byte VAR_V5_TALK_STRING_Y; - byte VAR_V5_CHARFLAG; - - byte VAR_V6_SCREEN_WIDTH; - byte VAR_V6_SCREEN_HEIGHT; - byte VAR_V6_EMSSPACE; - byte VAR_V6_RANDOM_NR; - - byte VAR_STRING2DRAW; - byte VAR_CAMERA_POS_Y; - - byte VAR_CAMERA_MIN_Y; - byte VAR_CAMERA_MAX_Y; - byte VAR_CAMERA_THRESHOLD_X; - byte VAR_CAMERA_THRESHOLD_Y; - byte VAR_CAMERA_SPEED_X; - byte VAR_CAMERA_SPEED_Y; - byte VAR_CAMERA_ACCEL_X; - byte VAR_CAMERA_ACCEL_Y; - - byte VAR_CAMERA_DEST_X; - - byte VAR_CAMERA_DEST_Y; - - byte VAR_CAMERA_FOLLOWED_ACTOR; - - byte VAR_LEFTBTN_DOWN; - byte VAR_RIGHTBTN_DOWN; - byte VAR_LEFTBTN_HOLD; - byte VAR_RIGHTBTN_HOLD; - - byte VAR_UNK_SCRIPT; - byte VAR_UNK_SCRIPT_2; - - byte VAR_DEFAULT_TALK_DELAY; - byte VAR_CHARSET_MASK; - - byte VAR_CUSTOMSCALETABLE; - byte VAR_VIDEONAME; - - void launch(); - - Scumm(GameDetector *detector, OSystem *syst); - virtual ~Scumm(); - - void go(); - - void setupGUIColors(); - byte getDefaultGUIColor(int color); - void waitForTimer(int msec_delay); - - void updateCursor(); - void animateCursor(); - void updatePalette(); -}; - -class Scumm_v3 : public Scumm -{ -public: - Scumm_v3(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} - - void readIndexFile(); - virtual void loadCharset(int no); -}; - -class Scumm_v4 : public Scumm_v3 -{ -public: - Scumm_v4(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} - - void loadCharset(int no); -}; - -class Scumm_v5 : public Scumm -{ -public: - Scumm_v5(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} -}; - -class Scumm_v6 : public Scumm -{ -public: - Scumm_v6(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} -}; - -class Scumm_v7 : public Scumm -{ -public: - Scumm_v7(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} -}; - -extern uint16 _debugLevel; - -extern const byte revBitMask[8]; -//void blitToScreen(Scumm *s, byte *src, int x, int y, int w, int h); - -#if defined(__GNUC__) -void CDECL error(const char *s, ...) NORETURN; -#else -void CDECL NORETURN error(const char *s, ...); -#endif - -void CDECL warning(const char *s, ...); -void CDECL debug(int level, const char *s, ...); -void checkHeap(); - -/* Direction conversion functions (between old dir and new dir format) */ -int newDirToOldDir(int dir); -int oldDirToNewDir(int dir); - -int normalizeAngle(int angle); -int fromSimpleDir(int dirtype, int dir); -int toSimpleDir(int dirtype, int dir); -int numSimpleDirDirections(int dirType); - - -#endif diff --git a/scumm/actor.cpp b/scumm/actor.cpp new file mode 100644 index 0000000000..697a1cdadf --- /dev/null +++ b/scumm/actor.cpp @@ -0,0 +1,1418 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "akos.h" +#include "costume.h" +#include "resource.h" + +#include + +void Actor::initActor(int mode) +{ + if (mode == 1) { + costume = 0; + room = 0; + x = 0; + y = 0; + facing = 180; + newDirection = 180; + } else if (mode == 2) { + facing = 180; + newDirection = 180; + } + + elevation = 0; + width = 24; + talkColor = 15; + new_2 = 0; + new_1 = -80; + scaley = scalex = 0xFF; + charset = 0; + sound[0] = 0; + sound[1] = 0; + sound[2] = 0; + sound[3] = 0; + sound[4] = 0; + sound[5] = 0; + sound[6] = 0; + sound[7] = 0; + newDirection = 0; + + stopActorMoving(); + + shadow_mode = 0; + layer = 0; + + setActorWalkSpeed(8, 2); + + ignoreBoxes = 0; + forceClip = 0; + new_3 = 0; + initFrame = 1; + walkFrame = 2; + standFrame = 3; + talkFrame1 = 4; + talkFrame2 = 5; + + walk_script = 0; + talk_script = 0; + + if (_vm->_features & GF_AFTER_V7) { + _vm->_classData[number] = _vm->_classData[0]; + } else { + _vm->_classData[number] = 0; + } +} + +void Actor::stopActorMoving() +{ + _vm->stopScriptNr(walk_script); + moving = 0; +} + +void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) +{ + if (newSpeedX == speedx && newSpeedY == speedy) + return; + + speedx = newSpeedX; + speedy = newSpeedY; + + if (moving) { + calcMovementFactor(walkdata.newx, walkdata.newy); + } +} + +int Scumm::getAngleFromPos(int x, int y) +{ + if (_gameId == GID_DIG) { + double temp = atan2((double)x, (double)-y); + return normalizeAngle((int)(temp * 180 / 3.1415926535)); + } else { + if (abs(y) * 2 < abs(x)) { + if (x > 0) + return 90; + return 270; + } else { + if (y > 0) + return 180; + return 0; + } + } +} + +int Actor::calcMovementFactor(int newX, int newY) +{ + int actorX, actorY; + int diffX, diffY; + int32 XYFactor, YXFactor; + + actorX = x; + actorY = y; + + if (actorX == newX && actorY == newY) + return 0; + + diffX = newX - actorX; + diffY = newY - actorY; + YXFactor = speedy << 16; + + if (diffY < 0) + YXFactor = -YXFactor; + + XYFactor = YXFactor * diffX; + if (diffY != 0) { + XYFactor /= diffY; + } else { + YXFactor = 0; + } + + if ((uint) abs((int)(XYFactor >> 16)) > speedx) { + XYFactor = speedx << 16; + if (diffX < 0) + XYFactor = -XYFactor; + + YXFactor = XYFactor * diffY; + if (diffX != 0) { + YXFactor /= diffX; + } else { + XYFactor = 0; + } + } + + walkdata.x = actorX; + walkdata.y = actorY; + walkdata.newx = newX; + walkdata.newy = newY; + walkdata.XYFactor = XYFactor; + walkdata.YXFactor = YXFactor; + walkdata.xfrac = 0; + walkdata.yfrac = 0; + + newDirection = _vm->getAngleFromPos(XYFactor, YXFactor); + + return actorWalkStep(); +} + +int Actor::remapDirection(int dir, bool is_walking) +{ + int specdir; + byte flags; + bool flipX; + bool flipY; + + if (!ignoreBoxes) { + specdir = _vm->_extraBoxFlags[walkbox]; + if (specdir) { + if (specdir & 0x8000) { + dir = specdir & 0x3FFF; + } else { + error("remapDirection: special dir not implemented"); + } + } + + flags = _vm->getBoxFlags(walkbox); + + flipX = (walkdata.XYFactor > 0); + flipY = (walkdata.YXFactor > 0); + + // FIXME - this special cases for the class might be necesary for other + // games besides Loom CD! + + // Check for X-Flip + if ((flags & kBoxXFlip) || isInClass(_vm->_gameId == GID_LOOM256 ? 19 : 30)) { + dir = 360 - dir; + flipX = !flipX; + } + // Check for Y-Flip + if ((flags & kBoxYFlip) || isInClass(_vm->_gameId == GID_LOOM256 ? 18 : 29)) { + dir = 180 - dir; + flipY = !flipY; + } + + switch (flags & 7) { + case 1: + if (is_walking) // Actor is walking + return flipX ? 90 : 270; + else // Actor is standing/turning + return (dir == 90) ? 90 : 270; + case 2: + if (is_walking) // Actor is walking + return flipY ? 180 : 0; + else // Actor is standing/turning + return (dir == 0) ? 0 : 180; + case 3: + return 270; + case 4: + return 90; + case 5: + return 0; + case 6: + return 180; + } + } + /* Or 1024 in to signal direction interpolation should be done */ + return normalizeAngle(dir) | 1024; +} + +int Actor::updateActorDirection(bool is_walking) +{ + int from, to; + int diff; + int dirType; + int dir; + int num; + bool shouldInterpolate; + + dirType = _vm->akos_hasManyDirections(this); + + from = toSimpleDir(dirType, facing); + dir = remapDirection(newDirection, is_walking); + shouldInterpolate = (dir & 1024); + to = toSimpleDir(dirType, dir & 1023); + num = numSimpleDirDirections(dirType); + + if (shouldInterpolate) { + // Turn left or right, depending on which is shorter. + diff = to - from; + if (abs(diff) > (num >> 1)) + diff = -diff; + + if (diff > 0) { + to = from + 1; + } else if (diff < 0){ + to = from - 1; + } + } + + dir = fromSimpleDir(dirType, (to + num) % num); + + return dir; +} + +void Actor::setBox(int box) +{ + walkbox = box; + + setupActorScale(); +} + + +int Actor::actorWalkStep() +{ + int tmpX, tmpY; + int actorX, actorY; + int distX, distY; + int direction; + + needRedraw = true; + needBgReset = true; + + direction = updateActorDirection(true); + if (!(moving & MF_IN_LEG) || facing != direction) { + if (walkFrame != frame || facing != direction) { + startWalkAnim(walkFrame == frame ? 2 : 1, direction); + } + moving |= MF_IN_LEG; + } + + actorX = x; + actorY = y; + + if (walkbox != walkdata.curbox && _vm->checkXYInBoxBounds(walkdata.curbox, actorX, actorY)) { + setBox(walkdata.curbox); + } + + distX = abs(walkdata.newx - walkdata.x); + distY = abs(walkdata.newy - walkdata.y); + + if (abs(actorX - walkdata.x) >= distX && abs(actorY - walkdata.y) >= distY) { + moving &= ~MF_IN_LEG; + return 0; + } + + tmpX = ((actorX + 8000) << 16) + walkdata.xfrac + (walkdata.XYFactor >> 8) * scalex; + walkdata.xfrac = (uint16)tmpX; + actorX = (tmpX >> 16) - 8000; + + tmpY = (actorY << 16) + walkdata.yfrac + (walkdata.YXFactor >> 8) * scalex; + walkdata.yfrac = (uint16)tmpY; + actorY = (tmpY >> 16); + + if (abs(actorX - walkdata.x) > distX) { + actorX = walkdata.newx; + } + + if (abs(actorY - walkdata.y) > distY) { + actorY = walkdata.newy; + } + + x = actorX; + y = actorY; + return 1; +} + + +void Actor::setupActorScale() +{ + uint16 scale; + byte *resptr; + + if (_vm->_features & GF_NO_SCALLING) { + scalex = 0xFF; + scaley = 0xFF; + return; + } + + if (ignoreBoxes != 0) + return; + + if (_vm->getBoxFlags(walkbox) & kBoxPlayerOnly) + return; + + scale = _vm->getBoxScale(walkbox); + + if (scale & 0x8000) { + scale = (scale & 0x7FFF) + 1; + resptr = _vm->getResourceAddress(rtScaleTable, scale); + if (resptr == NULL) + error("Scale table %d not defined", scale); + int theY = y; + if (theY >= 200) + theY = 199; + else if (theY < 0) + theY = 0; + scale = resptr[theY]; + } + + if (scale > 255) + warning("Actor %d at %d, scale %d out of range", number, y, scale); + + // FIXME - Quick fix to ft's fuel tower bug (by yazoo) + if (scale == 1 && _vm->_currentRoom == 76) + scale = 0xFF; + + scalex = (byte)scale; + scaley = (byte)scale; +} + +void Actor::startAnimActor(int frame) +{ + if (_vm->_features & GF_NEW_COSTUMES) { + switch (frame) { + case 1001: + frame = initFrame; + break; + case 1002: + frame = walkFrame; + break; + case 1003: + frame = standFrame; + break; + case 1004: + frame = talkFrame1; + break; + case 1005: + frame = talkFrame2; + break; + } + + if (costume != 0) { + animProgress = 0; + needRedraw = true; + needBgReset = true; + if (frame == initFrame) + cost.reset(); + _vm->akos_decodeData(this, frame, (uint) - 1); + } + + } else { + switch (frame) { + case 0x38: + frame = initFrame; + break; + case 0x39: + frame = walkFrame; + break; + case 0x3A: + frame = standFrame; + break; + case 0x3B: + frame = talkFrame1; + break; + case 0x3C: + frame = talkFrame2; + break; + } + + if (isInCurrentRoom() && costume) { + animProgress = 0; + cost.animCounter1 = 0; + needRedraw = true; + + if (initFrame == frame) + cost.reset(); + + if (frame != 0x3E) { + _vm->cost_decodeData(this, frame, (uint) - 1); + } + } + + needBgReset = true; + } +} + +void Actor::animateActor(int anim) +{ + int cmd, dir; + + if (_vm->_features & GF_AFTER_V7) { + + if (anim == 0xFF) + anim = 2000; + + cmd = anim / 1000; + dir = anim % 1000; + + } else { + + cmd = anim >> 2; + dir = oldDirToNewDir(anim & 3); + + // Convert into old cmd code + cmd = 0x3F - cmd + 2; + + } + + switch (cmd) { + case 2: + stopActorMoving(); + startAnimActor(standFrame); + break; + case 3: + moving &= ~MF_TURN; + setDirection(dir); + break; + case 4: + turnToDirection(dir); + break; + default: + startAnimActor(anim); + } +} + +void Actor::setDirection(int direction) +{ + uint aMask; + int i; + uint16 vald; + + if (facing == direction) + return; + + facing = normalizeAngle(direction); + + if (costume == 0) + return; + + aMask = 0x8000; + for (i = 0; i < 16; i++, aMask >>= 1) { + vald = cost.frame[i]; + if (vald == 0xFFFF) + continue; + if (_vm->_features & GF_AFTER_V7) + _vm->akos_decodeData(this, vald, aMask); + else + _vm->cost_decodeData(this, vald, aMask); + } + + needRedraw = true; + needBgReset = true; +} + +void Actor::putActor(int dstX, int dstY, byte newRoom) +{ + if (visible && _vm->_currentRoom != newRoom && _vm->_vars[_vm->VAR_TALK_ACTOR] == number) { + _vm->clearMsgQueue(); + } + + x = dstX; + y = dstY; + room = newRoom; + needRedraw = true; + needBgReset = true; + + if (_vm->_vars[_vm->VAR_EGO] == number) { + _vm->_egoPositioned = true; + } + + if (visible) { + if (isInCurrentRoom()) { + if (moving) { + startAnimActor(standFrame); + moving = 0; + } + adjustActorPos(); + } else { + hideActor(); + } + } else { + if (isInCurrentRoom()) + showActor(); + } +} + +int Actor::getActorXYPos(int &xPos, int &yPos) +{ + if (!isInCurrentRoom()) + return -1; + + xPos = x; + yPos = y; + return 0; +} + +AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY, int pathfrom) +{ + AdjustBoxResult abr, tmp; + uint threshold; + uint best; + int box, iterations = 0; /* Use iterations for those odd times we get stuck in the loop */ + int firstValidBox, i, j; + byte flags, b; + + if (_vm->_features & GF_SMALL_HEADER) + firstValidBox = 0; + else + firstValidBox = 1; + + abr.x = dstX; + abr.y = dstY; + abr.dist = 0; + + if (ignoreBoxes == 0) { + threshold = 30; + + while (1) { + iterations++; + if (iterations > 1000) + return abr; /* Safety net */ + box = _vm->getNumBoxes() - 1; + if (box < firstValidBox) + return abr; + + best = (uint) 0xFFFF; + b = 0; + + if (!(_vm->_features & GF_OLD256) || box) + for (j = box; j >= firstValidBox; j--) { + flags = _vm->getBoxFlags(j); + + if (flags & kBoxInvisible && (!(flags & kBoxPlayerOnly) || isInClass(31))) + continue; + + if (pathfrom >= firstValidBox) { + + if (flags & kBoxLocked && (!(flags & kBoxPlayerOnly))) + continue; + + i = _vm->getPathToDestBox(pathfrom, j); + if (i == -1) + continue; + + if (_vm->_features & GF_OLD256) { + // FIXME - we check here if the box suggested by getPathToDestBox + // is locked or not. This prevents us from walking thru + // closed doors in some cases in Zak256. However a better fix + // would be to recompute the box matrix whenever flags change. + flags = _vm->getBoxFlags(i); + if (flags & kBoxLocked && (!(flags & kBoxPlayerOnly))) + continue; + if (flags & kBoxInvisible && (!(flags & kBoxPlayerOnly) || isInClass(31))) + continue; + } + } + + if (!_vm->inBoxQuickReject(j, dstX, dstY, threshold)) + continue; + + if (_vm->checkXYInBoxBounds(j, dstX, dstY)) { + abr.x = dstX; + abr.y = dstY; + abr.dist = j; + return abr; + } + + tmp = _vm->getClosestPtOnBox(j, dstX, dstY); + + if (tmp.dist >= best) + continue; + + abr.x = tmp.x; + abr.y = tmp.y; + + if (tmp.dist == 0) { + abr.dist = j; + return abr; + } + best = tmp.dist; + b = j; + } + + if (threshold == 0 || threshold * threshold >= best) { + abr.dist = b; + return abr; + } + threshold = (threshold == 30) ? 80 : 0; + } + } + + return abr; +} + +void Actor::adjustActorPos() +{ + AdjustBoxResult abr; + byte flags; + + abr = adjustXYToBeInBox(x, y, -1); + + x = abr.x; + y = abr.y; + walkdata.destbox = (byte)abr.dist; + + setBox(abr.dist); + + walkdata.destx = -1; + + moving = 0; + cost.animCounter2 = 0; + + if (_vm->_features & GF_AFTER_V7) { + stopActorMoving(); + } + + flags = _vm->getBoxFlags(walkbox); + if (flags & 7) { + turnToDirection(facing); + } +} + +void Actor::turnToDirection(int newdir) +{ + if (newdir == -1) + return; + + moving &= ~MF_TURN; + + if (newdir != facing) { + moving = MF_TURN; + newDirection = newdir; + + // FIXME - workaround for bug #558236 + if (_vm->_gameId == GID_INDY4 && room == 39 && x == 617 && y == 125 && newdir == 180) + startAnimActor(standFrame); + } +} + +void Actor::hideActor() +{ + if (!visible) + return; + + if (moving) { + startAnimActor(standFrame); + moving = 0; + } + visible = false; + cost.animCounter2 = 0; + needRedraw = false; + needBgReset = true; +} + +void Actor::showActor() +{ + if (_vm->_currentRoom == 0 || visible) + return; + + adjustActorPos(); + + _vm->ensureResourceLoaded(rtCostume, costume); + + if (costumeNeedsInit) { + startAnimActor(initFrame); + costumeNeedsInit = false; + } + moving = 0; + visible = true; + needRedraw = true; +} + +void Scumm::showActors() +{ + int i; + Actor *a; + + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + if (a->isInCurrentRoom()) + a->showActor(); + } +} + +void Scumm::stopTalk() +{ + int act; + + _sound->stopTalkSound(); + + _haveMsg = 0; + _talkDelay = 0; + + act = _vars[VAR_TALK_ACTOR]; + if (act && act < 0x80) { + Actor *a = derefActorSafe(act, "stopTalk"); + if (a->isInCurrentRoom() && _useTalkAnims) { + a->startAnimActor(a->talkFrame2); + _useTalkAnims = false; + } + _vars[VAR_TALK_ACTOR] = 0xFF; + } + _keepText = false; + restoreCharsetBg(); +} + +void Scumm::clearMsgQueue() +{ + _messagePtr = (byte *)" "; + stopTalk(); +} + +void Scumm::walkActors() +{ + int i; + Actor *a; + + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + if (a->isInCurrentRoom()) + if (_features & GF_OLD256) + a->walkActorOld(); + else + a->walkActor(); + } +} + +/* Used in Scumm v5 only. Play sounds associated with actors */ +void Scumm::playActorSounds() +{ + int i; + Actor *a; + + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + if (a->cost.animCounter2 && a->isInCurrentRoom() && a->sound) { + _currentScript = 0xFF; + _sound->addSoundToQueue(a->sound[0]); + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + a->cost.animCounter2 = 0; + } + return; + } + } +} + + +#define DRAW_ORDER(x) ((x)->y - ((x)->layer << 11)) + +void Scumm::processActors() +{ + int i; + Actor *actors[MAX_ACTORS], *a, **ac, **ac2, *tmp, **end; + int numactors = 0; + + // Make a list of all actors in this room + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + if (a->isInCurrentRoom()) + actors[numactors++] = a; + } + if (!numactors) + return; + + end = actors + numactors; + + // Sort actors by position before we draw them (to ensure that actors in + // front are drawn after those "behind" them). + for (ac = end - 1; ac >= actors; --ac) { + for (ac2 = actors; ac2 != ac; ++ac2) { + if (DRAW_ORDER(*ac2) > DRAW_ORDER(*(ac2 + 1))) { + tmp = *(ac2 + 1); + *(ac2 + 1) = *ac2; + *ac2 = tmp; + } + } + } + + // Finally draw the now sorted actors + for (ac = actors; ac != end; ++ac) { + a = *ac; + if (a->costume) { + CHECK_HEAP getMaskFromBox(a->walkbox); + a->drawActorCostume(); + CHECK_HEAP a->animateCostume(); + } + } +} + +void Actor::drawActorCostume() +{ + if (!needRedraw) + return; + + // FIXME: ugly fix for samnmax inventory + if (_vm->_gameId == GID_SAMNMAX && _vm->getState(995)) + return; + + needRedraw = false; + + setupActorScale(); + + if (!(_vm->_features & GF_AFTER_V7)) { + CostumeRenderer cr(_vm); + + cr._actorX = x - _vm->virtscr->xstart; + cr._actorY = y - elevation; + cr._scaleX = scalex; + cr._scaleY = scaley; + + cr._outheight = _vm->virtscr->height; + + cr._zbuf = _vm->getMaskFromBox(walkbox); + + if (forceClip) + cr._zbuf = forceClip; + else if (isInClass(20)) + cr._zbuf = 0; + else if (cr._zbuf > _vm->gdi._numZBuffer) + cr._zbuf = (byte)_vm->gdi._numZBuffer; + + cr._shadow_table = _vm->_shadowPalette; + + cr.setCostume(costume); + cr.setPalette(palette); + cr.setFacing(facing); + + top = 0xFF; + + bottom = 0; + + /* if the actor is partially hidden, redraw it next frame */ + if (cr.drawCostume(this) & 1) { + needBgReset = true; + needRedraw = true; + } + } else { + AkosRenderer ar(_vm); + + ar.x = x - _vm->virtscr->xstart; + ar.y = y - elevation; + ar.scale_x = scalex; + ar.scale_y = scaley; + ar.clipping = forceClip; + if (ar.clipping == 100) { + ar.clipping = _vm->getMaskFromBox(walkbox); + if (ar.clipping > (byte)_vm->gdi._numZBuffer) + ar.clipping = _vm->gdi._numZBuffer; + } + ar.charsetmask = _vm->_vars[_vm->VAR_CHARSET_MASK] != 0; + + ar.outptr = _vm->virtscr->screenPtr + _vm->virtscr->xstart; + ar.outwidth = _vm->virtscr->width; + ar.outheight = _vm->virtscr->height; + + ar.shadow_mode = shadow_mode; + ar.shadow_table = _vm->_shadowPalette; + + ar.setCostume(costume); + ar.setPalette(palette); + ar.setFacing(this); + + ar.dirty_id = number; + + ar.cd = &cost; + + ar.draw_top = top = 0x7fffffff; + ar.draw_bottom = bottom = 0; + ar.drawCostume(); + top = ar.draw_top; + bottom = ar.draw_bottom; + } +} + +void Actor::animateCostume() +{ + if (costume == 0) + return; + + animProgress++; + if (animProgress >= animSpeed) { + animProgress = 0; + + if (_vm->_features & GF_AFTER_V7) { + byte *akos = _vm->getResourceAddress(rtCostume, costume); + assert(akos); + if (_vm->akos_increaseAnims(akos, this)) { + needRedraw = true; + needBgReset = true; + } + } else { + LoadedCostume lc(_vm); + lc.loadCostume(costume); + if (lc.increaseAnims(this)) { + needRedraw = true; + needBgReset = true; + } + } + } +} + +void Scumm::setActorRedrawFlags() +{ + int i, j; + uint32 bits; + + if (_fullRedraw) { + for (j = 0; j < NUM_ACTORS; j++) { + Actor *a = derefActor(j); + a->needRedraw = true; + a->needBgReset = true; + } + } else { + for (i = 0; i < 40; i++) { + bits = gfxUsageBits[_screenStartStrip + i]; + if (bits & 0x3FFFFFFF) { + for (j = 0; j < NUM_ACTORS; j++) { + if ((bits & (1 << j)) && bits != (uint32)(1 << j)) { + Actor *a = derefActor(j); + a->needRedraw = true; + a->needBgReset = true; + } + } + } + } + } +} + +int Scumm::getActorFromPos(int x, int y) +{ + uint32 drawbits; + int i; + + drawbits = gfxUsageBits[x >> 3]; + if (!(drawbits & 0x3FFFFFFF)) + return 0; + for (i = 1; i < NUM_ACTORS; i++) { + Actor *a = derefActor(i); + if (drawbits & (1 << i) && !getClass(i, 32) && y >= a->top && y <= a->bottom) { + return i; + } + } + return 0; +} + +void Scumm::actorTalk() +{ + int oldact; + Actor *a; + + _msgPtrToAdd = charset._buffer; + _messagePtr = addMessageToStack(_messagePtr); + assert((int)(_msgPtrToAdd - charset._buffer) < (int)(sizeof(charset._buffer))); + + if (_actorToPrintStrFor == 0xFF) { + if (!_keepText) + stopTalk(); + _vars[VAR_TALK_ACTOR] = 0xFF; + oldact = 0; + } else { + a = derefActorSafe(_actorToPrintStrFor, "actorTalk"); + if (!a->isInCurrentRoom() && !(_features & GF_AFTER_V7)) { + oldact = 0xFF; + } else { + if (!_keepText) + stopTalk(); + _vars[VAR_TALK_ACTOR] = a->number; + if (!string[0].no_talk_anim) { + a->startAnimActor(a->talkFrame1); + _useTalkAnims = true; + } + oldact = _vars[VAR_TALK_ACTOR]; + } + } + if (oldact >= 0x80) + return; + + if (_vars[VAR_TALK_ACTOR] > 0x7F) { + _charsetColor = (byte)string[0].color; + } else { + a = derefActorSafe(_vars[VAR_TALK_ACTOR], "actorTalk(2)"); + _charsetColor = a->talkColor; + } + charset._bufPos = 0; + _talkDelay = 0; + _haveMsg = 0xFF; + _vars[VAR_HAVE_MSG] = 0xFF; + CHARSET_1(); +} + +void Actor::setActorCostume(int c) +{ + int i; + + costumeNeedsInit = true; + + if (visible) { + hideActor(); + cost.reset(); + costume = c; + showActor(); + } else { + costume = c; + cost.reset(); + } + + for (i = 0; i < 32; i++) + palette[i] = 0xFF; +} + +void Actor::startWalkActor(int destX, int destY, int dir) +{ + AdjustBoxResult abr; + + abr = adjustXYToBeInBox(destX, destY, walkbox); + + if (!isInCurrentRoom()) { + x = abr.x; + y = abr.y; + if (dir != -1) + setDirection(dir); + return; + } + + if (ignoreBoxes != 0) { + abr.dist = 0; + walkbox = 0; + } else { + if (_vm->checkXYInBoxBounds(walkdata.destbox, abr.x, abr.y)) { + abr.dist = walkdata.destbox; + } else { + abr = adjustXYToBeInBox(abr.x, abr.y, walkbox); + } + if (moving && walkdata.destdir == dir && walkdata.destx == abr.x && walkdata.desty == abr.y) + return; + } + + if (x == abr.x && y == abr.y) { + turnToDirection(dir); + return; + } + + walkdata.destx = abr.x; + walkdata.desty = abr.y; + walkdata.destbox = (byte)abr.dist; /* a box */ + walkdata.destdir = dir; + moving = (moving & MF_IN_LEG) | MF_NEW_LEG; + walkdata.point3x = 32000; + + walkdata.curbox = walkbox; +} + +void Actor::startWalkAnim(int cmd, int angle) +{ + if (angle == -1) + angle = facing; + +/*FIXME: (yazoo): the walk script are buggy in dig causing + * troubles while walking. It's disabled until I can + * find a proper fix + * note: walk scripts aren't required to make the game + * work as usual */ + +/* int16 args[16]; + + if (walk_script != 0) { + args[2] = angle; + args[0] = number; + args[1] = cmd; + _vm->runScript(walk_script, 1, 0, args); + } else*/ { + switch (cmd) { + case 1: /* start walk */ + setDirection(angle); + startAnimActor(walkFrame); + break; + case 2: /* change dir only */ + setDirection(angle); + break; + case 3: /* stop walk */ + turnToDirection(angle); + startAnimActor(standFrame); + break; + } + } +} + +void Actor::walkActor() +{ + int j; + int16 foundPathX, foundPathY; + + if (!moving) + return; + + if (!(moving & MF_NEW_LEG)) { + if (moving & MF_IN_LEG && actorWalkStep()) + return; + + if (moving & MF_LAST_LEG) { + moving = 0; + setBox(walkdata.destbox); + startWalkAnim(3, walkdata.destdir); + return; + } + + if (moving & MF_TURN) { + j = updateActorDirection(false); + if (facing != j) + setDirection(j); + else + moving = 0; + return; + } + + setBox(walkdata.curbox); + moving &= MF_IN_LEG; + } + + do { + moving &= ~MF_NEW_LEG; + if ((!walkbox && (!(_vm->_features & GF_SMALL_HEADER)))) { + setBox(walkdata.destbox); + walkdata.curbox = walkdata.destbox; + break; + } + if (walkbox == walkdata.destbox) + break; + j = _vm->getPathToDestBox(walkbox, walkdata.destbox); + if (j == -1 || j > 0xF0) { + walkdata.destbox = walkbox; + moving |= MF_LAST_LEG; + return; + } + walkdata.curbox = j; + + if (_vm->findPathTowards(this, walkbox, j, walkdata.destbox, foundPathX, foundPathY)) + break; + if (calcMovementFactor(foundPathX, foundPathY)) + return; + + setBox(walkdata.curbox); + } while (1); + + moving |= MF_LAST_LEG; + calcMovementFactor(walkdata.destx, walkdata.desty); +} + +void Actor::walkActorOld() +{ + ScummPoint gateLoc[5]; // Gate locations + int new_dir, next_box; + + if (!moving) + return; + + if (moving & MF_NEW_LEG) { + restart: + moving &= ~MF_NEW_LEG; + + if (walkbox == 0xFF) { + walkbox = walkdata.destbox; + walkdata.curbox = walkdata.destbox; + moving |= MF_LAST_LEG; + calcMovementFactor(walkdata.destx, walkdata.desty); + return; + } + + if (walkbox == walkdata.destbox) { + moving |= MF_LAST_LEG; + calcMovementFactor(walkdata.destx, walkdata.desty); + return; + } + + next_box = _vm->getPathToDestBox(walkbox, walkdata.destbox); + + if (next_box == -1) { + moving |= MF_LAST_LEG; + return; + } + + walkdata.curbox = next_box; + + _vm->findPathTowardsOld(this, walkbox, next_box, walkdata.destbox, gateLoc); + if (gateLoc[2].x == 32000 && gateLoc[3].x == 32000) { + moving |= MF_LAST_LEG; + calcMovementFactor(walkdata.destx, walkdata.desty); + return; + } + + if (gateLoc[2].x != 32000) { + if (calcMovementFactor(gateLoc[2].x, gateLoc[2].y)) { + walkdata.point3x = gateLoc[3].x; + walkdata.point3y = gateLoc[3].y; + return; + } + } + + if (calcMovementFactor(gateLoc[3].x, gateLoc[3].y)) + return; + + walkbox = walkdata.destbox; + goto restart; + + } + + if (moving & MF_IN_LEG) { + if (actorWalkStep()) + return; + } + + if (moving & MF_LAST_LEG) { + moving = 0; + startWalkAnim(3, walkdata.destdir); + return; + } + + if (moving & MF_TURN) { + new_dir = updateActorDirection(false); + if (facing != new_dir) { + setDirection(new_dir); + return; + } + moving = 0; + return; + } + + if (walkdata.point3x != 32000) { + if (calcMovementFactor(walkdata.point3x, walkdata.point3y)) { + walkdata.point3x = 32000; + return; + } + walkdata.point3x = 32000; + } + + walkbox = walkdata.curbox; + moving &= MF_IN_LEG; + moving |= MF_NEW_LEG; + goto restart; +} + +byte *Actor::getActorName() +{ + byte *ptr = _vm->getResourceAddress(rtActorName, number); + if (ptr == NULL) + return (byte *)" "; + return ptr; +} + +void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold) +{ + byte *akos, *rgbs, *akpl; + int akpl_size, i; + int r, g, b; + byte akpl_color; + + if (!isInCurrentRoom()) { + warning("Remap actor %d not in current room", number); + return; + } + + if (costume < 1 || costume >= _vm->_numCostumes - 1) { + warning("Remap actor %d invalid costume", number, costume); + return; + } + + akos = _vm->getResourceAddress(rtCostume, costume); + akpl = findResource(MKID('AKPL'), akos); + + //get num palette entries + akpl_size = RES_SIZE(akpl) - 8; + + //skip resource header + akpl = RES_DATA(akpl); + + rgbs = findResource(MKID('RGBS'), akos); + + if (!rgbs) { + warning("Can't remap actor %d costume %d doesn't contain an RGB block", number, costume); + return; + } + // skip resource header + rgbs = RES_DATA(rgbs); + + for (i = 0; i < akpl_size; i++) { + r = *rgbs++; + g = *rgbs++; + b = *rgbs++; + + akpl_color = *akpl++; + + // allow remap of generic palette entry? + if (!shadow_mode || akpl_color >= 16) { + if (r_fact != 256) + r = (r * r_fact) >> 8; + if (g_fact != 256) + g = (g * g_fact) >> 8; + if (b_fact != 256) + b = (b * b_fact) >> 8; + palette[i] = _vm->remapPaletteColor(r, g, b, threshold); + } + } +} + +void Scumm::resetActorBgs() +{ + Actor *a; + int i; + uint32 onlyActorFlags, bitpos; + + for (i = 0; i < 40; i++) { + onlyActorFlags = (gfxUsageBits[_screenStartStrip + i] &= 0x3FFFFFFF); + a = getFirstActor(); + bitpos = 1; + + while (onlyActorFlags) { + if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) { + gfxUsageBits[_screenStartStrip + i] ^= bitpos; + + if ((a->bottom - a->top) >= 0) + gdi.resetBackground(a->top, a->bottom, i); + } + bitpos <<= 1; + onlyActorFlags >>= 1; + a++; + } + } + + for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { + a->needBgReset = false; + } +} + +void Actor::classChanged(int cls, bool value) +{ + switch(cls) { + case 20: // Never clip + break; + case 21: // Always clip + forceClip = value; + break; + case 22: // Ignore boxes + ignoreBoxes = value; + break; + case 29: // Y flip + break; + case 30: // X flip + break; + case 31: // ?? + break; + } +} + +bool Actor::isInClass(int cls) +{ + return _vm->getClass(number, cls); +} diff --git a/scumm/actor.h b/scumm/actor.h new file mode 100644 index 0000000000..d0b3ba8d35 --- /dev/null +++ b/scumm/actor.h @@ -0,0 +1,179 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + +#ifndef ACTOR_H +#define ACTOR_H + +#include +#include "scummsys.h" + +class Scumm; + +enum MoveFlags { + MF_NEW_LEG = 1, + MF_IN_LEG = 2, + MF_TURN = 4, + MF_LAST_LEG = 8 +}; + +struct ActorWalkData { + int16 destx, desty; // Final destination + byte destbox; + int16 destdir; + byte curbox; + int16 x, y; // Current position + int16 newx, newy; // Next position on our way to the destination + int32 XYFactor, YXFactor; + uint16 xfrac, yfrac; + int point3x, point3y; +}; + +struct CostumeData { + byte active[16]; + uint16 animCounter1; + byte animCounter2; + uint16 stopped; + uint16 curpos[16]; + uint16 start[16]; + uint16 end[16]; + uint16 frame[16]; + + void reset() { + stopped = 0; + for (int i = 0; i < 16; i++) { + active[i] = 0; + curpos[i] = start[i] = end[i] = frame[i] = 0xFFFF; + } + } +}; + +class Actor { + +public: + int x, y, top, bottom; + int elevation; + uint width; + byte number; + uint16 facing; + uint16 costume; + byte room; + byte talkColor; + byte scalex, scaley; + byte charset; + int16 newDirection; + byte moving; + byte ignoreBoxes; + byte forceClip; + byte initFrame, walkFrame, standFrame, talkFrame1, talkFrame2; + bool needRedraw, needBgReset, costumeNeedsInit, visible; + byte shadow_mode; + bool flip; + uint speedx, speedy; + byte frame; + byte walkbox; + byte mask; // This field is *NOT* used anymore, only kept around to make saveload.cpp happy + byte animProgress, animSpeed; + int16 new_1, new_2; + uint16 talk_script, walk_script; + byte new_3; + int8 layer; + ActorWalkData walkdata; + int16 animVariable[16]; + uint16 sound[8]; + CostumeData cost; + byte palette[64]; + +protected: + Scumm *_vm; + +public: + + // Constructor, sets all data to 0 + Actor() { + memset(this, 0, sizeof(Actor)); + } void initActorClass(Scumm *scumm) { + _vm = scumm; + } +//protected: + void hideActor(); + void showActor(); + + void initActor(int mode); + void putActor(int x, int y, byte room); + void setActorWalkSpeed(uint newSpeedX, uint newSpeedY); +protected: + int calcMovementFactor(int newx, int newy); + int actorWalkStep(); + int remapDirection(int dir, bool is_walking); + void setupActorScale(); +public: + void stopActorMoving(); + void startWalkAnim(int cmd, int angle); + void startAnimActor(int frame); + +protected: + void setBox(int box); + int updateActorDirection(bool is_walking); + +public: + void setDirection(int direction); + int getActorXYPos(int &x, int &y); + + AdjustBoxResult adjustXYToBeInBox(int dstX, int dstY, int pathfrom); +protected: + void adjustActorPos(); +public: + void turnToDirection(int newdir); + void walkActor(); + void drawActorCostume(); + void animateCostume(); + void setActorCostume(int c); + byte *getActorName(); + void startWalkActor(int x, int y, int dir); + + void remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold); + void walkActorOld(); + + void animateActor(int anim); + + bool isInCurrentRoom() { + return room == _vm->_currentRoom; + } + int getRoom() { + return room; + } + + int getAnimVar(byte var) { + return animVariable[var]; + } + void setAnimVar(byte var, int value) { + animVariable[var] = value; + } + + void classChanged(int cls, bool value); + +protected: + bool isInClass(int cls); +}; + +#endif diff --git a/scumm/akos.cpp b/scumm/akos.cpp new file mode 100644 index 0000000000..78eabfeb14 --- /dev/null +++ b/scumm/akos.cpp @@ -0,0 +1,1199 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "akos.h" + +bool Scumm::akos_hasManyDirections(Actor *a) +{ + if (_features & GF_NEW_COSTUMES) { + byte *akos; + AkosHeader *akhd; + + akos = getResourceAddress(rtCostume, a->costume); + assert(akos); + + akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos); + return (akhd->flags & 2) != 0; + } + return 0; +} + +int Scumm::akos_frameToAnim(Actor *a, int frame) +{ + if (akos_hasManyDirections(a)) + return toSimpleDir(1, a->facing) + frame * 8; + else + return newDirToOldDir(a->facing) + frame * 4; +} + +void Scumm::akos_decodeData(Actor *a, int frame, uint usemask) +{ + uint anim; + byte *akos, *r; + AkosHeader *akhd; + uint offs; + int i; + byte code; + uint16 start, len; + uint16 mask; + + if (a->costume == 0) + return; + + anim = akos_frameToAnim(a, frame); + + akos = getResourceAddress(rtCostume, a->costume); + assert(akos); + + akhd = (AkosHeader *) findResourceData(MKID('AKHD'), akos); + + if (anim >= READ_LE_UINT16(&akhd->num_anims)) + return; + + r = findResourceData(MKID('AKCH'), akos); + assert(r); + + offs = READ_LE_UINT16(r + anim * sizeof(uint16)); + if (offs == 0) + return; + r += offs; + + i = 0; + mask = READ_LE_UINT16(r); + r += sizeof(uint16); + do { + if (mask & 0x8000) { + code = *r++; + if (usemask & 0x8000) { + switch (code) { + case 1: + a->cost.active[i] = 0; + a->cost.frame[i] = frame; + a->cost.end[i] = 0; + a->cost.start[i] = 0; + a->cost.curpos[i] = 0; + break; + case 4: + a->cost.stopped |= 1 << i; + break; + case 5: + a->cost.stopped &= ~(1 << i); + break; + default: + start = READ_LE_UINT16(r); + len = READ_LE_UINT16(r + sizeof(uint16)); + r += sizeof(uint16) * 2; + + a->cost.active[i] = code; + a->cost.frame[i] = frame; + a->cost.end[i] = start + len; + a->cost.start[i] = start; + a->cost.curpos[i] = start; + break; + } + } else { + if (code != 1 && code != 4 && code != 5) + r += sizeof(uint16) * 2; + } + } + i++; + mask <<= 1; + usemask <<= 1; + } while ((uint16)mask); +} + +void AkosRenderer::setPalette(byte *new_palette) +{ + byte *the_akpl; + uint size, i; + + the_akpl = _vm->findResourceData(MKID('AKPL'), akos); + size = _vm->getResourceDataSize(akpl); + + if (size > 256) + error("akos_setPalette: %d is too many colors", size); + + for (i = 0; i < size; i++) { + palette[i] = new_palette[i] != 0xFF ? new_palette[i] : the_akpl[i]; + } +} + +void AkosRenderer::setCostume(int costume) +{ + akos = _vm->getResourceAddress(rtCostume, costume); + assert(akos); + + akhd = (AkosHeader *) _vm->findResourceData(MKID('AKHD'), akos); + akof = (AkosOffset *) _vm->findResourceData(MKID('AKOF'), akos); + akci = _vm->findResourceData(MKID('AKCI'), akos); + aksq = _vm->findResourceData(MKID('AKSQ'), akos); + akcd = _vm->findResourceData(MKID('AKCD'), akos); + akpl = _vm->findResourceData(MKID('AKPL'), akos); + codec = READ_LE_UINT16(&akhd->codec); +} + +void AkosRenderer::setFacing(Actor *a) +{ + mirror = (newDirToOldDir(a->facing) != 0 || akhd->flags & 1); + if (a->flip) + mirror ^= 1; +} + +bool AkosRenderer::drawCostume() +{ + int i; + bool result = false; + + move_x = move_y = 0; + for (i = 0; i < 16; i++) + result |= drawCostumeChannel(i); + return result; +} + +bool AkosRenderer::drawCostumeChannel(int chan) +{ + uint code; + byte *p; + AkosOffset *off; + AkosCI *the_akci; + uint i, extra; + + if (!cd->active[chan] || cd->stopped & (1 << chan)) + return false; + + p = aksq + cd->curpos[chan]; + + code = p[0]; + if (code & 0x80) + code = (code << 8) | p[1]; + + if (code == AKC_Return) + return false; + + if (code != AKC_ComplexChan) { + off = akof + (code & 0xFFF); + + assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((byte *)akof - 4) - 8); + assert((code & 0x7000) == 0); + + srcptr = akcd + READ_LE_UINT32(&off->akcd); + the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci)); + + move_x_cur = move_x + (int16)READ_LE_UINT16(&the_akci->rel_x); + move_y_cur = move_y + (int16)READ_LE_UINT16(&the_akci->rel_y); + width = READ_LE_UINT16(&the_akci->width); + height = READ_LE_UINT16(&the_akci->height); + move_x += (int16)READ_LE_UINT16(&the_akci->move_x); + move_y -= (int16)READ_LE_UINT16(&the_akci->move_y); + + switch (codec) { + case 1: + codec1(); + break; + case 5: + codec5(); + break; + case 16: + codec16(); + break; + default: + error("akos_drawCostumeChannel: invalid codec %d", codec); + } + } else { + extra = p[2]; + p += 3; + + for (i = 0; i != extra; i++) { + code = p[4]; + if (code & 0x80) + code = ((code & 0xF) << 8) | p[5]; + off = akof + code; + + srcptr = akcd + READ_LE_UINT32(&off->akcd); + the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci)); + + move_x_cur = move_x + (int16)READ_LE_UINT16(p + 0); + move_y_cur = move_y + (int16)READ_LE_UINT16(p + 2); + + p += (p[4] & 0x80) ? 6 : 5; + + width = READ_LE_UINT16(&the_akci->width); + height = READ_LE_UINT16(&the_akci->height); + + switch (codec) { + case 1: + codec1(); + break; + case 5: + codec5(); + break; + case 16: + codec16(); + break; + default: + error("akos_drawCostumeChannel: invalid codec %d", codec); + } + } + } + + return true; +} + +void akos_c1_0y_decode(AkosRenderer * ar) +{ + byte len, color; + byte *src, *dst; + int height; + uint y; + uint scrheight; + + len = ar->v1.replen; + src = ar->srcptr; + dst = ar->v1.destptr; + color = ar->v1.repcolor; + scrheight = ar->outheight; + height = ar->height; + y = ar->v1.y; + + if (len) + goto StartPos; + + do { + len = *src++; + color = len >> ar->v1.shl; + len &= ar->v1.mask; + if (!len) + len = *src++; + + do { + if (color && y < scrheight) { + *dst = ar->palette[color]; + } + + dst += ar->outwidth; + y++; + if (!--height) { + if (!--ar->v1.skip_width) + return; + dst -= ar->v1.y_pitch; + height = ar->height; + y = ar->v1.y; + } + StartPos:; + } while (--len); + } while (1); +} + +void akos_generic_decode(AkosRenderer * ar) +{ + byte *src, *dst; + byte len, height, maskbit; + uint y, color; + const byte *scaleytab, *mask; + + + y = ar->v1.y; + + len = ar->v1.replen; + src = ar->srcptr; + dst = ar->v1.destptr; + color = ar->v1.repcolor; + height = ar->height; + + scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; + maskbit = revBitMask[ar->v1.x & 7]; + mask = ar->v1.mask_ptr + (ar->v1.x >> 3); + + if (len) + goto StartPos; + + do { + len = *src++; + color = len >> ar->v1.shl; + len &= ar->v1.mask; + if (!len) + len = *src++; + + do { + if (*scaleytab++ < ar->scale_y) { + if (color && y < ar->outheight + && (!ar->v1.mask_ptr || !((mask[0] | mask[ar->v1.imgbufoffs]) & maskbit))) { + *dst = ar->palette[color]; + } + mask += 40; + dst += ar->outwidth; + y++; + } + if (!--height) { + if (!--ar->v1.skip_width) + return; + height = ar->height; + y = ar->v1.y; + + scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; + + if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) { + ar->v1.x += ar->v1.scaleXstep; + if ((uint) ar->v1.x >= 320) + return; + maskbit = revBitMask[ar->v1.x & 7]; + ar->v1.destptr += ar->v1.scaleXstep; + } + mask = ar->v1.mask_ptr + (ar->v1.x >> 3); + ar->v1.tmp_x += ar->v1.scaleXstep; + dst = ar->v1.destptr; + } + StartPos:; + } while (--len); + } while (1); +} + + +void akos_c1_spec1(AkosRenderer * ar) +{ + byte *src, *dst; + byte len, height, pcolor, maskbit; + uint y, color; + const byte *scaleytab, *mask; + + + y = ar->v1.y; + + len = ar->v1.replen; + src = ar->srcptr; + dst = ar->v1.destptr; + color = ar->v1.repcolor; + height = ar->height; + + scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; + maskbit = revBitMask[ar->v1.x & 7]; + mask = ar->v1.mask_ptr + (ar->v1.x >> 3); + + if (len) + goto StartPos; + + do { + len = *src++; + color = len >> ar->v1.shl; + len &= ar->v1.mask; + if (!len) + len = *src++; + + do { + if (*scaleytab++ < ar->scale_y) { + if (color && y < ar->outheight + && (!ar->v1.mask_ptr || !((mask[0] | mask[ar->v1.imgbufoffs]) & maskbit))) { + pcolor = ar->palette[color]; + if (pcolor == 13) + pcolor = ar->shadow_table[*dst]; + *dst = pcolor; + } + mask += 40; + dst += ar->outwidth; + y++; + } + if (!--height) { + if (!--ar->v1.skip_width) + return; + height = ar->height; + y = ar->v1.y; + + scaleytab = &ar->v1.scaletable[ar->v1.tmp_y]; + + if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) { + ar->v1.x += ar->v1.scaleXstep; + if ((uint) ar->v1.x >= 320) + return; + maskbit = revBitMask[ar->v1.x & 7]; + ar->v1.destptr += ar->v1.scaleXstep; + } + mask = ar->v1.mask_ptr + (ar->v1.x >> 3); + ar->v1.tmp_x += ar->v1.scaleXstep; + dst = ar->v1.destptr; + } + StartPos:; + } while (--len); + } while (1); +} + +const byte default_scale_table[768] = { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, + 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, + 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, + 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, + 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, + 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, + 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, + 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, + 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, + 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, + 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, + 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, + 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, + 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, + 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, + 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, + 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, + 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, + 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, + 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, + 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, + 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, + 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, + 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, + 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, + 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, + 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, + + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, + 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, + 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, + 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, + 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, + 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, + 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, + 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, + 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, + 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, + 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, + 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, + 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, + 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, + 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, + 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, + 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, + 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, + 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, + 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, + 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, + 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, + 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, + 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, + 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, + 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, + 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, + + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, + 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, + 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, + 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, + 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, + 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, + 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, + 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, + 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, + 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, + 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, + 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, + 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, + 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, + 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, + 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, + 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, + 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, + 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, + 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, + 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, + 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, + 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, + 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, + 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, + 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, + 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, +}; + + +void AkosRenderer::codec1() +{ + int num_colors; + bool use_scaling; + int i, j; + int cur_x, x_right, x_left, skip = 0, tmp_x, tmp_y; + int cur_y, y_top, y_bottom; + bool y_clipping; + bool masking; + int step; + + + /* implement custom scale table */ + + + + if (_vm->isGlobInMemory(rtString, _vm->_vars[_vm->VAR_CUSTOMSCALETABLE])) { + v1.scaletable = _vm->getStringAddressVar(_vm->VAR_CUSTOMSCALETABLE); + } else { + v1.scaletable = default_scale_table; + } + + /* Setup color decoding variables */ + num_colors = _vm->getResourceDataSize(akpl); + if (num_colors == 32) { + v1.mask = (1 << 3) - 1; + v1.shl = 3; + } else if (num_colors == 64) { + v1.mask = (1 << 2) - 1; + v1.shl = 2; + } else { + v1.mask = (1 << 4) - 1; + v1.shl = 4; + } + + use_scaling = (scale_x != 0xFF) || (scale_y != 0xFF); + + cur_x = x; + cur_y = y; + + if (use_scaling) { + + /* Scale direction */ + v1.scaleXstep = -1; + if (move_x_cur < 0) { + move_x_cur = -move_x_cur; + v1.scaleXstep = 1; + } + + if (mirror) { + /* Adjust X position */ + tmp_x = 0x180 - move_x_cur; + j = tmp_x; + for (i = 0; i < move_x_cur; i++) { + if (v1.scaletable[j++] < scale_x) + cur_x -= v1.scaleXstep; + } + + x_left = x_right = cur_x; + + j = tmp_x; + for (i = 0, skip = 0; i < width; i++) { + if (x_right < 0) { + skip++; + tmp_x = j; + } + if (v1.scaletable[j++] < scale_x) + x_right++; + } + } else { + /* No mirror */ + /* Adjust X position */ + tmp_x = 0x180 + move_x_cur; + j = tmp_x; + for (i = 0; i < move_x_cur; i++) { + if (v1.scaletable[j++] < scale_x) + cur_x += v1.scaleXstep; + } + + x_left = x_right = cur_x; + + j = tmp_x; + for (i = 0, skip = 0; i < width; i++) { + if (x_left >= (int)outwidth) { + tmp_x = j; + skip++; + } + if (v1.scaletable[j--] < scale_x) + x_left--; + } + } + + if (skip) + skip--; + + step = -1; + if (move_y_cur < 0) { + move_y_cur = -move_y_cur; + step = -step; + } + + tmp_y = 0x180 - move_y_cur; + for (i = 0; i < move_y_cur; i++) { + if (v1.scaletable[tmp_y++] < scale_y) + cur_y -= step; + } + + y_top = y_bottom = cur_y; + tmp_y = 0x180 - move_y_cur; + for (i = 0; i < height; i++) { + if (v1.scaletable[tmp_y++] < scale_y) + y_bottom++; + } + + tmp_y = 0x180 - move_y_cur; + } else { + if (!mirror) + move_x_cur = -move_x_cur; + + cur_x += move_x_cur; + cur_y += move_y_cur; + + if (mirror) { + x_left = cur_x; + x_right = cur_x + width; + } else { + x_right = cur_x; + x_left = cur_x - width; + } + + y_top = cur_y; + y_bottom = cur_y + height; + + tmp_x = 0x180; + tmp_y = 0x180; + } + + v1.tmp_x = tmp_x; + v1.tmp_y = tmp_y; + v1.skip_width = width; + + v1.scaleXstep = -1; + if (mirror) + v1.scaleXstep = -v1.scaleXstep; + + if ((uint) y_top >= (uint) outheight || y_bottom <= 0) + return; + + if ((int)x_left >= (int)outwidth || x_right <= 0) + return; + + v1.replen = 0; + v1.y_pitch = height * outwidth; + + if (mirror) { + v1.y_pitch--; + if (!use_scaling) + skip = -cur_x; + if (skip > 0) { + v1.skip_width -= skip; + codec1_ignorePakCols(skip); + cur_x = 0; + } else { + skip = x_right - outwidth; + if (skip > 0) + v1.skip_width -= skip; + } + } else { + v1.y_pitch++; + if (!use_scaling) { + skip = x_right - outwidth + 1; + } + if (skip > 0) { + v1.skip_width -= skip; + codec1_ignorePakCols(skip); + cur_x = outwidth - 1; + } else { + skip = -1 - x_left; + if (skip > 0) + v1.skip_width -= skip; + } + } + + v1.x = cur_x; + v1.y = cur_y; + + if (v1.skip_width <= 0 || height <= 0) + return; + + _vm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, 1 << dirty_id); + + y_clipping = ((uint) y_bottom > outheight || y_top < 0); + + if ((uint) y_top > (uint) outheight) + y_top = 0; + + if ((uint) y_bottom > (uint) outheight) + y_bottom = outheight; + + if (y_top < draw_top) + draw_top = y_top; + if (y_bottom > draw_bottom) + draw_bottom = y_bottom; + + if (cur_x == -1) + cur_x = 0; /* ?? */ + + v1.destptr = outptr + cur_x + cur_y * outwidth; + + masking = false; + if (clipping) { + masking = _vm->isMaskActiveAt(x_left, y_top, x_right, y_bottom, + _vm->getResourceAddress(rtBuffer, 9) + + _vm->gdi._imgBufOffs[clipping] + _vm->_screenStartStrip) != 0; + } + + v1.mask_ptr = NULL; + + if (masking || charsetmask || shadow_mode) { + v1.mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + cur_y * 40 + _vm->_screenStartStrip; + v1.imgbufoffs = _vm->gdi._imgBufOffs[clipping]; + if (!charsetmask && masking) { + v1.mask_ptr += v1.imgbufoffs; + v1.imgbufoffs = 0; + } + } + + switch (shadow_mode) { + case 1: + akos_c1_spec1(this); + return; + case 2: +// akos_c1_spec2(this); + warning("akos_c1_spec2"); + return; + case 3: +// akos_c1_spec3(this); + warning("akos_c1_spec3"); + return; + } + + akos_generic_decode(this); + +// akos_c1_0y_decode(this); + +#if 0 + + switch (((byte)y_clipping << 3) | ((byte)use_scaling << 2) | ((byte)masking << 1) | (byte)charsetmask) { + case 0: + akos_c1_0_decode(this); + break; + case 0 + 8: + akos_c1_0y_decode(this); + break; + case 2: + case 1: + akos_c1_12_decode(this); + break; + case 2 + 8: + case 1 + 8: + akos_c1_12y_decode(this); + break; + case 3 + 8: + case 3: + akos_c1_3_decode(this); + break; + case 4: + akos_c1_4_decode(this); + break; + case 4 + 8: + akos_c1_4y_decode(this); + break; + case 6: + case 5: + akos_c1_56_decode(this); + break; + case 6 + 8: + case 5 + 8: + akos_c1_56y_decode(this); + break; + case 7: + case 7 + 8: + akos_c1_7_decode(this); + break; + } +#endif +} + + +void AkosRenderer::codec1_ignorePakCols(int num) +{ + int n; + byte repcolor; + byte replen; + byte *src; + + n = height; + if (num > 1) + n *= num; + src = srcptr; + do { + repcolor = *src++; + replen = repcolor & v1.mask; + if (replen == 0) { + replen = *src++; + } + do { + if (!--n) { + v1.repcolor = repcolor >> v1.shl; + v1.replen = replen; + srcptr = src; + return; + } + } while (--replen); + } while (1); +} + + +void AkosRenderer::codec5() +{ + VirtScreen *vs; + BompDrawData bdd; + + int moveX; + int moveY; + int left; + int var_20; + int max_width; + + int right; + int top; + int bottom; + + vs = &_vm->virtscr[0]; + //setBlastObjectMode(shadow_mode); // not implemented yet + moveX = move_x_cur; + moveY = move_y_cur; + + if (!mirror) { + left = (x - moveX - width) + 1; + } else { + left = x + moveX - 1; + } + + var_20 = 0; + max_width = outwidth; + + right = left + width - 1; + top = y + moveY; + bottom = top + height; + + if (left < 0) + left = 0; + if (left > max_width) + left -= left - max_width; + + // Yazoo: this is not correct, but fix a lots of bugs for the momment + + draw_top = 0; + draw_bottom = vs->height; + + _vm->updateDirtyRect(0, left, right + 1, top, bottom + 1, 1 << dirty_id); + + bdd.dataptr = srcptr; + bdd.out = outptr; + bdd.outheight = outheight; + bdd.outwidth = outwidth; + bdd.scale_x = 0xFF; + bdd.scale_y = 0xFF; + bdd.srcheight = height; + bdd.srcwidth = width; + bdd.x = left + 1; + bdd.y = top; + + _vm->drawBomp(&bdd, 0, bdd.dataptr, 0, 0); +} + +void AkosRenderer::codec16() +{ + warning("akos_codec16: not implemented"); +} + + +bool Scumm::akos_increaseAnims(byte *akos, Actor *a) +{ + byte *aksq, *akfo; + int i; + uint size; + bool result; + + aksq = findResourceData(MKID('AKSQ'), akos); + akfo = findResourceData(MKID('AKFO'), akos); + + size = getResourceDataSize(akfo) >> 1; + + result = false; + for (i = 0; i != 0x10; i++) { + if (a->cost.active[i] != 0) + result |= akos_increaseAnim(a, i, aksq, (uint16 *)akfo, size); + } + return result; +} + + +#define GW(o) ((int16)READ_LE_UINT16(aksq+curpos+(o))) +#define GUW(o) READ_LE_UINT16(aksq+curpos+(o)) +#define GB(o) aksq[curpos+(o)] + +bool Scumm::akos_increaseAnim(Actor *a, int chan, byte *aksq, uint16 *akfo, int numakfo) +{ + byte active; + uint old_curpos, curpos, end; + uint code; + bool flag_value; + int tmp, tmp2; + + active = a->cost.active[chan]; + end = a->cost.end[chan]; + old_curpos = curpos = a->cost.curpos[chan]; + flag_value = false; + + do { + + code = aksq[curpos]; + if (code & 0x80) + code = (code << 8) | aksq[curpos + 1]; + + switch (active) { + case 6: + switch (code) { + case AKC_JumpIfSet: + case AKC_AddVar: + case AKC_SetVar: + case AKC_SkipGE: + case AKC_SkipG: + case AKC_SkipLE: + case AKC_SkipL: + case AKC_SkipNE: + case AKC_SkipE: + curpos += 5; + break; + case AKC_JumpTable: + case AKC_SetActorClip: + case AKC_Ignore3: + case AKC_Ignore2: + case AKC_Ignore: + case AKC_StartAnim: + case AKC_CmdQue3: + curpos += 3; + break; + case AKC_SoundStuff: + curpos += 8; + break; + case AKC_Cmd3: + case AKC_SetVarInActor: + case AKC_SetDrawOffs: + curpos += 6; + break; + case AKC_ClearFlag: + case AKC_HideActor: + case AKC_CmdQue3Quick: + case AKC_Return: + curpos += 2; + break; + case AKC_JumpGE: + case AKC_JumpG: + case AKC_JumpLE: + case AKC_JumpL: + case AKC_JumpNE: + case AKC_JumpE: + case AKC_Random: + curpos += 7; + break; + case AKC_Flip: + case AKC_Jump: + curpos += 4; + break; + case AKC_ComplexChan: + curpos += 3; + tmp = aksq[curpos - 1]; + while (--tmp >= 0) { + curpos += 4; + curpos += (aksq[curpos] & 0x80) ? 2 : 1; + } + break; + default: + if (code & 0xC000) + error("akos_increaseAnim: invalid code %x", code); + curpos += (code & 0x8000) ? 2 : 1; + } + break; + case 2: + curpos += (code & 0x8000) ? 2 : 1; + if (curpos > end) + curpos = a->cost.start[chan]; + break; + case 3: + if (curpos != end) + curpos += (code & 0x8000) ? 2 : 1; + break; + } + + code = aksq[curpos]; + if (code & 0x80) + code = (code << 8) | aksq[curpos + 1]; + + if (flag_value && code != AKC_ClearFlag) + continue; + + switch (code) { + case AKC_StartAnimInActor: + akos_queCommand(4, derefActorSafe(a->getAnimVar(GB(2)), + "akos_increaseAnim:29"), a->getAnimVar(GB(3)), 0); + continue; + + case AKC_Random: + a->setAnimVar(GB(6), getRandomNumberRng(GW(2), GW(4))); + continue; + case AKC_SkipGE: + case AKC_SkipG: + case AKC_SkipLE: + case AKC_SkipL: + case AKC_SkipNE: + case AKC_SkipE: + if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_SkipStart)) + flag_value = true; + continue; + case AKC_IncVar: + a->setAnimVar(0, a->getAnimVar(0) + 1); + continue; + case AKC_SetVar: + a->setAnimVar(GB(4), GW(2)); + continue; + case AKC_AddVar: + a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2)); + continue; + case AKC_Flip: + a->flip = GW(2) != 0; + continue; + case AKC_CmdQue3: + tmp = GB(2); + if ((uint) tmp < 8) + akos_queCommand(3, a, a->sound[tmp], 0); + continue; + case AKC_CmdQue3Quick: + akos_queCommand(3, a, a->sound[1], 0); + continue; + case AKC_StartAnim: + akos_queCommand(4, a, GB(2), 0); + continue; + case AKC_StartVarAnim: + akos_queCommand(4, a, a->getAnimVar(GB(2)), 0); + continue; + case AKC_SetVarInActor: + derefActorSafe(a->getAnimVar(GB(2)), "akos_increaseAnim:9")->setAnimVar(GB(3), GW(4) + ); + continue; + case AKC_HideActor: + akos_queCommand(1, a, 0, 0); + continue; + case AKC_SetActorClip: + akos_queCommand(5, a, GB(2), 0); + continue; + case AKC_SoundStuff: + tmp = GB(2); + if (tmp >= 8) + continue; + tmp2 = GB(4); + if (tmp2 < 1 || tmp2 > 3) + error("akos_increaseAnim:8 invalid code %d", tmp2); + akos_queCommand(tmp2 + 6, a, a->sound[tmp], GB(6)); + continue; + case AKC_SetDrawOffs: + akos_queCommand(6, a, GW(2), GW(4)); + continue; + case AKC_JumpTable: + if (akfo == NULL) + error("akos_increaseAnim: no AKFO table"); + tmp = a->getAnimVar(GB(2)) - 1; + if (tmp < 0 || tmp >= numakfo - 1) + error("akos_increaseAnim: invalid jump value %d", tmp); + curpos = READ_LE_UINT16(&akfo[tmp]); + break; + case AKC_JumpIfSet: + if (!a->getAnimVar(GB(4))) + continue; + a->setAnimVar(GB(4), 0); + curpos = GUW(2); + break; + + case AKC_ClearFlag: + flag_value = false; + continue; + + case AKC_Jump: + curpos = GUW(2); + break; + + case AKC_Return: + case AKC_ComplexChan: + break; + + case AKC_Ignore: + case AKC_Ignore2: + case AKC_Ignore3: + continue; + + case AKC_JumpE: + case AKC_JumpNE: + case AKC_JumpL: + case AKC_JumpLE: + case AKC_JumpG: + case AKC_JumpGE: + if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_JumpStart)) + continue; + curpos = GUW(2); + break; + + default: + if ((code & 0xC000) == 0xC000) + error("Undefined uSweat token %X", code); + } + break; + } while (1); + + int code2 = aksq[curpos]; + if (code2 & 0x80) + code2 = (code2 << 8) | aksq[curpos + 1]; + assert((code2 & 0xC000) != 0xC000 || code2 == AKC_ComplexChan || code2 == AKC_Return); + + a->cost.curpos[chan] = curpos; + + return curpos != old_curpos; +} + +void Scumm::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) +{ +// warning("akos_queCommand(%d,%d,%d,%d)", cmd, a->number, param_1, param_2); +} + + +bool Scumm::akos_compare(int a, int b, byte cmd) +{ + switch (cmd) { + case 0: + return a == b; + case 1: + return a != b; + case 2: + return a < b; + case 3: + return a <= b; + case 4: + return a > b; + default: + return a >= b; + } +} diff --git a/scumm/akos.h b/scumm/akos.h new file mode 100644 index 0000000000..d24f4b48bc --- /dev/null +++ b/scumm/akos.h @@ -0,0 +1,170 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + + +#if !defined(__GNUC__) +#pragma START_PACK_STRUCTS +#endif + +struct CostumeData; + +struct AkosHeader { + byte x_1[2]; + byte flags; + byte x_2; + uint16 num_anims; + uint16 x_3; + uint16 codec; +} GCC_PACK; + +struct AkosOffset { + uint32 akcd; + uint16 akci; +} GCC_PACK; + +struct AkosCI { + uint16 width, height; + int16 rel_x, rel_y; + int16 move_x, move_y; +} GCC_PACK; + +#if !defined(__GNUC__) +#pragma END_PACK_STRUCTS +#endif + +struct AkosRenderer { +//protected: + CostumeData *cd; + int x, y; /* where to draw costume */ + byte scale_x, scale_y; /* scaling */ + byte clipping; /* clip mask */ + bool charsetmask; + byte shadow_mode; + uint16 codec; + bool mirror; /* draw actor mirrored */ + byte dirty_id; + byte *outptr; + uint outwidth, outheight; + + /* pointer to various parts of the costume resource */ + byte *akos; + AkosHeader *akhd; + + /* current move offset */ + int move_x, move_y; + /* movement of cel to decode */ + int move_x_cur, move_y_cur; + /* width and height of cel to decode */ + int width, height; + + byte *srcptr; + byte *shadow_table; + + struct { + /* codec stuff */ + const byte *scaletable; + byte mask, shl; + bool doContinue; + byte repcolor; + byte replen; + int scaleXstep; + int x, y; + int tmp_x, tmp_y; + int y_pitch; + int skip_width; + byte *destptr; + byte *mask_ptr; + int imgbufoffs; + } v1; + + /* put less used stuff at the bottom to optimize opcodes */ + int draw_top, draw_bottom; + byte *akpl, *akci, *aksq; + AkosOffset *akof; + byte *akcd; + + byte palette[256]; + +protected: + Scumm *_vm; + +public: + + // Constructor, sets all data to 0 + AkosRenderer(Scumm *scumm) { + memset(this, 0, sizeof(AkosRenderer)); + _vm = scumm; + } bool drawCostume(); + void setPalette(byte *palette); + void setCostume(int costume); + void setFacing(Actor * a); + bool drawCostumeChannel(int chan); + void codec1(); + void codec5(); + void codec16(); + void codec1_ignorePakCols(int num); + void c1_spec2(); + void c1_spec3(); +}; + +enum AkosOpcodes { + AKC_Return = 0xC001, + AKC_SetVar = 0xC010, + AKC_CmdQue3 = 0xC015, + AKC_ComplexChan = 0xC020, + AKC_Jump = 0xC030, + AKC_JumpIfSet = 0xC031, + AKC_AddVar = 0xC040, + AKC_Ignore = 0xC050, + AKC_IncVar = 0xC060, + AKC_CmdQue3Quick = 0xC061, + AKC_SkipStart = 0xC070, + AKC_SkipE = 0xC070, + AKC_SkipNE = 0xC071, + AKC_SkipL = 0xC072, + AKC_SkipLE = 0xC073, + AKC_SkipG = 0xC074, + AKC_SkipGE = 0xC075, + AKC_StartAnim = 0xC080, + AKC_StartVarAnim = 0xC081, + AKC_Random = 0xC082, + AKC_SetActorClip = 0xC083, + AKC_StartAnimInActor = 0xC084, + AKC_SetVarInActor = 0xC085, + AKC_HideActor = 0xC086, + AKC_SetDrawOffs = 0xC087, + AKC_JumpTable = 0xC088, + AKC_SoundStuff = 0xC089, + AKC_Flip = 0xC08A, + AKC_Cmd3 = 0xC08B, + AKC_Ignore3 = 0xC08C, + AKC_Ignore2 = 0xC08D, + AKC_JumpStart = 0xC090, + AKC_JumpE = 0xC090, + AKC_JumpNE = 0xC091, + AKC_JumpL = 0xC092, + AKC_JumpLE = 0xC093, + AKC_JumpG = 0xC094, + AKC_JumpGE = 0xC095, + AKC_ClearFlag = 0xC09F +}; diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp new file mode 100644 index 0000000000..f8d68dca98 --- /dev/null +++ b/scumm/boxes.cpp @@ -0,0 +1,1039 @@ + /* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" + +#include + +#if !defined(__GNUC__) + #pragma START_PACK_STRUCTS +#endif + +struct Box { /* Internal walkbox file format */ + int16 ulx, uly; + int16 urx, ury; + int16 lrx, lry; + int16 llx, lly; + byte mask; + byte flags; + uint16 scale; +} GCC_PACK; + +#if !defined(__GNUC__) + #pragma END_PACK_STRUCTS +#endif + +struct PathNode { /* Linked list of walkpath nodes */ + uint index; + struct PathNode *left, *right; +}; + +struct PathVertex { /* Linked list of walkpath nodes */ + PathNode *left; + PathNode *right; +}; + +#define BOX_MATRIX_SIZE 2000 + + +PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node); + + +byte Scumm::getMaskFromBox(int box) +{ + Box *ptr = getBoxBaseAddr(box); + if (!ptr) + return 0; + + return ptr->mask; +} + +void Scumm::setBoxFlags(int box, int val) +{ + debug(2, "setBoxFlags(%d, 0x%02x)", box, val); + + /* FULL_THROTTLE stuff */ + if (val & 0xC000) { + assert(box >= 0 && box < 65); + _extraBoxFlags[box] = val; + } else { + Box *b = getBoxBaseAddr(box); + b->flags = val; + } +} + +byte Scumm::getBoxFlags(int box) +{ + Box *ptr = getBoxBaseAddr(box); + if (!ptr) + return 0; + return ptr->flags; +} + +void Scumm::setBoxScale(int box, int scale) +{ + Box *b = getBoxBaseAddr(box); + b->scale = scale; +} + +int Scumm::getBoxScale(int box) +{ + if (_features & GF_NO_SCALLING) + return (255); + Box *ptr = getBoxBaseAddr(box); + if (!ptr) + return 255; + return FROM_LE_16(ptr->scale); +} + +byte Scumm::getNumBoxes() +{ + byte *ptr = getResourceAddress(rtMatrix, 2); + if (!ptr) + return 0; + return ptr[0]; +} + +Box *Scumm::getBoxBaseAddr(int box) +{ + byte *ptr = getResourceAddress(rtMatrix, 2); + if (!ptr) + return NULL; + checkRange(ptr[0] - 1, 0, box, "Illegal box %d"); + if (_features & GF_SMALL_HEADER) { + if (_features & GF_OLD256) + return (Box *)(ptr + box * (SIZEOF_BOX - 2) + 1); + else + return (Box *)(ptr + box * SIZEOF_BOX + 1); + } else + return (Box *)(ptr + box * SIZEOF_BOX + 2); +} + +int Scumm::getSpecialBox(int param1, int param2) +{ + int i; + int numOfBoxes; + byte flag; + + numOfBoxes = getNumBoxes() - 1; + + for (i = numOfBoxes; i >= 0; i--) { + flag = getBoxFlags(i); + + if (!(flag & kBoxInvisible) && (flag & kBoxPlayerOnly)) + return (-1); + + if (checkXYInBoxBounds(i, param1, param2)) + return (i); + } + + return (-1); +} + +bool Scumm::checkXYInBoxBounds(int b, int x, int y) +{ + BoxCoords box; + + if (b == 0 && (!(_features & GF_SMALL_HEADER))) + return false; + + getBoxCoordinates(b, &box); + + if (x < box.ul.x && x < box.ur.x && x < box.lr.x && x < box.ll.x) + return false; + + if (x > box.ul.x && x > box.ur.x && x > box.lr.x && x > box.ll.x) + return false; + + if (y < box.ul.y && y < box.ur.y && y < box.lr.y && y < box.ll.y) + return false; + + if (y > box.ul.y && y > box.ur.y && y > box.lr.y && y > box.ll.y) + return false; + + if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y || + box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) { + + ScummPoint pt; + pt = closestPtOnLine(box.ul.x, box.ul.y, box.lr.x, box.lr.y, x, y); + if (distanceFromPt(x, y, pt.x, pt.y) <= 4) + return true; + } + + if (!compareSlope(box.ul.x, box.ul.y, box.ur.x, box.ur.y, x, y)) + return false; + + if (!compareSlope(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y)) + return false; + + if (!compareSlope(box.ll.x, box.ll.y, x, y, box.lr.x, box.lr.y)) + return false; + + if (!compareSlope(box.ul.x, box.ul.y, x, y, box.ll.x, box.ll.y)) + return false; + + return true; +} + +void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) +{ + Box *bp = getBoxBaseAddr(boxnum); + + box->ul.x = (int16)FROM_LE_16(bp->ulx); + box->ul.y = (int16)FROM_LE_16(bp->uly); + box->ur.x = (int16)FROM_LE_16(bp->urx); + box->ur.y = (int16)FROM_LE_16(bp->ury); + + box->ll.x = (int16)FROM_LE_16(bp->llx); + box->ll.y = (int16)FROM_LE_16(bp->lly); + box->lr.x = (int16)FROM_LE_16(bp->lrx); + box->lr.y = (int16)FROM_LE_16(bp->lry); +} + +uint Scumm::distanceFromPt(int x, int y, int ptx, int pty) +{ + int diffx, diffy; + + diffx = abs(ptx - x); + + if (diffx >= 0x100) + return 0xFFFF; + + diffy = abs(pty - y); + + if (diffy >= 0x100) + return 0xFFFF; + diffx *= diffx; + diffy *= diffy; + return diffx + diffy; +} + +ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) +{ + int lydiff, lxdiff; + int32 dist, a, b, c; + int x2, y2; + ScummPoint pt; + + if (llx == ulx) { // Vertical line? + x2 = ulx; + y2 = y; + } else if (lly == uly) { // Horizontal line? + x2 = x; + y2 = uly; + } else { + lydiff = lly - uly; + + lxdiff = llx - ulx; + + if (abs(lxdiff) > abs(lydiff)) { + dist = lxdiff * lxdiff + lydiff * lydiff; + + a = ulx * lydiff / lxdiff; + b = x * lxdiff / lydiff; + + c = (a + b - uly + y) * lydiff * lxdiff / dist; + + x2 = c; + y2 = c * lydiff / lxdiff - a + uly; + } else { + dist = lydiff * lydiff + lxdiff * lxdiff; + + a = uly * lxdiff / lydiff; + b = y * lydiff / lxdiff; + + c = (a + b - ulx + x) * lydiff * lxdiff / dist; + + y2 = c; + x2 = c * lxdiff / lydiff - a + ulx; + } + } + + lxdiff = llx - ulx; + lydiff = lly - uly; + + if (abs(lydiff) < abs(lxdiff)) { + if (lxdiff > 0) { + if (x2 < ulx) { + type1:; + x2 = ulx; + y2 = uly; + } else if (x2 > llx) { + type2:; + x2 = llx; + y2 = lly; + } + } else { + if (x2 > ulx) + goto type1; + if (x2 < llx) + goto type2; + } + } else { + if (lydiff > 0) { + if (y2 < uly) + goto type1; + if (y2 > lly) + goto type2; + } else { + if (y2 > uly) + goto type1; + if (y2 < lly) + goto type2; + } + } + + pt.x = x2; + pt.y = y2; + return pt; +} + +bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) +{ + int t; + BoxCoords box; + + getBoxCoordinates(b, &box); + + if (threshold == 0) + return true; + + t = x - threshold; + if (t > box.ul.x && t > box.ur.x && t > box.lr.x && t > box.ll.x) + return false; + + t = x + threshold; + if (t < box.ul.x && t < box.ur.x && t < box.lr.x && t < box.ll.x) + return false; + + t = y - threshold; + if (t > box.ul.y && t > box.ur.y && t > box.lr.y && t > box.ll.y) + return false; + + t = y + threshold; + if (t < box.ul.y && t < box.ur.y && t < box.lr.y && t < box.ll.y) + return false; + + return true; +} + +AdjustBoxResult Scumm::getClosestPtOnBox(int b, int x, int y) +{ + ScummPoint pt; + AdjustBoxResult best; + uint dist; + uint bestdist = (uint) 0xFFFF; + BoxCoords box; + + getBoxCoordinates(b, &box); + + pt = closestPtOnLine(box.ul.x, box.ul.y, box.ur.x, box.ur.y, x, y); + dist = distanceFromPt(x, y, pt.x, pt.y); + if (dist < bestdist) { + bestdist = dist; + best.x = pt.x; + best.y = pt.y; + } + + pt = closestPtOnLine(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y); + dist = distanceFromPt(x, y, pt.x, pt.y); + if (dist < bestdist) { + bestdist = dist; + best.x = pt.x; + best.y = pt.y; + } + + pt = closestPtOnLine(box.lr.x, box.lr.y, box.ll.x, box.ll.y, x, y); + dist = distanceFromPt(x, y, pt.x, pt.y); + if (dist < bestdist) { + bestdist = dist; + best.x = pt.x; + best.y = pt.y; + } + + pt = closestPtOnLine(box.ll.x, box.ll.y, box.ul.x, box.ul.y, x, y); + dist = distanceFromPt(x, y, pt.x, pt.y); + if (dist < bestdist) { + bestdist = dist; + best.x = pt.x; + best.y = pt.y; + } + + best.dist = bestdist; + return best; +} + +byte *Scumm::getBoxMatrixBaseAddr() +{ + byte *ptr = getResourceAddress(rtMatrix, 1); + if (*ptr == 0xFF) + ptr++; + return ptr; +} + +/* + * Compute if there is a way that connects box 'from' with box 'to'. + * Returns the number of a box adjactant to 'from' that is the next on the + * way to 'to' (this can be 'to' itself or a third box). + * If there is no connection -1 is return. + */ +int Scumm::getPathToDestBox(byte from, byte to) +{ + byte *boxm; + byte i; + int dest = -1; + + if (from == to) + return to; + + boxm = getBoxMatrixBaseAddr(); + + i = 0; + while (i != from) { + while (*boxm != 0xFF) + boxm += 3; + i++; + boxm++; + } + + while (boxm[0] != 0xFF) { + if (boxm[0] <= to && boxm[1] >= to) + dest = boxm[2]; + boxm += 3; + } + return dest; +} + +/* + * Computes the next point actor a has to walk towards in a straight + * line in order to get from box1 to box3 via box2. + */ +bool Scumm::findPathTowards(Actor *a, byte box1nr, byte box2nr, byte box3nr, int16 &foundPathX, int16 &foundPathY) +{ + BoxCoords box1; + BoxCoords box2; + ScummPoint tmp; + int i, j; + int flag; + int q, pos; + + getBoxCoordinates(box1nr, &box1); + getBoxCoordinates(box2nr, &box2); + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + if (box1.ul.x == box1.ur.x && box1.ul.x == box2.ul.x && box1.ul.x == box2.ur.x) { + flag = 0; + if (box1.ul.y > box1.ur.y) { + SWAP(box1.ul.y, box1.ur.y); + flag |= 1; + } + + if (box2.ul.y > box2.ur.y) { + SWAP(box2.ul.y, box2.ur.y); + flag |= 2; + } + + if (box1.ul.y > box2.ur.y || box2.ul.y > box1.ur.y || + (box1.ur.y == box2.ul.y || box2.ur.y == box1.ul.y) && + box1.ul.y != box1.ur.y && box2.ul.y != box2.ur.y) { + if (flag & 1) + SWAP(box1.ul.y, box1.ur.y); + if (flag & 2) + SWAP(box2.ul.y, box2.ur.y); + } else { + pos = a->y; + if (box2nr == box3nr) { + int diffX = a->walkdata.destx - a->x; + int diffY = a->walkdata.desty - a->y; + int boxDiffX = box1.ul.x - a->x; + + if (diffX != 0) { + int t; + + diffY *= boxDiffX; + t = diffY / diffX; + if (t == 0 && (diffY <= 0 || diffX <= 0) + && (diffY >= 0 || diffX >= 0)) + t = -1; + pos = a->y + t; + } + } + + q = pos; + if (q < box2.ul.y) + q = box2.ul.y; + if (q > box2.ur.y) + q = box2.ur.y; + if (q < box1.ul.y) + q = box1.ul.y; + if (q > box1.ur.y) + q = box1.ur.y; + if (q == pos && box2nr == box3nr) + return true; + foundPathY = q; + foundPathX = box1.ul.x; + return false; + } + } + + if (box1.ul.y == box1.ur.y && box1.ul.y == box2.ul.y && box1.ul.y == box2.ur.y) { + flag = 0; + if (box1.ul.x > box1.ur.x) { + SWAP(box1.ul.x, box1.ur.x); + flag |= 1; + } + + if (box2.ul.x > box2.ur.x) { + SWAP(box2.ul.x, box2.ur.x); + flag |= 2; + } + + if (box1.ul.x > box2.ur.x || box2.ul.x > box1.ur.x || + (box1.ur.x == box2.ul.x || box2.ur.x == box1.ul.x) && + box1.ul.x != box1.ur.x && box2.ul.x != box2.ur.x) { + if (flag & 1) + SWAP(box1.ul.x, box1.ur.x); + if (flag & 2) + SWAP(box2.ul.x, box2.ur.x); + } else { + + if (box2nr == box3nr) { + int diffX = a->walkdata.destx - a->x; + int diffY = a->walkdata.desty - a->y; + int boxDiffY = box1.ul.y - a->y; + + pos = a->x; + if (diffY != 0) { + pos += diffX * boxDiffY / diffY; + } + } else { + pos = a->x; + } + + q = pos; + if (q < box2.ul.x) + q = box2.ul.x; + if (q > box2.ur.x) + q = box2.ur.x; + if (q < box1.ul.x) + q = box1.ul.x; + if (q > box1.ur.x) + q = box1.ur.x; + if (q == pos && box2nr == box3nr) + return true; + foundPathX = q; + foundPathY = box1.ul.y; + return false; + } + } + tmp = box1.ul; + box1.ul = box1.ur; + box1.ur = box1.lr; + box1.lr = box1.ll; + box1.ll = tmp; + } + tmp = box2.ul; + box2.ul = box2.ur; + box2.ur = box2.lr; + box2.lr = box2.ll; + box2.ll = tmp; + } + return false; +} + +void Scumm::createBoxMatrix() +{ + byte *matrix_ptr; + int num, i, j; + byte flags; + int table_1[66], table_2[66]; + int counter, val; + int code; + + PathVertex *vtx; + PathNode *node, *node2 = NULL; + + _maxBoxVertexHeap = 1000; + + createResource(rtMatrix, 4, 1000); + createResource(rtMatrix, 3, 4160); //65 items of something of size 64 + createResource(rtMatrix, 1, BOX_MATRIX_SIZE); + + matrix_ptr = getResourceAddress(rtMatrix, 1); + + _boxMatrixPtr4 = getResourceAddress(rtMatrix, 4); + _boxMatrixPtr1 = getResourceAddress(rtMatrix, 1); + _boxMatrixPtr3 = getResourceAddress(rtMatrix, 3); + + _boxPathVertexHeapIndex = _boxMatrixItem = 0; + + num = getNumBoxes(); + + for (i = 0; i < num; i++) { + for (j = 0; j < num; j++) { + if (i == j) { + _boxMatrixPtr3[i * 64 + j] = 0; + } else if (areBoxesNeighbours(i, j)) { + _boxMatrixPtr3[i * 64 + j] = 1; + } else { + _boxMatrixPtr3[i * 64 + j] = 250; + } + } + } + + for (j = 0; j < num; j++) { + flags = getBoxFlags(j); + if (flags & kBoxInvisible) { + addToBoxMatrix(0xFF); + addToBoxMatrix(j); + addToBoxMatrix(j); + addToBoxMatrix(j); + } else { + vtx = addPathVertex(); + for (i = 0; i < num; i++) { + flags = getBoxFlags(j); + if (!(flags & kBoxInvisible)) { + node = unkMatrixProc2(vtx, i); + if (i == j) + node2 = node; + } + } + table_1[j] = 0; + table_2[j] = j; + vtx = unkMatrixProc1(vtx, node2); + node = vtx ? vtx->left : NULL; + + counter = 250; + while (node) { + val = _boxMatrixPtr3[j * 64 + node->index]; + table_1[node->index] = val; + if (val < counter) + counter = val; + + if (table_1[node->index] != 250) + table_2[node->index] = node->index; + else + table_2[node->index] = -1; + + node = node->left; + } + + while (vtx) { + counter = 250; + node2 = node = vtx->left; + + while (node) { + if (table_1[node->index] < counter) { + counter = table_1[node->index]; + node2 = node; + } + node = node->left; + } + vtx = unkMatrixProc1(vtx, node2); + node = vtx ? vtx->left : NULL; + while (node) { + code = _boxMatrixPtr3[node2->index * 64 + node->index]; + code += table_1[node2->index]; + if (code < table_1[node->index]) { + table_1[node->index] = code; + table_2[node->index] = table_2[node2->index]; + } + node = node->left; + } + } + + addToBoxMatrix(0xFF); + for (i = 1; i < num;) { + if (table_2[i - 1] != -1) { + addToBoxMatrix(i - 1); /* lo */ + if (table_2[i - 1] != table_2[i]) { + addToBoxMatrix(i - 1); /* hi */ + addToBoxMatrix(table_2[i - 1]); /* dst */ + } else { + while (table_2[i - 1] == table_2[i]) { + if (++i == num) + break; + } + addToBoxMatrix(i - 1); /* hi */ + addToBoxMatrix(table_2[i - 1]); /* dst */ + } + } + if (++i == num && table_2[i - 1] != -1) { + addToBoxMatrix(i - 1); /* lo */ + addToBoxMatrix(i - 1); /* hi */ + addToBoxMatrix(table_2[i - 1]); /* dest */ + } + } + } + } + + addToBoxMatrix(0xFF); + nukeResource(rtMatrix, 4); + nukeResource(rtMatrix, 3); +} + +PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node) +{ + if (node == NULL || vtx == NULL) + return NULL; + + if (!node->right) { + vtx->left = node->left; + } else { + node->right->left = node->left; + } + + if (!node->left) { + vtx->right = node->right; + } else { + node->left->right = node->right; + } + + if (vtx->left) + return vtx; + + return NULL; +} + +PathNode *Scumm::unkMatrixProc2(PathVertex *vtx, int i) +{ + PathNode *node; + + if (vtx == NULL) + return NULL; + + if (!vtx->right) { + node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode)); + vtx->left = vtx->right = node; + + node->index = i; + node->left = 0; + node->right = 0; + } else { + node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode)); + vtx->right->left = node; + + node->right = vtx->right; + node->index = i; + node->left = 0; + + vtx->right = node; + } + + return vtx->right; +} + +/* Check if two boxes are neighbours */ +bool Scumm::areBoxesNeighbours(int box1nr, int box2nr) +{ + int j, k, m, n; + int tmp_x, tmp_y; + bool result; + BoxCoords box; + BoxCoords box2; + + if (getBoxFlags(box1nr) & kBoxInvisible || getBoxFlags(box2nr) & kBoxInvisible) + return false; + + getBoxCoordinates(box1nr, &box2); + getBoxCoordinates(box2nr, &box); + + result = false; + j = 4; + + do { + k = 4; + do { + if (box2.ur.x == box2.ul.x && box.ul.x == box2.ul.x && box.ur.x == box2.ur.x) { + n = m = 0; + if (box2.ur.y < box2.ul.y) { + n = 1; + SWAP(box2.ur.y, box2.ul.y); + } + if (box.ur.y < box.ul.y) { + m = 1; + SWAP(box.ur.y, box.ul.y); + } + if (box.ur.y < box2.ul.y || + box.ul.y > box2.ur.y || + (box.ul.y == box2.ur.y || + box.ur.y == box2.ul.y) && box2.ur.y != box2.ul.y && box.ul.y != box.ur.y) { + if (n) { + SWAP(box2.ur.y, box2.ul.y); + } + if (m) { + SWAP(box.ur.y, box.ul.y); + } + } else { + if (n) { + SWAP(box2.ur.y, box2.ul.y); + } + if (m) { + SWAP(box.ur.y, box.ul.y); + } + result = true; + } + } + + if (box2.ur.y == box2.ul.y && box.ul.y == box2.ul.y && box.ur.y == box2.ur.y) { + n = m = 0; + if (box2.ur.x < box2.ul.x) { + n = 1; + SWAP(box2.ur.x, box2.ul.x); + } + if (box.ur.x < box.ul.x) { + m = 1; + SWAP(box.ur.x, box.ul.x); + } + if (box.ur.x < box2.ul.x || + box.ul.x > box2.ur.x || + (box.ul.x == box2.ur.x || + box.ur.x == box2.ul.x) && box2.ur.x != box2.ul.x && box.ul.x != box.ur.x) { + + if (n) { + SWAP(box2.ur.x, box2.ul.x); + } + if (m) { + SWAP(box.ur.x, box.ul.x); + } + } else { + if (n) { + SWAP(box2.ur.x, box2.ul.x); + } + if (m) { + SWAP(box.ur.x, box.ul.x); + } + result = true; + } + } + + tmp_x = box2.ul.x; + tmp_y = box2.ul.y; + box2.ul.x = box2.ur.x; + box2.ul.y = box2.ur.y; + box2.ur.x = box2.lr.x; + box2.ur.y = box2.lr.y; + box2.lr.x = box2.ll.x; + box2.lr.y = box2.ll.y; + box2.ll.x = tmp_x; + box2.ll.y = tmp_y; + } while (--k); + + tmp_x = box.ul.x; + tmp_y = box.ul.y; + box.ul.x = box.ur.x; + box.ul.y = box.ur.y; + box.ur.x = box.lr.x; + box.ur.y = box.lr.y; + box.lr.x = box.ll.x; + box.lr.y = box.ll.y; + box.ll.x = tmp_x; + box.ll.y = tmp_y; + } while (--j); + + return result; +} + +void Scumm::addToBoxMatrix(byte b) +{ + if (++_boxMatrixItem > BOX_MATRIX_SIZE) + error("Box matrix overflow"); + *_boxMatrixPtr1++ = b; +} + +void *Scumm::addToBoxVertexHeap(int size) +{ + byte *ptr = _boxMatrixPtr4; + + _boxMatrixPtr4 += size; + _boxPathVertexHeapIndex += size; + + if (_boxPathVertexHeapIndex >= _maxBoxVertexHeap) + error("Box path vertex heap overflow"); + + return ptr; +} + +PathVertex *Scumm::addPathVertex() +{ + _boxMatrixPtr4 = getResourceAddress(rtMatrix, 4); + _boxPathVertexHeapIndex = 0; + + return (PathVertex *)addToBoxVertexHeap(sizeof(PathVertex)); +} + +void Scumm::findPathTowardsOld(Actor *actor, byte trap1, byte trap2, byte final_trap, ScummPoint gateLoc[5]) +{ + ScummPoint pt; + ScummPoint gateA[2]; + ScummPoint gateB[2]; + + getGates(trap1, trap2, gateA, gateB); + + gateLoc[1].x = actor->x; + gateLoc[1].y = actor->y; + gateLoc[2].x = 32000; + gateLoc[3].x = 32000; + gateLoc[4].x = 32000; + + if (trap2 == final_trap) { /* next = final box? */ + gateLoc[4].x = actor->walkdata.destx; + gateLoc[4].y = actor->walkdata.desty; + + if (getMaskFromBox(trap1) == getMaskFromBox(trap2) || 1) { + if (compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateA[0].x, gateA[0].y) != + compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateB[0].x, gateB[0].y) && + compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateA[1].x, gateA[1].y) != + compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[4].x, gateLoc[4].y, gateB[1].x, gateB[1].y)) { + return; /* same zplane and between both gates? */ + } + } + } + + pt = closestPtOnLine(gateA[1].x, gateA[1].y, gateB[1].x, gateB[1].y, gateLoc[1].x, gateLoc[1].y); + gateLoc[3].x = pt.x; + gateLoc[3].y = pt.y; + + if (compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gateA[0].x, gateA[0].y) == + compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gateB[0].x, gateB[0].y)) { + closestPtOnLine(gateA[0].x, gateA[0].y, gateB[0].x, gateB[0].y, gateLoc[1].x, gateLoc[1].y); + gateLoc[2].x = pt.x; /* if point 2 between gates, ignore! */ + gateLoc[2].y = pt.y; + } + + return; +} + +void Scumm::getGates(int trap1, int trap2, ScummPoint gateA[2], ScummPoint gateB[2]) +{ + int i, j; + int Dist[8]; + int MinDist[3]; + int Closest[3]; + int Box[3]; + BoxCoords box; + ScummPoint Clo[8]; + ScummPoint poly[8]; + AdjustBoxResult abr; + int line1, line2; + + // For all corner coordinates of the first box, compute the point cloest + // to them on the second box (and also compute the distance of these points). + getBoxCoordinates(trap1, &box); + poly[0] = box.ul; + poly[1] = box.ur; + poly[2] = box.lr; + poly[3] = box.ll; + for (i = 0; i < 4; i++) { + abr = getClosestPtOnBox(trap2, poly[i].x, poly[i].y); + Dist[i] = abr.dist; + Clo[i].x = abr.x; + Clo[i].y = abr.y; + } + + // Now do the same but with the roles of the first and second box swapped. + getBoxCoordinates(trap2, &box); + poly[4] = box.ul; + poly[5] = box.ur; + poly[6] = box.lr; + poly[7] = box.ll; + for (i = 4; i < 8; i++) { + abr = getClosestPtOnBox(trap1, poly[i].x, poly[i].y); + Dist[i] = abr.dist; + Clo[i].x = abr.x; + Clo[i].y = abr.y; + } + + // Find the three closest "close" points between the two boxes. + for (j = 0; j < 3; j++) { + MinDist[j] = 0xFFFF; + for (i = 0; i < 8; i++) { + if (Dist[i] < MinDist[j]) { + MinDist[j] = Dist[i]; + Closest[j] = i; + } + } + Dist[Closest[j]] = 0xFFFF; + MinDist[j] = (int)sqrt((double)MinDist[j]); + Box[j] = (Closest[j] > 3); // Is the poin on the first or on the second box? + } + + + // Finally, compute the "gate". That's a pair of two points that are + // in the same box (actually, on the border of that box), which both have + // "minimal" distance to the other box in a certain sense. + + if (Box[0] == Box[1] && abs(MinDist[0] - MinDist[1]) < 4) { + line1 = Closest[0]; + line2 = Closest[1]; + + } else if (Box[0] == Box[1] && MinDist[0] == MinDist[1]) { /* parallel */ + line1 = Closest[0]; + line2 = Closest[1]; + } else if (Box[0] == Box[2] && MinDist[0] == MinDist[2]) { /* parallel */ + line1 = Closest[0]; + line2 = Closest[2]; + } else if (Box[1] == Box[2] && MinDist[1] == MinDist[2]) { /* parallel */ + line1 = Closest[1]; + line2 = Closest[2]; + + } else if (Box[0] == Box[2] && abs(MinDist[0] - MinDist[2]) < 4) { + line1 = Closest[0]; + line2 = Closest[2]; + } else if (abs(MinDist[0] - MinDist[2]) < 4) { /* if 1 close to 3 then use 2-3 */ + line1 = Closest[1]; + line2 = Closest[2]; + } else if (abs(MinDist[0] - MinDist[1]) < 4) { + line1 = Closest[0]; + line2 = Closest[1]; + } else { + line1 = Closest[0]; + line2 = Closest[0]; + } + + // Set the gate + if (line1 < 4) { /* from box 1 to box 2 */ + gateA[0] = poly[line1]; + gateA[1] = Clo[line1]; + + } else { + gateA[1] = poly[line1]; + gateA[0] = Clo[line1]; + } + + if (line2 < 4) { /* from box */ + gateB[0] = poly[line2]; + gateB[1] = Clo[line2]; + + } else { + gateB[1] = poly[line2]; + gateB[0] = Clo[line2]; + } +} + +bool Scumm::compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3) +{ + return (Y2 - Y1) * (X3 - X1) <= (Y3 - Y1) * (X2 - X1); +} diff --git a/scumm/boxes.h b/scumm/boxes.h new file mode 100644 index 0000000000..cc04d2398d --- /dev/null +++ b/scumm/boxes.h @@ -0,0 +1,52 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef BOXES_H +#define BOXES_H + +#define SIZEOF_BOX 20 + +typedef enum { + kBoxXFlip = 0x08, + kBoxYFlip = 0x10, + kBoxPlayerOnly = 0x20, + kBoxLocked = 0x40, + kBoxInvisible = 0x80, +} BoxFlags; + +struct AdjustBoxResult { /* Result type of AdjustBox functions */ + int16 x, y; + uint16 dist; +}; + +struct BoxCoords { /* Box coordinates */ + ScummPoint ul; + ScummPoint ur; + ScummPoint ll; + ScummPoint lr; +}; + +struct Box; +struct PathNode; +struct PathVertex; + +#endif diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp new file mode 100644 index 0000000000..14486838b5 --- /dev/null +++ b/scumm/bundle.cpp @@ -0,0 +1,660 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" +#include "scummsys.h" +#include "bundle.h" + +Bundle::Bundle(Scumm *parent) +{ + _voiceFile = NULL; + _musicFile = NULL; + _scumm = parent; + _lastSong = -1; +} + +Bundle::~Bundle() +{ + if (_voiceFile != NULL) + fclose(_voiceFile); + + if (_musicFile != NULL) + fclose(_musicFile); +} + +bool Bundle::openVoiceFile(char *filename) +{ + int32 tag, offset; + + if (_voiceFile != NULL) { + return false; + } + + _voiceFile = fopen(filename, "rb"); + if (_voiceFile == NULL) { + printf("Bundle: Can't open voice bundle file: %s\n", filename); + return false; + } + + tag = _scumm->fileReadDwordBE(_voiceFile); + offset = _scumm->fileReadDwordBE(_voiceFile); + _numVoiceFiles = _scumm->fileReadDwordBE(_voiceFile); + + _bundleVoiceTable = (BundleAudioTable *) malloc(_numVoiceFiles * sizeof(BundleAudioTable)); + + _scumm->fileSeek(_voiceFile, offset, SEEK_SET); + + for (int32 i = 0; i < _numVoiceFiles; i++) { + char name[13], c; + int32 z = 0; + int32 z2; + + for (z2 = 0; z2 < 8; z2++) + if ((c = _scumm->fileReadByte(_voiceFile)) != 0) + name[z++] = c; + name[z++] = '.'; + for (z2 = 0; z2 < 4; z2++) + if ((c = _scumm->fileReadByte(_voiceFile)) != 0) + name[z++] = c; + name[z] = '\0'; + strcpy(_bundleVoiceTable[i].filename, name); + _bundleVoiceTable[i].offset = _scumm->fileReadDwordBE(_voiceFile); + _bundleVoiceTable[i].size = _scumm->fileReadDwordBE(_voiceFile); + } + + return true; +} + +bool Bundle::openMusicFile(char *filename) +{ + int32 tag, offset; + + if (_musicFile != NULL) { + return false; + } + + _musicFile = fopen(filename, "rb"); + if (_musicFile == NULL) { + printf("Bundle: Can't open music bundle file: %s\n", filename); + return false; + } + + tag = _scumm->fileReadDwordBE(_musicFile); + offset = _scumm->fileReadDwordBE(_musicFile); + _numMusicFiles = _scumm->fileReadDwordBE(_musicFile); + + _bundleMusicTable = (BundleAudioTable *) malloc(_numMusicFiles * sizeof(BundleAudioTable)); + + _scumm->fileSeek(_musicFile, offset, SEEK_SET); + + for (int32 i = 0; i < _numMusicFiles; i++) { + char name[13], c; + int z = 0; + int z2; + + for (z2 = 0; z2 < 8; z2++) + if ((c = _scumm->fileReadByte(_musicFile)) != 0) + name[z++] = c; + name[z++] = '.'; + for (z2 = 0; z2 < 4; z2++) + if ((c = _scumm->fileReadByte(_musicFile)) != 0) + name[z++] = c; + name[z] = '\0'; + strcpy(_bundleMusicTable[i].filename, name); + _bundleMusicTable[i].offset = _scumm->fileReadDwordBE(_musicFile); + _bundleMusicTable[i].size = _scumm->fileReadDwordBE(_musicFile); + } + + return true; +} + +int32 Bundle::decompressVoiceSampleByIndex(int32 index, byte *comp_final) +{ + int32 i, tag, num, final_size, output_size; + byte *comp_input, *comp_output; + + if (_voiceFile == NULL) { + printf("Bundle: voice file is not open !\n"); + return 0; + } + + _scumm->fileSeek(_voiceFile, _bundleVoiceTable[index].offset, SEEK_SET); + tag = _scumm->fileReadDwordBE(_voiceFile); + num = _scumm->fileReadDwordBE(_voiceFile); + _scumm->fileReadDwordBE(_voiceFile); + _scumm->fileReadDwordBE(_voiceFile); + + if (tag != MKID_BE('COMP')) { + warning("Bundle: Compressed sound %d invalid (%c%c%c%c)", index, tag >> 24, tag >> 16, tag >> 8, + tag); + return 0; + } + + for (i = 0; i < num; i++) { + _compVoiceTable[i].offset = _scumm->fileReadDwordBE(_voiceFile); + _compVoiceTable[i].size = _scumm->fileReadDwordBE(_voiceFile); + _compVoiceTable[i].codec = _scumm->fileReadDwordBE(_voiceFile); + _scumm->fileReadDwordBE(_voiceFile); + } + + final_size = 0; + + comp_output = (byte *)malloc(10000); + for (i = 0; i < num; i++) { + comp_input = (byte *)malloc(_compVoiceTable[i].size); + + _scumm->fileSeek(_voiceFile, _bundleVoiceTable[index].offset + _compVoiceTable[i].offset, SEEK_SET); + _scumm->fileRead(_voiceFile, comp_input, _compVoiceTable[i].size); + + output_size = + decompressCodec(_compVoiceTable[i].codec, comp_input, comp_output, _compVoiceTable[i].size); + memcpy((byte *)&comp_final[final_size], comp_output, output_size); + final_size += output_size; + + free(comp_input); + } + free(comp_output); + + return final_size; +} + +int32 Bundle::decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final) +{ + int32 i, tag, num, final_size; + byte *comp_input; + + if (_musicFile == NULL) { + printf("Bundle: music file is not open !\n"); + return 0; + } + + if (_lastSong != index) { + _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset, SEEK_SET); + tag = _scumm->fileReadDwordBE(_musicFile); + num = _scumm->fileReadDwordBE(_musicFile); + _scumm->fileReadDwordBE(_musicFile); + _scumm->fileReadDwordBE(_musicFile); + + if (tag != MKID_BE('COMP')) { + warning("Bundle: Compressed sound %d invalid (%c%c%c%c)", index, tag >> 24, tag >> 16, tag >> 8, + tag); + return 0; + } + + for (i = 0; i < num; i++) { + _compMusicTable[i].offset = _scumm->fileReadDwordBE(_musicFile); + _compMusicTable[i].size = _scumm->fileReadDwordBE(_musicFile); + _compMusicTable[i].codec = _scumm->fileReadDwordBE(_musicFile); + _scumm->fileReadDwordBE(_musicFile); + } + } + + comp_input = (byte *)malloc(_compMusicTable[number].size); + + _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset + _compMusicTable[number].offset, + SEEK_SET); + _scumm->fileRead(_musicFile, comp_input, _compMusicTable[number].size); + final_size = + decompressCodec(_compMusicTable[number].codec, comp_input, comp_final, _compMusicTable[number].size); + + free(comp_input); + + _lastSong = index; + + return final_size; +} + + +int32 Bundle::decompressVoiceSampleByName(char *name, byte *comp_final) +{ + int32 final_size = 0, i; + + if (_voiceFile == NULL) { + printf("Bundle: voice file is not open !\n"); + return 0; + } + + for (i = 0; i < _numVoiceFiles; i++) { + if (!scumm_stricmp(name, _bundleVoiceTable[i].filename)) { + final_size = decompressVoiceSampleByIndex(i, comp_final); + return final_size; + } + } + return final_size; +} + +int32 Bundle::decompressMusicSampleByName(char *name, int32 number, byte *comp_final) +{ + int32 final_size = 0, i; + + if (_voiceFile == NULL) { + printf("Bundle: voice file is not open !\n"); + return 0; + } + + for (i = 0; i < _numMusicFiles; i++) { + if (!scumm_stricmp(name, _bundleMusicTable[i].filename)) { + final_size = decompressMusicSampleByIndex(i, number, comp_final); + return final_size; + } + } + return final_size; +} + +int32 Bundle::getNumberOfMusicSamplesByIndex(int32 index) +{ + if (_musicFile == NULL) { + printf("Bundle: music file is not open !\n"); + return 0; + } + + _scumm->fileSeek(_musicFile, _bundleMusicTable[index].offset, SEEK_SET); + _scumm->fileReadDwordBE(_musicFile); + return _scumm->fileReadDwordBE(_musicFile); +} + +int32 Bundle::getNumberOfMusicSamplesByName(char *name) +{ + int32 number = 0, i; + + if (_musicFile == NULL) { + printf("Bundle: music file is not open !\n"); + return 0; + } + + for (i = 0; i < _numMusicFiles; i++) { + if (!scumm_stricmp(name, _bundleMusicTable[i].filename)) { + number = getNumberOfMusicSamplesByIndex(i); + return number; + } + } + return number; +} + +#define NextBit bit = mask & 1; mask >>= 1; if (!--bitsleft) {mask = READ_LE_UINT16(srcptr); srcptr += 2; bitsleft=16;} + +int32 Bundle::compDecode(byte *src, byte *dst) +{ + byte *result, *srcptr = src, *dstptr = dst; + int data, size, bit, bitsleft = 16, mask = READ_LE_UINT16(srcptr); + srcptr += 2; + + while (1) { + NextBit if (bit) { + *dstptr++ = *srcptr++; + } else { + NextBit if (!bit) { + NextBit size = bit << 1; + NextBit size = (size | bit) + 3; + data = *srcptr++ | 0xffffff00; + } else { + data = *srcptr++; + size = *srcptr++; + + data |= 0xfffff000 + ((size & 0xf0) << 4); + size = (size & 0x0f) + 3; + + if (size == 3) + if (((*srcptr++) + 1) == 1) + return dstptr - dst; + } + result = dstptr + data; + while (size--) + *dstptr++ = *result++; + } + } +} +#undef NextBit + +int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 input_size) +{ + int32 output_size = input_size; + int32 offset1, offset2, offset3, length, k, c, s, j, r, t, z; + byte *src, *t_table, *p, *ptr; + byte t_tmp1, t_tmp2; + + switch (codec) { + case 0: + memcpy(comp_output, comp_input, output_size); + break; + + case 1: + output_size = compDecode(comp_input, comp_output); + break; + + case 2: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + break; + + case 3: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + break; + + case 4: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memset(t_table, 0, output_size); + + src = comp_output; + length = (output_size * 8) / 12; + k = 0; + if (length > 0) { + c = -12; + s = 0; + j = 0; + do { + ptr = src + length + (k / 2); + if (k & 1) { + r = c / 8; + *(t_table + r + 2) = ((*(src + j) & 0x0f) << 4) | ((*(ptr + 1) & 0xf0) >> 4); + *(t_table + r + 1) = (*(src + j) & 0xf0) | (*(t_table + r + 1)); + } else { + r = s / 8; + *(t_table + r + 0) = ((*(src + j) & 0x0f) << 4) | (*ptr & 0x0f); + *(t_table + r + 1) = (*(src + j) & 0xf0) >> 4; + } + s += 12; + k++; + j++; + c += 12; + } while (k < length); + } + offset1 = ((length - 1) * 3) / 2; + *(t_table + offset1 + 1) = (*(t_table + offset1 + 1)) | *(src + length - 1) & 0xf0; + memcpy(src, t_table, output_size); + free(t_table); + break; + + case 5: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memset(t_table, 0, output_size); + + src = comp_output; + length = (output_size * 8) / 12; + k = 1; + c = 0; + s = 12; + *t_table = (*(src + length)) >> 4; + t = length + k; + j = 1; + if (t > k) { + do { + ptr = src + length + (k / 2); + if (k & 1) { + r = c / 8; + *(t_table + r + 0) = (*(src + j - 1) & 0xf0) | (*(t_table + r)); + *(t_table + r + 1) = ((*(src + j - 1) & 0x0f) << 4) | (*ptr & 0x0f); + } else { + r = s / 8; + *(t_table + r + 0) = (*(src + j - 1) & 0xf0) >> 4; + *(t_table + r - 1) = ((*(src + j - 1) & 0x0f) << 4) | ((*ptr & 0xf0) >> 4); + } + s += 12; + k++; + j++; + c += 12; + } while (k < t); + } + memcpy(src, t_table, output_size); + free(t_table); + break; + + case 6: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memset(t_table, 0, output_size); + + src = comp_output; + length = (output_size * 8) / 12; + k = 0; + c = 0; + j = 0; + s = -12; + *t_table = *(output_size + src - 1); + *(t_table + output_size - 1) = *(src + length - 1); + t = length - 1; + if (t > 0) { + do { + ptr = src + length + (k / 2); + if (k & 1) { + r = s / 8; + *(t_table + r + 2) = (*(src + j) & 0xf0) | *(t_table + r + 2); + *(t_table + r + 3) = ((*(src + j) & 0x0f) << 4) | ((*ptr & 0xf0) >> 4); + } else { + r = c / 8; + *(t_table + r + 2) = (*(src + j) & 0xf0) >> 4; + *(t_table + r + 1) = ((*(src + j) & 0x0f) << 4) | (*ptr & 0x0f); + } + s += 12; + k++; + j++; + c += 12; + } while (k < t); + } + memcpy(src, t_table, output_size); + free(t_table); + break; + + case 10: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memcpy(t_table, p, output_size); + + offset1 = output_size / 3; + offset2 = offset1 * 2; + offset3 = offset2; + src = comp_output; + do { + if (offset1 == 0) + break; + offset1--; + offset2 -= 2; + offset3--; + *(t_table + offset2 + 0) = *(src + offset1); + *(t_table + offset2 + 1) = *(src + offset3); + } while (1); + + src = comp_output; + length = (output_size * 8) / 12; + k = 0; + if (length > 0) { + c = -12; + s = 0; + do { + j = length + (k / 2); + if (k & 1) { + r = c / 8; + t_tmp1 = *(t_table + k); + t_tmp2 = *(t_table + j + 1); + *(src + r + 2) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); + *(src + r + 1) = (*(src + r + 1)) | (t_tmp1 & 0xf0); + } else { + r = s / 8; + t_tmp1 = *(t_table + k); + t_tmp2 = *(t_table + j); + *(src + r + 0) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); + *(src + r + 1) = ((t_tmp1 & 0xf0) >> 4); + } + s += 12; + k++; + c += 12; + } while (k < length); + } + offset1 = ((length - 1) * 3) / 2; + *(src + offset1 + 1) = (*(t_table + length) & 0xf0) | *(src + offset1 + 1); + free(t_table); + break; + + case 11: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memcpy(t_table, p, output_size); + + offset1 = output_size / 3; + offset2 = offset1 * 2; + offset3 = offset2; + src = comp_output; + do { + if (offset1 == 0) + break; + offset1--; + offset2 -= 2; + offset3--; + *(t_table + offset2 + 0) = *(src + offset1); + *(t_table + offset2 + 1) = *(src + offset3); + } while (1); + + src = comp_output; + length = (output_size * 8) / 12; + k = 1; + c = 0; + s = 12; + t_tmp1 = (*(t_table + length)) >> 4; + *(src) = t_tmp1; + t = length + k; + if (t > k) { + do { + j = length + (k / 2); + if (k & 1) { + r = c / 8; + t_tmp1 = *(t_table + k - 1); + t_tmp2 = *(t_table + j); + *(src + r + 0) = (*(src + r)) | (t_tmp1 & 0xf0); + *(src + r + 1) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); + } else { + r = s / 8; + t_tmp1 = *(t_table + k - 1); + t_tmp2 = *(t_table + j); + *(src + r + 0) = (t_tmp1 & 0xf0) >> 4; + *(src + r - 1) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); + } + s += 12; + k++; + c += 12; + } while (k < t); + } + free(t_table); + break; + + case 12: + output_size = compDecode(comp_input, comp_output); + p = comp_output; + for (z = 2; z < output_size; z++) + p[z] += p[z - 1]; + for (z = 1; z < output_size; z++) + p[z] += p[z - 1]; + + t_table = (byte *)malloc(output_size); + memcpy(t_table, p, output_size); + + offset1 = output_size / 3; + offset2 = offset1 * 2; + offset3 = offset2; + src = comp_output; + do { + if (offset1 == 0) + break; + offset1--; + offset2 -= 2; + offset3--; + *(t_table + offset2 + 0) = *(src + offset1); + *(t_table + offset2 + 1) = *(src + offset3); + } while (1); + + src = comp_output; + length = (output_size * 8) / 12; + k = 0; + c = 0; + s = -12; + *(src) = *(output_size + t_table - 1); + *(src + output_size - 1) = *(t_table + length - 1); + t = length - 1; + if (t > 0) { + do { + j = length + (k / 2); + if (k & 1) { + r = s / 8; + t_tmp1 = *(t_table + k); + t_tmp2 = *(t_table + j); + *(src + r + 2) = (*(src + r + 2)) | (t_tmp1 & 0xf0); + *(src + r + 3) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4); + } else { + r = c / 8; + t_tmp1 = *(t_table + k); + t_tmp2 = *(t_table + j); + *(src + r + 2) = (t_tmp1 & 0xf0) >> 4; + *(src + r + 1) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f); + } + s += 12; + k++; + c += 12; + } while (k < t); + } + free(t_table); + break; + + default: + printf("Bundle: Unknown codec %d!\n", (int)codec); + output_size = 0; + break; + } + + return output_size; +} diff --git a/scumm/bundle.h b/scumm/bundle.h new file mode 100644 index 0000000000..c95cc853cd --- /dev/null +++ b/scumm/bundle.h @@ -0,0 +1,71 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef BUNDLE_H +#define BUNDLE_H + +#include "scummsys.h" + +class Scumm; + +class Bundle { + +private: + +struct CompTable { + int32 offset; + int32 size; + int32 codec; +}; + +struct BundleAudioTable { + char filename[13]; + int32 size; + int32 offset; +}; + + int32 compDecode(byte *src, byte *dst); + int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size); + CompTable _compVoiceTable[50]; + CompTable _compMusicTable[2500]; + FILE *_voiceFile; + FILE *_musicFile; + BundleAudioTable *_bundleVoiceTable; + BundleAudioTable *_bundleMusicTable; + int32 _numVoiceFiles; + int32 _numMusicFiles; + Scumm *_scumm; + int32 _lastSong; + +public: + Bundle(Scumm *parent); + ~Bundle(); + + bool openVoiceFile(char *filename); + bool openMusicFile(char *filename); + int32 decompressVoiceSampleByName(char *name, byte *comp_final); + int32 decompressVoiceSampleByIndex(int32 index, byte *comp_final); + int32 decompressMusicSampleByName(char *name, int32 number, byte *comp_final); + int32 decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final); + int32 getNumberOfMusicSamplesByIndex(int32 index); + int32 getNumberOfMusicSamplesByName(char *name); +}; + +#endif diff --git a/scumm/costume.cpp b/scumm/costume.cpp new file mode 100644 index 0000000000..1996613929 --- /dev/null +++ b/scumm/costume.cpp @@ -0,0 +1,1447 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "costume.h" + +const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; + +void CostumeRenderer::ignorePakCols(int a) +{ + int n; + + n = _height; + if (a > 1) + n *= a; + + do { + _repcolor = *_srcptr++; + _replen = _repcolor & _maskval; + if (_replen == 0) { + _replen = *_srcptr++; + } + do { + if (!--n) { + _repcolor >>= _shrval; + return; + } + } while (--_replen); + } while (1); +} + +const byte cost_scaleTable[256] = { + 255, 253, 125, 189, 61, 221, 93, 157, 29, 237, + 109, 173, 45, 205, 77, 141, 13, 245, 117, 181, + 53, 213, 85, 149, 21, 229, 101, 165, 37, 197, 69, + 133, 5, 249, 121, 185, 57, 217, 89, 153, 25, 233, + 105, 169, 41, 201, 73, 137, 9, 241, 113, 177, 49, + 209, 81, 145, 17, 225, 97, 161, 33, 193, 65, 129, + 1, 251, 123, 187, 59, 219, 91, 155, 27, 235, 107, + 171, 43, 203, 75, 139, 11, 243, 115, 179, 51, 211, + 83, 147, 19, 227, 99, 163, 35, 195, 67, 131, 3, + 247, 119, 183, 55, 215, 87, 151, 23, 231, 103, + 167, 39, 199, 71, 135, 7, 239, 111, 175, 47, 207, + 79, 143, 15, 223, 95, 159, 31, 191, 63, 127, 0, + 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, + 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, + 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, + 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, + 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, + 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, + 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, + 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, + 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, + 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, + 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, + 238, 30, 158, 94, 222, 62, 190, 126, 254 +}; + +byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame) +{ + int xmove, ymove, i, b, s; + uint scal; + byte scaling; + byte charsetmask, masking; + byte unk19; + byte newAmiCost; + int ex1, ex2; + + newAmiCost = (_vm->_gameId == GID_MONKEY2 || _vm->_gameId == GID_INDY4) && (_vm->_features & GF_AMIGA); + + CHECK_HEAP _maskval = 0xF; + _shrval = 4; + if (_loaded._numColors == 32) { + _maskval = 7; + _shrval = 3; + } + + _width2 = _srcptr[0]; + _width = _width2; + _height2 = _srcptr[2]; + _height = _height2; + xmove = (int16)READ_LE_UINT16(_srcptr + 4) + _xmove; + ymove = (int16)READ_LE_UINT16(_srcptr + 6) + _ymove; + _xmove += (int16)READ_LE_UINT16(_srcptr + 8); + _ymove -= (int16)READ_LE_UINT16(_srcptr + 10); + _srcptr += 12; + + switch (_loaded._ptr[7] & 0x7F) { + case 0x60: + case 0x61: + ex1 = _srcptr[0]; + ex2 = _srcptr[1]; + _srcptr += 2; + if (ex1 != 0xFF || ex2 != 0xFF) { + ex1 = READ_LE_UINT16(_loaded._ptr + _loaded._numColors + 10 + ex1 * 2); + _srcptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + ex1 + ex2 * 2) + 14; + } + } + + _xpos = _actorX; + _ypos = _actorY; + + scaling = _scaleX == 255 && _scaleY == 255 ? 0 : 1; + s = 0; + + if (scaling) { + _scaleIndexXStep = -1; + if (xmove < 0) { + xmove = -xmove; + _scaleIndexXStep = 1; + } + + if (_mirror) { + unk19 = _scaleIndexX = 128 - xmove; + for (i = 0; i < xmove; i++) { + scal = cost_scaleTable[_scaleIndexX++]; + if (scal < _scaleX) + _xpos -= _scaleIndexXStep; + } + _right = _left = _xpos; + _scaleIndexX = unk19; + for (i = 0; i < _width; i++) { + if (_right < 0) { + s++; + unk19 = _scaleIndexX; + } + scal = cost_scaleTable[_scaleIndexX++]; + if (scal < _scaleX) + _right++; + } + } else { + unk19 = _scaleIndexX = xmove + 128; + for (i = 0; i < xmove; i++) { + scal = cost_scaleTable[_scaleIndexX--]; + if (scal < _scaleX) + _xpos += _scaleIndexXStep; + } + _right = _left = _xpos; + _scaleIndexX = unk19; + for (i = 0; i < _width; i++) { + if (_left > 319) { + s++; + unk19 = _scaleIndexX; + } + scal = cost_scaleTable[_scaleIndexX--]; + if (scal < _scaleX) + _left--; + } + } + _scaleIndexX = unk19; + if (s) + s--; + _scaleIndexYStep = -1; + if (ymove < 0) { + ymove = -ymove; + _scaleIndexYStep = 1; + } + _scaleIndexY = 128 - ymove; + for (i = 0; i < ymove; i++) { + scal = cost_scaleTable[_scaleIndexY++]; + if (scal < _scaleY) + _ypos -= _scaleIndexYStep; + } + _top = _bottom = _ypos; + _scaleIndexY = 128 - ymove; + for (i = 0; i < _height; i++) { + scal = cost_scaleTable[_scaleIndexY++]; + if (scal < _scaleY) + _bottom++; + } + _scaleIndexY = _scaleIndexYTop = 128 - ymove; + } else { + if (_mirror == 0) + xmove = -xmove; + _xpos += xmove; + _ypos += ymove; + if (_mirror) { + _left = _xpos; + _right = _xpos + _width; + } else { + _left = _xpos - _width; + _right = _xpos; + } + _top = _ypos; + _bottom = _top + _height; + } + + _scaleIndexXStep = -1; + if (_mirror) + _scaleIndexXStep = 1; + _ypostop = _ypos; + + _vm->updateDirtyRect(0, _left, _right + 1, _top, _bottom, 1 << a->number); + + if (_top >= (int)_outheight || _bottom <= 0) + return 0; + + _ypitch = _height * 320; + _docontinue = 0; + b = 1; + if (_left > 319 || _right <= 0) + return 1; + if (_mirror) { + _ypitch--; + if (scaling == 0) { + s = -_xpos; + } + if (s > 0) { + if (!newAmiCost) { + _width2 -= s; + ignorePakCols(s); + _xpos = 0; + _docontinue = 1; + } + } else { + s = _right - 320; + if (s <= 0) { + b = 2; + } else { + _width2 -= s; + } + } + } else { + _ypitch++; + if (scaling == 0) + s = _right - 320; + if (s > 0) { + if (!newAmiCost) { + _width2 -= s; + ignorePakCols(s); + _xpos = 319; + _docontinue = 1; + } + } else { + s = -1 - _left; + if (s <= 0) + b = 2; + else + _width2 -= s; + } + } + + if (_width2 == 0) + return 0; + + if ((uint) _top > (uint) _outheight) + _top = 0; + + if (_left < 0) + _left = 0; + + if ((uint) _bottom > _outheight) + _bottom = _outheight; + + if (a->top > _top) + a->top = _top; + + if (a->bottom < _bottom) + a->bottom = _bottom; + + if (_height2 + _top >= 256) { + CHECK_HEAP return 2; + } + + _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos; + _backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos; + charsetmask = + _vm->hasCharsetMask(_left, _top + _vm->virtscr[0].topline, _right, + _vm->virtscr[0].topline + _bottom); + masking = 0; + + if (_vm->_features & GF_SMALL_HEADER) + masking = (_zbuf != 0); + else + masking = + _vm->isMaskActiveAt(_left, _top, _right, _bottom, + _vm->getResourceAddress(rtBuffer, 9) + + _vm->gdi._imgBufOffs[_zbuf] + + _vm->_screenStartStrip); + + if (masking || charsetmask) { + _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + _ypos * 40 + _vm->_screenStartStrip; + _imgbufoffs = _vm->gdi._imgBufOffs[_zbuf]; + if (!charsetmask && _zbuf != 0) + _mask_ptr += _imgbufoffs; + _mask_ptr_dest = _mask_ptr + _xpos / 8; + } + + CHECK_HEAP if (a->shadow_mode) { + proc_special(a, (masking << 1) + charsetmask); + return b; + } + + switch ((newAmiCost << 3) | (scaling << 2) | (masking << 1) | charsetmask) { + case 0: + proc6(); // no scaling, no masking, no charsetmask + break; + case 1: + case 2: + proc5(); // no scaling, masking or charsetmask + break; + case 3: + proc4(); // no scaling, masking and charsetmask + break; + case 4: + proc1(); // scaling, no masking, no charsetmask + break; + case 5: + case 6: + proc2(); // scaling, masking or charsetmask + break; + case 7: + proc3(); // scaling, masking and charsetmask + break; + case 8: + proc6_ami(); // no scaling, no masking, no charsetmask (Amiga) + break; + case 9: + case 10: + proc5_ami(); // no scaling, masking or charsetmask (Amiga) + break; + case 11: + proc4_ami(); // no scaling, masking and charsetmask (Amiga) + break; + case 12: + proc1_ami(); // scaling, no masking, no charsetmask (Amiga) + break; + case 13: + case 14: + proc2_ami(); // scaling, masking or charsetmask (Amiga) + break; + case 15: + proc3_ami(); // scaling, masking and charsetmask (Amiga) + break; + } + + CHECK_HEAP return b; +} + +void CostumeRenderer::proc6() +{ + byte *src, *dst; + byte len, height, pcolor, width; + uint y; + int color; + uint scrheight; + + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + scrheight = _outheight; + width = _width2; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && y < scrheight) { + pcolor = _palette[color]; + if (pcolor == 13) { + pcolor = _shadow_table[*dst]; + } + *dst = pcolor; + } + + dst += 320; + y++; + if (!--height) { + if (!--width) + return; + height = _height; + dst -= _ypitch; + y = _ypostop; + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc5() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor; + uint y, scrheight; + int color; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + scrheight = _outheight; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && y < scrheight && !(*mask & maskbit)) { + pcolor = _palette[color]; + if (pcolor == 13) + pcolor = _shadow_table[*dst]; + *dst = pcolor; + } + dst += 320; + y++; + mask += 40; + if (!--height) { + if (!--_width2) + return; + height = _height; + dst -= _ypitch; + y = _ypostop; + if (_scaleIndexXStep != 1) { + maskbit <<= 1; + if (!maskbit) { + maskbit = 1; + _mask_ptr--; + } + } else { + maskbit >>= 1; + if (!maskbit) { + maskbit = 0x80; + _mask_ptr++; + } + } + mask = _mask_ptr; + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc4() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor; + uint y, scrheight; + int color; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + scrheight = _outheight; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && y < scrheight && !((*mask | mask[_imgbufoffs]) & maskbit)) { + pcolor = _palette[color]; + if (pcolor == 13) + pcolor = _shadow_table[*dst]; + *dst = pcolor; + } + dst += 320; + y++; + mask += 40; + if (!--height) { + if (!--_width2) + return; + height = _height; + dst -= _ypitch; + y = _ypostop; + if (_scaleIndexXStep != 1) { + maskbit <<= 1; + if (!maskbit) { + maskbit = 1; + _mask_ptr--; + } + } else { + maskbit >>= 1; + if (!maskbit) { + maskbit = 0x80; + _mask_ptr++; + } + } + mask = _mask_ptr; + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc3() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor, width; + int color, t; + uint y; + + mask = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + width = _width2; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (cost_scaleTable[_scaleIndexY++] < _scaleY) { + if (color && y < _outheight && !((*mask | mask[_imgbufoffs]) & maskbit)) { + pcolor = _palette[color]; + if (pcolor == 13) + pcolor = _shadow_table[*dst]; + *dst = pcolor; + } + dst += 320; + mask += 40; + y++; + } + if (!--height) { + if (!--width) + return; + height = _height; + y = _ypostop; + _scaleIndexY = _scaleIndexYTop; + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + if (_xpos >= 320) + return; + maskbit = revBitMask[_xpos & 7]; + _backbuff_ptr += _scaleIndexXStep; + } + dst = _backbuff_ptr; + mask = _mask_ptr + (_xpos >> 3); + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc2() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor, width; + int color, t; + uint y; + + mask = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + width = _width2; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (cost_scaleTable[_scaleIndexY++] < _scaleY) { + if (color && y < _outheight && !(*mask & maskbit)) { + pcolor = _palette[color]; + if (pcolor == 13) + pcolor = _shadow_table[*dst]; + *dst = pcolor; + } + dst += 320; + mask += 40; + y++; + } + if (!--height) { + if (!--width) + return; + height = _height; + y = _ypostop; + _scaleIndexY = _scaleIndexYTop; + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + if (_xpos >= 320) + return; + maskbit = revBitMask[_xpos & 7]; + _backbuff_ptr += _scaleIndexXStep; + } + dst = _backbuff_ptr; + mask = _mask_ptr + (_xpos >> 3); + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc1() +{ + byte *mask, *src, *dst, *dstorg; + byte maskbit, len, height, pcolor, width; + int color, t; + uint y; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + src = _srcptr; + dstorg = dst = _backbuff_ptr; + len = _replen; + color = _repcolor; + height = _height2; + width = _width2; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (cost_scaleTable[_scaleIndexY++] < _scaleY) { + if (color && y < _outheight) { + pcolor = _palette[color]; + if (pcolor == 13) + pcolor = _shadow_table[*dst]; + *dst = pcolor; + } + dst += 320; + y++; + } + if (!--height) { + if (!--width) + return; + height = _height; + y = _ypostop; + _scaleIndexY = _scaleIndexYTop; + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + if (_xpos >= 320) + return; + _backbuff_ptr += _scaleIndexXStep; + } + dst = _backbuff_ptr; + } + StartPos:; + } while (--len); + } while (1); +} + +void CostumeRenderer::proc6_ami() +{ + byte len; + byte *src, *dst; + byte width, height, pcolor; + int color; + int step = _scaleIndexXStep; + uint x; + uint y; + uint scrheight; + + x = _xpos; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + scrheight = _outheight; + width = _width; + height = _height2; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && x >= 0 && x < 320) { + pcolor = _palette[color]; +/* if (pcolor == 13) { + pcolor = _shadow_table[*dst]; + }*/ + *dst = pcolor; + } + + dst += step; + x += step; + if (!--width) { + if (!--height) + return; + width = _width; + dst += 320-step*_width; + x = _xpos; + y++; + if (y >= scrheight) + return; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc5_ami() +{ + byte *mask, *src, *dst; + byte maskbit, len, width, height, pcolor; + uint y, scrheight; + int color, x; + int step = _scaleIndexXStep; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + x = _xpos; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + scrheight = _outheight; + width = _width; + height = _height2; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && x >=0 && x < 320 && !(*mask & maskbit)) { + pcolor = _palette[color]; +/* if (pcolor == 13) + pcolor = _shadow_table[*dst];*/ + *dst = pcolor; + } + dst += step; + x += step; + if (step != 1) { + maskbit <<= 1; + if (!maskbit) + { + maskbit = 1; + mask--; + } + } else { + maskbit >>= 1; + if (!maskbit) + { + maskbit = 0x80; + mask++; + } + } + if (!--width) { + if (!--height) + return; + width = _width; + x = _xpos; + y++; + dst += 320-step*_width; + _mask_ptr+=40; + mask = _mask_ptr; + maskbit = revBitMask[_xpos & 7]; + if (y >= scrheight) + return; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc4_ami() +{ + byte *mask, *src, *dst; + byte maskbit, len, width, height, pcolor; + uint y, scrheight; + int color, x; + int step = _scaleIndexXStep; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + x = _xpos; + y = _ypos; + src = _srcptr; + dst = _backbuff_ptr; + scrheight = _outheight; + height = _height2; + width = _width; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (color && x >= 0 && x < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) { + pcolor = _palette[color]; +/* if (pcolor == 13) + pcolor = _shadow_table[*dst];*/ + *dst = pcolor; + } + dst += step; + x += step; + if (step != 1) { + maskbit <<= 1; + if (!maskbit) { + maskbit = 1; + mask--; + } + } else { + maskbit >>= 1; + if (!maskbit) { + maskbit = 0x80; + mask++; + } + } + if (!--width) { + if (!--height) + return; + width = _width; + y++; + x = _xpos; + dst += 320-step*_width; + _mask_ptr+= 40; + mask = _mask_ptr; + maskbit = revBitMask[_xpos & 7]; + if (y >= scrheight) + return; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc3_ami() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor, width; + int color, t; + uint y; + uint oldXpos, oldScaleIndexX; + + mask = _mask_ptr_dest; + dst = _backbuff_ptr; + height = _height2; + width = _width; + src = _srcptr; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + oldXpos = _xpos; + oldScaleIndexX = _scaleIndexX; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + do { + if (cost_scaleTable[_scaleIndexY] < _scaleY) { + if (color && _xpos >= 0 && _xpos < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) { + pcolor = _palette[color]; +/* if (pcolor == 13) + pcolor = _shadow_table[*dst];*/ + *dst = pcolor; + } + + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + dst += _scaleIndexXStep; + maskbit = revBitMask[_xpos & 7]; + } + mask = _mask_ptr + (_xpos >> 3); + } + if (!--width) { + if (!--height) + return; + + if (y >= _outheight) + return; + + if (_xpos != oldXpos) { + dst += 320-(_xpos-oldXpos); + _mask_ptr += 40; + mask = _mask_ptr; + y++; + } + width = _width; + _xpos = oldXpos; + _scaleIndexX = oldScaleIndexX; + _scaleIndexY++; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc2_ami() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor, width; + int color, t; + uint y; + uint oldXpos, oldScaleIndexX; + + mask = _mask_ptr_dest; + dst = _backbuff_ptr; + height = _height2; + width = _width; + src = _srcptr; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + + oldXpos = _xpos; + oldScaleIndexX = _scaleIndexX; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + do { + if (cost_scaleTable[_scaleIndexY] < _scaleY) { + if (color && _xpos >= 0 && _xpos < 320 && !(*mask & maskbit)) { + pcolor = _palette[color]; +/* if (pcolor == 13) + pcolor = _shadow_table[*dst];*/ + *dst = pcolor; + } + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + dst += _scaleIndexXStep; + maskbit = revBitMask[_xpos & 7]; + _backbuff_ptr += _scaleIndexXStep; + } + mask = _mask_ptr + (_xpos >> 3); + } + if (!--width) { + if (!--height) + return; + + if (y >= _outheight) + return; + + if (_xpos != oldXpos) { + dst += 320-(_xpos-oldXpos); + _mask_ptr += 40; + mask = _mask_ptr; + y++; + } + width = _width; + _xpos = oldXpos; + _scaleIndexX = oldScaleIndexX; + _scaleIndexY++; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc1_ami() +{ + byte *mask, *src, *dst; + byte maskbit, len, height, pcolor, width; + uint y; + int color; + int t, x; + uint oldXpos, oldScaleIndexX; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + x = _xpos; + y = _ypos; + + dst = _backbuff_ptr; + height = _height2; + width = _width; + src = _srcptr; + + oldXpos = _xpos; + oldScaleIndexX = _scaleIndexX; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { + if (cost_scaleTable[_scaleIndexY] < _scaleY) { + if (color && _xpos >= 0 && _xpos < 320) { + pcolor = _palette[color]; +/* if (pcolor == 13) + pcolor = _shadow_table[*dst];*/ + *dst = pcolor; + } + + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + dst += _scaleIndexXStep; + } + } + if (!--width) { + if (!--height) + return; + + if (y >= _outheight) + return; + + if (_xpos != oldXpos) { + dst += 320-(_xpos-oldXpos); + y++; + } + width = _width; + _xpos = oldXpos; + _scaleIndexX = oldScaleIndexX; + _scaleIndexY++; + } + } while (--len); + } while (1); +} + +void CostumeRenderer::proc_special(Actor *a, byte mask2) +{ + byte *mask, *src, *dst, *dstorg; + byte maskbit, len, height, pcolor, width; + uint y; + int color; + int t; + + byte shadow1; + byte shadow2; + byte shadow3; + byte shadow4; + byte shadow5; + + shadow1 = a->shadow_mode & 0x80; + shadow2 = a->shadow_mode & 0x40; + shadow3 = a->shadow_mode & 0x20; + shadow4 = a->shadow_mode & 0x10; + shadow5 = a->shadow_mode & 0x0F; + + mask = _mask_ptr = _mask_ptr_dest; + maskbit = revBitMask[_xpos & 7]; + y = _ypos; + + mask = _mask_ptr_dest; + dstorg = dst = _backbuff_ptr; + height = _height2; + width = _width2; + len = _replen; + color = _repcolor; + src = _srcptr; + + if (_mirror == 0) + shadow5 = -shadow5; + + maskbit = revBitMask[_xpos & 7]; + + dst = _backbuff_ptr; + + if (mask2 != 0 && mask2 < 3) + _imgbufoffs = 0; + + if (_docontinue) + goto StartPos; + + do { + len = *src++; + color = len >> _shrval; + len &= _maskval; + if (!len) + len = *src++; + + do { // ok + if (cost_scaleTable[_scaleIndexY++] < _scaleY) { + if (color && y < _outheight) { + if (!mask2 || (mask2 && !((*mask | mask[_imgbufoffs]) & maskbit))) { + if (shadow3 == 0) { + pcolor = _palette[color]; + if (pcolor != 13) + goto proc_special_end; + + } + if (shadow2 != 0) { + warning("proc_special: shadow2 unimplemented"); + pcolor = 0; + } else // we don't need all the random stuff, just the background copy + { + pcolor = _vm->_proc_special_palette[*dst]; + } + proc_special_end:; + *dst = pcolor; + } + } + dst += 320; + mask += 40; + y++; + } + if (!--height) { + if (!--width) + return; + height = _height; + y = _ypostop; + _scaleIndexY = _scaleIndexYTop; + t = _scaleIndexX; + _scaleIndexX = t + _scaleIndexXStep; + if (cost_scaleTable[t] < _scaleX) { + _xpos += _scaleIndexXStep; + if (_xpos >= 320) + return; + maskbit = revBitMask[_xpos & 7]; + _backbuff_ptr += _scaleIndexXStep; + } + dst = _backbuff_ptr; + mask = _mask_ptr + (_xpos >> 3); + } + StartPos:; + } while (--len); + } while (1); + +} + +void LoadedCostume::loadCostume(int id) +{ + _ptr = _vm->getResourceAddress(rtCostume, id); + + if (_vm->_features & GF_AFTER_V6) { + _ptr += 8; + } else if (!(_vm->_features & GF_SMALL_HEADER)) { + _ptr += 2; + } + + switch (_ptr[7] & 0x7F) { + case 0x58: + _numColors = 16; + break; + case 0x59: + _numColors = 32; + break; + case 0x60: /* New since version 6 */ + _numColors = 16; + break; + case 0x61: /* New since version 6 */ + _numColors = 32; + break; + default: + error("Costume %d is invalid", id); + } + + _dataptr = _ptr + READ_LE_UINT16(_ptr + _numColors + 8); +} + +byte CostumeRenderer::drawOneSlot(Actor *a, int slot) +{ + + if (!(_vm->_features & GF_AFTER_V7)) { + int i; + int code; + CostumeData *cd = &a->cost; + + if (cd->curpos[slot] == 0xFFFF || cd->stopped & (1 << slot)) + return 0; + + i = cd->curpos[slot] & 0x7FFF; + + _frameptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + _loaded._numColors + slot * 2 + 10); + + code = _loaded._dataptr[i] & 0x7F; + + _srcptr = _loaded._ptr + READ_LE_UINT16(_frameptr + code * 2); + + if (code != 0x7B) { + if (!(_vm->_features & GF_OLD256) || code < 0x79) + return mainRoutine(a, slot, code); + } + } + + return 0; + +} + +byte CostumeRenderer::drawCostume(Actor *a) +{ + int i; + byte r = 0; + + _xmove = _ymove = 0; + for (i = 0; i != 16; i++) + r |= drawOneSlot(a, i); + return r; +} + +int Scumm::cost_frameToAnim(Actor *a, int frame) +{ + return newDirToOldDir(a->facing) + frame * 4; +} + +void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) +{ + byte *p, *r; + uint mask, j; + int i; + byte extra, cmd; + byte *dataptr; + int anim; + LoadedCostume lc(this); + + lc.loadCostume(a->costume); + + anim = cost_frameToAnim(a, frame); + + p = lc._ptr; + if (anim > p[6]) { + return; + } + + r = p + READ_LE_UINT16(p + anim * 2 + lc._numColors + 42); + if (r == p) { + return; + } + + if (_features & GF_OLD256) + dataptr = p + *(p + lc._numColors + 8); + else + dataptr = p + READ_LE_UINT16(p + lc._numColors + 8); + + mask = READ_LE_UINT16(r); + r += 2; + i = 0; + do { + if (mask & 0x8000) { + if (_features & GF_OLD256) { + j = 0; + j = *(r); + r++; + if (j == 0xFF) + j = 0xFFFF; + } else { + j = READ_LE_UINT16(r); + r += 2; + } + if (usemask & 0x8000) { + if (j == 0xFFFF) { + a->cost.curpos[i] = 0xFFFF; + a->cost.start[i] = 0; + a->cost.frame[i] = frame; + } else { + extra = *r++; + cmd = dataptr[j]; + if (cmd == 0x7A) { + a->cost.stopped &= ~(1 << i); + } else if (cmd == 0x79) { + a->cost.stopped |= (1 << i); + } else { + a->cost.curpos[i] = a->cost.start[i] = j; + a->cost.end[i] = j + (extra & 0x7F); + if (extra & 0x80) + a->cost.curpos[i] |= 0x8000; + a->cost.frame[i] = frame; + } + } + } else { + if (j != 0xFFFF) + r++; + } + } + i++; + usemask <<= 1; + mask <<= 1; + } while ((uint16)mask); +} + +void CostumeRenderer::setPalette(byte *palette) +{ + int i; + byte color; + + for (i = 0; i < _loaded._numColors; i++) { + if ((_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_actor_color) || (_vm->_features & GF_AFTER_V6)) { + color = palette[i]; + if (color == 255) + color = _loaded._ptr[8 + i]; + } else { + color = (i == 12) ? 0 : 8; + } + _palette[i] = color; + } +} + +void CostumeRenderer::setFacing(uint16 facing) +{ + _mirror = newDirToOldDir(facing) != 0 || (_loaded._ptr[7] & 0x80); +} + +void CostumeRenderer::setCostume(int costume) +{ + _loaded.loadCostume(costume); +} + +byte LoadedCostume::increaseAnims(Actor *a) +{ + int i; + byte r = 0; + + for (i = 0; i != 16; i++) { + if (a->cost.curpos[i] != 0xFFFF) + r += increaseAnim(a, i); + } + return r; +} + +byte LoadedCostume::increaseAnim(Actor *a, int slot) +{ + int highflag; + int i, end; + byte code, nc; + + if (a->cost.curpos[slot] == 0xFFFF) + return 0; + + highflag = a->cost.curpos[slot] & 0x8000; + i = a->cost.curpos[slot] & 0x7FFF; + end = a->cost.end[slot]; + code = _dataptr[i] & 0x7F; + + do { + if (!highflag) { + if (i++ >= end) + i = a->cost.start[slot]; + } else { + if (i != end) + i++; + } + nc = _dataptr[i]; + + if (nc == 0x7C) { + a->cost.animCounter1++; + if (a->cost.start[slot] != end) + continue; + } else { + if (_vm->_features & GF_AFTER_V6) { + if (nc >= 0x71 && nc <= 0x78) { + _vm->_sound->addSoundToQueue2(a->sound[nc - 0x71]); + if (a->cost.start[slot] != end) + continue; + } + } else { + if (nc == 0x78) { + a->cost.animCounter2++; + if (a->cost.start[slot] != end) + continue; + } + } + } + + a->cost.curpos[slot] = i | highflag; + return (_dataptr[i] & 0x7F) != code; + } while (1); +} + +bool Scumm::isCostumeInUse(int cost) +{ + int i; + Actor *a; + + if (_roomResource != 0) + for (i = 1; i < NUM_ACTORS; i++) { + a = derefActor(i); + if (a->isInCurrentRoom() && a->costume == cost) + return true; + } + + return false; +} diff --git a/scumm/costume.h b/scumm/costume.h new file mode 100644 index 0000000000..fa7264f1c0 --- /dev/null +++ b/scumm/costume.h @@ -0,0 +1,112 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef COSTUME_H +#define COSTUME_H + + +class LoadedCostume { +protected: + Scumm *_vm; + +public: + byte *_ptr; + byte *_dataptr; + byte _numColors; + + LoadedCostume(Scumm *vm) : _vm(vm), _ptr(0), _dataptr(0), _numColors(0) {} + + void loadCostume(int id); + byte increaseAnims(Actor *a); + +protected: + byte increaseAnim(Actor *a, int slot); +}; + + +class CostumeRenderer { +protected: + Scumm *_vm; + + LoadedCostume _loaded; + +public: + byte *_shadow_table; + + byte *_frameptr; + byte *_srcptr; + byte *_bgbak_ptr, *_backbuff_ptr, *_mask_ptr, *_mask_ptr_dest; + int _actorX, _actorY; + byte _zbuf; + uint _scaleX, _scaleY; + int _xmove, _ymove; + bool _mirror; + byte _maskval; + byte _shrval; + byte _width2; + int _width; + byte _height2; + int _height; + int _xpos, _ypos; + + uint _outheight; + int _scaleIndexXStep; + int _scaleIndexYStep; + byte _scaleIndexX; /* must wrap at 256 */ + byte _scaleIndexY, _scaleIndexYTop; + int _left, _right; + int _dir2; + int _top, _bottom; + int _ypostop; + int _ypitch; + byte _docontinue; + int _imgbufoffs; + byte _repcolor; + byte _replen; + byte _palette[32]; + + void proc6(); + void proc5(); + void proc4(); + void proc3(); + void proc2(); + void proc1(); + void proc6_ami(); + void proc5_ami(); + void proc4_ami(); + void proc3_ami(); + void proc2_ami(); + void proc1_ami(); + void proc_special(Actor *a, byte mask); + byte mainRoutine(Actor *a, int slot, int frame); + void ignorePakCols(int num); + + byte drawOneSlot(Actor *a, int slot); + byte drawCostume(Actor *a); + + void setPalette(byte *palette); + void setFacing(uint16 facing); + void setCostume(int costume); + +public: + CostumeRenderer(Scumm *vm) : _vm(vm), _loaded(vm) {} +}; + +#endif diff --git a/scumm/debug.cpp b/scumm/debug.cpp new file mode 100644 index 0000000000..6957f13bf4 --- /dev/null +++ b/scumm/debug.cpp @@ -0,0 +1,485 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +/* + * Readline and command completion support by Tom Dunstan + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "debug.h" + +#ifdef HAVE_READLINE +#include "debugrl.h" +#endif + +enum { + CMD_INVALID, + CMD_HELP, + CMD_CONTINUE, + CMD_GO, + CMD_ACTOR, + CMD_SCRIPTS, + CMD_LOAD_ROOM, + CMD_DUMPBOX, + CMD_VAR, + CMD_WATCH, + CMD_QUIT +}; + +void ScummDebugger::attach(Scumm *s) +{ + if (_s) + detach(); + + _welcome = true; + _s = s; + s->_debugger = this; + + _go_amount = 1; +#ifdef HAVE_READLINE + initialize_readline(); +#endif +} + +bool ScummDebugger::do_command() +{ + switch (get_command()) { + case CMD_HELP: + printf("Debugger commands:\n" + "(a)ctor [actornum] -> show actor information\n" + "(b)ox [boxnum] -> list and draw the specified (or all) boxes\n" + "(c)ontinue -> exit the debugger and continue the program\n" + "(h)elp -> display this help text\n" + "(g)o [numframes] -> increase frame\n" + "(r)oom [roomnum] -> load room\n" + "(s)cripts -> show running scripts\n" + "(v)ariable -> set or show a variable value\n" + "(w)atch [varnum] -> set a variable watch. 0 means all variables.\n" + "(q)uit -> exit game\n"); + return true; + + case CMD_CONTINUE: + detach(); + return false; + + case CMD_GO: + if (!_parameters[0]) + _go_amount = 1; + else + _go_amount = atoi(_parameters); + return false; + case CMD_ACTOR: + if (!_parameters[0]) + printActors(-1); + else + printActors(atoi(_parameters)); + return true; + case CMD_SCRIPTS: + printScripts(); + return true; + case CMD_LOAD_ROOM: + if (!_parameters[0]) { + printf("Current room: %d [%d]\n", _s->_currentRoom, _s->_roomResource); + } else { + int room = atoi(_parameters); + _s->_actors[_s->_vars[_s->VAR_EGO]].room = room; + _s->startScene(room, 0, 0); + _s->_fullRedraw = 1; + } + return true; + case CMD_DUMPBOX: + if (!_parameters[0]) + printBoxes(); + else + printBox(atoi(_parameters)); + return true; + case CMD_VAR: + if (!_parameters[0]) { + printf("v 123 will show the value of 123, v 123 456 will set the value of 123 to 456.\n"); + } else { + char *tok = strtok(_parameters, " "); + int var = atoi(tok); + tok = strtok(NULL, ""); + if (tok) + _s->writeVar(var, atoi(tok)); + + printf("Var[%d] = %d\n", var, _s->readVar(var)); + } + return true; + + case CMD_WATCH: + if (!_parameters[0]) { + printf("Clearing all watches..\n"); + _s->_varwatch = -1; + } else { + _s->_varwatch = atoi(_parameters); + if (_s->_varwatch == 0) + printf("Watching all variables\n"); + else + printf("Watching vars[%d]\n", _s->_varwatch); + } + return true; + case CMD_QUIT: + exit(1); + + default: /* this line is never reached */ + error("Unknown debug command"); + return true; + } +} + +void ScummDebugger::enter() +{ + if (_welcome) { + _welcome = false; + printf + ("Debugging Mode entered!, please switch to this console for input.\n" + "Enter h to list all the debug commands\n"); + } + while (do_command()) { + } +} + + +void ScummDebugger::on_frame() +{ + if (_go_amount == 0) + return; + if (!--_go_amount) + enter(); +} + + +void ScummDebugger::detach() +{ + _s->_debugger = NULL; + _s = NULL; +} + +struct DebuggerCommands { + char text[8]; + byte len; + byte id; +}; + +static const DebuggerCommands debugger_commands[] = { + {"h", 1, CMD_HELP}, + {"c", 1, CMD_CONTINUE}, + {"g", 1, CMD_GO}, + {"a", 1, CMD_ACTOR}, + {"s", 1, CMD_SCRIPTS}, + {"r", 1, CMD_LOAD_ROOM}, + {"b", 1, CMD_DUMPBOX}, + {"v", 1, CMD_VAR}, + {"w", 1, CMD_WATCH}, + {"q", 1, CMD_QUIT}, + {"", 0, 0} +}; + +int ScummDebugger::get_command() +{ + const DebuggerCommands *dc; + char *s; + int i; + static char *buf; + + do { +#ifndef HAVE_READLINE + buf = _cmd_buffer; + printf("debug> "); + if (!fgets(_cmd_buffer, sizeof(_cmd_buffer), stdin)) + return CMD_CONTINUE; + + i = strlen(_cmd_buffer); + while (i > 0 && _cmd_buffer[i - 1] == 10) + _cmd_buffer[--i] = 0; + + if (i == 0) + continue; + +#else // yes we do have readline + if (buf) { + free(buf); + } + buf = readline("debug> "); + if (!buf) { + printf("\n"); + return CMD_CONTINUE; + } + if (strlen(buf) == 0) { + continue; + } + add_history(buf); +#endif + + dc = debugger_commands; + do { + if (!strncmp(buf, dc->text, dc->len)) { + for (s = buf; *s; s++) { + if (*s == 32) { + s++; + break; + } + } + _parameters = s; + return _command = dc->id; + } + } while ((++dc)->text[0]); + + for (s = buf; *s; s++) + if (*s == 32) { + *s = 0; + break; + } + printf("Invalid command '%s'. Type 'help' for a list of available commands.\n", buf); + } while (1); +} + +void ScummDebugger::printActors(int act) +{ + int i; + Actor *a; + + printf("+------------------------------------------------------------------+\n"); + printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|cls|\n"); + printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+---+\n"); + for (i = 1; i < _s->NUM_ACTORS; i++) { + if (act == -1 || act == i) { + a = &_s->_actors[i]; + if (a->visible) + printf("|%2d|%4d|%3d %3d|%4d|%3d|%5d|%3d|%3d|%2d|%5d|%5d|%3d|%3d|$%02x|\n", + a->number, a->room, a->x, a->y, a->elevation, a->costume, + a->width, a->walkbox, a->moving, a->forceClip, a->frame, + a->scalex, a->speedx, a->facing, _s->_classData[a->number]); + } + } + printf("+--------------------------------------------------------------+\n"); +} + +void ScummDebugger::printScripts() +{ + int i; + ScriptSlot *ss; + + printf("+---------------------------------+\n"); + printf("|# |num|sta|typ|un1|un2|fc|cut|un5|\n"); + printf("+--+---+---+---+---+---+--+---+---+\n"); + for (i = 0; i < 25; i++) { + ss = &_s->vm.slot[i]; + if (ss->number) { + printf("|%2d|%3d|%3d|%3d|%3d|%3d|%2d|%3d|%3d|\n", + i, ss->number, ss->status, ss->where, ss->unk1, ss->unk2, + ss->freezeCount, ss->cutsceneOverride, ss->unk5); + } + } + printf("+-------------------------------------+\n"); +} + + +void ScummDebugger::printBoxes() +{ + int num, i = 0; + byte *boxm = _s->getBoxMatrixBaseAddr(); + num = _s->getNumBoxes(); + + printf("Walk matrix:\n"); + for (i = 0; i < num; i++) { + while (*boxm != 0xFF) { + printf("[%d] ", *boxm); + boxm++; + } + boxm++; + printf("\n"); + } + + printf("\nWalk boxes:\n"); + for (i = 0; i < num; i++) + printBox(i); +} + +void ScummDebugger::printBox(int box) +{ + BoxCoords coords; + int flags = _s->getBoxFlags(box); + int mask = _s->getMaskFromBox(box); + + _s->getBoxCoordinates(box, &coords); + + // Draw the box + boxTest(box); + + // Print out coords, flags, zbuffer mask + printf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d], flags=0x%02x, mask=%d\n", + box, + coords.ul.x, coords.ul.y, coords.ll.x, coords.ll.y, + coords.ur.x, coords.ur.y, coords.lr.x, coords.lr.y, + flags, mask); +} + + +/************ ENDER: Temporary debug code for boxen **************/ +/* +int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) +*/ + +static int gfxPrimitivesCompareInt(const void *a, const void *b); + +static int *gfxPrimitivesPolyInts = NULL; +static int gfxPrimitivesPolyAllocated = 0; + + +static byte *getBasePtr(Scumm *_s, int x, int y) +{ + VirtScreen *vs = _s->findVirtScreen(y); + + if (vs == NULL) + return NULL; + + return vs->screenPtr + x + (y - vs->topline) * 320 + + _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; +} + +static void hline(Scumm *scumm, int x1, int x2, int y, byte color) +{ + byte *ptr; + + if (x2 < x1) + x2 ^= x1 ^= x2 ^= x1; // Swap x2 and x1 + + ptr = getBasePtr(scumm, x1, y); + + if (ptr == NULL) + return; + + while (x1++ <= x2) { + *ptr++ = color; + } +} + + +static void filledPolygonColor(Scumm *scumm, int16 *vx, int16 *vy, int n, int color) +{ + int i; + int y; + int miny, maxy; + int x1, y1; + int x2, y2; + int ind1, ind2; + int ints; + + /* Sanity check */ + if (n < 3) { + return; + } + + /* Allocate temp array, only grow array */ + if (!gfxPrimitivesPolyAllocated) { + gfxPrimitivesPolyInts = (int *)malloc(sizeof(int) * n); + gfxPrimitivesPolyAllocated = n; + } else { + if (gfxPrimitivesPolyAllocated < n) { + gfxPrimitivesPolyInts = (int *)realloc(gfxPrimitivesPolyInts, sizeof(int) * n); + gfxPrimitivesPolyAllocated = n; + } + } + + /* Determine Y maxima */ + miny = vy[0]; + maxy = vy[0]; + for (i = 1; (i < n); i++) { + if (vy[i] < miny) { + miny = vy[i]; + } else if (vy[i] > maxy) { + maxy = vy[i]; + } + } + + /* Draw, scanning y */ + for (y = miny; (y <= maxy); y++) { + ints = 0; + for (i = 0; (i < n); i++) { + if (!i) { + ind1 = n - 1; + ind2 = 0; + } else { + ind1 = i - 1; + ind2 = i; + } + y1 = vy[ind1]; + y2 = vy[ind2]; + if (y1 < y2) { + x1 = vx[ind1]; + x2 = vx[ind2]; + } else if (y1 > y2) { + y2 = vy[ind1]; + y1 = vy[ind2]; + x2 = vx[ind1]; + x1 = vx[ind2]; + } else { + continue; + } + if ((y >= y1) && (y < y2)) { + gfxPrimitivesPolyInts[ints++] = (y - y1) * (x2 - x1) / (y2 - y1) + x1; + } else if ((y == maxy) && (y > y1) && (y <= y2)) { + gfxPrimitivesPolyInts[ints++] = (y - y1) * (x2 - x1) / (y2 - y1) + x1; + } + } + qsort(gfxPrimitivesPolyInts, ints, sizeof(int), gfxPrimitivesCompareInt); + + for (i = 0; (i < ints); i += 2) { + hline(scumm, gfxPrimitivesPolyInts[i], gfxPrimitivesPolyInts[i + 1], y, color); + } + } + + return; +} + +static int gfxPrimitivesCompareInt(const void *a, const void *b) +{ + return (*(const int *)a) - (*(const int *)b); +} + +void ScummDebugger::boxTest(int num) +{ + BoxCoords box; + int16 rx1[4], ry1[4]; + + _s->getBoxCoordinates(num, &box); + rx1[0] = box.ul.x; + ry1[0] = box.ul.y; + rx1[1] = box.ur.x; + ry1[1] = box.ur.y; + rx1[2] = box.lr.x; + ry1[2] = box.lr.y; + rx1[3] = box.ll.x; + ry1[3] = box.ll.y; + + // TODO - maybe use different colors for each box, and/or print the box number inside it? + filledPolygonColor(_s, &rx1[0], &ry1[0], 4, 255); + + VirtScreen *vs = _s->findVirtScreen(box.ul.y); + if (vs != NULL) + _s->setVirtscreenDirty(vs, 0, 0, 320, 200); + _s->drawDirtyScreenParts(); + _s->_system->update_screen(); +} diff --git a/scumm/debug.h b/scumm/debug.h new file mode 100644 index 0000000000..4a5f8f9b4c --- /dev/null +++ b/scumm/debug.h @@ -0,0 +1,52 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef DEBUG_H +#define DEBUG_H + +class Scumm; + +struct ScummDebugger { + Scumm *_s; + byte _command; + char *_parameters; + + bool _welcome; + + int _go_amount; + + char _cmd_buffer[256]; + + void on_frame(); + bool do_command(); + void enter(); + int get_command(); + void attach(Scumm *s); + void detach(); + + void printActors(int act); + void printScripts(); + + void printBox(int box); + void printBoxes(); + void boxTest(int box); +}; + +#endif diff --git a/scumm/debugrl.cpp b/scumm/debugrl.cpp new file mode 100644 index 0000000000..8c9366a2f4 --- /dev/null +++ b/scumm/debugrl.cpp @@ -0,0 +1,87 @@ +#ifdef HAVE_READLINE + +#include "debugrl.h" + +// A lot of this was ripped straight from the readline fileman.c example. + +char *_debugger_commands[] = { + "help", + "quit", + "go", + "actor", + "scripts", + "exit", + (char *)NULL +}; + + +// forwards decls +char **scumm_debugger_completion(const char *text, int start, int end); +char *scumm_debugger_command_generator(const char *text, int state); + +void initialize_readline() +{ + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "scummvm"; + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = scumm_debugger_completion; +} + +char **scumm_debugger_completion(const char *text, int start, int end) +{ + + char **matches; + + matches = (char **)NULL; + + // If this word is at the start of the line, then it is a command + // to complete. + if (start == 0) { + matches = rl_completion_matches(text, scumm_debugger_command_generator); + } else { + // At some stage it'd be nice to have symbolic actor name completion + // or something similarly groovy. Not right now though. + } + + // This just makes sure that readline doesn't try to use its default + // completer, which uses filenames in the current dir, if we can't find + // a match, since filenames don't have much use in the debuger :) + // There's probably a nice way to do this once, rather than every time. + rl_attempted_completion_over = 1; + + return (matches); +} + + +/* Generator function for command completion. STATE lets us know whether + to start from scratch; without any state (i.e. STATE == 0), then we + start at the top of the list. */ +char *scumm_debugger_command_generator(const char *text, int state) +{ + + static int list_index, len; + char *name; + + /* If this is a new word to complete, initialize now. This includes + saving the length of TEXT for efficiency, and initializing the index + variable to 0. */ + if (!state) { + list_index = 0; + len = strlen(text); + } + + /* Return the next name which partially matches from the command list. */ + while (name = _debugger_commands[list_index]) { + list_index++; + + if (strncmp(name, text, len) == 0) + //return (dupstr(name)); + return strdup(name); + } + + /* If no names matched, then return NULL. */ + return ((char *)NULL); +} + +#endif /* HAVE_READLINE */ diff --git a/scumm/debugrl.h b/scumm/debugrl.h new file mode 100644 index 0000000000..c309ec96d8 --- /dev/null +++ b/scumm/debugrl.h @@ -0,0 +1,5 @@ +#include +#include +#include +// initializes readline with our own completer +void initialize_readline (); diff --git a/scumm/engine.cpp b/scumm/engine.cpp new file mode 100644 index 0000000000..bd416f5f70 --- /dev/null +++ b/scumm/engine.cpp @@ -0,0 +1,101 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "engine.h" +#include "gameDetector.h" +#include "config-file.h" +#include "scumm.h" +#include "simon/simon.h" +#include "sound/mixer.h" + +/* FIXME - BIG HACK for MidiEmu */ +OSystem *g_system = 0; +SoundMixer *g_mixer = 0; + +Engine::Engine(GameDetector *detector, OSystem *syst) + : _system(syst) +{ + _mixer = new SoundMixer(); + + _gameDataPath = detector->_gameDataPath; + + /* FIXME - BIG HACK for MidiEmu */ + g_system = _system; + g_mixer = _mixer; +} + +Engine::~Engine() +{ + delete _mixer; +} + +const char *Engine::getSavePath() const +{ + const char *dir = NULL; + +#ifdef _WIN32_WCE + dir = _gameDataPath; +#else + +#if !defined(MACOS_CARBON) + dir = getenv("SCUMMVM_SAVEPATH"); +#endif + + // If SCUMMVM_SAVEPATH was not specified, try to use game specific savepath from config + if (!dir || dir[0] == 0) + dir = scummcfg->get("savepath"); + + // If SCUMMVM_SAVEPATH was not specified, try to use general path from config + if (!dir || dir[0] == 0) + dir = scummcfg->get("savepath", "scummvm"); + + // If no save path was specified, use no directory prefix + if (dir == NULL) + dir = ""; +#endif + + return dir; +} + +Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) +{ + Engine *engine; + + if (detector->_gameId >= GID_SIMON_FIRST && detector->_gameId <= GID_SIMON_LAST) { + // Simon the Sorcerer + detector->_gameId -= GID_SIMON_FIRST; + engine = new SimonState(detector, syst); + } else { + // Some kind of Scumm game + if (detector->_features & GF_OLD256) + engine = new Scumm_v3(detector, syst); + else if (detector->_features & GF_SMALL_HEADER) // this force loomCD as v4 + engine = new Scumm_v4(detector, syst); + else if (detector->_features & GF_AFTER_V7) + engine = new Scumm_v7(detector, syst); + else if (detector->_features & GF_AFTER_V6) // this force SamnmaxCD as v6 + engine = new Scumm_v6(detector, syst); + else + engine = new Scumm_v5(detector, syst); + } + + return engine; +} diff --git a/scumm/engine.h b/scumm/engine.h new file mode 100644 index 0000000000..6241d70a7f --- /dev/null +++ b/scumm/engine.h @@ -0,0 +1,60 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef ENGINE_H +#define ENGINE_H + +#include "scummsys.h" +#include "system.h" + +class SoundMixer; +class GameDetector; + +/* FIXME - BIG HACK for MidiEmu */ +extern OSystem *g_system; +extern SoundMixer *g_mixer; + +class Engine { +public: + OSystem *_system; + SoundMixer *_mixer; + +protected: + char *_gameDataPath; + +public: + Engine(GameDetector *detector, OSystem *syst); + virtual ~Engine(); + + // Invoke the main engine loop using this method + virtual void go() = 0; + + // Get the save game dir path + const char *getSavePath() const; + + const char *getGameDataPath() const { return _gameDataPath; } + + // Create a new engine object based on the detector - either + // a Scumm or a SimonState object currently. + static Engine *createFromDetector(GameDetector *detector, OSystem *syst); +}; + + +#endif diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp new file mode 100644 index 0000000000..5b4e43f1cf --- /dev/null +++ b/scumm/gfx.cpp @@ -0,0 +1,2872 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "gui/gui.h" +#include "gui/newgui.h" +#include "resource.h" + +void Scumm::getGraphicsPerformance() +{ + int i; + + for (i = 10; i != 0; i--) { + initScreens(0, 0, _realWidth, _realHeight); //ender + } + + if (!(_features & GF_SMALL_HEADER)) /* FIXME TEST: Enders Zak fix */ + _vars[VAR_PERFORMANCE_1] = 0; //_scummTimer; + + for (i = 10; i != 0; i--) { + setDirtyRange(0, 0, _realHeight); //ender + drawDirtyScreenParts(); + } + + if (!(_features & GF_SMALL_HEADER)) /* FIXME TEST: Enders Zak fix */ + _vars[VAR_PERFORMANCE_2] = 0; //_scummTimer; + + if (_gameId == GID_DIG) + initScreens(0, 0, _realWidth, _realHeight); + else + initScreens(0, 16, _realWidth, 144); +} + +void Scumm::initScreens(int a, int b, int w, int h) +{ + int i; + + for (i = 0; i < 3; i++) { + nukeResource(rtBuffer, i + 1); + nukeResource(rtBuffer, i + 5); + } + + if (!getResourceAddress(rtBuffer, 4)) { + initVirtScreen(3, 0, 80, _realWidth, 13, false, false); + } + initVirtScreen(0, 0, b, _realWidth, h - b, true, true); + initVirtScreen(1, 0, 0, _realWidth, b, false, false); + initVirtScreen(2, 0, h, _realWidth, _realHeight - h, false, false); //ender + + _screenB = b; + _screenH = h; + +} + +void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, + bool fourextra) +{ + VirtScreen *vs = &virtscr[slot]; + int size; + int i; + byte *ptr; + + assert(height >= 0); + assert(slot >= 0 && slot < 4); + + vs->number = slot; + vs->unk1 = 0; + vs->width = 320; + vs->topline = top; + vs->height = height; + vs->alloctwobuffers = twobufs; + vs->scrollable = fourextra; + vs->xstart = 0; + size = vs->width * vs->height; + vs->size = size; + vs->backBuf = NULL; + + if (vs->scrollable) + size += 320 * 4; + + createResource(rtBuffer, slot + 1, size); + vs->screenPtr = getResourceAddress(rtBuffer, slot + 1); + + ptr = vs->screenPtr; + for (i = 0; i < size; i++) // reset background ? + *ptr++ = 0; + + if (twobufs) { + createResource(rtBuffer, slot + 5, size); + } + + if (slot != 3) { + setDirtyRange(slot, 0, height); + } +} + +void Scumm::setDirtyRange(int slot, int top, int bottom) +{ + int i; + VirtScreen *vs = &virtscr[slot]; + for (i = 0; i < NUM_STRIPS; i++) { + vs->tdirty[i] = top; + vs->bdirty[i] = bottom; + } +} + +/* power of 2 */ +#define NUM_SHAKE_POSITIONS 8 + +static const int8 shake_positions[NUM_SHAKE_POSITIONS] = { + 0, 1 * 2, 2 * 2, 1 * 2, 0 * 2, 2 * 2, 3 * 2, 1 * 2 +}; + +void Scumm::drawDirtyScreenParts() +{ + int i; + VirtScreen *vs; + byte *src; + + updateDirtyScreen(2); + if (_features & GF_OLD256) + updateDirtyScreen(1); + + if ((camera._last.x == camera._cur.x && camera._last.y == camera._cur.y && (_features & GF_AFTER_V7)) + || (camera._last.x == camera._cur.x)) { + updateDirtyScreen(0); + } else { + vs = &virtscr[0]; + + src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100; + _system->copy_rect(src, 320, 0, vs->topline, 320, vs->height); + + for (i = 0; i < NUM_STRIPS; i++) { + vs->tdirty[i] = (byte)vs->height; + vs->bdirty[i] = 0; + } + } + + /* Handle shaking */ + if (_shakeEnabled && !_gui->isActive() && !_newgui->isActive()) { + _shakeFrame = (_shakeFrame + 1) & (NUM_SHAKE_POSITIONS - 1); + _system->set_shake_pos(shake_positions[_shakeFrame]); + } else if (!_shakeEnabled &&_shakeFrame != 0) { + _shakeFrame = 0; + _system->set_shake_pos(shake_positions[_shakeFrame]); + } +} + +void Scumm::updateDirtyScreen(int slot) +{ + gdi.updateDirtyScreen(&virtscr[slot]); +} + +void Gdi::updateDirtyScreen(VirtScreen *vs) +{ + int i; + int start, w, top, bottom; + + if (vs->height == 0) + return; + + _readOffs = 0; + if (vs->scrollable) + _readOffs = vs->xstart; + + w = 8; + start = 0; + + for (i = 0; i < NUM_STRIPS; i++) { + bottom = vs->bdirty[i]; + + if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y)) + drawStripToScreen(vs, start, w, 0, vs->height); + else if (bottom) { + top = vs->tdirty[i]; + vs->tdirty[i] = (byte)vs->height; + vs->bdirty[i] = 0; + if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) { + w += 8; + continue; + } + if (_vm->_features & GF_AFTER_V7) + drawStripToScreen(vs, start, w, 0, vs->height); + else + drawStripToScreen(vs, start, w, top, bottom); + w = 8; + } + start = i + 1; + } +} + +void Gdi::drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b) +{ + byte *ptr; + int scrollY; + int height; + + if (b <= t) + return; + + if (t > vs->height) + t = 0; + + if (b > vs->height) + b = vs->height; + + height = b - t; + if (height > 200) + height = 200; + + scrollY = _vm->camera._cur.y - 100; + if (scrollY == -100) + scrollY = 0; + + ptr = vs->screenPtr + (t * NUM_STRIPS + x) * 8 + _readOffs + scrollY * 320; + _vm->_system->copy_rect(ptr, 320, x * 8, vs->topline + t, w, height); +} + +void blit(byte *dst, byte *src, int w, int h) +{ + assert(h > 0); + + do { + memcpy(dst, src, w); + dst += 320; + src += 320; + } while (--h); +} + +void Scumm::setCursor(int cursor) +{ + warning("setCursor(%d)", cursor); +} + +void Scumm::setCameraAt(int pos_x, int pos_y) +{ + + if (_features & GF_AFTER_V7) { + ScummPoint old; + + old = camera._cur; + + camera._cur.x = pos_x; + camera._cur.y = pos_y; + + clampCameraPos(&camera._cur); + + camera._dest = camera._cur; + + assert(camera._cur.x >= 160 && camera._cur.y >= 100); + + if ((camera._cur.x != old.x || camera._cur.y != old.y) + && _vars[VAR_SCROLL_SCRIPT]) { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + _vars[VAR_CAMERA_POS_Y] = camera._cur.y; + runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); + } + } else { + int t; + + if (camera._mode != CM_FOLLOW_ACTOR || abs(pos_x - camera._cur.x) > 160) { + camera._cur.x = pos_x; + } + camera._dest.x = pos_x; + + t = _vars[VAR_CAMERA_MIN_X]; + if (camera._cur.x < t) + camera._cur.x = t; + + t = _vars[VAR_CAMERA_MAX_X]; + if (camera._cur.x > t) + camera._cur.x = t; + + if (_vars[VAR_SCROLL_SCRIPT]) { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); + } + + if (camera._cur.x != camera._last.x && charset._hasMask) + stopTalk(); + } +} + +void Scumm::setCameraFollows(Actor *a) +{ + if (_features & GF_AFTER_V7) { + byte oldfollow = camera._follows; + int ax, ay; + + camera._follows = a->number; + + if (!a->isInCurrentRoom()) { + startScene(a->getRoom(), 0, 0); + } + + ax = abs(a->x - camera._cur.x); + ay = abs(a->y - camera._cur.y); + + if (ax > _vars[VAR_CAMERA_THRESHOLD_X] || ay > _vars[VAR_CAMERA_THRESHOLD_Y] || ax > 160 || ay > 100) { + setCameraAt(a->x, a->y); + } + + if (a->number != oldfollow) + runHook(0); + } else { + int t, i; + + camera._mode = CM_FOLLOW_ACTOR; + camera._follows = a->number; + + if (!a->isInCurrentRoom()) { + startScene(a->getRoom(), 0, 0); + camera._mode = CM_FOLLOW_ACTOR; + camera._cur.x = a->x; + setCameraAt(camera._cur.x, 0); + } + + t = (a->x >> 3); + + if (t - _screenStartStrip < camera._leftTrigger || t - _screenStartStrip > camera._rightTrigger) + setCameraAt(a->x, 0); + + for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { + if (a->isInCurrentRoom()) + a->needRedraw = true; + } + runHook(0); + } +} + +void Scumm::initBGBuffers(int height) +{ + byte *ptr; + int size, itemsize, i; + byte *room; + + if (_features & GF_AFTER_V7) { + initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1); + } + + room = getResourceAddress(rtRoom, _roomResource); + if (_features & GF_OLD256) { + // FIXME - maybe this should check for multiple planes like we do + // for GF_SMALL_HEADER already. + gdi._numZBuffer = 2; + } else if (_features & GF_SMALL_HEADER) { + +//#define DEBUG_ZPLANE_CODE + + ptr = findResourceData(MKID('SMAP'), room); +#ifdef DEBUG_ZPLANE_CODE + printf("Trying to determine room zplanes:\n"); + hexdump(ptr-6, 0x20); +#endif + + int off; + gdi._numZBuffer = 0; + off = READ_LE_UINT32(ptr); + for (i = 0; off && (i < 4); i++) { +#ifdef DEBUG_ZPLANE_CODE + printf("Plane %d\n", i); + hexdump(ptr, 0x20); +#endif + + gdi._numZBuffer++; + ptr += off; + off = READ_LE_UINT16(ptr); + } +#ifdef DEBUG_ZPLANE_CODE + printf("Real plane count = %d\n", gdi._numZBuffer); +#endif + } else { + ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room)); + gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1; + } + assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5); + + if (_features & GF_AFTER_V7) + itemsize = (virtscr[0].height + 4) * NUM_STRIPS; + else + itemsize = (_scrHeight + 4) * NUM_STRIPS; + + + size = itemsize * gdi._numZBuffer; + createResource(rtBuffer, 9, size); + + for (i = 0; i < 4; i++) + gdi._imgBufOffs[i] = i * itemsize; +} + +void Scumm::setPaletteFromPtr(byte *ptr) +{ + int i, r, g, b; + byte *dest; + int numcolor; + + if (_features & GF_SMALL_HEADER) { + if (_features & GF_OLD256) + numcolor = 256; + else + numcolor = READ_LE_UINT16(ptr + 6) / 3; + ptr += 8; + } else { + numcolor = getResourceDataSize(ptr) / 3; + } + + checkRange(256, 0, numcolor, "Too many colors (%d) in Palette"); + + dest = _currentPalette; + + for (i = 0; i < numcolor; i++) { + r = *ptr++; + g = *ptr++; + b = *ptr++; + if (i <= 15 || r < 252 || g < 252 || b < 252) { + *dest++ = r; + *dest++ = g; + *dest++ = b; + } else { + dest += 3; + } + } + + setDirtyColors(0, numcolor - 1); +} + +void Scumm::setPaletteFromRes() +{ + byte *ptr; + ptr = getResourceAddress(rtRoom, _roomResource) + _CLUT_offs; + setPaletteFromPtr(ptr); +} + + +void Scumm::setDirtyColors(int min, int max) +{ + if (_palDirtyMin > min) + _palDirtyMin = min; + if (_palDirtyMax < max) + _palDirtyMax = max; +} + +void Scumm::initCycl(byte *ptr) +{ + int j; + ColorCycle *cycl; + + memset(_colorCycle, 0, sizeof(_colorCycle)); + + while ((j = *ptr++) != 0) { + if (j < 1 || j > 16) { + error("Invalid color cycle index %d", j); + } + cycl = &_colorCycle[j - 1]; + + ptr += 2; + cycl->counter = 0; + cycl->delay = 16384 / READ_BE_UINT16_UNALIGNED(ptr); + ptr += 2; + cycl->flags = READ_BE_UINT16_UNALIGNED(ptr); + ptr += 2; + cycl->start = *ptr++; + cycl->end = *ptr++; + } +} + +void Scumm::stopCycle(int i) +{ + ColorCycle *cycl; + + checkRange(16, 0, i, "Stop Cycle %d Out Of Range"); + if (i != 0) { + _colorCycle[i - 1].delay = 0; + return; + } + + for (i = 0, cycl = _colorCycle; i < 16; i++, cycl++) + cycl->delay = 0; +} + +void Scumm::cyclePalette() +{ + ColorCycle *cycl; + int valueToAdd; + int i, num; + byte *start, *end; + byte tmp[3]; + + valueToAdd = _vars[VAR_TIMER]; + if (valueToAdd < _vars[VAR_TIMER_NEXT]) + valueToAdd = _vars[VAR_TIMER_NEXT]; + + if (!_colorCycle) // FIXME + return; + + for (i = 0, cycl = _colorCycle; i < 16; i++, cycl++) { + if (cycl->delay && (cycl->counter += valueToAdd) >= cycl->delay) { + do { + cycl->counter -= cycl->delay; + } while (cycl->delay <= cycl->counter); + + setDirtyColors(cycl->start, cycl->end); + moveMemInPalRes(cycl->start, cycl->end, cycl->flags & 2); + start = &_currentPalette[cycl->start * 3]; + end = &_currentPalette[cycl->end * 3]; + + num = cycl->end - cycl->start; + + if (!(cycl->flags & 2)) { + memmove(tmp, end, 3); + memmove(start + 3, start, num * 3); + memmove(start, tmp, 3); + } else { + memmove(tmp, start, 3); + memmove(start, start + 3, num * 3); + memmove(end, tmp, 3); + } + } + } +} + +void Scumm::moveMemInPalRes(int start, int end, byte direction) +{ + byte *startptr, *endptr; + byte *startptr2, *endptr2; + int num; + byte tmp[6]; + byte tmp2[6]; + + if (!_palManipCounter) + return; + + startptr = getResourceAddress(rtTemp, 4) + start * 6; + endptr = getResourceAddress(rtTemp, 4) + end * 6; + + startptr2 = getResourceAddress(rtTemp, 5) + start * 6; + endptr2 = getResourceAddress(rtTemp, 5) + end * 6; + + num = end - start; + + if (!endptr) { + warning("moveMemInPalRes(%d,%d): Bad end pointer\n", start, end); + return; + } + + if (!direction) { + memmove(tmp, endptr, 6); + memmove(startptr + 6, startptr, num * 6); + memmove(startptr, tmp, 6); + memmove(tmp2, endptr2, 6); + memmove(startptr2 + 6, startptr2, num * 6); + memmove(startptr2, tmp2, 6); + } else { + memmove(tmp, startptr, 6); + memmove(startptr, startptr + 6, num * 6); + memmove(endptr, tmp, 6); + memmove(tmp2, startptr2, 6); + memmove(startptr2, startptr2 + 6, num * 6); + memmove(endptr2, tmp2, 6); + } +} + +void Scumm::drawFlashlight() +{ + static byte *flashBuffer = NULL; + static int flashX, flashY, flashW, flashH; + + int i, j, offset; + int topline = virtscr[0].topline; + + // Remove the flash light first if it was previously drawn + if (_flashlightIsDrawn) { + updateDirtyRect(0, flashX<<3, (flashX+flashW)<<3, flashY, flashY+flashH, 0x80000000); + + if (flashBuffer) { + + offset = 320 - flashW*8; + i = flashH; + do { + j = flashW*2; + do { + *(uint32 *)flashBuffer = 0; + flashBuffer += 4; + } while (--j); + flashBuffer += offset; + } while (--i); + } + + _flashlightIsDrawn = false; + } + + if (_flashlightXStrips == 0 || _flashlightYStrips == 0) + return; + + // Calculate the area of the flashlight + Actor *a = a = derefActorSafe(_vars[VAR_EGO], "drawFlashlight"); + flashW = _flashlightXStrips; + flashH = _flashlightYStrips * 8; + flashX = a->x/8 - flashW/2 - _screenStartStrip; + flashY = a->y - flashH/2; + + // Clip the flashlight at the borders + if (flashX < 0) + flashX = 0; + else if (flashX > NUM_STRIPS - flashW) + flashX = NUM_STRIPS - flashW; + if (flashY < 0) + flashY = 0; + else if (flashY > virtscr[0].height - flashH) + flashY = virtscr[0].height - flashH; + + // Redraw any actors "under" the flashlight + for (i = flashX; i < flashX+flashW; i++) { + gfxUsageBits[_screenStartStrip + i] |= 0x80000000; + virtscr[0].tdirty[i] = 0; + virtscr[0].bdirty[i] = virtscr[0].height; + } + + byte *bgbak; + offset = (flashY - topline) * 320 + virtscr[0].xstart + flashX*8; + flashBuffer = virtscr[0].screenPtr + offset; + bgbak = getResourceAddress(rtBuffer, 5) + offset; + + blit(flashBuffer, bgbak, flashW*8, flashH); + + // TODO - flashlight should have round corners + + _flashlightIsDrawn = true; +} + +void Scumm::fadeIn(int effect) +{ + switch (effect) { + case 1: + case 2: + case 3: + case 4: + transitionEffect(effect - 1); + break; + case 128: + unkScreenEffect6(); + break; + case 130: + unkScreenEffect1(); + break; + case 131: + unkScreenEffect2(); + break; + case 132: + unkScreenEffect3(); + break; + case 133: + unkScreenEffect4(); + break; + case 134: + unkScreenEffect5(0); + break; + case 135: + unkScreenEffect5(1); + break; + case 129: + break; + default: + warning("Unknown screen effect, %d", effect); + } + _screenEffectFlag = true; +} + +void Scumm::fadeOut(int a) +{ + VirtScreen *vs; + + setDirtyRange(0, 0, 0); + if (!(_features & GF_AFTER_V7)) + camera._last.x = camera._cur.x; + + if (!_screenEffectFlag) + return; + _screenEffectFlag = false; + + if (a == 0) + return; + + // Fill screen 0 with black + vs = &virtscr[0]; + gdi._backbuff_ptr = vs->screenPtr + vs->xstart; + memset(gdi._backbuff_ptr, 0, vs->size); + + // Fade to black with the specified effect, if any. + switch (a) { + case 1: + case 2: + case 3: + case 4: + transitionEffect(a - 1); + break; + case 128: + unkScreenEffect6(); + break; + case 129: + // Just blit screen 0 to the display (i.e. display will be black) + setDirtyRange(0, 0, vs->height); + updateDirtyScreen(0); + break; + case 134: + unkScreenEffect5(0); + break; + case 135: + unkScreenEffect5(1); + break; + default: + warning("fadeOut: default case %d", a); + } +} + +void Scumm::redrawBGAreas() +{ + int i; + int val; + int diff; + + if (!(_features & GF_AFTER_V7)) + if (camera._cur.x != camera._last.x && charset._hasMask) + stopTalk(); + + val = 0; + + if (!_fullRedraw && _BgNeedsRedraw) { + for (i = 0; i != NUM_STRIPS; i++) { + if (gfxUsageBits[_screenStartStrip + i] & 0x80000000) { + redrawBGStrip(i, 1); + } + } + } + + if (_features & GF_AFTER_V7) { + diff = (camera._cur.x >> 3) - (camera._last.x >> 3); + if (_fullRedraw == 0 && diff == 1) { + val = 2; + redrawBGStrip(NUM_STRIPS-1, 1); + } else if (_fullRedraw == 0 && diff == -1) { + val = 1; + redrawBGStrip(0, 1); + } else if (_fullRedraw != 0 || diff != 0) { + _BgNeedsRedraw = false; + _fullRedraw = false; + redrawBGStrip(0, NUM_STRIPS); + } + } else { + if (_fullRedraw == 0 && camera._cur.x - camera._last.x == 8) { + val = 2; + redrawBGStrip(NUM_STRIPS-1, 1); + } else if (_fullRedraw == 0 && camera._cur.x - camera._last.x == -8) { + val = 1; + redrawBGStrip(0, 1); + } else if (_fullRedraw != 0 || camera._cur.x != camera._last.x) { + _BgNeedsRedraw = false; + _flashlightIsDrawn = false; + redrawBGStrip(0, NUM_STRIPS); + } + } + + drawRoomObjects(val); + _BgNeedsRedraw = false; +} + +const uint32 zplane_tags[] = { + MKID('ZP00'), + MKID('ZP01'), + MKID('ZP02'), + MKID('ZP03'), + MKID('ZP04') +}; + +void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, + int stripnr, int numstrip, byte flag) +{ + byte *smap_ptr, *where_draw_ptr; + int i; + byte *zplane_list[6]; + + int bottom; + byte twobufs; + int numzbuf; + int sx; + bool lightsOn; + + // Check whether lights are turned on or not + lightsOn = (_vm->_features & GF_AFTER_V6) || (vs->number != 0) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen); + + CHECK_HEAP; + if (_vm->_features & GF_SMALL_HEADER) + smap_ptr = _smap_ptr = ptr; + else + smap_ptr = findResource(MKID('SMAP'), ptr); + + assert(smap_ptr); + + numzbuf = _disable_zbuffer ? 0 : _numZBuffer; + + if (_vm->_features & GF_SMALL_HEADER) { + /* this is really ugly, FIXME */ + if (ptr[-2] == 'B' && ptr[-1] == 'M' && READ_LE_UINT32(ptr - 6) > (READ_LE_UINT32(ptr) + 10)) { + zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr); + // FIXME - how does GF_OLD256 encode the multiple zplanes? + if (!(_vm->_features & GF_OLD256)) + for (i = 2; i < numzbuf; i++) { + zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]); + } + } else if (ptr[-4] == 'O' && ptr[-3] == 'I' && READ_LE_UINT32(ptr - 8) > READ_LE_UINT32(ptr) + 12) { + zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr); + // FIXME - how does GF_OLD256 encode the multiple zplanes? + if (!(_vm->_features & GF_OLD256)) + for (i = 2; i < numzbuf; i++) { + zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]); + } + } else { + zplane_list[1] = 0; + } + } else { + for (i = 1; i < numzbuf; i++) { + zplane_list[i] = findResource(zplane_tags[i], ptr); + } + } + + + + bottom = y + h; + if (bottom > vs->height) { + warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", bottom, vs->height); + } + + twobufs = vs->alloctwobuffers; + + _vertStripNextInc = h * 320 - 1; + + _numLinesToProcess = h; + + do { + if (_vm->_features & GF_SMALL_HEADER) + _smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4); + else + _smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8); + + CHECK_HEAP; + sx = x; + if (vs->scrollable) + sx -= vs->xstart >> 3; + + if ((uint) sx >= NUM_STRIPS) + return; + + if (y < vs->tdirty[sx]) + vs->tdirty[sx] = y; + + if (bottom > vs->bdirty[sx]) + vs->bdirty[sx] = bottom; + + _backbuff_ptr = vs->screenPtr + (y * NUM_STRIPS + x) * 8; + if (twobufs) + _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number + 5) + (y * NUM_STRIPS + x) * 8; + else + _bgbak_ptr = _backbuff_ptr; + + _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * NUM_STRIPS + x); + + where_draw_ptr = _bgbak_ptr; + decompressBitmap(); + + CHECK_HEAP; + if (twobufs) { + _bgbak_ptr = where_draw_ptr; + + if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) { + if (flag & dbClear || !lightsOn) + clear8ColWithMasking(); + else + draw8ColWithMasking(); + } else { + if (flag & dbClear || !lightsOn) + clear8Col(); + else + blit(_backbuff_ptr, _bgbak_ptr, 8, h); + } + } + CHECK_HEAP; + if (flag & dbDrawMaskOnBoth) { + _z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8); + _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x; + if (_useOrDecompress && flag & dbAllowMaskOr) + decompressMaskImgOr(); + else + decompressMaskImg(); + } + + for (i = 1; i < numzbuf; i++) { + uint16 offs; + + if (!zplane_list[i]) + continue; + + if (_vm->_features & GF_SMALL_HEADER) + if (_vm->_features & GF_OLD256) + offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4); + else + offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2); + else + offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); + + _mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * NUM_STRIPS + x + _imgBufOffs[i]; + + if (offs) { + _z_plane_ptr = zplane_list[i] + offs; + + if (_useOrDecompress && flag & dbAllowMaskOr) + decompressMaskImgOr(); + else + decompressMaskImg(); + } else { + if (_useOrDecompress && flag & dbAllowMaskOr); /* nothing */ + else + for (int h = 0; h < _numLinesToProcess; h++) + _mask_ptr_dest[h * NUM_STRIPS] = 0; + /* needs better abstraction, FIXME */ + } + } + CHECK_HEAP; + x++; + stripnr++; + } while (--numstrip); +} + + +void Gdi::decompressBitmap() +{ + const byte decompress_table[] = { + 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x0, + }; + + _useOrDecompress = false; + + byte code = *_smap_ptr++; + assert(_numLinesToProcess); + + if (_vm->_features & GF_AMIGA) + _palette_mod = 16; + else + _palette_mod = 0; + + switch (code) { + case 1: + unkDecode7(); + break; + + case 2: + unkDecode8(); /* Ender - Zak256/Indy256 */ + break; + + case 3: + unkDecode9(); /* Ender - Zak256/Indy256 */ + break; + + case 4: + unkDecode10(); /* Ender - Zak256/Indy256 */ + break; + + case 7: + unkDecode11(); /* Ender - Zak256/Indy256 */ + break; + + case 14: + case 15: + case 16: + case 17: + case 18: + _decomp_shr = code - 10; + _decomp_mask = decompress_table[code - 10]; + unkDecode6(); + break; + + case 24: + case 25: + case 26: + case 27: + case 28: + _decomp_shr = code - 20; + _decomp_mask = decompress_table[code - 20]; + unkDecode5(); + break; + + case 34: + case 35: + case 36: + case 37: + case 38: + _useOrDecompress = true; + _decomp_shr = code - 30; + _decomp_mask = decompress_table[code - 30]; + unkDecode4(); + break; + + case 44: + case 45: + case 46: + case 47: + case 48: + _useOrDecompress = true; + _decomp_shr = code - 40; + _decomp_mask = decompress_table[code - 40]; + unkDecode2(); + break; + + case 64: + case 65: + case 66: + case 67: + case 68: + _decomp_shr = code - 60; + _decomp_mask = decompress_table[code - 60]; + unkDecode1(); + break; + + case 84: + case 85: + case 86: + case 87: + case 88: + _useOrDecompress = true; + _decomp_shr = code - 80; + _decomp_mask = decompress_table[code - 80]; + unkDecode3(); + break; + + /* New since version 6 */ + case 104: + case 105: + case 106: + case 107: + case 108: + _decomp_shr = code - 100; + _decomp_mask = decompress_table[code - 100]; + unkDecode1(); + break; + + /* New since version 6 */ + case 124: + case 125: + case 126: + case 127: + case 128: + _useOrDecompress = true; + _decomp_shr = code - 120; + _decomp_mask = decompress_table[code - 120]; + unkDecode3(); + break; + + default: + error("Gdi::decompressBitmap: default case %d", code); + } +} + +int Scumm::hasCharsetMask(int x, int y, int x2, int y2) +{ + if (!charset._hasMask || y > gdi._mask_bottom || x > gdi._mask_right || + y2 < gdi._mask_top || x2 < gdi._mask_left) + return 0; + return 1; +} + +void Gdi::draw8ColWithMasking() +{ + int height = _numLinesToProcess; + byte *mask = _mask_ptr; + byte *dst = _backbuff_ptr; + byte *src = _bgbak_ptr; + byte maskbits; + + do { + maskbits = *mask; + if (maskbits) { + if (!(maskbits & 0x80)) + dst[0] = src[0]; + if (!(maskbits & 0x40)) + dst[1] = src[1]; + if (!(maskbits & 0x20)) + dst[2] = src[2]; + if (!(maskbits & 0x10)) + dst[3] = src[3]; + if (!(maskbits & 0x08)) + dst[4] = src[4]; + if (!(maskbits & 0x04)) + dst[5] = src[5]; + if (!(maskbits & 0x02)) + dst[6] = src[6]; + if (!(maskbits & 0x01)) + dst[7] = src[7]; + } else { + ((uint32 *)dst)[0] = ((uint32 *)src)[0]; + ((uint32 *)dst)[1] = ((uint32 *)src)[1]; + } + src += 320; + dst += 320; + mask += NUM_STRIPS; + } while (--height); +} + +void Gdi::clear8ColWithMasking() +{ + int height = _numLinesToProcess; + byte *mask = _mask_ptr; + byte *dst = _backbuff_ptr; + byte maskbits; + + do { + maskbits = *mask; + if (maskbits) { + if (!(maskbits & 0x80)) + dst[0] = 0; + if (!(maskbits & 0x40)) + dst[1] = 0; + if (!(maskbits & 0x20)) + dst[2] = 0; + if (!(maskbits & 0x10)) + dst[3] = 0; + if (!(maskbits & 0x08)) + dst[4] = 0; + if (!(maskbits & 0x04)) + dst[5] = 0; + if (!(maskbits & 0x02)) + dst[6] = 0; + if (!(maskbits & 0x01)) + dst[7] = 0; + } else { + ((uint32 *)dst)[0] = 0; + ((uint32 *)dst)[1] = 0; + } + dst += 320; + mask += NUM_STRIPS; + } while (--height); +} + +void Gdi::clear8Col() +{ + int height = _numLinesToProcess; + byte *dst = _backbuff_ptr; + + do { + ((uint32 *)dst)[0] = 0; + ((uint32 *)dst)[1] = 0; + dst += 320; + } while (--height); +} + +void Gdi::decompressMaskImg() +{ + byte *src = _z_plane_ptr; + byte *dst = _mask_ptr_dest; + int height = _numLinesToProcess; + byte b, c; + + while (1) { + b = *src++; + + if (b & 0x80) { + b &= 0x7F; + c = *src++; + + do { + *dst = c; + dst += NUM_STRIPS; + if (!--height) + return; + } while (--b); + } else { + do { + *dst = *src++; + dst += NUM_STRIPS; + if (!--height) + return; + } while (--b); + } + } +} + +void Gdi::decompressMaskImgOr() +{ + byte *src = _z_plane_ptr; + byte *dst = _mask_ptr_dest; + int height = _numLinesToProcess; + byte b, c; + + while (1) { + b = *src++; + if (b & 0x80) { + b &= 0x7F; + c = *src++; + + do { + *dst |= c; + dst += NUM_STRIPS; + if (!--height) + return; + } while (--b); + } else { + do { + *dst |= *src++; + dst += NUM_STRIPS; + if (!--height) + return; + } while (--b); + } + } +} + +void Scumm::redrawBGStrip(int start, int num) +{ + int s = _screenStartStrip + start; + + assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / sizeof(gfxUsageBits[0])); + + _curVirtScreen = &virtscr[0]; + + for (int i = 0; i < num; i++) + gfxUsageBits[s + i] |= 0x80000000; + + /*if (_curVirtScreen->height < _scrHeight) { + warning("Screen Y size %d < Room height %d", + _curVirtScreen->height, + _scrHeight); + } */ + + gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs, + _curVirtScreen, s, 0, _curVirtScreen->height, s, num, 0); +} + +#define READ_BIT (cl--,bit = bits&1, bits>>=1,bit) +#define FILL_BITS if (cl <= 8) { bits |= (*src++ << cl); cl += 8;} + +void Gdi::unkDecode1() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + uint bits = *src++; + byte cl = 8; + byte bit; + byte incm, reps; + _tempNumLines = _numLinesToProcess; + + do { + _currentX = 8; + do { + FILL_BITS *dst++ = color + _palette_mod;; + + againPos:; + + if (!READ_BIT) { + } else if (READ_BIT) { + incm = (bits & 7) - 4; + cl -= 3; + bits >>= 3; + if (!incm) { + FILL_BITS reps = bits & 0xFF; + do { + if (!--_currentX) { + _currentX = 8; + dst += 312; + if (!--_tempNumLines) + return; + } + *dst++ = color + _palette_mod; + } while (--reps); + bits >>= 8; + bits |= (*src++) << (cl - 8); + goto againPos; + } else { + color += incm; + } + } else { + FILL_BITS color = bits & _decomp_mask; + cl -= _decomp_shr; + bits >>= _decomp_shr; + } + } while (--_currentX); + dst += 312; + } while (--_tempNumLines); +} + +void Gdi::unkDecode2() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + int8 inc = -1; + uint bits = *src++; + byte cl = 8; + byte bit; + + _tempNumLines = _numLinesToProcess; + + do { + _currentX = 8; + do { + FILL_BITS if (color != _transparency) + *dst = color + _palette_mod; + dst++; + if (!READ_BIT) { + } else if (!READ_BIT) { + FILL_BITS color = bits & _decomp_mask; + bits >>= _decomp_shr; + cl -= _decomp_shr; + inc = -1; + } else if (!READ_BIT) { + color += inc; + } else { + inc = -inc; + color += inc; + } + } while (--_currentX); + dst += 312; + } while (--_tempNumLines); +} + +void Gdi::unkDecode3() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + uint bits = *src++; + byte cl = 8; + byte bit; + byte incm, reps; + + _tempNumLines = _numLinesToProcess; + + do { + _currentX = 8; + do { + FILL_BITS if (color != _transparency) + *dst = color + _palette_mod; + dst++; + + againPos:; + if (!READ_BIT) { + } else if (READ_BIT) { + incm = (bits & 7) - 4; + + cl -= 3; + bits >>= 3; + if (incm) { + color += incm; + } else { + FILL_BITS reps = bits & 0xFF; + if (color == _transparency) { + do { + if (!--_currentX) { + _currentX = 8; + dst += 312; + if (!--_tempNumLines) + return; + } + dst++; + } while (--reps); + } else { + do { + if (!--_currentX) { + _currentX = 8; + dst += 312; + if (!--_tempNumLines) + return; + } + *dst++ = color + _palette_mod; + } while (--reps); + } + bits >>= 8; + bits |= (*src++) << (cl - 8); + goto againPos; + } + } else { + FILL_BITS color = bits & _decomp_mask; + cl -= _decomp_shr; + bits >>= _decomp_shr; + } + } while (--_currentX); + dst += 312; + } while (--_tempNumLines); +} + +void Gdi::unkDecode4() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + int8 inc = -1; + uint bits = *src++; + byte cl = 8; + byte bit; + + _currentX = 8; + do { + _tempNumLines = _numLinesToProcess; + do { + FILL_BITS if (color != _transparency) + *dst = color + _palette_mod; + dst += 320; + if (!READ_BIT) { + } else if (!READ_BIT) { + FILL_BITS color = bits & _decomp_mask; + bits >>= _decomp_shr; + cl -= _decomp_shr; + inc = -1; + } else if (!READ_BIT) { + color += inc; + } else { + inc = -inc; + color += inc; + } + } while (--_tempNumLines); + dst -= _vertStripNextInc; + } while (--_currentX); +} + +void Gdi::unkDecode5() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + int8 inc = -1; + uint bits = *src++; + byte cl = 8; + byte bit; + + _tempNumLines = _numLinesToProcess; + + do { + _currentX = 8; + do { + FILL_BITS *dst++ = color + _palette_mod; + if (!READ_BIT) { + } else if (!READ_BIT) { + FILL_BITS color = bits & _decomp_mask; + bits >>= _decomp_shr; + cl -= _decomp_shr; + inc = -1; + } else if (!READ_BIT) { + color += inc; + } else { + inc = -inc; + color += inc; + } + } while (--_currentX); + dst += 312; + } while (--_tempNumLines); +} + +void Gdi::unkDecode6() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + byte color = *src++; + int8 inc = -1; + uint bits = *src++; + byte cl = 8; + byte bit; + + _currentX = 8; + do { + _tempNumLines = _numLinesToProcess; + do { + FILL_BITS *dst = color + _palette_mod; + dst += 320; + if (!READ_BIT) { + } else if (!READ_BIT) { + FILL_BITS color = bits & _decomp_mask; + bits >>= _decomp_shr; + cl -= _decomp_shr; + inc = -1; + } else if (!READ_BIT) { + color += inc; + } else { + inc = -inc; + color += inc; + } + } while (--_tempNumLines); + dst -= _vertStripNextInc; + } while (--_currentX); +} + +/* Ender - Zak256/Indy256 decoders */ +#define READ_256BIT \ + if ((mask <<= 1) == 256) {buffer = *src++; mask = 1;} \ + bits = ((buffer & mask) != 0); + +#define NEXT_ROW \ + dst += 320; \ + if (--h == 0) { \ + if (!--_currentX) \ + return; \ + dst -= _vertStripNextInc; \ + h = _numLinesToProcess; \ + } + +void Gdi::unkDecode7() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + int height = _numLinesToProcess; + uint h = _numLinesToProcess; + + + if (_vm->_features & GF_OLD256) { + _currentX = 8; + for (;;) { + byte color = *src++; + *dst = color; + NEXT_ROW} + return; + } + + do { + /* Endian safe */ +#if defined(SCUMM_NEED_ALIGNMENT) + memcpy(dst, src, 8); +#else + ((uint32 *)dst)[0] = ((uint32 *)src)[0]; + ((uint32 *)dst)[1] = ((uint32 *)src)[1]; +#endif + dst += 320; + src += 8; + } while (--height); +} + +void Gdi::unkDecode8() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + uint h = _numLinesToProcess; + + _currentX = 8; + for (;;) { + uint run = (*src++) + 1; + byte color = *src++; + + do { + *dst = color; + NEXT_ROW} while (--run); + } +} + +void Gdi::unkDecode9() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + unsigned char c, bits, color, run; + int x, y, i, z; + uint buffer = 0, mask = 128; + int h = _numLinesToProcess; + x = y = i = z = run = 0; + + _currentX = 8; + for (;;) { + c = 0; + for (i = 0; i < 4; i++) { + READ_256BIT; + c += (bits << i); + } + + switch ((c >> 2)) { + case 0: + color = 0; + for (i = 0; i < 4; i++) { + READ_256BIT; + color += bits << i; + } + for (i = 0; i < ((c & 3) + 2); i++) { + *dst = (run * 16 + color); + NEXT_ROW} + break; + + case 1: + for (i = 0; i < ((c & 3) + 1); i++) { + color = 0; + for (z = 0; z < 4; z++) { + READ_256BIT; + color += bits << z; + } + *dst = (run * 16 + color); + NEXT_ROW} + break; + + case 2: + run = 0; + for (i = 0; i < 4; i++) { + READ_256BIT; + run += bits << i; + } + break; + } + } +} + +void Gdi::unkDecode10() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + int i; + unsigned char local_palette[256], numcolors = *src++; + uint h = _numLinesToProcess; + + for (i = 0; i < numcolors; i++) + local_palette[i] = *src++; + + _currentX = 8; + + for (;;) { + byte color = *src++; + if (color < numcolors) { + *dst = local_palette[color]; + NEXT_ROW} else { + uint run = color - numcolors + 1; + color = *src++; + do { + *dst = color; + NEXT_ROW} while (--run); + } + } +} + + +void Gdi::unkDecode11() +{ + byte *src = _smap_ptr; + byte *dst = _bgbak_ptr; + int bits, i; + uint buffer = 0, mask = 128; + unsigned char inc = 1, color = *src++; + + _currentX = 8; + do { + _tempNumLines = _numLinesToProcess; + do { + *dst = color; + dst += 320; + for (i = 0; i < 3; i++) { + READ_256BIT if (!bits) + break; + } + switch (i) { + case 1: + inc = -inc; + color -= inc; + break; + + case 2: + color -= inc; + break; + + case 3: + color = 0; + inc = 1; + for (i = 0; i < 8; i++) { + READ_256BIT color += bits << i; + } + break; + } + } while (--_tempNumLines); + dst -= _vertStripNextInc; + } while (--_currentX); +} + + +#undef NEXT_ROW +#undef READ_256BIT +#undef READ_BIT +#undef FILL_BITS + +void Scumm::restoreCharsetBg() +{ + _bkColor = 0; + + if (gdi._mask_left != -1) { + restoreBG(gdi._mask_left, gdi._mask_top, gdi._mask_right, gdi._mask_bottom); + charset._hasMask = false; + gdi._mask_left = -1; + charset._strLeft = -1; + charset._left = -1; + } + + charset._xpos2 = string[0].xpos; + charset._ypos2 = string[0].ypos; +} + +void Scumm::restoreBG(int left, int top, int right, int bottom) +{ + VirtScreen *vs; + int topline, height, width, widthmod; + byte *backbuff, *bgbak, *mask; + + if (left == right || top == bottom) + return; + if (top < 0) + top = 0; + + if ((vs = findVirtScreen(top)) == NULL) + return; + + topline = vs->topline; + height = topline + vs->height; + if (vs->number == 0) { + left += _lastXstart - vs->xstart; + right += _lastXstart - vs->xstart; + } + + right++; + if (left < 0) + left = 0; + if (right < 0) + right = 0; + if (left > 320) + return; + if (right > 320) + right = 320; + if (bottom >= height) + bottom = height; + + updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, 0x40000000); + + height = (top - topline) * 320 + vs->xstart + left; + + backbuff = vs->screenPtr + height; + bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height; + mask = getResourceAddress(rtBuffer, 9) + top * NUM_STRIPS + (left >> 3) + _screenStartStrip; + if (vs->number == 0) { + mask += vs->topline * 216; + } + + height = bottom - top; + width = right - left; + widthmod = (width >> 2) + 2; + + if (vs->alloctwobuffers && _currentRoom != 0 /*&& _vars[VAR_V5_DRAWFLAGS]&2 */ ) { + blit(backbuff, bgbak, width, height); + if (vs->number == 0 && charset._hasMask && height) { + do { + memset(mask, 0, widthmod); + mask += NUM_STRIPS; + } while (--height); + } + } else { + if (height) { + do { + memset(backbuff, _bkColor, width); + backbuff += 320; + } while (--height); + } + } +} + +void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits) +{ + VirtScreen *vs = &virtscr[virt]; + int lp, rp; + uint32 *sp; + int num; + + if (top > vs->height || left > vs->width || right < 0 || bottom < 0) + return; + + if (top < 0) + top = 0; + if (left < 0) + left = 0; + if (bottom > vs->height) + bottom = vs->height; + if (right > vs->width) + right = vs->width; + + if (virt == 0 && dirtybits) { + rp = (right >> 3) + _screenStartStrip; + lp = (left >> 3) + _screenStartStrip; + if (lp < 0) + lp = 0; + if (rp >= 200) + rp = 200; + if (lp <= rp) { + num = rp - lp + 1; + sp = &gfxUsageBits[lp]; + do { + *sp++ |= dirtybits; + } while (--num); + } + } + + setVirtscreenDirty(vs, left, top, right, bottom); +} + +void Scumm::setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom) +{ + int lp = left >> 3; + int rp = right >> 3; + + if (lp >= NUM_STRIPS || rp < 0) + return; + if (lp < 0) + lp = 0; + if (rp >= NUM_STRIPS) + rp = NUM_STRIPS - 1; + + while (lp <= rp) { + if (top < vs->tdirty[lp]) + vs->tdirty[lp] = top; + if (bottom > vs->bdirty[lp]) + vs->bdirty[lp] = bottom; + lp++; + } +} + +VirtScreen *Scumm::findVirtScreen(int y) +{ + VirtScreen *vs = virtscr; + int i; + + for (i = 0; i < 3; i++, vs++) { + if (y >= vs->topline && y < vs->topline + vs->height) { + return _curVirtScreen = vs; + } + } + return _curVirtScreen = NULL; +} + +void Scumm::unkScreenEffect1() +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect1()"); +} + +void Scumm::unkScreenEffect2() +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect2()"); +} + +void Scumm::unkScreenEffect3() +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect3()"); +} + +void Scumm::unkScreenEffect4() +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect4()"); +} + +/* *INDENT-OFF* */ + +static const int8 screen_eff7_table1[4][16] = { + { 1, 1, -1, 1, -1, 1, -1, -1, + 1, -1, -1, -1, 1, 1, 1, -1}, + { 0, 1, 2, 1, 2, 0, 2, 1, + 2, 0, 2, 1, 0, 0, 0, 0}, + {-2, -1, 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, 0, 0, 0, 0}, + { 0, -1, -2, -1, -2, 0, -2, -1, -2, 0, -2, -1, 0, 0, 0, 0} +}; + +static const byte screen_eff7_table2[4][16] = { + { 0, 0, 39, 0, 39, 0, 39, 24, + 0, 24, 39, 24, 0, 0, 0, 24}, + { 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 255, 0, 0, 0}, + {39, 24, 39, 24, 39, 24, 39, 24, + 38, 24, 38, 24, 255, 0, 0, 0}, + { 0, 24, 39, 24, 39, 0, 39, 24, + 38, 0, 38, 24, 255, 0, 0, 0} +}; + +static const byte transition_num_of_iterations[4] = { + 13, 25, 25, 25 +}; + +/* *INDENT-ON* */ + +/* Transition effect. There are four different effects possible, + * indicated by the value of a: + * 0: Iris effect + * 1: ? + * 2: ? + * 3: ? + * All effects basically operate on 8x8 blocks of the screen. These blocks + * are updated in a certain order; the exact order determines how the + * effect appears to the user. + */ +void Scumm::transitionEffect(int a) +{ + int delta[16]; // Offset applied during each iteration + int tab_2[16]; + int i, j; + int bottom; + int l, t, r, b; + + for (i = 0; i < 16; i++) { + delta[i] = screen_eff7_table1[a][i]; + j = screen_eff7_table2[a][i]; + if (j == 24) + j = (virtscr[0].height >> 3) - 1; + tab_2[i] = j; + } + + bottom = virtscr[0].height >> 3; + for (j = 0; j < transition_num_of_iterations[a]; j++) { + for (i = 0; i < 4; i++) { + l = tab_2[i * 4]; + t = tab_2[i * 4 + 1]; + r = tab_2[i * 4 + 2]; + b = tab_2[i * 4 + 3]; + if (t == b) { + while (l <= r) { + if (l >= 0 && l < NUM_STRIPS && (uint) t < (uint) bottom) { + virtscr[0].tdirty[l] = t << 3; + virtscr[0].bdirty[l] = (t + 1) << 3; + } + l++; + } + } else { + if (l < 0 || l >= NUM_STRIPS || b <= t) + continue; + if (b > bottom) + b = bottom; + virtscr[0].tdirty[l] = t << 3; + virtscr[0].bdirty[l] = (b + 1) << 3; + } + updateDirtyScreen(0); + } + + for (i = 0; i < 16; i++) + tab_2[i] += delta[i]; + + // Draw the current state to the screen and wait half a sec so the user + // can watch the effect taking place. + updatePalette(); + _system->update_screen(); + waitForTimer(30); + } +} + +void Scumm::unkScreenEffect6() +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect6"); +} + +void Scumm::unkScreenEffect5(int a) +{ + /* XXX: not implemented */ + warning("stub unkScreenEffect5(%d)", a); +} + +void Scumm::setShake(int mode) +{ + if (_shakeEnabled != (mode != 0)) + _fullRedraw = true; + + _shakeEnabled = mode != 0; + _shakeFrame = 0; + _system->set_shake_pos(0); +} + +void Gdi::clearUpperMask() +{ + memset(_vm->getResourceAddress(rtBuffer, 9), 0, _imgBufOffs[1] - _imgBufOffs[0] + ); +} + +void Scumm::clampCameraPos(ScummPoint *pt) +{ + if (pt->x < _vars[VAR_CAMERA_MIN_X]) + pt->x = _vars[VAR_CAMERA_MIN_X]; + + if (pt->x > _vars[VAR_CAMERA_MAX_X]) + pt->x = _vars[VAR_CAMERA_MAX_X]; + + if (pt->y < _vars[VAR_CAMERA_MIN_Y]) + pt->y = _vars[VAR_CAMERA_MIN_Y]; + + if (pt->y > _vars[VAR_CAMERA_MAX_Y]) + pt->y = _vars[VAR_CAMERA_MAX_Y]; +} + + +void Scumm::moveCamera() +{ + if (_features & GF_AFTER_V7) { + ScummPoint old = camera._cur; + Actor *a = NULL; + + if (camera._follows) { + a = derefActorSafe(camera._follows, "moveCamera"); + if (abs(camera._cur.x - a->x) > _vars[VAR_CAMERA_THRESHOLD_X] || + abs(camera._cur.y - a->y) > _vars[VAR_CAMERA_THRESHOLD_Y]) { + camera._movingToActor = true; + if (_vars[VAR_CAMERA_THRESHOLD_X] == 0) + camera._cur.x = a->x; + if (_vars[VAR_CAMERA_THRESHOLD_Y] == 0) + camera._cur.y = a->y; + clampCameraPos(&camera._cur); + } + } else { + camera._movingToActor = false; + } + + if (camera._movingToActor) { + camera._dest.x = a->x; + camera._dest.y = a->y; + } + + assert(camera._cur.x >= 160 && camera._cur.y >= 100); + + clampCameraPos(&camera._dest); + + if (camera._cur.x < camera._dest.x) { + camera._cur.x += _vars[VAR_CAMERA_SPEED_X]; + if (camera._cur.x > camera._dest.x) + camera._cur.x = camera._dest.x; + } + + if (camera._cur.x > camera._dest.x) { + camera._cur.x -= _vars[VAR_CAMERA_SPEED_X]; + if (camera._cur.x < camera._dest.x) + camera._cur.x = camera._dest.x; + } + + if (camera._cur.y < camera._dest.y) { + camera._cur.y += _vars[VAR_CAMERA_SPEED_Y]; + if (camera._cur.y > camera._dest.y) + camera._cur.y = camera._dest.y; + } + + if (camera._cur.y > camera._dest.y) { + camera._cur.y -= _vars[VAR_CAMERA_SPEED_Y]; + if (camera._cur.y < camera._dest.y) + camera._cur.y = camera._dest.y; + } + + if (camera._cur.x == camera._dest.x && camera._cur.y == camera._dest.y) { + + camera._movingToActor = false; + camera._accel.x = camera._accel.y = 0; + _vars[VAR_CAMERA_SPEED_X] = _vars[VAR_CAMERA_SPEED_Y] = 0; + } else { + + camera._accel.x += _vars[VAR_CAMERA_ACCEL_X]; + camera._accel.y += _vars[VAR_CAMERA_ACCEL_Y]; + + _vars[VAR_CAMERA_SPEED_X] += camera._accel.x / 100; + _vars[VAR_CAMERA_SPEED_Y] += camera._accel.y / 100; + + if (_vars[VAR_CAMERA_SPEED_X] < 8) + _vars[VAR_CAMERA_SPEED_X] = 8; + + if (_vars[VAR_CAMERA_SPEED_Y] < 8) + _vars[VAR_CAMERA_SPEED_Y] = 8; + + } + + cameraMoved(); + + if (camera._cur.x != old.x || camera._cur.y != old.y) { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + _vars[VAR_CAMERA_POS_Y] = camera._cur.y; + + _vars[VAR_CAMERA_DEST_X] = camera._dest.x; + + _vars[VAR_CAMERA_DEST_Y] = camera._dest.y; + + _vars[VAR_CAMERA_FOLLOWED_ACTOR] = camera._follows; + + if (_vars[VAR_SCROLL_SCRIPT]) + runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); + } + } else { + int pos = camera._cur.x; + int actorx, t; + Actor *a = NULL; + + camera._cur.x &= 0xFFF8; + + if (camera._cur.x < _vars[VAR_CAMERA_MIN_X]) { + if (_vars[VAR_CAMERA_FAST_X]) + camera._cur.x = _vars[VAR_CAMERA_MIN_X]; + else + camera._cur.x += 8; + cameraMoved(); + return; + } + + if (camera._cur.x > _vars[VAR_CAMERA_MAX_X]) { + if (_vars[VAR_CAMERA_FAST_X]) + camera._cur.x = _vars[VAR_CAMERA_MAX_X]; + else + camera._cur.x -= 8; + cameraMoved(); + return; + } + + if (camera._mode == CM_FOLLOW_ACTOR) { + a = derefActorSafe(camera._follows, "moveCamera"); + + actorx = a->x; + t = (actorx >> 3) - _screenStartStrip; + + if (t < camera._leftTrigger || t > camera._rightTrigger) { + if (_vars[VAR_CAMERA_FAST_X]) { + if (t > 35) + camera._dest.x = actorx + 80; + if (t < 5) + camera._dest.x = actorx - 80; + } else + camera._movingToActor = 1; + } + } + + if (camera._movingToActor) { + a = derefActorSafe(camera._follows, "moveCamera(2)"); + camera._dest.x = a->x; + } + + if (camera._dest.x < _vars[VAR_CAMERA_MIN_X]) + camera._dest.x = _vars[VAR_CAMERA_MIN_X]; + + if (camera._dest.x > _vars[VAR_CAMERA_MAX_X]) + camera._dest.x = _vars[VAR_CAMERA_MAX_X]; + + if (_vars[VAR_CAMERA_FAST_X]) { + camera._cur.x = camera._dest.x; + } else { + if (camera._cur.x < camera._dest.x) + camera._cur.x += 8; + if (camera._cur.x > camera._dest.x) + camera._cur.x -= 8; + } + + /* a is set a bit above */ + if (camera._movingToActor && camera._cur.x >> 3 == a->x >> 3) { + camera._movingToActor = 0; + } + + cameraMoved(); + + if (pos != camera._cur.x && _vars[VAR_SCROLL_SCRIPT]) { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); + } + } +} + +void Scumm::cameraMoved() +{ + if (_features & GF_AFTER_V7) { + + assert(camera._cur.x >= 160 && camera._cur.y >= 100); + + _screenStartStrip = (camera._cur.x - 160) >> 3; + _screenEndStrip = _screenStartStrip + NUM_STRIPS - 1; + virtscr[0].xstart = _screenStartStrip << 3; + + _screenLeft = camera._cur.x - 160; + _screenTop = camera._cur.y - 100; + } else { + + if (camera._cur.x < 160) { + camera._cur.x = 160; + } else if (camera._cur.x + 160 >= _scrWidth) { + camera._cur.x = _scrWidth - 160; + } + + _screenStartStrip = (camera._cur.x >> 3) - 20; + _screenEndStrip = _screenStartStrip + NUM_STRIPS - 1; + virtscr[0].xstart = _screenStartStrip << 3; + } +} + +void Scumm::panCameraTo(int x, int y) +{ + if (_features & GF_AFTER_V7) { + + camera._follows = 0; + camera._dest.x = x; + camera._dest.y = y; + } else { + + camera._dest.x = x; + camera._mode = CM_PANNING; + camera._movingToActor = 0; + } +} + +void Scumm::actorFollowCamera(int act) +{ + if (!(_features & GF_AFTER_V7)) { + int old; + + /* mi1 compatibilty */ + if (act == 0) { + camera._mode = CM_NORMAL; + camera._follows = 0; + camera._movingToActor = 0; + return; + } + + old = camera._follows; + setCameraFollows(derefActorSafe(act, "actorFollowCamera")); + if (camera._follows != old) + runHook(0); + + camera._movingToActor = 0; + } +} + +void Scumm::setCameraAtEx(int at) +{ + if (!(_features & GF_AFTER_V7)) { + camera._mode = CM_NORMAL; + camera._cur.x = at; + setCameraAt(at, 0); + camera._movingToActor = 0; + } +} + +void Scumm::palManipulate() +{ + byte *srcptr, *destptr; + byte *pal; + int i, j; + + if (!_palManipCounter) + return; + srcptr = getResourceAddress(rtTemp, 4) + _palManipStart * 6; + destptr = getResourceAddress(rtTemp, 5) + _palManipStart * 6; + pal = _currentPalette + _palManipStart * 3; + + i = _palManipStart; + while (i < _palManipEnd) { + j = (*((uint16 *)srcptr) += *(uint16 *)destptr); + *pal++ = j >> 8; + srcptr += 2; + destptr += 2; + + j = (*((uint16 *)srcptr) += *(uint16 *)destptr); + *pal++ = j >> 8; + srcptr += 2; + destptr += 2; + + j = (*((uint16 *)srcptr) += *(uint16 *)destptr); + *pal++ = j >> 8; + srcptr += 2; + destptr += 2; + + i++; + } + setDirtyColors(_palManipStart, _palManipEnd); + if (!--_palManipCounter) { + nukeResource(rtTemp, 4); + nukeResource(rtTemp, 5); + } +} + +void Scumm::swapPalColors(int a, int b) +{ + byte *ap, *bp; + byte t; + + if ((uint) a >= 256 || (uint) b >= 256) + error("swapPalColors: invalid values, %d, %d", a, b); + + ap = &_currentPalette[a * 3]; + bp = &_currentPalette[b * 3]; + + t = ap[0]; + ap[0] = bp[0]; + bp[0] = t; + t = ap[1]; + ap[1] = bp[1]; + bp[1] = t; + t = ap[2]; + ap[2] = bp[2]; + bp[2] = t; + + setDirtyColors(a, b); +} + +void Gdi::resetBackground(int top, int bottom, int strip) +{ + VirtScreen *vs = &_vm->virtscr[0]; + int offs; + + if (top < vs->tdirty[strip]) + vs->tdirty[strip] = top; + + if (bottom > vs->bdirty[strip]) + vs->bdirty[strip] = bottom; + + offs = (top * NUM_STRIPS + _vm->_screenStartStrip + strip); + _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + offs; + _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + (offs << 3); + _backbuff_ptr = vs->screenPtr + (offs << 3); + + _numLinesToProcess = bottom - top; + if (_numLinesToProcess) { + if ((_vm->_features & GF_AFTER_V6) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen)) { + if (_vm->hasCharsetMask(strip << 3, top, (strip + 1) << 3, bottom)) + draw8ColWithMasking(); + else + blit(_backbuff_ptr, _bgbak_ptr, 8, _numLinesToProcess); + } else { + clear8Col(); + } + } +} + +void Scumm::setPalColor(int idx, int r, int g, int b) +{ + _currentPalette[idx * 3 + 0] = r; + _currentPalette[idx * 3 + 1] = g; + _currentPalette[idx * 3 + 2] = b; + setDirtyColors(idx, idx); +} + +void Scumm::setCursorHotspot2(int x, int y) +{ + _cursorHotspotX = x; + _cursorHotspotY = y; +} + +byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem) +{ + int w, h, i; + + l >>= 3; + if (l < 0) + l = 0; + if (t < 0) + t = 0; + + r >>= 3; + if (r > NUM_STRIPS-1) + r = NUM_STRIPS-1; + + mem += l + t * NUM_STRIPS; + + w = r - l; + h = b - t + 1; + + do { + for (i = 0; i <= w; i++) + if (mem[i]) { + return true; + } + mem += NUM_STRIPS; + } while (--h); + + return false; +} + +void Scumm::setPalette(int palindex) +{ + byte *pals; + + _curPalIndex = palindex; + pals = getPalettePtr(); + if (pals == NULL) + error("invalid palette %d", palindex); + setPaletteFromPtr(pals); +} + +byte *Scumm::findPalInPals(byte *pal, int idx) +{ + byte *offs; + uint32 size; + + pal = findResource(MKID('WRAP'), pal); + if (pal == NULL) + return NULL; + + offs = findResourceData(MKID('OFFS'), pal); + if (offs == NULL) + return NULL; + + size = getResourceDataSize(offs) >> 2; + + if ((uint32)idx >= (uint32)size) + return NULL; + + return offs + READ_LE_UINT32(offs + idx * sizeof(uint32)); +} + +byte *Scumm::getPalettePtr() +{ + byte *cptr; + + cptr = getResourceAddress(rtRoom, _roomResource); + if (_CLUT_offs) { + cptr += _CLUT_offs; + } else { + cptr = findPalInPals(cptr + _PALS_offs, _curPalIndex); + } + return cptr; +} + +void Scumm::darkenPalette(int startColor, int endColor, int redScale, int greenScale, int blueScale) +{ + if (startColor <= endColor) { + byte *cptr, *cur; + int num; + int color; + + cptr = getPalettePtr() + startColor * 3; + cur = _currentPalette + startColor * 3; + num = endColor - startColor + 1; + + do { + color = *cptr++; + if (redScale != 0xFF) + color = color * redScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + + color = *cptr++; + if (greenScale != 0xFF) + color = color * greenScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + + color = *cptr++; + if (blueScale != 0xFF) + color = color * blueScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + } while (--num); + setDirtyColors(startColor, endColor); + } +} + +void Scumm::desaturatePalette() +{ + // FIXME: Should this be made to take a range of colors instead? + + byte *cur; + int i; + + cur = _currentPalette; + + for (i = 0; i <= 255; i++) + { + int max, min; + int brightness; + + // An algorithm that is good enough for The GIMP should be + // good enough for us... + + max = (cur[0] > cur[1]) ? cur[0] : cur[1]; + if (cur[2] > max) + max = cur[2]; + + min = (cur[0] < cur[1]) ? cur[0] : cur[1]; + if (cur[2] < min) + min = cur[2]; + + brightness = (min + max) / 2; + + *cur++ = brightness; + *cur++ = brightness; + *cur++ = brightness; + } + + setDirtyColors(0, 255); +} + +void Scumm::grabCursor(int x, int y, int w, int h) +{ + VirtScreen *vs = findVirtScreen(y); + + if (vs == NULL) { + warning("grabCursor: invalid Y %d", y); + return; + } + + grabCursor(vs->screenPtr + (y - vs->topline) * 320 + x, w, h); + +} + +void Scumm::decompressBomp(byte *dst, byte *src, int w, int h) +{ + int len, num; + byte code, color; + + src += 8; + + do { + len = w; + src += 2; + while (len) { + code = *src++; + num = (code >> 1) + 1; + if (num > len) + num = len; + len -= num; + if (code & 1) { + color = *src++; + do + *dst++ = color; + while (--num); + } else { + do + *dst++ = *src++; + while (--num); + } + } + } while (--h); +} + +void Scumm::grabCursor(byte *ptr, int width, int height) +{ + uint size; + byte *dst; + + size = width * height; + if (size > sizeof(_grabbedCursor)) + error("grabCursor: grabbed cursor too big"); + + _cursorWidth = width; + _cursorHeight = height; + _cursorAnimate = 0; + + dst = _grabbedCursor; + for (; height; height--) { + memcpy(dst, ptr, width); + dst += width; + ptr += 320; + } + + updateCursor(); +} + +void Scumm::useIm01Cursor(byte *im, int w, int h) +{ + VirtScreen *vs = &virtscr[0]; + + w <<= 3; + h <<= 3; + + drawBox(0, 0, w - 1, h - 1, 0xFF); + + vs->alloctwobuffers = false; + gdi._disable_zbuffer = true; + gdi.drawBitmap(im, vs, _screenStartStrip, 0, h, 0, w >> 3, 0); + vs->alloctwobuffers = true; + gdi._disable_zbuffer = false; + + grabCursor(vs->screenPtr + vs->xstart, w, h); + + blit(vs->screenPtr + vs->xstart, getResourceAddress(rtBuffer, 5) + vs->xstart, w, h); +} + +void Scumm::updateCursor() +{ + _system->set_mouse_cursor(_grabbedCursor, _cursorWidth, _cursorHeight, + _cursorHotspotX, _cursorHotspotY); +} + +void Scumm::animateCursor() +{ + if (_cursorAnimate) { + if (!(_cursorAnimateIndex & 0x3)) { + decompressDefaultCursor((_cursorAnimateIndex >> 2) & 3); + } + _cursorAnimateIndex++; + } + +} + +void Scumm::useBompCursor(byte *im, int width, int height) +{ + uint size; + + width <<= 3; + height <<= 3; + + size = width * height; + if (size > sizeof(_grabbedCursor)) + error("useBompCursor: cursor too big"); + + _cursorWidth = width; + _cursorHeight = height; + _cursorAnimate = 0; + + decompressBomp(_grabbedCursor, im + 10, width, height); + + updateCursor(); +} + +static const byte default_cursor_colors[4] = { + 15, 15, 7, 8 +}; + +void Scumm::decompressDefaultCursor(int idx) +{ + int i; + byte color; + + memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor)); + _cursorWidth = 16; + _cursorHeight = 16; + _cursorHotspotX = 8; + _cursorHotspotY = 8; + + color = default_cursor_colors[idx]; + + for (i = 0; i < 16; i++) { + if ((i < 7) || (i > 9)) { + _grabbedCursor[16 * 8 + i] = color; + _grabbedCursor[16 * i + 8] = color; + } + } + + updateCursor(); +} + + +int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) +{ + int i; + int ar, ag, ab; + uint sum, j, bestsum, bestitem = 0; + byte *pal = _currentPalette; + + if (r > 255) + r = 255; + if (g > 255) + g = 255; + if (b > 255) + b = 255; + + bestsum = (uint) - 1; + + r &= ~3; + g &= ~3; + b &= ~3; + + for (i = 0; i < 256; i++, pal += 3) { + ar = pal[0] & ~3; + ag = pal[1] & ~3; + ab = pal[2] & ~3; + if (ar == r && ag == g && ab == b) + return i; + + j = ar - r; + sum = j * j * 3; + j = ag - g; + sum += j * j * 6; + j = ab - b; + sum += j * j * 2; + + if (sum < bestsum) { + bestsum = sum; + bestitem = i; + } + } + + if (threshold != (uint) - 1 && bestsum > threshold * threshold * (2 + 3 + 6)) { + pal = _currentPalette + (256 - 2) * 3; + for (i = 254; i > 48; i--, pal -= 3) { + if (pal[0] >= 252 && pal[1] >= 252 && pal[2] >= 252) { + setPalColor(i, r, g, b); + return i; + } + } + } + + return bestitem; +} + + +// param3= clipping + +// param2= mirror + +// param1= never used ? +void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, int param3) +{ + byte *dest = bd->out + bd->y * bd->outwidth, *src; + int h = bd->srcheight; + bool inside; + + if (h == 0 || bd->srcwidth == 0) + return; + + inside = (bd->x >= 0) && (bd->y >= 0) && + (bd->x <= bd->outwidth - bd->srcwidth) && (bd->y <= bd->outheight - bd->srcheight); + + if (1 || bd->scale_x == 255 && bd->scale_y == 255) { + /* Routine used when no scaling is needed */ + if (inside) { + dest += bd->x; + src = bd->dataptr; + do { + byte code, color; + uint len = bd->srcwidth, num, i; + byte *d = dest; + src += 2; + do { + code = *src++; + num = (code >> 1) + 1; + if (num > len) + num = len; + len -= num; + if (code & 1) { + color = *src++; + if (color != 255) { + do + *d++ = color; + while (--num); + } else { + d += num; + } + } else { + for (i = 0; i < num; i++) + if ((color = src[i]) != 255) + d[i] = color; + d += num; + src += num; + } + } while (len); + dest += bd->outwidth; + } while (--h); + } else { + uint y = bd->y; + src = bd->dataptr; + + do { + byte color; + uint len, num; + uint x; + if ((uint) y >= (uint) bd->outheight) { + src += READ_LE_UINT16(src) + 2; + continue; + } + len = bd->srcwidth; + x = bd->x; + + src += 2; + do { + byte code = *src++; + num = (code >> 1) + 1; + if (num > len) + num = len; + len -= num; + if (code & 1) { + if ((color = *src++) != 255) { + do { + if ((uint) x < (uint) bd->outwidth) + dest[x] = color; + } while (++x, --num); + } else { + x += num; + } + } else { + do { + if ((color = *src++) != 255 && (uint) x < (uint) bd->outwidth) + dest[x] = color; + } while (++x, --num); + } + } while (len); + } while (dest += bd->outwidth, y++, --h); + } + } else { + /* scaling of bomp images not supported yet */ + } + + CHECK_HEAP; +} + + +/* Yazoo: This function create the specialPalette used for semi-transparency in SamnMax */ + + +void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, + int16 colorMax) +{ + byte *palPtr; + byte *curPtr; + byte *searchPtr; + + byte readComp1; + byte readComp2; + byte readComp3; + + int colorComp1; + int colorComp2; + int colorComp3; + + int searchComp1; + int searchComp2; + int searchComp3; + + short int bestResult; + short int currentResult; + + byte currentIndex; + + int i; + int j; + + palPtr = getPalettePtr(); + + for (i = 0; i < 256; i++) + _proc_special_palette[i] = i; + + curPtr = palPtr + colorMin * 3; + + for (i = colorMin; i < colorMax; i++) { + readComp1 = *(curPtr++); + readComp2 = *(curPtr++); + readComp3 = *(curPtr++); + + colorComp1 = ((readComp1) * c) >> 8; + colorComp2 = ((readComp2) * d) >> 8; + colorComp3 = ((readComp3) * e) >> 8; + + searchPtr = palPtr; + bestResult = 32000; + currentIndex = 0; + + for (j = a; j < b; j++) { + searchComp1 = (*searchPtr++); + searchComp2 = (*searchPtr++); + searchComp3 = (*searchPtr++); + + currentResult = + abs(searchComp1 - colorComp1) + abs(searchComp2 - colorComp2) + abs(searchComp3 - colorComp3); + + if (currentResult < bestResult) { + _proc_special_palette[i] = currentIndex; + bestResult = currentResult; + } + currentIndex++; + } + } +} + diff --git a/scumm/gfx.h b/scumm/gfx.h new file mode 100644 index 0000000000..bc858536a4 --- /dev/null +++ b/scumm/gfx.h @@ -0,0 +1,193 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef GFX_H +#define GFX_H + +enum { + NUM_STRIPS = 40 +}; + +enum VideoMode { /* Video scalers */ + VIDEO_SCALE = 0, + VIDEO_2XSAI = 1, + VIDEO_SUPERSAI = 2, + VIDEO_SUPEREAGLE = 3 +}; + +enum { /* Camera modes */ + CM_NORMAL = 1, + CM_FOLLOW_ACTOR = 2, + CM_PANNING = 3 +}; + +struct CameraData { /* Camera state data */ + ScummPoint _cur; + ScummPoint _dest; + ScummPoint _accel; + ScummPoint _last; + int _leftTrigger, _rightTrigger; + byte _follows, _mode; + bool _movingToActor; +}; + + +struct VirtScreen { /* Virtual screen areas */ + int number; + uint16 unk1; + uint16 topline; + uint16 width, height; + uint16 size; + byte alloctwobuffers; + byte scrollable; + uint16 xstart; + uint16 tdirty[40]; + uint16 bdirty[40]; + byte *screenPtr; + byte *backBuf; +}; + +struct MouseCursor { /* Mouse cursor */ + int8 hotspot_x, hotspot_y; + byte colors[4]; + byte data[32]; +}; + +struct ColorCycle { /* Palette cycles */ + uint16 delay; + uint16 counter; + uint16 flags; + byte start; + byte end; +}; + +struct BlastObject { /* BlastObjects to draw */ + uint16 number, areaX, areaY, areaWidth, areaHeight; + int16 posX, posY; + uint16 width, height; + uint16 unk3, unk4, image; + + uint16 mode; +}; + +#if !defined(__GNUC__) + #pragma START_PACK_STRUCTS +#endif + +struct BompHeader { /* Bomp header */ + uint16 unk; + uint16 width, height; +} GCC_PACK; + +#if !defined(__GNUC__) + #pragma END_PACK_STRUCTS +#endif + +struct BompDrawData { /* Bomp graphics data */ + byte *out; + int outwidth, outheight; + int x, y; + byte scale_x, scale_y; + byte *dataptr; + int srcwidth, srcheight; +}; + +struct Gdi { + Scumm *_vm; + + byte *_readPtr; + uint _readOffs; + + int _numZBuffer; + int _imgBufOffs[4]; + byte _disable_zbuffer; + + bool _useOrDecompress; + int _numLinesToProcess; + int _tempNumLines; + byte _currentX; + byte _hotspot_x; + byte _hotspot_y; + byte _cursorActive; + + int16 _drawMouseX; + int16 _drawMouseY; + int16 _mask_top, _mask_bottom, _mask_right, _mask_left; + byte _currentCursor; + byte _mouseColors[4]; + byte _mouseColor; + byte _mouseClipMask1, _mouseClipMask2, _mouseClipMask3; + byte _mouseColorIndex; + byte *_mouseMaskPtr; + byte *_smap_ptr; + byte *_backbuff_ptr; + byte *_bgbak_ptr; + byte *_mask_ptr; + byte *_mask_ptr_dest; + byte *_z_plane_ptr; + + byte _palette_mod; + byte _decomp_shr, _decomp_mask; + byte _transparency; + uint32 _vertStripNextInc; + byte *_backupIsWhere; + + /* Bitmap decompressors */ + void decompressBitmap(); + void unkDecode1(); + void unkDecode2(); + void unkDecode3(); + void unkDecode4(); + void unkDecode5(); + void unkDecode6(); + void unkDecode7(); + void unkDecode8(); + void unkDecode9(); + void unkDecode10(); + void unkDecode11(); + + void drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, int stripnr, int numstrip, byte flag); + void clearUpperMask(); + + void disableZBuffer() { _disable_zbuffer++; } + void enableZBuffer() { _disable_zbuffer--; } + + void draw8ColWithMasking(); + void clear8ColWithMasking(); + void clear8Col(); + void decompressMaskImgOr(); + void decompressMaskImg(); + + void resetBackground(int top, int bottom, int strip); + void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b); + void updateDirtyScreen(VirtScreen *vs); + + enum DrawBitmapFlags { + dbAllowMaskOr = 1, + dbDrawMaskOnBoth = 2, + dbClear = 4 + }; +}; + +void blit(byte *dst, byte *src, int w, int h); + +#endif diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp new file mode 100644 index 0000000000..93f2f99597 --- /dev/null +++ b/scumm/imuse.cpp @@ -0,0 +1,4580 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#include "stdafx.h" +#include "scumm.h" +#include "fmopl.h" +#include "mididrv.h" +#include "imuse.h" +#include "saveload.h" + +/* + * Some constants + */ +#define TICKS_PER_BEAT 480 + +#define SYSEX_ID 0x7D +#define PERCUSSION_CHANNEL 9 + +#define TRIGGER_ID 0 +#define COMMAND_ID 1 + +#define MDPG_TAG "MDpg" +#define MDHD_TAG "MDhd" + + +/* Roland to General Midi patch table. Still needs some work. */ +static const byte mt32_to_gmidi[128] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x + 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x + 88, 54, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x + 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x + 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x + 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x + 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x + 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x +}; + + +/* Put IMUSE specific classes here, instead of in a .h file + * they will only be used from this file, so it will reduce + * compile time */ + +class IMuseDriver; + +struct Part; +struct MidiChannelAdl; +struct MidiChannelGM; +struct Instrument; + + +struct HookDatas { + byte _jump, _transpose; + byte _part_onoff[16]; + byte _part_volume[16]; + byte _part_program[16]; + byte _part_transpose[16]; + + int query_param(int param, byte chan); + int set(byte cls, byte value, byte chan); +}; + + +struct Player { + IMuseInternal *_se; + + Part *_parts; + bool _active; + bool _scanning; + int _id; + byte _priority; + byte _volume; + int8 _pan; + int8 _transpose; + int8 _detune; + uint _vol_chan; + byte _vol_eff; + + uint _song_index; + uint _track_index; + uint _timer_counter; + uint _loop_to_beat; + uint _loop_from_beat; + uint _loop_counter; + uint _loop_to_tick; + uint _loop_from_tick; + uint32 _tempo; + uint32 _tempo_eff; /* NoSave */ + uint32 _cur_pos; + uint32 _next_pos; + uint32 _song_offset; + uint32 _timer_speed; /* NoSave */ + uint _tick_index; + uint _beat_index; + uint _ticks_per_beat; + byte _speed; /* NoSave */ + bool _abort; + + HookDatas _hook; + + bool _mt32emulate; + + /* Player part */ + void hook_clear(); + void clear(); + bool start_sound(int sound); + void uninit_parts(); + byte *parse_midi(byte *s); + void key_off(uint8 chan, byte data); + void key_on(uint8 chan, byte data, byte velocity); + void part_set_transpose(uint8 chan, byte relative, int8 b); + void parse_sysex(byte *p, uint len); + void maybe_jump(byte *data); + void maybe_set_transpose(byte *data); + void maybe_part_onoff(byte *data); + void maybe_set_volume(byte *data); + void maybe_set_program(byte *data); + void maybe_set_transpose_part(byte *data); + uint update_actives(); + Part *get_part(uint8 part); + void turn_off_pedals(); + int set_vol(byte vol); + int get_param(int param, byte chan); + int query_part_param(int param, byte chan); + int set_transpose(byte relative, int b); + void set_priority(int pri); + void set_pan(int pan); + void set_detune(int detune); + void turn_off_parts(); + void play_active_notes(); + void cancel_volume_fade(); + + static void decode_sysex_bytes(byte *src, byte *dst, int len); + + void clear_active_note(int chan, byte note); + void set_active_note(int chan, byte note); + void clear_active_notes(); + + /* Sequencer part */ + bool set_loop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick); + void clear_loop(); + void set_speed(byte speed); + bool jump(uint track, uint beat, uint tick); + void uninit_seq(); + void set_tempo(uint32 data); + int start_seq_sound(int sound); + void find_sustaining_notes(byte *a, byte *b, uint32 l); + int scan(uint totrack, uint tobeat, uint totick); + int query_param(int param); + + int fade_vol(byte vol, int time); + void sequencer_timer(); +}; + +struct VolumeFader { + Player *player; + bool active; + byte curvol; + uint16 speed_lo_max, num_steps; + int8 speed_hi; + int8 direction; + int8 speed_lo; + uint16 speed_lo_counter; + + void initialize() { + active = false; + } void on_timer(); +}; + +struct SustainingNotes { + SustainingNotes *next; + SustainingNotes *prev; + Player *player; + byte note, chan; + uint32 off_pos; + uint32 pos; + uint16 counter; +}; + +struct CommandQueue { + uint16 array[8]; +}; + + +struct IsNoteCmdData { + byte chan; + byte note; + byte vel; +}; + + + +struct MidiChannel { + Part *_part; + MidiChannelAdl *adl() { return (MidiChannelAdl *)this; } + MidiChannelGM *gm() { return (MidiChannelGM *)this; } +}; + + +struct MidiChannelGM : MidiChannel { + byte _chan; + uint16 _actives[8]; +}; + + +struct Part { + int _slot; + IMuseDriver *_drv; + Part *_next, *_prev; + MidiChannel *_mc; + Player *_player; + int16 _pitchbend; + byte _pitchbend_factor; + int8 _transpose, _transpose_eff; + byte _vol, _vol_eff; + int8 _detune, _detune_eff; + int8 _pan, _pan_eff; + bool _on; + byte _modwheel; + bool _pedal; + byte _program; + int8 _pri; + byte _pri_eff; + byte _chan; + byte _effect_level; + byte _chorus; + byte _percussion; + byte _bank; + + void key_on(byte note, byte velocity); + void key_off(byte note); + void set_param(byte param, int value); + void init(IMuseDriver * _driver); + void setup(Player *player); + void uninit(); + void off(); + void silence(); + void set_instrument(uint b); + void set_instrument(Instrument * data); + + void set_transpose(int8 transpose); + void set_vol(uint8 volume); + void set_detune(int8 detune); + void set_pri(int8 pri); + void set_pan(int8 pan); + void set_modwheel(uint value); + void set_pedal(bool value); + void set_pitchbend(int value); + void release_pedal(); + void set_program(byte program); + void set_chorus(uint chorus); + void set_effect_level(uint level); + + int update_actives(uint16 *active); + void set_pitchbend_factor(uint8 value); + void set_onoff(bool on); + void fix_after_load(); + + void update_pris(); + + void changed(byte what); +}; + +/* Abstract IMuseInternal driver class */ +class IMuseDriver { +public: + enum { + pcMod = 1, + pcVolume = 2, + pcPedal = 4, + pcModwheel = 8, + pcPan = 16, + pcEffectLevel = 32, + pcProgram = 64, + pcChorus = 128, + pcAll = 255, + }; + + virtual void on_timer() = 0; + virtual uint32 get_base_tempo() = 0; + virtual byte get_hardware_type() = 0; + virtual void init(IMuseInternal *eng, OSystem *syst) = 0; + virtual void update_pris() = 0; + virtual void set_instrument(uint slot, byte *instr) = 0; + virtual void part_set_instrument(Part *part, Instrument * instr) = 0; + virtual void part_key_on(Part *part, byte note, byte velocity) = 0; + virtual void part_key_off(Part *part, byte note) = 0; + virtual void part_off(Part *part) = 0; + virtual void part_changed(Part *part, byte what) = 0; + virtual void part_set_param(Part *part, byte param, int value) = 0; + virtual int part_update_active(Part *part, uint16 *active) = 0; +}; + + +// WARNING: This is the internal variant of the IMUSE class. +// imuse.h contains a public version of the same class. +// the public version, only contains a set of methods. +class IMuseInternal { + friend struct Player; +private: + IMuseDriver * _driver; + + byte **_base_sounds; + + byte _locked; + byte _hardware_type; + +private: + + bool _paused; + bool _active_volume_faders; + bool _initialized; + byte _volume_fader_counter; + + int _game_tempo; + + uint _queue_end, _queue_pos, _queue_sound; + byte _queue_adding; + + SustainingNotes *_sustain_notes_used; + SustainingNotes *_sustain_notes_free; + SustainingNotes *_sustain_notes_head; + + byte _queue_marker; + byte _queue_cleared; + byte _master_volume; /* Master volume. 0-127 */ + byte _music_volume; /* Global music volume. 0-128 */ + + uint16 _trigger_count; + + uint16 _channel_volume[8]; + uint16 _channel_volume_eff[8]; /* NoSave */ + uint16 _volchan_table[8]; + + Player _players[8]; + SustainingNotes _sustaining_notes[24]; + VolumeFader _volume_fader[8]; + Part _parts[32]; + + uint16 _active_notes[128]; + CommandQueue _cmd_queue[64]; + + byte *findTag(int sound, char *tag, int index); + bool isMT32(int sound); + int get_queue_sound_status(int sound); + Player *allocate_player(byte priority); + void handle_marker(uint id, byte data); + int get_channel_volume(uint a); + void init_players(); + void init_parts(); + void init_volume_fader(); + void init_sustaining_notes(); + void init_queue(); + + void sequencer_timers(); + void expire_sustain_notes(); + void expire_volume_faders(); + + Part *allocate_part(byte pri); + + int enqueue_command(int a, int b, int c, int d, int e, int f, int g); + int enqueue_trigger(int sound, int marker); + int query_queue(int param); + Player *get_player_byid(int id); + + int get_volchan_entry(uint a); + int set_volchan_entry(uint a, uint b); + int set_channel_volume(uint chan, uint vol); + void update_volumes(); + void reset_tick(); + VolumeFader *allocate_volume_fader(); + + int set_volchan(int sound, int volchan); + + void fix_parts_after_load(); + void fix_players_after_load(Scumm *scumm); + + static int saveReference(IMuseInternal *me, byte type, void *ref); + static void *loadReference(IMuseInternal *me, byte type, int ref); + + void lock(); + void unlock(); + + int set_master_volume_intern(uint vol); + +public: + Part *parts_ptr() { + return _parts; + } + IMuseDriver *driver() { + return _driver; + } + + int initialize(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); + + /* Public interface */ + + void on_timer(); + void pause(bool paused); + int terminate(); + int save_or_load(Serializer *ser, Scumm *scumm); + int set_music_volume(uint vol); + int get_music_volume(); + int set_master_volume(uint vol); + int get_master_volume(); + bool start_sound(int sound); + int stop_sound(int sound); + int stop_all_sounds(); + int get_sound_status(int sound); + int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h); + int clear_queue(); + void setBase(byte **base); + + uint32 property(int prop, uint32 value); + + static IMuseInternal *create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); +}; + + +/* IMuseAdlib classes */ + +struct Struct10 { + byte active; + int16 cur_val; + int16 count; + uint16 param; + int16 start_value; + byte loop; + byte table_a[4]; + byte table_b[4]; + int8 unk3; + int8 modwheel; + int8 modwheel_last; + uint16 speed_lo_max; + uint16 num_steps; + int16 speed_hi; + int8 direction; + uint16 speed_lo; + uint16 speed_lo_counter; +}; + +struct Struct11 { + int16 modify_val; + byte param, flag0x40, flag0x10; + Struct10 *s10; +}; + +struct InstrumentExtra { + byte a, b, c, d, e, f, g, h; +}; + +struct Instrument { + byte flags_1; + byte oplvl_1; + byte atdec_1; + byte sustrel_1; + byte waveform_1; + byte flags_2; + byte oplvl_2; + byte atdec_2; + byte sustrel_2; + byte waveform_2; + byte feedback; + byte flags_a; + InstrumentExtra extra_a; + byte flags_b; + InstrumentExtra extra_b; + byte duration; +}; + +struct MidiChannelAdl : MidiChannel { + MidiChannelAdl *_next, *_prev; + byte _waitforpedal; + byte _note; + byte _channel; + byte _twochan; + byte _vol_1, _vol_2; + int16 _duration; + + Struct10 _s10a; + Struct11 _s11a; + Struct10 _s10b; + Struct11 _s11b; +}; + +class IMuseAdlib:public IMuseDriver { +private: + FM_OPL *_opl; + byte *_adlib_reg_cache; + IMuseInternal *_se; + SoundMixer *_mixer; + + int _adlib_timer_counter; + + uint16 channel_table_2[9]; + int _midichan_index; + int _next_tick; + uint16 curnote_table[9]; + MidiChannelAdl _midi_channels[9]; + + Instrument _part_instr[32]; + Instrument _glob_instr[32]; + + void adlib_key_off(int chan); + void adlib_note_on(int chan, byte note, int mod); + void adlib_note_on_ex(int chan, byte note, int mod); + int adlib_read_param(int chan, byte data); + void adlib_setup_channel(int chan, Instrument * instr, byte vol_1, byte vol_2); + byte adlib_read(byte port) { + return _adlib_reg_cache[port]; + } + void adlib_set_param(int channel, byte param, int value); + void adlib_key_onoff(int channel); + void adlib_write(byte port, byte value); + void adlib_playnote(int channel, int note); + + MidiChannelAdl *allocate_midichan(byte pri); + + void reset_tick(); + void mc_off(MidiChannel * mc); + + static void link_mc(Part *part, MidiChannelAdl *mc); + static void mc_inc_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11); + static void mc_init_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11, byte flags, + InstrumentExtra * ie); + static void struct10_init(Struct10 * s10, InstrumentExtra * ie); + static byte struct10_ontimer(Struct10 * s10, Struct11 * s11); + static void struct10_setup(Struct10 * s10); + static int random_nr(int a); + void mc_key_on(MidiChannel * mc, byte note, byte velocity); + + static void premix_proc(void *param, int16 *buf, uint len); + +public: + IMuseAdlib(SoundMixer *mixer) { + _mixer = mixer; + } + void uninit(); + void init(IMuseInternal *eng, OSystem *syst); + void update_pris() { + } + void generate_samples(int16 *buf, int len); + void on_timer(); + void set_instrument(uint slot, byte *instr); + void part_set_instrument(Part *part, Instrument * instr); + void part_key_on(Part *part, byte note, byte velocity); + void part_key_off(Part *part, byte note); + void part_set_param(Part *part, byte param, int value); + void part_changed(Part *part, byte what); + void part_off(Part *part); + int part_update_active(Part *part, uint16 *active); + void adjust_priorities() { + } + + uint32 get_base_tempo() { +#ifdef _WIN32_WCE + return 0x1F0000 * 2; // Sampled down to 11 kHz +#else //_WIN32_WCE + return 0x1F0000; // Was: 0x1924E0; +#endif //_WIN32_WCE + } + + byte get_hardware_type() { + return 1; + } +}; + + +/* IMuseGM classes */ + +class IMuseGM : public IMuseDriver { + IMuseInternal *_se; + OSystem *_system; + MidiDriver *_md; + MidiChannelGM _midi_channels[9]; + + int16 _midi_pitchbend_last[16]; + uint8 _midi_volume_last[16]; + bool _midi_pedal_last[16]; + byte _midi_modwheel_last[16]; + byte _midi_effectlevel_last[16]; + byte _midi_chorus_last[16]; + int8 _midi_pan_last[16]; + + + void midiPitchBend(byte chan, int16 pitchbend); + void midiVolume(byte chan, byte volume); + void midiPedal(byte chan, bool pedal); + void midiModWheel(byte chan, byte modwheel); + void midiEffectLevel(byte chan, byte level); + void midiChorus(byte chan, byte chorus); + void midiControl0(byte chan, byte value); + void midiProgram(byte chan, byte program, bool mt32emulate); + void midiPan(byte chan, int8 pan); + void midiNoteOn(byte chan, byte note, byte velocity); + void midiNoteOff(byte chan, byte note); + void midiSilence(byte chan); + void midiInit(); + +public: + IMuseGM(MidiDriver *midi) { _md = midi; } + void uninit(); + void init(IMuseInternal *eng, OSystem *os); + void update_pris(); + void part_off(Part *part); + int part_update_active(Part *part, uint16 *active); + + void on_timer() {} + void set_instrument(uint slot, byte *instr) {} + void part_set_instrument(Part *part, Instrument * instr) {} + void part_set_param(Part *part, byte param, int value) {} + void part_key_on(Part *part, byte note, byte velocity); + void part_key_off(Part *part, byte note); + void part_changed(Part *part, byte what); + + static int midi_driver_thread(void *param); + + uint32 get_base_tempo() { return 0x460000; } + byte get_hardware_type() { return 5; } +}; + + + +//********************************* +//**** IMUSE helper functions **** +//********************************* + + +static int clamp(int val, int min, int max) +{ + if (val < min) + return min; + if (val > max) + return max; + return val; +} + +static int transpose_clamp(int a, int b, int c) +{ + if (b > a) + a += (b - a + 11) / 12 * 12; + if (c < a) + a -= (a - c + 11) / 12 * 12; + return a; +} + +static uint32 get_delta_time(byte **s) +{ + byte *d = *s, b; + uint32 time = 0; + do { + b = *d++; + time = (time << 7) | (b & 0x7F); + } while (b & 0x80); + *s = d; + return time; +} + +static uint read_word(byte *a) +{ + return (a[0] << 8) + a[1]; +} + +static void skip_midi_cmd(byte **song_ptr) +{ + byte *s, code; + + const byte num_skip[] = { + 2, 2, 2, 2, 1, 1, 2 + }; + + s = *song_ptr; + + code = *s++; + + if (code < 0x80) { + s = NULL; + } else if (code < 0xF0) { + s += num_skip[(code & 0x70) >> 4]; + } else { + if (code == 0xF0 || code == 0xF7 || code == 0xFF && *s++ != 0x2F) { + s += get_delta_time(&s); + } else { + s = NULL; + } + } + *song_ptr = s; +} + +static int is_note_cmd(byte **a, IsNoteCmdData * isnote) +{ + byte *s = *a; + byte code; + + code = *s++; + + switch (code >> 4) { + case 8: /* key off */ + isnote->chan = code & 0xF; + isnote->note = *s++; + isnote->vel = *s++; + *a = s; + return 1; + case 9: /* key on */ + isnote->chan = code & 0xF; + isnote->note = *s++; + isnote->vel = *s++; + *a = s; + if (isnote->vel) + return 2; + return 1; + case 0xA: + case 0xB: + case 0xE: + s++; + case 0xC: + case 0xD: + s++; + break; + case 0xF: + if (code == 0xF0 || code == 0xF7 || code == 0xFF && *s++ != 0x2F) { + s += get_delta_time(&s); + break; + } + return -1; + default: + return -1; + } + *a = s; + return 0; +} + +/**********************************************************************/ + +void IMuseInternal::lock() +{ + _locked++; +} + +void IMuseInternal::unlock() +{ + _locked--; +} + +byte *IMuseInternal::findTag(int sound, char *tag, int index) +{ + byte *ptr = NULL; + int32 size, pos; + + if (_base_sounds) + ptr = _base_sounds[sound]; + + if (ptr == NULL) { + // debug(1, "IMuseInternal::findTag completely failed finding sound %d", + // sound); + return NULL; + + } + + ptr += 8; + size = READ_BE_UINT32_UNALIGNED(ptr); + ptr += 4; + + pos = 0; + + while (pos < size) { + if (!memcmp(ptr + pos, tag, 4) && !index--) + return ptr + pos + 8; + pos += READ_BE_UINT32_UNALIGNED(ptr + pos + 4) + 8; + } + + debug(1, "IMuseInternal::findTag failed finding sound %d", sound); + return NULL; +} + +bool IMuseInternal::isMT32(int sound) +{ + byte *ptr = NULL; + uint32 tag; + + if (_base_sounds) + ptr = _base_sounds[sound]; + + if (ptr == NULL) + return false; + + tag = *(((uint32 *)ptr) + 1); + switch (tag) { + case MKID('ADL '): + return false; + case MKID('ROL '): + return true; + case MKID('GMD '): + return false; + case MKID('MAC '): + return true; + case MKID('SPK '): + return false; + } + + return false; +} + +bool IMuseInternal::start_sound(int sound) +{ + Player *player; + void *mdhd; + + mdhd = findTag(sound, MDHD_TAG, 0); + if (!mdhd) { + mdhd = findTag(sound, MDPG_TAG, 0); + if (!mdhd) { + warning("SE::start_sound failed: Couldn't find %s", MDHD_TAG); + return false; + } + } + player = allocate_player(128); + if (!player) + return false; + + player->clear(); + return player->start_sound(sound); +} + + +Player *IMuseInternal::allocate_player(byte priority) +{ + Player *player = _players, *best = NULL; + int i; + byte bestpri = 255; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (!player->_active) + return player; + if (player->_priority < bestpri) { + best = player; + bestpri = player->_priority; + } + } + + if (bestpri < priority) + return best; + + debug(1, "Denying player request"); + return NULL; +} + +void IMuseInternal::init_players() +{ + Player *player = _players; + int i; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + player->_active = false; + player->_se = this; + } +} + +void IMuseInternal::init_sustaining_notes() +{ + SustainingNotes *next = NULL, *sn = _sustaining_notes; + int i; + + _sustain_notes_used = NULL; + _sustain_notes_head = NULL; + + for (i = ARRAYSIZE(_sustaining_notes); i != 0; i--, sn++) { + sn->next = next; + next = sn; + } + _sustain_notes_free = next; +} + +void IMuseInternal::init_volume_fader() +{ + VolumeFader *vf = _volume_fader; + int i; + + for (i = ARRAYSIZE(_volume_fader); i != 0; i--, vf++) + vf->initialize(); + + _active_volume_faders = false; +} + +void IMuseInternal::init_parts() +{ + Part *part; + int i; + + for (i = 0, part = _parts; i != ARRAYSIZE(_parts); i++, part++) { + part->init(_driver); + part->_slot = i; + } +} + +int IMuseInternal::stop_sound(int sound) +{ + Player *player = _players; + int i; + int r = -1; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (player->_active && player->_id == sound) { + player->clear(); + r = 0; + } + } + return r; +} + +int IMuseInternal::stop_all_sounds() +{ + Player *player = _players; + int i; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (player->_active) + player->clear(); + } + return 0; +} + +void IMuseInternal::on_timer() +{ + if (_locked || _paused) + return; + + lock(); + + sequencer_timers(); + expire_sustain_notes(); + expire_volume_faders(); + _driver->on_timer(); + + unlock(); +} + +void IMuseInternal::sequencer_timers() +{ + Player *player = _players; + int i; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (player->_active) + player->sequencer_timer(); + } +} + +void IMuseInternal::handle_marker(uint id, byte data) +{ + uint16 *p; + uint pos; + + pos = _queue_end; + if (pos == _queue_pos) + return; + + if (_queue_adding && _queue_sound == id && data == _queue_marker) + return; + + p = _cmd_queue[pos].array; + + if (p[0] != TRIGGER_ID || p[1] != id || p[2] != data) + return; + + _trigger_count--; + _queue_cleared = false; + do { + pos = (pos + 1) & (ARRAYSIZE(_cmd_queue) - 1); + if (_queue_pos == pos) + break; + p = _cmd_queue[pos].array; + if (*p++ != COMMAND_ID) + break; + _queue_end = pos; + + do_command(p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0); + + if (_queue_cleared) + return; + pos = _queue_end; + } while (1); + + _queue_end = pos; +} + +int IMuseInternal::get_channel_volume(uint a) +{ + if (a < 8) + return _channel_volume_eff[a]; + return _master_volume; +} + +Part *IMuseInternal::allocate_part(byte pri) +{ + Part *part, *best = NULL; + int i; + + for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { + if (!part->_player) + return part; + if (pri >= part->_pri_eff) { + pri = part->_pri_eff; + best = part; + } + } + + if (best) + best->uninit(); + else + debug(1, "Denying part request"); + return best; +} + +void IMuseInternal::expire_sustain_notes() +{ + SustainingNotes *sn, *next; + Player *player; + uint32 counter; + + for (sn = _sustain_notes_head; sn; sn = next) { + next = sn->next; + player = sn->player; + + counter = sn->counter + player->_timer_speed; + sn->pos += counter >> 16; + sn->counter = (unsigned short)counter & 0xFFFF; + + if (sn->pos >= sn->off_pos) { + player->key_off(sn->chan, sn->note); + + /* Unlink the node */ + if (next) + next->prev = sn->prev; + if (sn->prev) + sn->prev->next = next; + else + _sustain_notes_head = next; + + /* And put it in the free list */ + sn->next = _sustain_notes_free; + _sustain_notes_free = sn; + } + } +} + +void IMuseInternal::expire_volume_faders() +{ + VolumeFader *vf; + int i; + + if (++_volume_fader_counter & 7) + return; + + if (!_active_volume_faders) + return; + + _active_volume_faders = false; + vf = _volume_fader; + for (i = ARRAYSIZE(_volume_fader); i != 0; i--, vf++) { + if (vf->active) { + _active_volume_faders = true; + vf->on_timer(); + } + } +} + +void VolumeFader::on_timer() +{ + byte newvol; + + newvol = curvol + speed_hi; + speed_lo_counter += speed_lo; + + if (speed_lo_counter >= speed_lo_max) { + speed_lo_counter -= speed_lo_max; + newvol += direction; + } + + if (curvol != newvol) { + if (!newvol) { + player->clear(); + active = false; + return; + } + curvol = newvol; + player->set_vol(newvol); + } + + if (!--num_steps) { + active = false; + } +} + +int IMuseInternal::get_sound_status(int sound) +{ + int i; + Player *player; + + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active && player->_id == (uint16)sound) + return 1; + } + return get_queue_sound_status(sound); +} + +int IMuseInternal::get_queue_sound_status(int sound) +{ + uint16 *a; + int i, j; + + j = _queue_pos; + i = _queue_end; + + while (i != j) { + a = _cmd_queue[i].array; + if (a[0] == COMMAND_ID && a[1] == 8 && a[2] == (uint16)sound) + return 2; + i = (i + 1) & (ARRAYSIZE(_cmd_queue) - 1); + } + return 0; +} + +int IMuseInternal::set_volchan(int sound, int volchan) +{ + int r; + int i; + int num; + Player *player, *best, *sameid; + + r = get_volchan_entry(volchan); + if (r == -1) + return -1; + + if (r >= 8) { + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active && player->_id == (uint16)sound && player->_vol_chan != (uint16)volchan) { + player->_vol_chan = volchan; + player->set_vol(player->_volume); + return 0; + } + } + return -1; + } else { + best = NULL; + num = 0; + sameid = NULL; + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active) { + if (player->_vol_chan == (uint16)volchan) { + num++; + if (!best || player->_priority <= best->_priority) + best = player; + } else if (player->_id == (uint16)sound) { + sameid = player; + } + } + } + if (sameid == NULL) + return -1; + if (num >= r) + best->clear(); + player->_vol_chan = volchan; + player->set_vol(player->_volume); + return 0; + } +} + +int IMuseInternal::clear_queue() +{ + _queue_adding = false; + _queue_cleared = true; + _queue_pos = 0; + _queue_end = 0; + _trigger_count = 0; + return 0; +} + +int IMuseInternal::enqueue_command(int a, int b, int c, int d, int e, int f, int g) +{ + uint16 *p; + uint i; + + i = _queue_pos; + + if (i == _queue_end) + return -1; + + if (a == -1) { + _queue_adding = false; + _trigger_count++; + return 0; + } + + p = _cmd_queue[_queue_pos].array; + p[0] = COMMAND_ID; + p[1] = a; + p[2] = b; + p[3] = c; + p[4] = d; + p[5] = e; + p[6] = f; + p[7] = g; + + i = (i + 1) & (ARRAYSIZE(_cmd_queue) - 1); + + if (_queue_end != i) { + _queue_pos = i; + return 0; + } else { + _queue_pos = (i - 1) & (ARRAYSIZE(_cmd_queue) - 1); + return -1; + } +} + +int IMuseInternal::query_queue(int param) +{ + switch (param) { + case 0: /* get trigger count */ + return _trigger_count; + case 1: /* get trigger type */ + if (_queue_end == _queue_pos) + return -1; + return _cmd_queue[_queue_end].array[1]; + case 2: /* get trigger sound */ + if (_queue_end == _queue_pos) + return 0xFF; + return _cmd_queue[_queue_end].array[2]; + default: + return -1; + } +} + +int IMuseInternal::get_music_volume() +{ + return _music_volume * 2; +} + +int IMuseInternal::set_music_volume(uint vol) +{ + if (vol > 256) + vol = 256; + else if (vol < 0) + vol = 0; + + _music_volume = vol / 2; + return 0; +} + +int IMuseInternal::set_master_volume_intern(uint vol) +{ + if (vol > 127) + return -1; + + if (_music_volume > 0) + vol = vol * _music_volume / 128; + + _master_volume = vol; + for (int i = 0; i != 8; i++) + _channel_volume_eff[i] = (_channel_volume[i] + 1) * vol >> 7; + update_volumes(); + + return 0; +} + +int IMuseInternal::set_master_volume(uint vol) +{ + // recalibrate from 0-256 range + vol = vol * 127 / 256; + + return set_master_volume_intern(vol); +} + +int IMuseInternal::get_master_volume() +{ + // recalibrate to 0-256 range + return _master_volume * 256 / 127; +} + +int IMuseInternal::terminate() +{ + return 0; + /* not implemented */ +} + + +int IMuseInternal::enqueue_trigger(int sound, int marker) +{ + uint16 *p; + uint pos; + + pos = _queue_pos; + + p = _cmd_queue[pos].array; + p[0] = TRIGGER_ID; + p[1] = sound; + p[2] = marker; + + pos = (pos + 1) & (ARRAYSIZE(_cmd_queue) - 1); + if (_queue_end == pos) { + _queue_pos = (pos - 1) & (ARRAYSIZE(_cmd_queue) - 1); + return -1; + } + + _queue_pos = pos; + _queue_adding = true; + _queue_sound = sound; + _queue_marker = marker; + return 0; +} + +int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g, int h) +{ + byte cmd = a & 0xFF; + byte param = a >> 8; + Player *player = NULL; + + if (!_initialized && (cmd || param)) + return -1; + + if (param == 0) { + switch (cmd) { + case 6: + return set_master_volume_intern(b); + case 7: + return _master_volume; + case 8: + return start_sound(b) ? 0 : -1; + case 9: + return stop_sound(b); + case 10: + return stop_all_sounds(); //FIXME: Sam and Max unknown + case 11: + return stop_all_sounds(); + case 13: + return get_sound_status(b); + case 14:{ // FIXME: Sam and Max command - Total guess + int i; // Seems to work as a volume fader + Player *player; + + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active && player->_id == (uint16)b) { + player->fade_vol(e, f); + return 0; + } + } + } + case 15:{ // FIXME: Sam and Max command - Total guess + int i; // Something to do with position? + Player *player; + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active && player->_id == (uint16)b) { + player->jump(player->_track_index + 1, 0, 0); + return 0; + } + } + } + + case 16: + return set_volchan(b, c); + case 17: + return set_channel_volume(b, c); + case 18: + return set_volchan_entry(b, c); + case 19: + return stop_sound(b); //FIXME: Sam and Max unknown + case 20: + return stop_sound(b); //FIXME: Sam and Max unknown + case 2: + case 3: + return 0; + default: + warning("IMuseInternal::do_command invalid command %d", cmd); + } + } else if (param == 1) { + + if ((1 << cmd) & (0x783FFF)) { + player = get_player_byid(b); + if (!player) + return -1; + if ((1 << cmd) & (1 << 11 | 1 << 22)) { + assert(c >= 0 && c <= 15); + player = (Player *)player->get_part(c); + if (!player) + return -1; + } + } + + switch (cmd) { + case 0: + return player->get_param(c, d); + case 1: + player->set_priority(c); + return 0; + case 2: + return player->set_vol(c); + case 3: + player->set_pan(c); + return 0; + case 4: + return player->set_transpose(c, d); + case 5: + player->set_detune(c); + return 0; + case 6: + player->set_speed(c); + return 0; + case 7: + return player->jump(c, d, e) ? 0 : -1; + case 8: + return player->scan(c, d, e); + case 9: + return player->set_loop(c, d, e, f, g) ? 0 : -1; + case 10: + player->clear_loop(); + return 0; + case 11: + ((Part *)player)->set_onoff(d != 0); + return 0; + case 12: + return player->_hook.set(c, d, e); + case 13: + return player->fade_vol(c, d); + case 14: + return enqueue_trigger(b, c); + case 15: + return enqueue_command(b, c, d, e, f, g, h); + case 16: + return clear_queue(); + case 19: + return player->get_param(c, d); + case 20: + return player->_hook.set(c, d, e); + case 21: + return -1; + case 22: + ((Part *)player)->set_vol(d); + return 0; + case 23: + return query_queue(b); + case 24: + return 0; + default: + warning("IMuseInternal::do_command default midi command %d", cmd); + return -1; + } + } + + return -1; +} + +int IMuseInternal::set_channel_volume(uint chan, uint vol) +{ + if (chan >= 8 || vol > 127) + return -1; + + _channel_volume[chan] = vol; + _channel_volume_eff[chan] = _master_volume * (vol + 1) >> 7; + update_volumes(); + return 0; +} + +void IMuseInternal::update_volumes() +{ + Player *player; + int i; + + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active) + player->set_vol(player->_volume); + } +} + +int IMuseInternal::set_volchan_entry(uint a, uint b) +{ + if (a >= 8) + return -1; + _volchan_table[a] = b; + return 0; +} + +int HookDatas::query_param(int param, byte chan) +{ + switch (param) { + case 18: + return _jump; + case 19: + return _transpose; + case 20: + return _part_onoff[chan]; + case 21: + return _part_volume[chan]; + case 22: + return _part_program[chan]; + case 23: + return _part_transpose[chan]; + default: + return -1; + } +} + +int HookDatas::set(byte cls, byte value, byte chan) +{ + switch (cls) { + case 0: + _jump = value; + break; + case 1: + _transpose = value; + break; + case 2: + if (chan < 16) + _part_onoff[chan] = value; + else if (chan == 16) + memset(_part_onoff, value, 16); + break; + case 3: + if (chan < 16) + _part_volume[chan] = value; + else if (chan == 16) + memset(_part_volume, value, 16); + break; + case 4: + if (chan < 16) + _part_program[chan] = value; + else if (chan == 16) + memset(_part_program, value, 16); + break; + case 5: + if (chan < 16) + _part_transpose[chan] = value; + else if (chan == 16) + memset(_part_transpose, value, 16); + break; + default: + return -1; + } + return 0; +} + + +VolumeFader *IMuseInternal::allocate_volume_fader() +{ + VolumeFader *vf; + int i; + + vf = _volume_fader; + for (i = ARRAYSIZE(_volume_fader); vf->active;) { + vf++; + if (!--i) + return NULL; + } + + vf->active = true; + _active_volume_faders = true; + return vf; +} + +Player *IMuseInternal::get_player_byid(int id) +{ + int i; + Player *player, *found = NULL; + + for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { + if (player->_active && player->_id == (uint16)id) { + if (found) + return NULL; + found = player; + } + } + return found; +} + +int IMuseInternal::get_volchan_entry(uint a) +{ + if (a < 8) + return _volchan_table[a]; + return -1; +} + +uint32 IMuseInternal::property(int prop, uint32 value) +{ + switch (prop) { + case IMuse::PROP_TEMPO_BASE: + _game_tempo = value; + break; + } + return 0; +} + +void IMuseInternal::setBase(byte **base) +{ + _base_sounds = base; +} + + +IMuseInternal *IMuseInternal::create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) +{ + IMuseInternal *i = new IMuseInternal; + i->initialize(syst, midi, mixer); + return i; +} + + +int IMuseInternal::initialize(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) +{ + int i; + + IMuseDriver *driv; + + if (midi == NULL) { + driv = new IMuseAdlib(mixer); + } else { + driv = new IMuseGM(midi); + } + + _driver = driv; + _hardware_type = driv->get_hardware_type(); + _game_tempo = driv->get_base_tempo(); + + driv->init(this, syst); + + _master_volume = 127; + if (_music_volume < 1) + _music_volume = kDefaultMusicVolume; + + for (i = 0; i != 8; i++) + _channel_volume[i] = _channel_volume_eff[i] = _volchan_table[i] = 127; + + init_players(); + init_sustaining_notes(); + init_volume_fader(); + init_queue(); + init_parts(); + + _initialized = true; + + return 0; +} + +void IMuseInternal::init_queue() +{ + _queue_adding = false; + _queue_pos = 0; + _queue_end = 0; + _trigger_count = 0; +} + +void IMuseInternal::pause(bool paused) +{ + lock(); + + int i; + Part *part; + + for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { + if (part->_player) { + if (paused) { + part->_vol_eff = 0; + } else { + part->set_vol(part->_vol); + } + part->changed(IMuseDriver::pcVolume); + } + } + + _paused = paused; + + unlock(); +} + + +/*************************************************************************/ + +int Player::fade_vol(byte vol, int time) +{ + VolumeFader *vf; + int i; + + cancel_volume_fade(); + if (time == 0) { + set_vol(vol); + return 0; + } + + vf = _se->allocate_volume_fader(); + if (vf == NULL) + return -1; + + vf->player = this; + vf->num_steps = vf->speed_lo_max = time; + vf->curvol = _volume; + i = (vol - vf->curvol); + vf->speed_hi = i / time; + if (i < 0) { + i = -i; + vf->direction = -1; + } else { + vf->direction = 1; + } + vf->speed_lo = i % time; + vf->speed_lo_counter = 0; + return 0; +} + +void Player::clear() +{ + uninit_seq(); + cancel_volume_fade(); + uninit_parts(); + _active = false; + _ticks_per_beat = TICKS_PER_BEAT; +} + +bool Player::start_sound(int sound) +{ + void *mdhd; + + mdhd = _se->findTag(sound, MDHD_TAG, 0); + if (mdhd == NULL) { + mdhd = _se->findTag(sound, MDPG_TAG, 0); + if (mdhd == NULL) { + warning("P::start_sound failed: Couldn't find %s", MDHD_TAG); + return false; + } + } + + _mt32emulate = _se->isMT32(sound); + _parts = NULL; + _active = true; + _id = sound; + _priority = 0x80; + _volume = 0x7F; + _vol_chan = 0xFFFF; + + _vol_eff = (_se->get_channel_volume(0xFFFF) << 7) >> 7; + + _pan = 0; + _transpose = 0; + _detune = 0; + + hook_clear(); + if (start_seq_sound(sound) != 0) { + _active = false; + return false; + } + return true; +} + +void Player::hook_clear() +{ + memset(&_hook, 0, sizeof(_hook)); +} + +int Player::start_seq_sound(int sound) +{ + byte *ptr, *track_ptr; + + _song_index = sound; + _timer_counter = 0; + _loop_to_beat = 1; + _loop_from_beat = 1; + _track_index = 0; + _loop_counter = 0; + _loop_to_tick = 0; + _loop_from_tick = 0; + + set_tempo(500000); + set_speed(128); + ptr = _se->findTag(sound, "MTrk", _track_index); + if (ptr == NULL) + return -1; + + track_ptr = ptr; + _cur_pos = _next_pos = get_delta_time(&track_ptr); + _song_offset = track_ptr - ptr; + + _tick_index = _cur_pos; + _beat_index = 1; + + if (_tick_index >= _ticks_per_beat) { + _beat_index += _tick_index / _ticks_per_beat; + _tick_index %= _ticks_per_beat; + } + + return 0; +} + +void Player::set_tempo(uint32 b) +{ + uint32 i, j; + + i = _se->_game_tempo; + + j = _tempo = b; + + while (i & 0xFFFF0000 || j & 0xFFFF0000) { + i >>= 1; + j >>= 1; + } + + _tempo_eff = (i << 16) / j; + + set_speed(_speed); +} + +void Player::cancel_volume_fade() +{ + VolumeFader *vf = _se->_volume_fader; + int i; + + for (i = 0; i < 8; i++, vf++) { + if (vf->active && vf->player == this) + vf->active = false; + } +} + +void Player::uninit_parts() +{ + if (_parts && _parts->_player != this) + error("asd"); + while (_parts) + _parts->uninit(); +} + +void Player::uninit_seq() +{ + _abort = true; +} + +void Player::set_speed(byte speed) +{ + _speed = speed; + _timer_speed = (_tempo_eff * speed >> 7); +} + +byte *Player::parse_midi(byte *s) +{ + byte cmd, chan, note, velocity, control; + uint value; + Part *part; + + cmd = *s++; + + chan = cmd & 0xF; + + switch (cmd >> 4) { + case 0x8: /* key off */ + note = *s++; + if (!_scanning) { + key_off(chan, note); + } else { + clear_active_note(chan, note); + } + s++; /* skip velocity */ + break; + + case 0x9: /* key on */ + note = *s++; + velocity = *s++; + if (velocity) { + if (!_scanning) + key_on(chan, note, velocity); + else + set_active_note(chan, note); + } else { + if (!_scanning) + key_off(chan, note); + else + clear_active_note(chan, note); + } + break; + + case 0xA: /* aftertouch */ + s += 2; + break; + + case 0xB: /* control change */ + control = *s++; + value = *s++; + part = get_part(chan); + if (!part) + break; + + switch (control) { + case 1: /* modulation wheel */ + part->set_modwheel(value); + break; + case 7: /* volume */ + part->set_vol(value); + break; + case 10: /* pan position */ + part->set_pan(value - 0x40); + break; + case 16: /* pitchbend factor */ + part->set_pitchbend_factor(value); + break; + case 17: /* gp slider 2 */ + part->set_detune(value - 0x40); + break; + case 18: /* gp slider 3 */ + part->set_pri(value - 0x40); + _se->_driver->update_pris(); + break; + case 64: /* hold pedal */ + part->set_pedal(value != 0); + break; + case 91: /* effects level */ + part->set_effect_level(value); + break; + case 93: /* chorus */ + part->set_chorus(value); + break; + default: + warning("parse_midi: invalid control %d", control); + } + break; + + case 0xC: /* program change */ + value = *s++; + part = get_part(chan); + if (part) + part->set_program(value); + break; + + case 0xD: /* channel pressure */ + s++; + break; + + case 0xE: /* pitch bend */ + part = get_part(chan); + if (part) + part->set_pitchbend(((s[1] - 0x40) << 7) | s[0]); + s += 2; + break; + + case 0xF: + if (chan == 0) { + uint size = get_delta_time(&s); + if (*s == SYSEX_ID) + parse_sysex(s, size); + s += size; + } else if (chan == 0xF) { + cmd = *s++; + if (cmd == 47) + goto Error; /* end of song */ + if (cmd == 81) { + set_tempo((s[1] << 16) | (s[2] << 8) | s[3]); + s += 4; + break; + } + s += get_delta_time(&s); + } else if (chan == 0x7) { + s += get_delta_time(&s); + } else { + goto Error; + } + break; + + default: + Error:; + if (!_scanning) + clear(); + return NULL; + } + return s; +} + +void Player::parse_sysex(byte *p, uint len) +{ + byte code; + byte a; + uint b; + byte buf[128]; + Part *part; + + /* too big? */ + if (len >= sizeof(buf) * 2) + return; + + /* skip sysex manufacturer */ + p++; + len -= 2; + + switch (code = *p++) { + case 16: /* set instrument in part */ + a = *p++ & 0x0F; + if (_se->_hardware_type != *p++) + break; + decode_sysex_bytes(p, buf, len - 3); + part = get_part(a); + if (part) + part->set_instrument((Instrument *) buf); + break; + + case 17: /* set global instrument */ + p++; + if (_se->_hardware_type != *p++) + break; + a = *p++; + decode_sysex_bytes(p, buf, len - 4); + _se->_driver->set_instrument(a, buf); + break; + + case 33: /* param adjust */ + a = *p++ & 0x0F; + if (_se->_hardware_type != *p++) + break; + decode_sysex_bytes(p, buf, len - 3); + part = get_part(a); + if (part) + part->set_param(read_word(buf), read_word(buf + 2)); + break; + + case 48: /* hook - jump */ + if (_scanning) + break; + decode_sysex_bytes(p + 1, buf, len - 2); + maybe_jump(buf); + break; + + case 49: /* hook - global transpose */ + decode_sysex_bytes(p + 1, buf, len - 2); + maybe_set_transpose(buf); + break; + + case 50: /* hook - part on/off */ + buf[0] = *p++ & 0x0F; + decode_sysex_bytes(p, buf + 1, len - 2); + maybe_part_onoff(buf); + break; + + case 51: /* hook - set volume */ + buf[0] = *p++ & 0x0F; + decode_sysex_bytes(p, buf + 1, len - 2); + maybe_set_volume(buf); + break; + + case 52: /* hook - set program */ + buf[0] = *p++ & 0x0F; + decode_sysex_bytes(p, buf + 1, len - 2); + maybe_set_program(buf); + break; + + case 53: /* hook - set transpose */ + buf[0] = *p++ & 0x0F; + decode_sysex_bytes(p, buf + 1, len - 2); + maybe_set_transpose_part(buf); + break; + + case 64: /* marker */ + p++; + len -= 2; + while (len--) { + _se->handle_marker(_id, *p++); + } + break; + + case 80: /* loop */ + decode_sysex_bytes(p + 1, buf, len - 2); + set_loop(read_word(buf), + read_word(buf + 2), read_word(buf + 4), read_word(buf + 6), read_word(buf + 8) + ); + break; + + case 81: /* end loop */ + clear_loop(); + break; + + case 96: /* set instrument */ + part = get_part(p[0] & 0x0F); + b = (p[1] & 0x0F) << 12 | (p[2] & 0x0F) << 8 | (p[4] & 0x0F) << 4 | (p[4] & 0x0F); + if (part) + part->set_instrument(b); + break; + + default: + debug(6, "unknown sysex %d", code); + } +} + +void Player::decode_sysex_bytes(byte *src, byte *dst, int len) +{ + while (len >= 0) { + *dst++ = (src[0] << 4) | (src[1] & 0xF); + src += 2; + len -= 2; + } +} + +void Player::maybe_jump(byte *data) +{ + byte cmd; + + cmd = data[0]; + + /* is this the hook i'm waiting for? */ + if (cmd && _hook._jump != cmd) + return; + + /* reset hook? */ + if (cmd != 0 && cmd < 0x80) + _hook._jump = 0; + + jump(read_word(data + 1), read_word(data + 3), read_word(data + 5)); +} + +void Player::maybe_set_transpose(byte *data) +{ + byte cmd; + + cmd = data[0]; + + /* is this the hook i'm waiting for? */ + if (cmd && _hook._transpose != cmd) + return; + + /* reset hook? */ + if (cmd != 0 && cmd < 0x80) + _hook._transpose = 0; + + set_transpose(data[1], (int8)data[2]); +} + +void Player::maybe_part_onoff(byte *data) +{ + byte cmd, *p; + uint chan; + Part *part; + + cmd = data[1]; + chan = data[0]; + + p = &_hook._part_onoff[chan]; + + /* is this the hook i'm waiting for? */ + if (cmd && *p != cmd) + return; + + if (cmd != 0 && cmd < 0x80) + *p = 0; + + part = get_part(chan); + if (part) + part->set_onoff(data[2] != 0); +} + +void Player::maybe_set_volume(byte *data) +{ + byte cmd; + byte *p; + uint chan; + Part *part; + + cmd = data[1]; + chan = data[0]; + + p = &_hook._part_volume[chan]; + + /* is this the hook i'm waiting for? */ + if (cmd && *p != cmd) + return; + + /* reset hook? */ + if (cmd != 0 && cmd < 0x80) + *p = 0; + + part = get_part(chan); + if (part) + part->set_vol(data[2]); +} + +void Player::maybe_set_program(byte *data) +{ + byte cmd; + byte *p; + uint chan; + Part *part; + + cmd = data[1]; + chan = data[0]; + + /* is this the hook i'm waiting for? */ + p = &_hook._part_program[chan]; + + if (cmd && *p != cmd) + return; + + if (cmd != 0 && cmd < 0x80) + *p = 0; + + part = get_part(chan); + if (part) + part->set_program(data[2]); +} + +void Player::maybe_set_transpose_part(byte *data) +{ + byte cmd; + byte *p; + uint chan; + + cmd = data[1]; + chan = data[0]; + + /* is this the hook i'm waiting for? */ + p = &_hook._part_transpose[chan]; + + if (cmd && *p != cmd) + return; + + /* reset hook? */ + if (cmd != 0 && cmd < 0x80) + *p = 0; + + part_set_transpose(chan, data[2], (int8)data[3]); +} + +int Player::set_transpose(byte relative, int b) +{ + Part *part; + + if (b > 24 || b < -24 || relative > 1) + return -1; + if (relative) + b = transpose_clamp(_transpose + b, -7, 7); + + _transpose = b; + + for (part = _parts; part; part = part->_next) { + part->set_transpose(part->_transpose); + } + + return 0; +} + +void Player::clear_active_notes() +{ + memset(_se->_active_notes, 0, sizeof(_se->_active_notes)); +} + +void Player::clear_active_note(int chan, byte note) +{ + _se->_active_notes[note] &= ~(1 << chan); +} + +void Player::set_active_note(int chan, byte note) +{ + _se->_active_notes[note] |= (1 << chan); +} + +void Player::part_set_transpose(uint8 chan, byte relative, int8 b) +{ + Part *part; + + if (b > 24 || b < -24) + return; + + part = get_part(chan); + if (!part) + return; + if (relative) + b = transpose_clamp(b + part->_transpose, -7, 7); + part->set_transpose(b); +} + +void Player::key_on(uint8 chan, uint8 note, uint8 velocity) +{ + Part *part; + + part = get_part(chan); + if (!part || !part->_on) + return; + + part->key_on(note, velocity); +} + +void Player::key_off(uint8 chan, uint8 note) +{ + Part *part; + + for (part = _parts; part; part = part->_next) { + if (part->_chan == (byte)chan && part->_on) + part->key_off(note); + } +} + +bool Player::jump(uint track, uint beat, uint tick) +{ + byte *mtrk, *cur_mtrk, *scanpos; + uint32 topos, curpos, track_offs; + + if (!_active) + return false; + + mtrk = _se->findTag(_song_index, "MTrk", track); + if (!mtrk) + return false; + + cur_mtrk = _se->findTag(_song_index, "MTrk", _track_index); + if (!cur_mtrk) + return false; + + _se->lock(); + + if (beat == 0) + beat = 1; + + topos = (beat - 1) * _ticks_per_beat + tick; + + if (track == _track_index && topos >= _cur_pos) { + scanpos = _song_offset + mtrk; + curpos = _next_pos; + } else { + scanpos = mtrk; + curpos = get_delta_time(&scanpos); + } + + while (curpos < topos) { + skip_midi_cmd(&scanpos); + if (!scanpos) { + _se->unlock(); + return false; + } + curpos += get_delta_time(&scanpos); + } + + track_offs = scanpos - mtrk; + + turn_off_pedals(); + + find_sustaining_notes(cur_mtrk + _song_offset, mtrk + track_offs, curpos - topos); + + _beat_index = beat; + _tick_index = tick; + _cur_pos = topos; + _next_pos = curpos; + _timer_counter = 0; + _song_offset = track_offs; + if (track != _track_index) { + _track_index = track; + _loop_counter = 0; + } + _abort = true; + _se->unlock(); + return true; +} + +bool Player::set_loop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick) +{ + if (tobeat + 1 >= frombeat) + return false; + + if (tobeat == 0) + tobeat = 1; + + _loop_counter = 0; /* because of possible interrupts */ + _loop_to_beat = tobeat; + _loop_to_tick = totick; + _loop_from_beat = frombeat; + _loop_from_tick = fromtick; + _loop_counter = count; + + return true; +} + +void Player::clear_loop() +{ + _loop_counter = 0; +} + +void Player::turn_off_pedals() +{ + Part *part; + + for (part = _parts; part; part = part->_next) { + if (part->_pedal) + part->set_pedal(false); + } +} + +void Player::find_sustaining_notes(byte *a, byte *b, uint32 l) +{ + uint32 pos; + uint16 mask; + uint16 *bitlist_ptr; + SustainingNotes *sn, *next; + IsNoteCmdData isnote; + int j; + uint num_active; + uint max_off_pos; + + num_active = update_actives(); + + /* pos contains number of ticks since current position */ + pos = _next_pos - _cur_pos; + if ((int32)pos < 0) + pos = 0; + + /* locate the positions where the notes are turned off. + * remember each note that was turned off + */ + while (num_active != 0) { + /* is note off? */ + j = is_note_cmd(&a, &isnote); + if (j == -1) + break; + if (j == 1) { + mask = 1 << isnote.chan; + bitlist_ptr = _se->_active_notes + isnote.note; + if (*bitlist_ptr & mask) { + *bitlist_ptr &= ~mask; + num_active--; + /* Get a node from the free list */ + if ((sn = _se->_sustain_notes_free) == NULL) + return; + _se->_sustain_notes_free = sn->next; + + /* Insert it in the beginning of the used list */ + sn->next = _se->_sustain_notes_used; + _se->_sustain_notes_used = sn; + sn->prev = NULL; + if (sn->next) + sn->next->prev = sn; + + sn->note = isnote.note; + sn->chan = isnote.chan; + sn->player = this; + sn->off_pos = pos; + sn->pos = 0; + sn->counter = 0; + } + } + pos += get_delta_time(&a); + } + + /* find the maximum position where a note was turned off */ + max_off_pos = 0; + for (sn = _se->_sustain_notes_used; sn; sn = sn->next) { + _se->_active_notes[sn->note] |= (1 << sn->chan); + if (sn->off_pos > max_off_pos) { + max_off_pos = sn->off_pos; + } + } + + /* locate positions where notes are turned on */ + pos = l; + while (pos < max_off_pos) { + j = is_note_cmd(&b, &isnote); + if (j == -1) + break; + if (j == 2) { + mask = 1 << isnote.chan; + bitlist_ptr = _se->_active_notes + isnote.note; + + if (*bitlist_ptr & mask) { + sn = _se->_sustain_notes_used; + while (sn) { + next = sn->next; + if (sn->note == isnote.note && sn->chan == isnote.chan && pos < sn->off_pos) { + *bitlist_ptr &= ~mask; + /* Unlink from the sustain list */ + if (next) + next->prev = sn->prev; + if (sn->prev) + sn->prev->next = next; + else + _se->_sustain_notes_used = next; + /* Insert into the free list */ + sn->next = _se->_sustain_notes_free; + _se->_sustain_notes_free = sn; + } + sn = next; + } + } + } + pos += get_delta_time(&b); + } + + /* Concatenate head and used list */ + if (!_se->_sustain_notes_head) { + _se->_sustain_notes_head = _se->_sustain_notes_used; + _se->_sustain_notes_used = NULL; + return; + } + sn = _se->_sustain_notes_head; + while (sn->next) + sn = sn->next; + sn->next = _se->_sustain_notes_used; + _se->_sustain_notes_used = NULL; + if (sn->next) + sn->next->prev = sn; +} + +Part *Player::get_part(uint8 chan) +{ + Part *part; + + part = _parts; + while (part) { + if (part->_chan == chan) + return part; + part = part->_next; + } + + part = _se->allocate_part(_priority); + if (!part) { + warning("no parts available"); + return NULL; + } + + part->_chan = chan; + part->setup(this); + + return part; +} + +uint Player::update_actives() +{ + Part *part; + uint16 *active; + int count = 0; + + clear_active_notes(); + active = _se->_active_notes; + for (part = _parts; part; part = part->_next) { + if (part->_mc) + count += part->update_actives(active); + } + return count; +} + +void Player::set_priority(int pri) +{ + Part *part; + + _priority = pri; + for (part = _parts; part; part = part->_next) { + part->set_pri(part->_pri); + } + _se->_driver->update_pris(); +} + +void Player::set_pan(int pan) +{ + Part *part; + + _pan = pan; + for (part = _parts; part; part = part->_next) { + part->set_pan(part->_pan); + } +} + +void Player::set_detune(int detune) +{ + Part *part; + + _detune = detune; + for (part = _parts; part; part = part->_next) { + part->set_detune(part->_detune); + } +} + +int Player::scan(uint totrack, uint tobeat, uint totick) +{ + byte *mtrk, *scanptr; + uint32 curpos, topos; + uint32 pos; + + assert(totrack >= 0 && tobeat >= 0 && totick >= 0); + + if (!_active) + return -1; + + mtrk = _se->findTag(_song_index, "MTrk", totrack); + if (!mtrk) + return -1; + + _se->lock(); + if (tobeat == 0) + tobeat++; + + turn_off_parts(); + clear_active_notes(); + scanptr = mtrk; + curpos = get_delta_time(&scanptr); + _scanning = true; + + topos = (tobeat - 1) * _ticks_per_beat + totick; + + while (curpos < topos) { + scanptr = parse_midi(scanptr); + if (!scanptr) { + _scanning = false; + _se->unlock(); + return -1; + } + curpos += get_delta_time(&scanptr); + } + pos = scanptr - mtrk; + + _scanning = false; + _se->driver()->update_pris(); + play_active_notes(); + _beat_index = tobeat; + _tick_index = totick; + _cur_pos = topos; + _next_pos = curpos; + _timer_counter = 0; + _song_offset = pos; + if (_track_index != totrack) { + _track_index = totrack; + _loop_counter = 0; + } + _se->unlock(); + return 0; +} + +void Player::turn_off_parts() +{ + Part *part; + + for (part = _parts; part; part = part->_next) + part->off(); +} + +void Player::play_active_notes() +{ + int i, j; + uint mask; + + for (i = 0; i != 128; i++) { + mask = _se->_active_notes[i]; + for (j = 0; j != 16; j++, mask >>= 1) { + if (mask & 1) { + key_on(j, i, 80); + } + } + } +} + +int Player::set_vol(byte vol) +{ + Part *part; + + if (vol > 127) + return -1; + + _volume = vol; + _vol_eff = _se->get_channel_volume(_vol_chan) * (vol + 1) >> 7; + + for (part = _parts; part; part = part->_next) { + part->set_vol(part->_vol); + } + + return 0; +} + +int Player::get_param(int param, byte chan) +{ + switch (param) { + case 0: + return (byte)_priority; + case 1: + return (byte)_volume; + case 2: + return (byte)_pan; + case 3: + return (byte)_transpose; + case 4: + return (byte)_detune; + case 5: + return _speed; + case 6: + return _track_index; + case 7: + return _beat_index; + case 8: + return _tick_index; + case 9: + return _loop_counter; + case 10: + return _loop_to_beat; + case 11: + return _loop_to_tick; + case 12: + return _loop_from_beat; + case 13: + return _loop_from_tick; + case 14: + case 15: + case 16: + case 17: + return query_part_param(param, chan); + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + return _hook.query_param(param, chan); + default: + return -1; + } +} + +int Player::query_part_param(int param, byte chan) +{ + Part *part; + + part = _parts; + while (part) { + if (part->_chan == chan) { + switch (param) { + case 14: + return part->_on; + case 15: + return part->_vol; + case 16: + return part->_program; + case 17: + return part->_transpose; + default: + return -1; + } + } + part = part->_next; + } + return 129; +} + +void Player::sequencer_timer() +{ + byte *mtrk; + uint32 counter; + byte *song_ptr; + + counter = _timer_counter + _timer_speed; + _timer_counter = counter & 0xFFFF; + _cur_pos += counter >> 16; + _tick_index += counter >> 16; + + if (_tick_index >= _ticks_per_beat) { + _beat_index += _tick_index / _ticks_per_beat; + _tick_index %= _ticks_per_beat; + } + if (_loop_counter && _beat_index >= _loop_from_beat && _tick_index >= _loop_from_tick) { + _loop_counter--; + jump(_track_index, _loop_to_beat, _loop_to_tick); + } + if (_next_pos <= _cur_pos) { + mtrk = _se->findTag(_song_index, "MTrk", _track_index); + if (!mtrk) { + warning("Sound %d was unloaded while active", _song_index); + clear(); + } else { + song_ptr = mtrk + _song_offset; + _abort = false; + + while (_next_pos <= _cur_pos) { + song_ptr = parse_midi(song_ptr); + if (!song_ptr || _abort) + return; + _next_pos += get_delta_time(&song_ptr); + } + _song_offset = song_ptr - mtrk; + } + } +} + +/*******************************************************************/ + +#define OFFS(type,item) ((int)(&((type*)0)->item)) +#define SIZE(type,item) sizeof(((type*)0)->item) +#define MKLINE(type,item,saveas) {OFFS(type,item),saveas,SIZE(type,item)} +#define MKARRAY(type,item,saveas,num) {OFFS(type,item),128|saveas,SIZE(type,item)}, {num,0,0} +#define MKEND() {0xFFFF,0xFF,0xFF} + +#define MKREF(type,item,refid) {OFFS(type,item),refid,0xFF} + +enum { + TYPE_PART = 1, + TYPE_PLAYER = 2, +}; + +int IMuseInternal::saveReference(IMuseInternal *me, byte type, void *ref) +{ + switch (type) { + case TYPE_PART: + return (Part *)ref - me->_parts; + case TYPE_PLAYER: + return (Player *)ref - me->_players; + default: + error("saveReference: invalid type"); + } +} + +void *IMuseInternal::loadReference(IMuseInternal *me, byte type, int ref) +{ + switch (type) { + case TYPE_PART: + return &me->_parts[ref]; + case TYPE_PLAYER: + return &me->_players[ref]; + default: + error("loadReference: invalid type"); + } +} + +int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) +{ + const SaveLoadEntry mainEntries[] = { + MKLINE(IMuseInternal, _queue_end, sleUint8), + MKLINE(IMuseInternal, _queue_pos, sleUint8), + MKLINE(IMuseInternal, _queue_sound, sleUint16), + MKLINE(IMuseInternal, _queue_adding, sleByte), + MKLINE(IMuseInternal, _queue_marker, sleByte), + MKLINE(IMuseInternal, _queue_cleared, sleByte), + MKLINE(IMuseInternal, _master_volume, sleByte), + MKLINE(IMuseInternal, _trigger_count, sleUint16), + MKARRAY(IMuseInternal, _channel_volume[0], sleUint16, 8), + MKARRAY(IMuseInternal, _volchan_table[0], sleUint16, 8), + MKEND() + }; + + const SaveLoadEntry playerEntries[] = { + MKREF(Player, _parts, TYPE_PART), + MKLINE(Player, _active, sleByte), + MKLINE(Player, _id, sleUint16), + MKLINE(Player, _priority, sleByte), + MKLINE(Player, _volume, sleByte), + MKLINE(Player, _pan, sleInt8), + MKLINE(Player, _transpose, sleByte), + MKLINE(Player, _detune, sleInt8), + MKLINE(Player, _vol_chan, sleUint16), + MKLINE(Player, _vol_eff, sleByte), + MKLINE(Player, _speed, sleByte), + MKLINE(Player, _song_index, sleUint16), + MKLINE(Player, _track_index, sleUint16), + MKLINE(Player, _timer_counter, sleUint16), + MKLINE(Player, _loop_to_beat, sleUint16), + MKLINE(Player, _loop_from_beat, sleUint16), + MKLINE(Player, _loop_counter, sleUint16), + MKLINE(Player, _loop_to_tick, sleUint16), + MKLINE(Player, _loop_from_tick, sleUint16), + MKLINE(Player, _tempo, sleUint32), + MKLINE(Player, _cur_pos, sleUint32), + MKLINE(Player, _next_pos, sleUint32), + MKLINE(Player, _song_offset, sleUint32), + MKLINE(Player, _tick_index, sleUint16), + MKLINE(Player, _beat_index, sleUint16), + MKLINE(Player, _ticks_per_beat, sleUint16), + MKLINE(Player, _hook._jump, sleByte), + MKLINE(Player, _hook._transpose, sleByte), + MKARRAY(Player, _hook._part_onoff[0], sleByte, 16), + MKARRAY(Player, _hook._part_volume[0], sleByte, 16), + MKARRAY(Player, _hook._part_program[0], sleByte, 16), + MKARRAY(Player, _hook._part_transpose[0], sleByte, 16), + MKEND() + }; + + const SaveLoadEntry volumeFaderEntries[] = { + MKREF(VolumeFader, player, TYPE_PLAYER), + MKLINE(VolumeFader, active, sleUint8), + MKLINE(VolumeFader, curvol, sleUint8), + MKLINE(VolumeFader, speed_lo_max, sleUint16), + MKLINE(VolumeFader, num_steps, sleUint16), + MKLINE(VolumeFader, speed_hi, sleInt8), + MKLINE(VolumeFader, direction, sleInt8), + MKLINE(VolumeFader, speed_lo, sleInt8), + MKLINE(VolumeFader, speed_lo_counter, sleUint16), + MKEND() + }; + + const SaveLoadEntry partEntries[] = { + MKREF(Part, _next, TYPE_PART), + MKREF(Part, _prev, TYPE_PART), + MKREF(Part, _player, TYPE_PLAYER), + MKLINE(Part, _pitchbend, sleInt16), + MKLINE(Part, _pitchbend_factor, sleUint8), + MKLINE(Part, _transpose, sleInt8), + MKLINE(Part, _vol, sleUint8), + MKLINE(Part, _detune, sleInt8), + MKLINE(Part, _pan, sleInt8), + MKLINE(Part, _on, sleUint8), + MKLINE(Part, _modwheel, sleUint8), + MKLINE(Part, _pedal, sleUint8), + MKLINE(Part, _program, sleUint8), + MKLINE(Part, _pri, sleUint8), + MKLINE(Part, _chan, sleUint8), + MKLINE(Part, _effect_level, sleUint8), + MKLINE(Part, _chorus, sleUint8), + MKLINE(Part, _percussion, sleUint8), + MKLINE(Part, _bank, sleUint8), + MKEND() + }; + + if (!ser->isSaving()) { + stop_all_sounds(); + } +#ifdef _WIN32_WCE // Don't break savegames made with andys' build + if (!ser->isSaving() && ser->checkEOFLoadStream()) + return 0; +#endif + + ser->_ref_me = this; + ser->_saveload_ref = ser->isSaving()? ((void *)&saveReference) : ((void *)&loadReference); + + ser->saveLoadEntries(this, mainEntries); + ser->saveLoadArrayOf(_players, ARRAYSIZE(_players), sizeof(_players[0]), playerEntries); + ser->saveLoadArrayOf(_parts, ARRAYSIZE(_parts), sizeof(_parts[0]), partEntries); + ser->saveLoadArrayOf(_volume_fader, ARRAYSIZE(_volume_fader), + sizeof(_volume_fader[0]), volumeFaderEntries); + + if (!ser->isSaving()) { + /* Load all sounds that we need */ + fix_players_after_load(scumm); + init_sustaining_notes(); + _active_volume_faders = true; + fix_parts_after_load(); + _driver->update_pris(); + } + + return 0; +} + +#undef MKLINE +#undef MKEND + +void IMuseInternal::fix_parts_after_load() +{ + Part *part; + int i; + + for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { + if (part->_player) + part->fix_after_load(); + } +} + +/* Only call this routine from the main thread, + * since it uses getResourceAddress */ +void IMuseInternal::fix_players_after_load(Scumm *scumm) +{ + Player *player = _players; + int i; + + for (i = ARRAYSIZE(_players); i != 0; i--, player++) { + if (player->_active) { + player->set_tempo(player->_tempo); + scumm->getResourceAddress(rtSound, player->_id); + player->_mt32emulate = isMT32(player->_id); + } + } +} + +void Part::set_detune(int8 detune) +{ + _detune_eff = clamp((_detune = detune) + _player->_detune, -128, 127); + changed(IMuseDriver::pcMod); +} + +void Part::set_pitchbend(int value) +{ + _pitchbend = value * _pitchbend_factor >> 6; + changed(IMuseDriver::pcMod); +} + +void Part::set_vol(uint8 vol) +{ + _vol_eff = ((_vol = vol) + 1) * _player->_vol_eff >> 7; + changed(IMuseDriver::pcVolume); +} + +void Part::set_pri(int8 pri) +{ + _pri_eff = clamp((_pri = pri) + _player->_priority, 0, 255); +} + +void Part::set_pan(int8 pan) +{ + _pan_eff = clamp((_pan = pan) + _player->_pan, -64, 63); + changed(IMuseDriver::pcPan); +} + +void Part::set_transpose(int8 transpose) +{ + _transpose_eff = transpose_clamp((_transpose = transpose) + _player->_transpose, -12, 12); + changed(IMuseDriver::pcMod); +} + +void Part::set_pedal(bool value) +{ + _pedal = value; + changed(IMuseDriver::pcPedal); +} + +void Part::set_modwheel(uint value) +{ + _modwheel = value; + changed(IMuseDriver::pcModwheel); +} + +void Part::set_chorus(uint chorus) +{ + _chorus = chorus; + changed(IMuseDriver::pcChorus); +} + +void Part::set_effect_level(uint level) +{ + _effect_level = level; + changed(IMuseDriver::pcEffectLevel); +} + +void Part::fix_after_load() +{ + set_transpose(_transpose); + set_vol(_vol); + set_detune(_detune); + set_pri(_pri); + set_pan(_pan); +} + +void Part::set_pitchbend_factor(uint8 value) +{ + if (value > 12) + return; + set_pitchbend(0); + _pitchbend_factor = value; +} + +void Part::set_onoff(bool on) +{ + if (_on != on) { + _on = on; + if (!on) + off(); + if (!_percussion) + update_pris(); + } +} + +void Part::set_instrument(Instrument * data) +{ + _drv->part_set_instrument(this, data); +} + +void Part::key_on(byte note, byte velocity) +{ + _drv->part_key_on(this, note, velocity); +} + +void Part::key_off(byte note) +{ + _drv->part_key_off(this, note); +} + +void Part::init(IMuseDriver * driver) +{ + _drv = driver; + _player = NULL; + _next = NULL; + _prev = NULL; + _mc = NULL; +} + +void Part::setup(Player *player) +{ + _player = player; + + /* Insert first into player's list */ + _prev = NULL; + _next = player->_parts; + if (player->_parts) + player->_parts->_prev = this; + player->_parts = this; + + _percussion = true; + _on = true; + _pri_eff = player->_priority; + _pri = 0; + _vol = 127; + _vol_eff = player->_vol_eff; + _pan = clamp(player->_pan, -64, 63); + _transpose_eff = player->_transpose; + _transpose = 0; + _detune = 0; + _detune_eff = player->_detune; + _pitchbend_factor = 2; + _pitchbend = 0; + _effect_level = 64; + _program = 255; + _chorus = 0; + _modwheel = 0; + _bank = 0; + _pedal = false; + _mc = NULL; +} + +void Part::uninit() +{ + if (!_player) + return; + off(); + + /* unlink */ + if (_next) + _next->_prev = _prev; + if (_prev) + _prev->_next = _next; + else + _player->_parts = _next; + _player = NULL; + _next = NULL; + _prev = NULL; +} + +void Part::off() +{ + _drv->part_off(this); +} + +void Part::changed(byte what) +{ + _drv->part_changed(this, what); +} + +void Part::set_param(byte param, int value) +{ + _drv->part_set_param(this, param, value); +} + +void Part::update_pris() +{ + _drv->update_pris(); +} + +int Part::update_actives(uint16 *active) +{ + return _drv->part_update_active(this, active); +} + +void Part::set_program(byte program) +{ + if (_program != program || _bank != 0) { + _program = program; + _bank = 0; + changed(IMuseDriver::pcProgram); + } +} + +void Part::set_instrument(uint b) +{ + _bank = (byte)(b >> 8); + _program = (byte)b; + changed(IMuseDriver::pcProgram); +} + + +//******************************************** +//***** ADLIB PART OF IMUSE STARTS HERE ****** +//******************************************** + + +static byte lookup_table[64][32]; +const byte volume_table[] = { + 0, 4, 7, 11, + 13, 16, 18, 20, + 22, 24, 26, 27, + 29, 30, 31, 33, + 34, 35, 36, 37, + 38, 39, 40, 41, + 42, 43, 44, 44, + 45, 46, 47, 47, + 48, 49, 49, 50, + 51, 51, 52, 53, + 53, 54, 54, 55, + 55, 56, 56, 57, + 57, 58, 58, 59, + 59, 60, 60, 60, + 61, 61, 62, 62, + 62, 63, 63, 63 +}; + +int lookup_volume(int a, int b) +{ + if (b == 0) + return 0; + + if (b == 31) + return a; + + if (a < -63 || a > 63) { + return b * (a + 1) >> 5; + } + + if (b < 0) { + if (a < 0) { + return lookup_table[-a][-b]; + } else { + return -lookup_table[a][-b]; + } + } else { + if (a < 0) { + return -lookup_table[-a][b]; + } else { + return lookup_table[a][b]; + } + } +} + +void create_lookup_table() +{ + int i, j; + int sum; + + for (i = 0; i < 64; i++) { + sum = i; + for (j = 0; j < 32; j++) { + lookup_table[i][j] = sum >> 5; + sum += i; + } + } + for (i = 0; i < 64; i++) + lookup_table[i][0] = 0; +} + +MidiChannelAdl *IMuseAdlib::allocate_midichan(byte pri) +{ + MidiChannelAdl *ac, *best = NULL; + int i; + + for (i = 0; i < 9; i++) { + if (++_midichan_index >= 9) + _midichan_index = 0; + ac = &_midi_channels[_midichan_index]; + if (!ac->_part) + return ac; + if (!ac->_next) { + if (ac->_part->_pri_eff <= pri) { + pri = ac->_part->_pri_eff; + best = ac; + } + } + } + + if (best) + mc_off(best); + else; //debug(1, "Denying adlib channel request"); + return best; +} + +void IMuseAdlib::premix_proc(void *param, int16 *buf, uint len) +{ + ((IMuseAdlib *) param)->generate_samples(buf, len); +} + +void IMuseAdlib::init(IMuseInternal *eng, OSystem *syst) +{ + int i; + MidiChannelAdl *mc; + + _se = eng; + + for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++) { + mc->_channel = i; + mc->_s11a.s10 = &mc->_s10b; + mc->_s11b.s10 = &mc->_s10a; + } + + _adlib_reg_cache = (byte *)calloc(256, 1); + + _opl = OPLCreate(OPL_TYPE_YM3812, 3579545, syst->property(OSystem::PROP_GET_SAMPLE_RATE, 0)); + + adlib_write(1, 0x20); + adlib_write(8, 0x40); + adlib_write(0xBD, 0x00); + create_lookup_table(); + + _mixer->setup_premix(this, premix_proc); +} + +void IMuseAdlib::adlib_write(byte port, byte value) +{ + if (_adlib_reg_cache[port] == value) + return; + _adlib_reg_cache[port] = value; + + OPLWriteReg(_opl, port, value); +} + +void IMuseAdlib::adlib_key_off(int chan) +{ + byte port = chan + 0xB0; + adlib_write(port, adlib_read(port) & ~0x20); +} + +struct AdlibSetParams { + byte a, b, c, d; +}; + +static const byte channel_mappings[9] = { + 0, 1, 2, 8, + 9, 10, 16, 17, + 18 +}; + +static const byte channel_mappings_2[9] = { + 3, 4, 5, 11, + 12, 13, 19, 20, + 21 +}; + +static const AdlibSetParams adlib_setparam_table[] = { + {0x40, 0, 63, 63}, /* level */ + {0xE0, 2, 0, 0}, /* unused */ + {0x40, 6, 192, 0}, /* level key scaling */ + {0x20, 0, 15, 0}, /* modulator frequency multiple */ + {0x60, 4, 240, 15}, /* attack rate */ + {0x60, 0, 15, 15}, /* decay rate */ + {0x80, 4, 240, 15}, /* sustain level */ + {0x80, 0, 15, 15}, /* release rate */ + {0xE0, 0, 3, 0}, /* waveform select */ + {0x20, 7, 128, 0}, /* amp mod */ + {0x20, 6, 64, 0}, /* vib */ + {0x20, 5, 32, 0}, /* eg typ */ + {0x20, 4, 16, 0}, /* ksr */ + {0xC0, 0, 1, 0}, /* decay alg */ + {0xC0, 1, 14, 0} /* feedback */ +}; + +void IMuseAdlib::adlib_set_param(int channel, byte param, int value) +{ + const AdlibSetParams *as; + byte port; + + assert(channel >= 0 && channel < 9); + + if (param <= 12) { + port = channel_mappings_2[channel]; + } else if (param <= 25) { + param -= 13; + port = channel_mappings[channel]; + } else if (param <= 27) { + param -= 13; + port = channel; + } else if (param == 28 || param == 29) { + if (param == 28) + value -= 15; + else + value -= 383; + value <<= 4; + channel_table_2[channel] = value; + adlib_playnote(channel, curnote_table[channel] + value); + return; + } else { + return; + } + + as = &adlib_setparam_table[param]; + if (as->d) + value = as->d - value; + port += as->a; + adlib_write(port, (adlib_read(port) & ~as->c) | (((byte)value) << as->b)); +} + +static const byte octave_numbers[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7 +}; + +static const byte note_numbers[] = { + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 3, 4, 5, 6, 7, 8, 9, 10 +}; + +static const byte note_to_f_num[] = { + 90, 91, 92, 92, 93, 94, 94, 95, + 96, 96, 97, 98, 98, 99, 100, 101, + 101, 102, 103, 104, 104, 105, 106, 107, + 107, 108, 109, 110, 111, 111, 112, 113, + 114, 115, 115, 116, 117, 118, 119, 120, + 121, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, + 143, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 157, 158, 159, 160, + 161, 162, 163, 165, 166, 167, 168, 169, + 171, 172, 173, 174, 176, 177, 178, 180, + 181, 182, 184, 185, 186, 188, 189, 190, + 192, 193, 194, 196, 197, 199, 200, 202, + 203, 205, 206, 208, 209, 211, 212, 214, + 215, 217, 218, 220, 222, 223, 225, 226, + 228, 230, 231, 233, 235, 236, 238, 240, + 242, 243, 245, 247, 249, 251, 252, 254, +}; + +void IMuseAdlib::adlib_playnote(int channel, int note) +{ + byte old, oct, notex; + int note2; + int i; + + note2 = (note >> 7) - 4; + + oct = octave_numbers[note2] << 2; + notex = note_numbers[note2]; + + old = adlib_read(channel + 0xB0); + if (old & 0x20) { + old &= ~0x20; + if (oct > old) { + if (notex < 6) { + notex += 12; + oct -= 4; + } + } else if (oct < old) { + if (notex > 11) { + notex -= 12; + oct += 4; + } + } + } + + i = (notex << 3) + ((note >> 4) & 0x7); + adlib_write(channel + 0xA0, note_to_f_num[i]); + adlib_write(channel + 0xB0, oct | 0x20); +} + +void IMuseAdlib::adlib_note_on(int chan, byte note, int mod) +{ + int code; + assert(chan >= 0 && chan < 9); + code = (note << 7) + mod; + curnote_table[chan] = code; + adlib_playnote(chan, channel_table_2[chan] + code); +} + +void IMuseAdlib::adlib_note_on_ex(int chan, byte note, int mod) +{ + int code; + assert(chan >= 0 && chan < 9); + code = (note << 7) + mod; + curnote_table[chan] = code; + channel_table_2[chan] = 0; + adlib_playnote(chan, code); +} + +void IMuseAdlib::adlib_key_onoff(int channel) +{ + byte val; + byte port = channel + 0xB0; + assert(channel >= 0 && channel < 9); + + val = adlib_read(port); + adlib_write(port, val & ~0x20); + adlib_write(port, val | 0x20); +} + +void IMuseAdlib::adlib_setup_channel(int chan, Instrument * instr, byte vol_1, byte vol_2) +{ + byte port; + + assert(chan >= 0 && chan < 9); + + port = channel_mappings[chan]; + adlib_write(port + 0x20, instr->flags_1); + adlib_write(port + 0x40, (instr->oplvl_1 | 0x3F) - vol_1); + adlib_write(port + 0x60, ~instr->atdec_1); + adlib_write(port + 0x80, ~instr->sustrel_1); + adlib_write(port + 0xE0, instr->waveform_1); + + port = channel_mappings_2[chan]; + adlib_write(port + 0x20, instr->flags_2); + adlib_write(port + 0x40, (instr->oplvl_2 | 0x3F) - vol_2); + adlib_write(port + 0x60, ~instr->atdec_2); + adlib_write(port + 0x80, ~instr->sustrel_2); + adlib_write(port + 0xE0, instr->waveform_2); + + adlib_write((byte)chan + 0xC0, instr->feedback); +} + +int IMuseAdlib::adlib_read_param(int chan, byte param) +{ + const AdlibSetParams *as; + byte val; + byte port; + + assert(chan >= 0 && chan < 9); + + if (param <= 12) { + port = channel_mappings_2[chan]; + } else if (param <= 25) { + param -= 13; + port = channel_mappings[chan]; + } else if (param <= 27) { + param -= 13; + port = chan; + } else if (param == 28) { + return 0xF; + } else if (param == 29) { + return 0x17F; + } else { + return 0; + } + + as = &adlib_setparam_table[param]; + val = adlib_read(port + as->a); + val &= as->c; + val >>= as->b; + if (as->d) + val = as->d - val; + + return val; +} + +void IMuseAdlib::generate_samples(int16 *data, int len) +{ + int step; + + if (!_opl) { + memset(data, 0, len * sizeof(int16)); + return; + } + + do { + step = len; + if (step > _next_tick) + step = _next_tick; + YM3812UpdateOne(_opl, data, step); + + if (!(_next_tick -= step)) { + _se->on_timer(); + reset_tick(); + } + data += step; + } while (len -= step); +} + + +void IMuseAdlib::reset_tick() +{ + _next_tick = 88; +} + +void IMuseAdlib::on_timer() +{ + MidiChannelAdl *mc; + int i; + + _adlib_timer_counter += 0xD69; + while (_adlib_timer_counter >= 0x411B) { + _adlib_timer_counter -= 0x411B; + mc = _midi_channels; + for (i = 0; i != ARRAYSIZE(_midi_channels); i++, mc++) { + if (!mc->_part) + continue; + if (mc->_duration && (mc->_duration -= 0x11) <= 0) { + mc_off(mc); + return; + } + if (mc->_s10a.active) { + mc_inc_stuff(mc, &mc->_s10a, &mc->_s11a); + } + if (mc->_s10b.active) { + mc_inc_stuff(mc, &mc->_s10b, &mc->_s11b); + } + } + } +} + +const byte param_table_1[16] = { + 29, 28, 27, 0, + 3, 4, 7, 8, + 13, 16, 17, 20, + 21, 30, 31, 0 +}; + +const uint16 param_table_2[16] = { + 0x2FF, 0x1F, 0x7, 0x3F, + 0x0F, 0x0F, 0x0F, 0x3, + 0x3F, 0x0F, 0x0F, 0x0F, + 0x3, 0x3E, 0x1F, 0 +}; + +static const uint16 num_steps_table[] = { + 1, 2, 4, 5, + 6, 7, 8, 9, + 10, 12, 14, 16, + 18, 21, 24, 30, + 36, 50, 64, 82, + 100, 136, 160, 192, + 240, 276, 340, 460, + 600, 860, 1200, 1600 +}; + +int IMuseAdlib::random_nr(int a) +{ + static byte _rand_seed = 1; + if (_rand_seed & 1) { + _rand_seed >>= 1; + _rand_seed ^= 0xB8; + } else { + _rand_seed >>= 1; + } + return _rand_seed * a >> 8; +} + +void IMuseAdlib::struct10_setup(Struct10 * s10) +{ + int b, c, d, e, f, g, h; + byte t; + + b = s10->unk3; + f = s10->active - 1; + + t = s10->table_a[f]; + e = num_steps_table[lookup_table[t & 0x7F][b]]; + if (t & 0x80) { + e = random_nr(e); + } + if (e == 0) + e++; + + s10->num_steps = s10->speed_lo_max = e; + + if (f != 2) { + c = s10->param; + g = s10->start_value; + t = s10->table_b[f]; + d = lookup_volume(c, (t & 0x7F) - 31); + if (t & 0x80) { + d = random_nr(d); + } + if (d + g > c) { + h = c - g; + } else { + h = d; + if (d + g < 0) + h = -g; + } + h -= s10->cur_val; + } else { + h = 0; + } + + s10->speed_hi = h / e; + if (h < 0) { + h = -h; + s10->direction = -1; + } else { + s10->direction = 1; + } + + s10->speed_lo = h % e; + s10->speed_lo_counter = 0; +} + +byte IMuseAdlib::struct10_ontimer(Struct10 * s10, Struct11 * s11) +{ + byte result = 0; + int i; + + if (s10->count && (s10->count -= 17) <= 0) { + s10->active = 0; + return 0; + } + + i = s10->cur_val + s10->speed_hi; + s10->speed_lo_counter += s10->speed_lo; + if (s10->speed_lo_counter >= s10->speed_lo_max) { + s10->speed_lo_counter -= s10->speed_lo_max; + i += s10->direction; + } + if (s10->cur_val != i || s10->modwheel != s10->modwheel_last) { + s10->cur_val = i; + s10->modwheel_last = s10->modwheel; + i = lookup_volume(i, s10->modwheel_last); + if (i != s11->modify_val) { + s11->modify_val = i; + result = 1; + } + } + + if (!--s10->num_steps) { + s10->active++; + if (s10->active > 4) { + if (s10->loop) { + s10->active = 1; + result |= 2; + struct10_setup(s10); + } else { + s10->active = 0; + } + } else { + struct10_setup(s10); + } + } + + return result; +} + +void IMuseAdlib::struct10_init(Struct10 * s10, InstrumentExtra * ie) +{ + s10->active = 1; + s10->cur_val = 0; + s10->modwheel_last = 31; + s10->count = ie->a; + if (s10->count) + s10->count *= 63; + s10->table_a[0] = ie->b; + s10->table_a[1] = ie->d; + s10->table_a[2] = ie->f; + s10->table_a[3] = ie->g; + + s10->table_b[0] = ie->c; + s10->table_b[1] = ie->e; + s10->table_b[2] = 0; + s10->table_b[3] = ie->h; + + struct10_setup(s10); +} + +void IMuseAdlib::mc_init_stuff(MidiChannelAdl *mc, Struct10 * s10, + Struct11 * s11, byte flags, InstrumentExtra * ie) +{ + Part *part = mc->_part; + + s11->modify_val = 0; + s11->flag0x40 = flags & 0x40; + s10->loop = flags & 0x20; + s11->flag0x10 = flags & 0x10; + s11->param = param_table_1[flags & 0xF]; + s10->param = param_table_2[flags & 0xF]; + s10->unk3 = 31; + if (s11->flag0x40) { + s10->modwheel = part->_modwheel >> 2; + } else { + s10->modwheel = 31; + } + + switch (s11->param) { + case 0: + s10->start_value = mc->_vol_2; + break; + case 13: + s10->start_value = mc->_vol_1; + break; + case 30: + s10->start_value = 31; + s11->s10->modwheel = 0; + break; + case 31: + s10->start_value = 0; + s11->s10->unk3 = 0; + break; + default: + s10->start_value = ((IMuseAdlib *) part->_drv)->adlib_read_param(mc->_channel, s11->param); + } + + struct10_init(s10, ie); +} + +void IMuseAdlib::mc_inc_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11) +{ + byte code; + Part *part = mc->_part; + + code = struct10_ontimer(s10, s11); + + if (code & 1) { + switch (s11->param) { + case 0: + mc->_vol_2 = s10->start_value + s11->modify_val; + ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 0, + volume_table[lookup_table[mc->_vol_2] + [part->_vol_eff >> 2]]); + break; + case 13: + mc->_vol_1 = s10->start_value + s11->modify_val; + if (mc->_twochan) { + ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 13, + volume_table[lookup_table[mc->_vol_1] + [part->_vol_eff >> 2]]); + } else { + ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 13, mc->_vol_1); + } + break; + case 30: + s11->s10->modwheel = (char)s11->modify_val; + break; + case 31: + s11->s10->unk3 = (char)s11->modify_val; + break; + default: + ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, s11->param, + s10->start_value + s11->modify_val); + break; + } + } + + if (code & 2 && s11->flag0x10) + ((IMuseAdlib *) part->_drv)->adlib_key_onoff(mc->_channel); +} + +void IMuseAdlib::part_changed(Part *part, byte what) +{ + MidiChannelAdl *mc; + + if (what & pcProgram) { + if (part->_program < 32) { + part_set_instrument(part, &_glob_instr[part->_program]); + } + } + + if (what & pcMod) { + for (mc = part->_mc->adl(); mc; mc = mc->_next) { + adlib_note_on(mc->_channel, mc->_note + part->_transpose_eff, + part->_pitchbend + part->_detune_eff); + } + } + + if (what & pcVolume) { + for (mc = part->_mc->adl(); mc; mc = mc->_next) { + adlib_set_param(mc->_channel, 0, volume_table[lookup_table[mc->_vol_2] + [part->_vol_eff >> 2]]); + if (mc->_twochan) { + adlib_set_param(mc->_channel, 13, volume_table[lookup_table[mc->_vol_1] + [part->_vol_eff >> 2]]); + } + } + } + + if (what & pcPedal) { + if (!part->_pedal) { + for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { + if (mc->_waitforpedal) + mc_off(mc); + } + } + } + + if (what & pcModwheel) { + for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { + if (mc->_s10a.active && mc->_s11a.flag0x40) + mc->_s10a.modwheel = part->_modwheel >> 2; + if (mc->_s10b.active && mc->_s11b.flag0x40) + mc->_s10b.modwheel = part->_modwheel >> 2; + } + } +} + +void IMuseAdlib::mc_key_on(MidiChannel * mc2, byte note, byte velocity) +{ + MidiChannelAdl *mc = (MidiChannelAdl *)mc2; + Part *part = mc->_part; + Instrument *instr = &_part_instr[part->_slot]; + int c; + byte vol_1, vol_2; + + mc->_twochan = instr->feedback & 1; + mc->_note = note; + mc->_waitforpedal = false; + mc->_duration = instr->duration; + if (mc->_duration != 0) + mc->_duration *= 63; + + vol_1 = (instr->oplvl_1 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_1 >> 2]; + if (vol_1 > 0x3F) + vol_1 = 0x3F; + mc->_vol_1 = vol_1; + + vol_2 = (instr->oplvl_2 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_2 >> 2]; + if (vol_2 > 0x3F) + vol_2 = 0x3F; + mc->_vol_2 = vol_2; + + c = part->_vol_eff >> 2; + + vol_2 = volume_table[lookup_table[vol_2][c]]; + if (mc->_twochan) + vol_1 = volume_table[lookup_table[vol_1][c]]; + + adlib_setup_channel(mc->_channel, instr, vol_1, vol_2); + adlib_note_on_ex(mc->_channel, part->_transpose_eff + note, part->_detune_eff + part->_pitchbend); + + if (instr->flags_a & 0x80) { + mc_init_stuff(mc, &mc->_s10a, &mc->_s11a, instr->flags_a, &instr->extra_a); + } else { + mc->_s10a.active = 0; + } + + if (instr->flags_b & 0x80) { + mc_init_stuff(mc, &mc->_s10b, &mc->_s11b, instr->flags_b, &instr->extra_b); + } else { + mc->_s10b.active = 0; + } +} + +void IMuseAdlib::set_instrument(uint slot, byte *data) +{ + if (slot < 32) { + memcpy(&_glob_instr[slot], data, sizeof(Instrument)); + } +} + + +void IMuseAdlib::link_mc(Part *part, MidiChannelAdl *mc) +{ + mc->_part = part; + mc->_next = (MidiChannelAdl *)part->_mc; + part->_mc = mc; + mc->_prev = NULL; + + if (mc->_next) + mc->_next->_prev = mc; +} + +void IMuseAdlib::part_key_on(Part *part, byte note, byte velocity) +{ + MidiChannelAdl *mc; + + mc = allocate_midichan(part->_pri_eff); + if (!mc) + return; + + link_mc(part, mc); + mc_key_on(mc, note, velocity); +} + +void IMuseAdlib::part_key_off(Part *part, byte note) +{ + MidiChannelAdl *mc; + + for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { + if (mc->_note == note) { + if (part->_pedal) + mc->_waitforpedal = true; + else + mc_off(mc); + } + } +} + +struct AdlibInstrSetParams { + byte param; + byte shl; + byte mask; +}; + +#define MKLINE(_a_,_b_,_c_) { (int)&((Instrument*)0)->_a_, _b_, ((1<<(_c_))-1)<<(_b_) } +static const AdlibInstrSetParams adlib_instr_params[69] = { + MKLINE(oplvl_2, 0, 6), + MKLINE(waveform_2, 2, 5), + MKLINE(oplvl_2, 6, 2), + MKLINE(flags_2, 0, 4), + MKLINE(atdec_2, 4, 4), + MKLINE(atdec_2, 0, 4), + MKLINE(sustrel_2, 4, 4), + MKLINE(sustrel_2, 0, 4), + MKLINE(waveform_2, 0, 2), + MKLINE(flags_2, 7, 1), + MKLINE(flags_2, 6, 1), + MKLINE(flags_2, 5, 1), + MKLINE(flags_2, 4, 1), + + MKLINE(oplvl_1, 0, 6), + MKLINE(waveform_1, 2, 5), + MKLINE(oplvl_1, 6, 2), + MKLINE(flags_1, 0, 4), + MKLINE(atdec_1, 4, 4), + MKLINE(atdec_1, 0, 4), + MKLINE(sustrel_1, 4, 4), + MKLINE(sustrel_1, 0, 4), + MKLINE(waveform_1, 0, 2), + MKLINE(flags_1, 7, 1), + MKLINE(flags_1, 6, 1), + MKLINE(flags_1, 5, 1), + MKLINE(flags_1, 4, 1), + + MKLINE(feedback, 0, 1), + MKLINE(feedback, 1, 3), + + MKLINE(flags_a, 7, 1), + MKLINE(flags_a, 6, 1), + MKLINE(flags_a, 5, 1), + MKLINE(flags_a, 4, 1), + MKLINE(flags_a, 0, 4), + MKLINE(extra_a.a, 0, 8), + MKLINE(extra_a.b, 0, 7), + MKLINE(extra_a.c, 0, 7), + MKLINE(extra_a.d, 0, 7), + MKLINE(extra_a.e, 0, 7), + MKLINE(extra_a.f, 0, 7), + MKLINE(extra_a.g, 0, 7), + MKLINE(extra_a.h, 0, 7), + MKLINE(extra_a.b, 7, 1), + MKLINE(extra_a.c, 7, 1), + MKLINE(extra_a.d, 7, 1), + MKLINE(extra_a.e, 7, 1), + MKLINE(extra_a.f, 7, 1), + MKLINE(extra_a.g, 7, 1), + MKLINE(extra_a.h, 7, 1), + + MKLINE(flags_b, 7, 1), + MKLINE(flags_b, 6, 1), + MKLINE(flags_b, 5, 1), + MKLINE(flags_b, 4, 1), + MKLINE(flags_b, 0, 4), + MKLINE(extra_b.a, 0, 8), + MKLINE(extra_b.b, 0, 7), + MKLINE(extra_b.c, 0, 7), + MKLINE(extra_b.d, 0, 7), + MKLINE(extra_b.e, 0, 7), + MKLINE(extra_b.f, 0, 7), + MKLINE(extra_b.g, 0, 7), + MKLINE(extra_b.h, 0, 7), + MKLINE(extra_b.b, 7, 1), + MKLINE(extra_b.c, 7, 1), + MKLINE(extra_b.d, 7, 1), + MKLINE(extra_b.e, 7, 1), + MKLINE(extra_b.f, 7, 1), + MKLINE(extra_b.g, 7, 1), + MKLINE(extra_b.h, 7, 1), + + MKLINE(duration, 0, 8), +}; +#undef MKLINE + +void IMuseAdlib::part_set_param(Part *part, byte param, int value) +{ + const AdlibInstrSetParams *sp = &adlib_instr_params[param]; + byte *p = (byte *)&_part_instr[part->_slot] + sp->param; + *p = (*p & ~sp->mask) | (value << sp->shl); + + if (param < 28) { + MidiChannelAdl *mc; + + for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { + adlib_set_param(mc->_channel, param, value); + } + } +} + +void IMuseAdlib::part_off(Part *part) +{ + MidiChannelAdl *mc = (MidiChannelAdl *)part->_mc; + part->_mc = NULL; + for (; mc; mc = mc->_next) { + mc_off(mc); + } +} + +void IMuseAdlib::mc_off(MidiChannel * mc2) +{ + MidiChannelAdl *mc = (MidiChannelAdl *)mc2, *tmp; + + adlib_key_off(mc->_channel); + + tmp = mc->_prev; + + if (mc->_next) + mc->_next->_prev = tmp; + if (tmp) + tmp->_next = mc->_next; + else + mc->_part->_mc = mc->_next; + mc->_part = NULL; +} + +void IMuseAdlib::part_set_instrument(Part *part, Instrument * instr) +{ + Instrument *i = &_part_instr[part->_slot]; + memcpy(i, instr, sizeof(Instrument)); +} + +int IMuseAdlib::part_update_active(Part *part, uint16 *active) +{ + uint16 bits; + int count = 0; + MidiChannelAdl *mc; + + bits = 1 << part->_chan; + + for (mc = part->_mc->adl(); mc; mc = mc->_next) { + if (!(active[mc->_note] & bits)) { + active[mc->_note] |= bits; + count++; + } + } + return count; +} + +//******************************************** +//** GENERAL MIDI PART OF IMUSE STARTS HERE ** +//******************************************** + +void IMuseGM::midiPitchBend(byte chan, int16 pitchbend) +{ + uint16 tmp; + + if (_midi_pitchbend_last[chan] != pitchbend) { + _midi_pitchbend_last[chan] = pitchbend; + tmp = (pitchbend << 2) + 0x2000; + _md->send(((tmp >> 7) & 0x7F) << 16 | (tmp & 0x7F) << 8 | 0xE0 | chan); + } +} + +void IMuseGM::midiVolume(byte chan, byte volume) +{ + if (_midi_volume_last[chan] != volume) { + _midi_volume_last[chan] = volume; + _md->send(volume << 16 | 7 << 8 | 0xB0 | chan); + } +} +void IMuseGM::midiPedal(byte chan, bool pedal) +{ + if (_midi_pedal_last[chan] != pedal) { + _midi_pedal_last[chan] = pedal; + _md->send(pedal << 16 | 64 << 8 | 0xB0 | chan); + } +} + +void IMuseGM::midiModWheel(byte chan, byte modwheel) +{ + if (_midi_modwheel_last[chan] != modwheel) { + _midi_modwheel_last[chan] = modwheel; + _md->send(modwheel << 16 | 1 << 8 | 0xB0 | chan); + } +} + +void IMuseGM::midiEffectLevel(byte chan, byte level) +{ + if (_midi_effectlevel_last[chan] != level) { + _midi_effectlevel_last[chan] = level; + _md->send(level << 16 | 91 << 8 | 0xB0 | chan); + } +} + +void IMuseGM::midiChorus(byte chan, byte chorus) +{ + if (_midi_chorus_last[chan] != chorus) { + _midi_chorus_last[chan] = chorus; + _md->send(chorus << 16 | 93 << 8 | 0xB0 | chan); + } +} + +void IMuseGM::midiControl0(byte chan, byte value) +{ + _md->send(value << 16 | 0 << 8 | 0xB0 | chan); +} + + +void IMuseGM::midiProgram(byte chan, byte program, bool mt32emulate) +{ + if (mt32emulate) { /* Don't convert the percussion channel, it is the same in GM and MT32 */ + if (chan != PERCUSSION_CHANNEL) + program = mt32_to_gmidi[program]; + } + + _md->send(program << 8 | 0xC0 | chan); +} + +void IMuseGM::midiPan(byte chan, int8 pan) +{ + if (_midi_pan_last[chan] != pan) { + _midi_pan_last[chan] = pan; + _md->send(((pan - 64) & 0x7F) << 16 | 10 << 8 | 0xB0 | chan); + } +} + +void IMuseGM::midiNoteOn(byte chan, byte note, byte velocity) +{ + _md->send(velocity << 16 | note << 8 | 0x90 | chan); +} + +void IMuseGM::midiNoteOff(byte chan, byte note) +{ + _md->send(note << 8 | 0x80 | chan); +} + +void IMuseGM::midiSilence(byte chan) +{ + _md->send((64 << 8) | 0xB0 | chan); + _md->send((123 << 8) | 0xB0 | chan); +} + + +void IMuseGM::part_key_on(Part *part, byte note, byte velocity) +{ + MidiChannelGM *mc = part->_mc->gm(); + + if (mc) { + mc->_actives[note >> 4] |= (1 << (note & 0xF)); + midiNoteOn(mc->_chan, note, velocity); + } else if (part->_percussion) { + midiVolume(PERCUSSION_CHANNEL, part->_vol_eff); + midiProgram(PERCUSSION_CHANNEL, part->_bank, part->_player->_mt32emulate); + midiNoteOn(PERCUSSION_CHANNEL, note, velocity); + } +} + +void IMuseGM::part_key_off(Part *part, byte note) +{ + MidiChannelGM *mc = part->_mc->gm(); + + if (mc) { + mc->_actives[note >> 4] &= ~(1 << (note & 0xF)); + midiNoteOff(mc->_chan, note); + } else if (part->_percussion) { + midiNoteOff(PERCUSSION_CHANNEL, note); + } +} + +#if !defined(__MORPHOS__) +int IMuseGM::midi_driver_thread(void *param) +{ + IMuseGM *mid = (IMuseGM *) param; + int old_time, cur_time; + + old_time = mid->_system->get_msecs(); + + for (;;) { + mid->_system->delay_msecs(10); + + cur_time = mid->_system->get_msecs(); + while (old_time < cur_time) { + old_time += 10; + mid->_se->on_timer(); + } + } +} +#else +#include +#include +#include +#include "../morphos/morphos.h" +int IMuseGM::midi_driver_thread(void *param) +{ + IMuseGM *mid = (IMuseGM *) param; + int old_time, cur_time; + bool initialized; + + ObtainSemaphore(&ScummMusicThreadRunning); + + initialized = init_morphos_music(0); + + old_time = mid->_system->get_msecs(); + + if (!initialized) + Wait(SIGBREAKF_CTRL_C); + else { + for (;;) { + MusicTimerIORequest->tr_time.tv_micro = 10000; + MusicTimerIORequest->tr_node.io_Command = TR_ADDREQUEST; + MusicTimerIORequest->tr_time.tv_secs = 0; + DoIO((struct IORequest *)MusicTimerIORequest); + + if (CheckSignal(SIGBREAKF_CTRL_C)) + break; + + cur_time = mid->_system->get_msecs(); + while (old_time < cur_time) { + old_time += 10; + mid->_se->on_timer(); + } + } + } + + exit_morphos_music(); + + ReleaseSemaphore(&ScummMusicThreadRunning); + RemTask(NULL); + return 0; +} +#endif + +void IMuseGM::init(IMuseInternal *eng, OSystem *syst) +{ + int i; + MidiChannelGM *mc; + + _system = syst; + + /* open midi driver */ + int result = _md->open(MidiDriver::MO_SIMPLE); + if (result) + error("IMuseGM::error = %s", MidiDriver::get_error_name(result)); + + /* Install the on_timer thread */ + _se = eng; + syst->create_thread(midi_driver_thread, this); + + for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++) + mc->_chan = i; +} + +void IMuseGM::update_pris() +{ + Part *part, *hipart; + int i; + byte hipri, lopri; + MidiChannelGM *mc, *lomc; + + while (true) { + hipri = 0; + hipart = NULL; + for (i = 32, part = _se->parts_ptr(); i; i--, part++) { + if (part->_player && !part->_percussion && part->_on && !part->_mc && part->_pri_eff >= hipri) { + hipri = part->_pri_eff; + hipart = part; + } + } + + if (!hipart) + return; + + lopri = 255; + lomc = NULL; + for (i = ARRAYSIZE(_midi_channels), mc = _midi_channels;; mc++) { + if (!mc->_part) { + lomc = mc; + break; + } + if (mc->_part->_pri_eff <= lopri) { + lopri = mc->_part->_pri_eff; + lomc = mc; + } + + if (!--i) { + if (lopri >= hipri) + return; + lomc->_part->off(); + break; + } + } + + hipart->_mc = lomc; + lomc->_part = hipart; + hipart->changed(pcAll); + } +} + +int IMuseGM::part_update_active(Part *part, uint16 *active) +{ + int i, j; + uint16 *act, mask, bits; + int count = 0; + + bits = 1 << part->_chan; + + act = part->_mc->gm()->_actives; + + for (i = 8; i; i--) { + mask = *act++; + if (mask) { + for (j = 16; j; j--, mask >>= 1, active++) { + if (mask & 1 && !(*active & bits)) { + *active |= bits; + count++; + } + } + } else { + active += 16; + } + } + return count; +} + +void IMuseGM::part_changed(Part *part, byte what) +{ + MidiChannelGM *mc; + + /* Mark for re-schedule if program changed when in pre-state */ + if (what & pcProgram && part->_percussion) { + part->_percussion = false; + update_pris(); + } + + if (!(mc = part->_mc->gm())) + return; + + if (part->_player == NULL) { /* No player, so dump phantom channel */ + part->_mc = NULL; + mc->_part = NULL; + memset(mc->_actives, 0, sizeof(mc->_actives)); + return; + } + + if (what & pcMod) + midiPitchBend(mc->_chan, + clamp(part->_pitchbend + part->_detune_eff + + (part->_transpose_eff << 7), -2048, 2047)); + + if (what & pcVolume) + midiVolume(mc->_chan, part->_vol_eff); + + if (what & pcPedal) + midiPedal(mc->_chan, part->_pedal); + + if (what & pcModwheel) + midiModWheel(mc->_chan, part->_modwheel); + + if (what & pcPan) + midiPan(mc->_chan, part->_pan_eff); + + if (what & pcEffectLevel) + midiEffectLevel(mc->_chan, part->_effect_level); + + if (what & pcProgram) { + if (part->_bank) { + midiControl0(mc->_chan, part->_bank); + midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate); + midiControl0(mc->_chan, 0); + } else { + midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate); + } + } + + if (what & pcChorus) + midiChorus(mc->_chan, part->_effect_level); +} + + +void IMuseGM::part_off(Part *part) +{ + MidiChannelGM *mc = part->_mc->gm(); + if (mc) { + part->_mc = NULL; + mc->_part = NULL; + memset(mc->_actives, 0, sizeof(mc->_actives)); + midiSilence(mc->_chan); + } +} + + + +/* + * Implementation of the dummy IMuse class that acts as a proxy for + * our real IMuseInternal class. This way we reduce the compile time + * and inter source dependencies. + */ +IMuse::IMuse():_imuse(NULL) +{ +} + +IMuse::~IMuse() +{ + if (_imuse) + delete _imuse; +} + +void IMuse::on_timer() +{ + _imuse->on_timer(); +} + +void IMuse::pause(bool paused) +{ + _imuse->pause(paused); +} + +int IMuse::save_or_load(Serializer *ser, Scumm *scumm) +{ + return _imuse->save_or_load(ser, scumm); +} + +int IMuse::set_music_volume(uint vol) +{ + return _imuse->set_music_volume(vol); +} + +int IMuse::get_music_volume() +{ + return _imuse->get_music_volume(); +} + +int IMuse::set_master_volume(uint vol) +{ + return _imuse->set_master_volume(vol); +} + +int IMuse::get_master_volume() +{ + return _imuse->get_master_volume(); +} + +bool IMuse::start_sound(int sound) +{ + return _imuse->start_sound(sound); +} + +int IMuse::stop_sound(int sound) +{ + return _imuse->stop_sound(sound); +} + +int IMuse::stop_all_sounds() +{ + return _imuse->stop_all_sounds(); +} + +int IMuse::get_sound_status(int sound) +{ + return _imuse->get_sound_status(sound); +} + +int32 IMuse::do_command(int a, int b, int c, int d, int e, int f, int g, int h) +{ + return _imuse->do_command(a, b, c, d, e, f, g, h); +} + +int IMuse::clear_queue() +{ + return _imuse->clear_queue(); +} + +void IMuse::setBase(byte **base) +{ + _imuse->setBase(base); +} + +uint32 IMuse::property(int prop, uint32 value) +{ + return _imuse->property(prop, value); +} + +IMuse *IMuse::create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) +{ + IMuse *i = new IMuse; + i->_imuse = IMuseInternal::create(syst, midi, mixer); + return i; +} diff --git a/scumm/imuse.h b/scumm/imuse.h new file mode 100644 index 0000000000..f265f52492 --- /dev/null +++ b/scumm/imuse.h @@ -0,0 +1,61 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +class IMuseInternal; + +class IMuse { +public: + enum { + PROP_TEMPO_BASE = 1, + }; + + IMuse(); + ~IMuse(); + + void on_timer(); // For the MacOS 9 port only + void pause(bool paused); + int save_or_load(Serializer *ser, Scumm *scumm); + int set_music_volume(uint vol); + int get_music_volume(); + int set_master_volume(uint vol); + int get_master_volume(); + bool start_sound(int sound); + int stop_sound(int sound); + int stop_all_sounds(); + int get_sound_status(int sound); + int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h); + int clear_queue(); + void setBase(byte **base); + uint32 property(int prop, uint32 value); + + static IMuse *create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); + + static IMuse *create_adlib(OSystem *syst, SoundMixer *mixer) { + return create(syst, NULL, mixer); + } + static IMuse *create_midi(OSystem *syst, MidiDriver *midi) { + return create(syst, midi, NULL); + } + +private: + IMuseInternal *_imuse; // Pointer to the real imuse object +}; diff --git a/scumm/insane.cpp b/scumm/insane.cpp new file mode 100644 index 0000000000..ef9dd779eb --- /dev/null +++ b/scumm/insane.cpp @@ -0,0 +1,1510 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#if !defined(macintosh) && !defined(__MORPHOS__) +#define NEED_SDL_HEADERS +#endif + +#ifdef _WIN32_WCE +#define PICKY_ALIGN +#endif + +#include "stdafx.h" +#include "scumm.h" +#include "smush.h" + +static SmushPlayer * h_sp; + +SmushPlayer::SmushPlayer(Scumm * parent) { + _scumm = parent; + h_sp = this; +} + +SmushPlayer::~SmushPlayer() { +} + +static void smush_handler (Scumm * scumm) { + h_sp->update(); +} + +byte * SmushPlayer::loadTres() { + byte buf[100]; + FILE * f_tres; + uint32 tmp, l; + + sprintf((char *)buf, "%sVIDEO/DIGTXT.TRS", (byte *)_scumm->getGameDataPath()); + f_tres = (FILE*)_scumm->fileOpen((char *)&buf, 1); + + if (f_tres == NULL) { + sprintf((char *)buf, "%svideo/digtxt.trs", (byte *)_scumm->getGameDataPath()); + f_tres = (FILE*)_scumm->fileOpen((char *)&buf, 1); + if (f_tres == NULL) + return NULL; + } + + _scumm->fileRead(f_tres, &tmp, 4); // read tag + if (_scumm->_fileReadFailed) + error("SP: error while reading TRES"); + + tmp = READ_BE_UINT32(&tmp); + if (tmp == 'ETRS') + { + _scumm->fileRead(f_tres, &tmp, 4); // read length + tmp = READ_BE_UINT32(&tmp); + tmp -= 8; + _bufferTres = (byte*)malloc (tmp + 1); + _scumm->fileRead(f_tres, _bufferTres, 8); // skip 8 bytes + _scumm->fileRead(f_tres, _bufferTres, tmp); + for (l = 0; l < tmp; l++) + *(_bufferTres + l) ^= 0xcc; + _bufferTres[tmp] = 0; + } + else + { + _scumm->fileSeek(f_tres, 0, SEEK_END); // assume file is unencrypted + tmp = ftell(f_tres); + _scumm->fileSeek(f_tres, 0, SEEK_SET); + _bufferTres = (byte*)malloc (tmp + 1); + fread(_bufferTres, tmp, 1, f_tres); + _bufferTres[tmp] = 0; + } + _scumm->fileClose(f_tres); + + return _bufferTres; +} + +void SmushPlayer::loadFonts() { + byte buf[100]; + FILE * f_tres; + uint32 tmp; + int l; + byte * buffer = NULL; + + for (l = 0; l < SP_MAX_FONTS; l++) + { + _fonts [l] = NULL; + sprintf((char *)buf, "%sVIDEO/FONT%d.NUT", (char *)_scumm->getGameDataPath(), l); + f_tres = (FILE*)_scumm->fileOpen((char *)buf, 1); + + if (f_tres == NULL) { + sprintf((char *)buf, "%svideo/font%d.nut", (char *)_scumm->getGameDataPath(), l); + f_tres = (FILE*)_scumm->fileOpen((char *)buf, 1); + if (f_tres == NULL) + continue; + } + + _scumm->fileRead(f_tres, &tmp, 4); // read tag + tmp = READ_BE_UINT32(&tmp); + if (tmp == 'ANIM') { + _scumm->fileRead(f_tres, &tmp, 4); // read length + tmp = READ_BE_UINT32(&tmp); + buffer = (byte *)malloc(tmp); + _scumm->fileRead(f_tres, buffer, tmp); + _fonts[l] = buffer; + } + _scumm->fileClose(f_tres); + } +} + +byte * SmushPlayer::getStringTRES(int32 number) { + byte * txt = NULL; + uint32 l, i, j; + + for (l = 0;; l++) { + char t = *(_bufferTres + l); + if (t == 0) + break; + if (t == '#') { + byte buf[10]; + strncpy ((char*)buf, (char*)_bufferTres + l + 1, 9); + buf[9] = 0; + if (strcmp ((char*)buf, "define a ") == 0) { + l += 10; + for (i = 0; i < 5; i++) { + buf[i] = *(_bufferTres + l + i); + if (buf[i] == 0x0d) + { + buf[i] = 0; + l += 2; + break; + } + } + if (atol((char*)buf) == number) { + for (j = 0; j < 200; j++) { + t = *(_bufferTres + l + j + i); + if ((t == 0) || (t == '#')) + break; + } + txt = (byte *)malloc(j + 1); + strncpy((char*)txt, (char*)_bufferTres + l + i, j); + txt[j] = 0; + return txt; + } + } + } + } + + return txt; +} + +uint32 SmushPlayer::getFontHeight(uint8 c_font) { + byte * font = _fonts[c_font]; + uint32 offset = 0, t_offset = 0; + + if (font == NULL) + return 0; + + if (READ_BE_UINT32(font) != 'AHDR') + return 0; + + offset = READ_BE_UINT32(font + 4) + 8; + if (READ_BE_UINT32(font + offset) == 'FRME') { + offset += 8; + if (READ_BE_UINT32(font + offset) == 'FOBJ') { + t_offset = offset + 8; + } + else + return 0; + } + return READ_LE_UINT16(font + t_offset + 8); +} + +uint32 SmushPlayer::getCharWidth(uint8 c_font, byte txt) { + byte * font = _fonts[c_font]; + uint32 offset = 0, t_offset = 0, l; + + if (font == NULL) + return 0; + + if (READ_BE_UINT32(font) != 'AHDR') + return 0; + + offset = READ_BE_UINT32(font + 4) + 8; + for (l = 0; l <= txt; l++) { + if (READ_BE_UINT32(font + offset) == 'FRME') { + offset += 8; + if (READ_BE_UINT32(font + offset) == 'FOBJ') { + t_offset = offset + 8; + offset += READ_BE_UINT32(font + offset + 4) + 8; + } + else + return 0; + } + else + return 0; + } + return READ_LE_UINT16(font + t_offset + 6); +} + +void SmushPlayer::drawStringTRES(uint32 x, uint32 y, byte * txt) { + char buf[4]; + uint32 c_line = 0, l = 0, i, tmp_x, x_pos, last_l, t_width, t_height; + uint8 c_font = 0, c_color = 0, last_j; + int j; + + if ((txt[l] == '^') && (txt[l + 1] == 'f')) { + buf[0] = txt[l + 2]; + buf[1] = txt[l + 3]; + buf[2] = 0; + l += 4; + c_font = atoi(buf); + if (c_font >= SP_MAX_FONTS) + error ("SP: number font out of range"); + } + if ((txt[l] == '^') && (txt[l + 1] == 'c')) { + buf[0] = txt[l + 2]; + buf[1] = txt[l + 3]; + buf[2] = txt[l + 4]; + buf[3] = 0; + l += 5; + c_color = atoi(buf); + } + + t_height = getFontHeight(c_font); + x_pos = x; + last_j = 0; + last_l = l; + + for (j = 0;; j++) { + if (txt[l + j] == 0) { + break; + } + if (txt[l + j] == 0x0d) { + if (txt[l + j + 2] == 0x0d) break; + l += j + 2; + j = -1; + last_j = 0; + c_line++; + x_pos = x; + if (c_line * t_height + y >= 200) { + if (y > t_height) { + y -= t_height; + } + else + { + y = 0; + } + continue; + } + } + t_width = getCharWidth (c_font, txt[l + j]); + if (x_pos + t_width >= 320) { + if ((x > t_width) && (c_line == 0)) { + x -= t_width; + x_pos += t_width; + if (txt[l + j] == ' ') { + last_j = j; + } + continue; + } + j = last_j; + txt[l + j] = 0x0d; + x_pos = x; + c_line++; + l++; + j = -1; + last_j = 0; + if (c_line * t_height + y >= 200) { + if (y > t_height) { + y -= t_height; + } + else { + y = 0; + } + } + } + else { + x_pos += t_width; + if (txt[l + j] == ' ') { + last_j = j; + } + } + } + + l = last_l; + c_line = 0; + + for (;;) { + tmp_x = x; + for (i = 0;; i++) { + if (txt[l + i] == 0) + goto exit_loop; + if (txt[l + i] == 0x0d) { + if (txt[l + i + 1] == 0x0a) { + l += i + 2; + break; + } + else { + l += i + 1; + break; + } + } + drawCharTRES (&tmp_x, y, c_line, c_font, c_color, txt[l + i]); + } + c_line++; + } +exit_loop: ; + +} + +void SmushPlayer::codec44Depack(byte *dst, byte *src, uint32 len) { + byte val; + uint16 size_line; + uint16 num; + + do { + size_line = READ_LE_UINT16(src); + src += 2; + len -= 2; + + for (; size_line != 0;) { + num = *src++; + val = *src++; + memset(dst, val, num); + dst += num; + len -= 2; + size_line -= 2; + if (size_line == 0) break; + + num = READ_LE_UINT16(src) + 1; + src += 2; + memcpy(dst, src, num); + dst += num; + src += num; + len -= num + 2; + size_line -= num + 2; + + } + dst--; + + } while (len > 1); +} + +void SmushPlayer::drawCharTRES(uint32 * x, uint32 y, uint32 c_line, uint8 c_font, uint8 color, uint8 txt) { + byte * font = _fonts[c_font]; + uint32 offset = 0, t_offset = 0, l, width, height, length = 0; + + if (font == NULL) + return; + + if (READ_BE_UINT32(font) != 'AHDR') + return; + + offset = READ_BE_UINT32(font + 4) + 8; + for (l = 0; l <= txt; l++) { + if (READ_BE_UINT32(font + offset) == 'FRME') { + offset += 8; + if (READ_BE_UINT32(font + offset) == 'FOBJ') { + t_offset = offset + 8; + length = READ_BE_UINT32(font + offset + 4) - 0xe; + offset += READ_BE_UINT32(font + offset + 4) + 8; + } + else + return; + } + else + return; + } + + byte * dst = (byte*)malloc (1000); + byte * src = (byte*)(font + t_offset + 0x0e); + + codec44Depack (dst, src, length); + + width = READ_LE_UINT16(font + t_offset + 6); + height = READ_LE_UINT16(font + t_offset + 8); + + y += c_line * height; + for (uint32 ty = 0; ty < height; ty++) { + for (uint32 tx = 0; tx < width; tx++) { + byte pixel = *(dst + ty * width + tx); + if (pixel != 0) { + if (color == 0) { + if (pixel == 0x01) + pixel = 0xf; + } + else { + if (pixel == 0x01) + pixel = color; + } + if (pixel == 0xff) + pixel = 0x0; + *(_renderBitmap + ((ty + y) * 320 + *x + tx)) = pixel; + } + } + } + *x += width; + free (dst); +} + +uint32 SmushPlayer::nextBE32() { + uint32 a = READ_BE_UINT32(_cur); + _cur += sizeof(uint32); + + return a; +} + +void SmushPlayer::openFile(byte *fileName) { + byte buf[100]; + + sprintf((char *)buf, "%sVIDEO/%s", (char *)_scumm->getGameDataPath(), (char *)fileName); + _in = (FILE*)_scumm->fileOpen((char *)buf, 1); + + if (_in == NULL) { + sprintf((char *)buf, "%svideo/%s", (char *)_scumm->getGameDataPath(), (char *)fileName); + _in = (FILE*)_scumm->fileOpen((char *)buf, 1); + } +} + +void SmushPlayer::nextBlock() { + _blockTag = _scumm->fileReadDwordBE(_in); + _blockSize = _scumm->fileReadDwordBE(_in); + + if (_block != NULL) + free(_block); + + _block = (byte *)malloc(_blockSize); + + if (_block == NULL) + error("SP: cannot allocate memory"); + + _scumm->fileRead(_in, _block, _blockSize); +} + +bool SmushPlayer::parseTag() { + switch (nextBlock(), _blockTag) { + + case 'AHDR': + parseAHDR(); + break; + + case 'FRME': + parseFRME(); + break; + + default: + error("SP: Encountered invalid block %c%c%c%c", _blockTag >> 24, _blockTag >> 16, _blockTag >> 8, _blockTag); + } + + return true; +} + +void SmushPlayer::parseAHDR() { + memcpy(_fluPalette, _block + 6, 0x300); + _paletteChanged = true; +} + +void SmushPlayer::parseIACT() { + uint32 pos, bpos, tag, sublen, subpos, trk, idx; + byte flags; + bool new_mixer = false; + byte *buf; + + flags = SoundMixer::FLAG_AUTOFREE; + + pos = 0; + pos += 6; + + trk = READ_LE_UINT32(_cur + pos); /* FIXME: is this correct ? */ + pos += 4; + + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_imusTrk[idx] == trk) + break; + } + + if (idx == MAX_STREAMER) { + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_imusTrk[idx] == 0 && _scumm->_mixer->_channels[idx] == NULL) { + _imusTrk[idx] = trk; + _imusSize[idx] = 0; + new_mixer = true; + break; + } + } + } + + if (idx == MAX_STREAMER) { + warning("iMUS table full"); + return; + } + + pos += 8; /* FIXME: what are these ? */ + + while (pos < _frmeSize) { + + if (_imusSize[idx] == 0) { + tag = READ_BE_UINT32(_cur + pos); + pos += 4; + if (tag != 'iMUS') + error("trk %d: iMUS tag not found", trk); + _imusSize[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + } + if (_imusSubSize[idx] == 0) { + _imusSubTag[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + _imusSubSize[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + _imusSize[idx] -= 8; + debug(3, "trk %d: tag '%4s' size %x", trk, _cur + pos - 8, _imusSubSize[idx]); + } + + sublen = _imusSubSize[idx] < (_frmeSize - pos) ? _imusSubSize[idx] : (_frmeSize - pos); + + switch (_imusSubTag[idx]) { + case 'MAP ': + tag = READ_BE_UINT32(_cur + pos); + if (tag != 'FRMT') + error("trk %d: no FRMT section"); + _imusCodec[idx] = READ_BE_UINT32(_cur + pos + 16); + _imusRate[idx] = READ_BE_UINT32(_cur + pos + 20); + _imusChan[idx] = READ_BE_UINT32(_cur + pos + 24); + _imusPos[idx] = 0; + break; + case 'DATA': + switch (_imusCodec[idx]) { + case 8: + if (_imusChan[idx] == 2) + flags |= SoundMixer::FLAG_STEREO; + flags |= SoundMixer::FLAG_UNSIGNED; + buf = (byte *)malloc(sublen); + memcpy(buf, _cur + pos, sublen); + bpos = sublen; + break; + case 12: + if (_imusChan[idx] == 2) + flags |= SoundMixer::FLAG_STEREO; + flags |= SoundMixer::FLAG_16BITS; + buf = (byte *)malloc(2 * sublen); + + bpos = 0; + subpos = 0; + + while (subpos < sublen) { + + while (_imusPos[idx] < 3 && subpos < sublen) { + _imusData[idx][_imusPos[idx]] = _cur[pos + subpos]; + _imusPos[idx]++; + subpos++; + } + + if (_imusPos[idx] == 3) { + uint32 temp; + + temp = (_imusData[idx][1] & 0x0f) << 8; + temp = (temp | _imusData[idx][0]) << 4; + temp -= 0x8000; + + buf[bpos++] = (byte)((temp >> 8) & 0xff); + buf[bpos++] = (byte)(temp & 0xff); + + temp = (_imusData[idx][1] & 0xf0) << 4; + temp = (temp | _imusData[idx][2]) << 4; + temp -= 0x8000; + + buf[bpos++] = (byte)((temp >> 8) & 0xff); + buf[bpos++] = (byte)(temp & 0xff); + _imusPos[idx] = 0; + } + } + break; + default: + error("trk %d: unknown iMUS codec %d", trk, _imusCodec[idx]); + } + + debug(3, "trk %d: iMUSE play part, len 0x%x rate %d remain 0x%x", + trk, bpos, _imusRate[idx], _imusSubSize[idx]); + + _imusBuf[idx] = buf; + _imusFinalSize[idx] = bpos; + _imusFlags[idx] = flags; + _imusNewMixer[idx] = new_mixer; + + break; + default: + error("trk %d: unknown tag inside iMUS %08x [%c%c%c%c]", + trk, _imusSubTag[idx], _imusSubTag[idx] >> 24, + _imusSubTag[idx] >> 16, _imusSubTag[idx] >> 8, _imusSubTag[idx]); + } + + _imusSubSize[idx] -= sublen; + _imusSize[idx] -= sublen; + pos += sublen; + + if (_imusSubSize[idx] == 0 && _imusSubTag[idx] == 'DATA') { + _imusTrk[idx] = 0; + return; + } + } +} + +void SmushPlayer::parseNPAL() { + memcpy(_fluPalette, _cur, 0x300); + _paletteChanged = true; +} + +void SmushPlayer::codec1(CodecData * cd) { + uint y = cd->y; + byte *src = cd->src; + byte *dest = cd->out; + uint h = cd->h; + + if (!h || !cd->w) + return; + + dest += cd->y * cd->pitch; + + do { + byte color; + uint len, num; + uint x; + + if ((uint) y >= (uint) cd->outheight) { + src += READ_LE_UINT16(src)+2; + continue; + } + + len = cd->w; + x = cd->x; + src += 2; + + do { + byte code = *src++; + + num = (code >> 1) + 1; + if (num > len) + num = len; + len -= num; + + if (code & 1) { + color = *src++; +// if ((color = *src++)!=0) { + do { + if ((uint) x < (uint) cd->outwidth) + dest[x] = color; + } while (++x, --num); +// } else { +// x += num; +// } + } else { + do { + color = *src++; + if ( /*(color=*src++) != 0 && */ (uint) x < (uint) cd->outwidth) + dest[x] = color; + } while (++x, --num); + } + } while (len); + } while (dest += cd->pitch, y++, --h); +} + +void SmushPlayer::codec37BompDepack(byte *dst, byte *src, int32 len) { + byte code; + byte color; + int32 num; + + do { + code = *src++; + if (code & 1) { + num = (code >> 1) + 1; + color = *src++; + memset(dst, color, num); + dst += num; + } else { + num = (code >> 1) + 1; + memcpy(dst, src, num); + dst += num; + src += num; + } + } while (len -= num); +} + +void SmushPlayer::codec37Proc4(byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table) { + byte code, *tmp; + int32 i; + uint32 t; + + if (pitch != 320) { + warning("SP: invalid pitch"); + return; + } + + do { + i = bw; + do { + code = *src++; + if (code == 0xFD) { + t = src[0]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst, &t, sizeof uint32); + memcpy(dst + 320, &t, sizeof uint32); + memcpy(dst + 320 * 2, &t, sizeof uint32); + memcpy(dst + 320 * 3, &t, sizeof uint32); +#else + *(uint32 *)(dst + 0) = t; + *(uint32 *)(dst + 320) = t; + *(uint32 *)(dst + 320 * 2) = t; + *(uint32 *)(dst + 320 * 3) = t; +#endif + src += 1; + dst += 4; + } else if (code == 0xFE) { + t = src[0]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst, &t, sizeof uint32); +#else + *(uint32 *)(dst + 0) = t; +#endif + t = src[1]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320) = t; +#endif + t = src[2]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320 * 2, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320 * 2) = t; +#endif + t = src[3]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320 * 3, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320 * 3) = t; +#endif + src += 4; + dst += 4; + } else if (code == 0xFF) { +#ifdef PICKY_ALIGN + memcpy(dst, src, sizeof uint32); + memcpy(dst + 320, src + sizeof uint32, sizeof uint32); + memcpy(dst + 320 * 2, src + 2 * sizeof uint32, sizeof uint32); + memcpy(dst + 320 * 3, src + 3 * sizeof uint32, sizeof uint32); +#else + *(uint32 *)(dst + 0) = ((uint32 *)src)[0]; + *(uint32 *)(dst + 320) = ((uint32 *)src)[1]; + *(uint32 *)(dst + 320 * 2) = ((uint32 *)src)[2]; + *(uint32 *)(dst + 320 * 3) = ((uint32 *)src)[3]; +#endif + src += 16; + dst += 4; + } else if (code == 0x00) { + uint16 count = src[0] + 1; + src += 1; + for (uint16 l = 0; l < count; l++) { + tmp = dst + next_offs; +#ifdef PICKY_ALIGN + memcpy(dst, tmp, sizeof uint32); + memcpy(dst + 320, tmp + 320, sizeof uint32); + memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); + memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); +#else + *(uint32 *)(dst + 0) = *(uint32 *)(tmp); + *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); + *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); + *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); +#endif + dst += 4; + i--; + if (i == 0) { + i = bw; + dst += 320 * 4 - 320; + bh--; + } + } + i++; + } else { + tmp = dst + table[code] + next_offs; +#ifdef PICKY_ALIGN + memcpy(dst, tmp, sizeof uint32); + memcpy(dst + 320, tmp + 320, sizeof uint32); + memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); + memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); +#else + *(uint32 *)(dst + 0) = *(uint32 *)(tmp); + *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); + *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); + *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); +#endif + dst += 4; + } + if (i <= 0) + break; + if (bh <= 0) + break; + } while (--i); + dst += 320 * 4 - 320; + if (bh <= 0) + break; + } while (--bh); +} + + +void SmushPlayer::codec37Proc5(int32 game, byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, + + int32 pitch, int16 *table) { + byte code, *tmp; + int32 i; + uint32 t; + + if (pitch != 320) { + warning("SP: invalid pitch"); + return; + } + + do { + i = bw; + do { + code = *src++; + + // FIXME: Full Throttle has different FD and FEs? + if ((game == GID_DIG) && (code == 0xFD)) { + t = src[0]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst, &t, sizeof uint32); + memcpy(dst + 320, &t, sizeof uint32); + memcpy(dst + 320 * 2, &t, sizeof uint32); + memcpy(dst + 320 * 3, &t, sizeof uint32); +#else + *(uint32 *)(dst + 0) = t; + *(uint32 *)(dst + 320) = t; + *(uint32 *)(dst + 320 * 2) = t; + *(uint32 *)(dst + 320 * 3) = t; +#endif + src += 1; + dst += 4; + } else if ((game == GID_DIG) && (code == 0xFE)) { + t = src[0]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst, &t, sizeof uint32); +#else + *(uint32 *)(dst + 0) = t; +#endif + t = src[1]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320) = t; +#endif + t = src[2]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320 * 2, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320 * 2) = t; +#endif + t = src[3]; + t += (t << 8) + (t << 16) + (t << 24); +#ifdef PICKY_ALIGN + memcpy(dst + 320 * 3, &t, sizeof uint32); +#else + *(uint32 *)(dst + 320 * 3) = t; +#endif + src += 4; + dst += 4; + } else if (code == 0xFF) { +#ifdef PICKY_ALIGN + memcpy(dst, src, sizeof uint32); + memcpy(dst + 320, src + sizeof uint32, sizeof uint32); + memcpy(dst + 320 * 2, src + 2 * sizeof uint32, sizeof uint32); + memcpy(dst + 320 * 3, src + 3 * sizeof uint32, sizeof uint32); +#else + *(uint32 *)(dst + 0) = ((uint32 *)src)[0]; + *(uint32 *)(dst + 320) = ((uint32 *)src)[1]; + *(uint32 *)(dst + 320 * 2) = ((uint32 *)src)[2]; + *(uint32 *)(dst + 320 * 3) = ((uint32 *)src)[3]; +#endif + src += 16; + dst += 4; + } else { + tmp = dst + table[code] + next_offs; +#ifdef PICKY_ALIGN + memcpy(dst, tmp, sizeof uint32); + memcpy(dst + 320, tmp + 320, sizeof uint32); + memcpy(dst + 320 * 2, tmp + 320 * 2, sizeof uint32); + memcpy(dst + 320 * 3, tmp + 320 * 3, sizeof uint32); +#else + *(uint32 *)(dst + 0) = *(uint32 *)(tmp); + *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320); + *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2); + *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3); +#endif + dst += 4; + } + } while (--i); + dst += 320 * 4 - 320; + } while (--bh); +} + +// this table is the same in FT and Dig +static const int8 maketable_bytes[] = { + 0, 0, 1, 0, 2, 0, 3, 0, 5, 0, 8, 0, 13, 0, 21, 0, + -1, 0, -2, 0, -3, 0, -5, 0, -8, 0, -13, 0, -17, 0, -21, 0, + 0, 1, 1, 1, 2, 1, 3, 1, 5, 1, 8, 1, 13, 1, 21, 1, + -1, 1, -2, 1, -3, 1, -5, 1, -8, 1, -13, 1, -17, 1, -21, 1, + 0, 2, 1, 2, 2, 2, 3, 2, 5, 2, 8, 2, 13, 2, 21, 2, + -1, 2, -2, 2, -3, 2, -5, 2, -8, 2, -13, 2, -17, 2, -21, 2, + 0, 3, 1, 3, 2, 3, 3, 3, 5, 3, 8, 3, 13, 3, 21, 3, + -1, 3, -2, 3, -3, 3, -5, 3, -8, 3, -13, 3, -17, 3, -21, 3, + 0, 5, 1, 5, 2, 5, 3, 5, 5, 5, 8, 5, 13, 5, 21, 5, + -1, 5, -2, 5, -3, 5, -5, 5, -8, 5, -13, 5, -17, 5, -21, 5, + 0, 8, 1, 8, 2, 8, 3, 8, 5, 8, 8, 8, 13, 8, 21, 8, + -1, 8, -2, 8, -3, 8, -5, 8, -8, 8, -13, 8, -17, 8, -21, 8, + 0, 13, 1, 13, 2, 13, 3, 13, 5, 13, 8, 13, 13, 13, 21, 13, + -1, 13, -2, 13, -3, 13, -5, 13, -8, 13, -13, 13, -17, 13, -21, 13, + 0, 21, 1, 21, 2, 21, 3, 21, 5, 21, 8, 21, 13, 21, 21, 21, + -1, 21, -2, 21, -3, 21, -5, 21, -8, 21, -13, 21, -17, 21, -21, 21, + 0, -1, 1, -1, 2, -1, 3, -1, 5, -1, 8, -1, 13, -1, 21, -1, + -1, -1, -2, -1, -3, -1, -5, -1, -8, -1, -13, -1, -17, -1, -21, -1, + 0, -2, 1, -2, 2, -2, 3, -2, 5, -2, 8, -2, 13, -2, 21, -2, + -1, -2, -2, -2, -3, -2, -5, -2, -8, -2, -13, -2, -17, -2, -21, -2, + 0, -3, 1, -3, 2, -3, 3, -3, 5, -3, 8, -3, 13, -3, 21, -3, + -1, -3, -2, -3, -3, -3, -5, -3, -8, -3, -13, -3, -17, -3, -21, -3, + 0, -5, 1, -5, 2, -5, 3, -5, 5, -5, 8, -5, 13, -5, 21, -5, + -1, -5, -2, -5, -3, -5, -5, -5, -8, -5, -13, -5, -17, -5, -21, -5, + 0, -8, 1, -8, 2, -8, 3, -8, 5, -8, 8, -8, 13, -8, 21, -8, + -1, -8, -2, -8, -3, -8, -5, -8, -8, -8, -13, -8, -17, -8, -21, -8, + 0, -13, 1, -13, 2, -13, 3, -13, 5, -13, 8, -13, 13, -13, 21, -13, + -1, -13, -2, -13, -3, -13, -5, -13, -8, -13, -13, -13, -17, -13, -21, -13, + 0, -17, 1, -17, 2, -17, 3, -17, 5, -17, 8, -17, 13, -17, 21, -17, + -1, -17, -2, -17, -3, -17, -5, -17, -8, -17, -13, -17, -17, -17, -21, -17, + 0, -21, 1, -21, 2, -21, 3, -21, 5, -21, 8, -21, 13, -21, 21, -21, + -1, -21, -2, -21, -3, -21, -5, -21, -8, -21, -13, -21, -17, -21, 0, 0, + -8, -29, 8, -29, -18, -25, 17, -25, 0, -23, -6, -22, 6, -22, -13, -19, + 12, -19, 0, -18, 25, -18, -25, -17, -5, -17, 5, -17, -10, -15, 10, -15, + 0, -14, -4, -13, 4, -13, 19, -13, -19, -12, -8, -11, -2, -11, 0, -11, + 2, -11, 8, -11, -15, -10, -4, -10, 4, -10, 15, -10, -6, -9, -1, -9, + 1, -9, 6, -9, -29, -8, -11, -8, -8, -8, -3, -8, 3, -8, 8, -8, + 11, -8, 29, -8, -5, -7, -2, -7, 0, -7, 2, -7, 5, -7, -22, -6, + -9, -6, -6, -6, -3, -6, -1, -6, 1, -6, 3, -6, 6, -6, 9, -6, + 22, -6, -17, -5, -7, -5, -4, -5, -2, -5, 0, -5, 2, -5, 4, -5, + 7, -5, 17, -5, -13, -4, -10, -4, -5, -4, -3, -4, -1, -4, 0, -4, + 1, -4, 3, -4, 5, -4, 10, -4, 13, -4, -8, -3, -6, -3, -4, -3, + -3, -3, -2, -3, -1, -3, 0, -3, 1, -3, 2, -3, 4, -3, 6, -3, + 8, -3, -11, -2, -7, -2, -5, -2, -3, -2, -2, -2, -1, -2, 0, -2, + 1, -2, 2, -2, 3, -2, 5, -2, 7, -2, 11, -2, -9, -1, -6, -1, + -4, -1, -3, -1, -2, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, + 4, -1, 6, -1, 9, -1, -31, 0, -23, 0, -18, 0, -14, 0, -11, 0, + -7, 0, -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 0, -31, 1, 0, + 2, 0, 3, 0, 4, 0, 5, 0, 7, 0, 11, 0, 14, 0, 18, 0, + 23, 0, 31, 0, -9, 1, -6, 1, -4, 1, -3, 1, -2, 1, -1, 1, + 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 6, 1, 9, 1, -11, 2, + -7, 2, -5, 2, -3, 2, -2, 2, -1, 2, 0, 2, 1, 2, 2, 2, + 3, 2, 5, 2, 7, 2, 11, 2, -8, 3, -6, 3, -4, 3, -2, 3, + -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 6, 3, 8, 3, + -13, 4, -10, 4, -5, 4, -3, 4, -1, 4, 0, 4, 1, 4, 3, 4, + 5, 4, 10, 4, 13, 4, -17, 5, -7, 5, -4, 5, -2, 5, 0, 5, + 2, 5, 4, 5, 7, 5, 17, 5, -22, 6, -9, 6, -6, 6, -3, 6, + -1, 6, 1, 6, 3, 6, 6, 6, 9, 6, 22, 6, -5, 7, -2, 7, + 0, 7, 2, 7, 5, 7, -29, 8, -11, 8, -8, 8, -3, 8, 3, 8, + 8, 8, 11, 8, 29, 8, -6, 9, -1, 9, 1, 9, 6, 9, -15, 10, + -4, 10, 4, 10, 15, 10, -8, 11, -2, 11, 0, 11, 2, 11, 8, 11, + 19, 12, -19, 13, -4, 13, 4, 13, 0, 14, -10, 15, 10, 15, -5, 17, + 5, 17, 25, 17, -25, 18, 0, 18, -12, 19, 13, 19, -6, 22, 6, 22, + 0, 23, -17, 25, 18, 25, -8, 29, 8, 29, 0, 31, 0, 0, -6, -22, + 6, -22, -13, -19, 12, -19, 0, -18, -5, -17, 5, -17, -10, -15, 10, -15, + 0, -14, -4, -13, 4, -13, 19, -13, -19, -12, -8, -11, -2, -11, 0, -11, + 2, -11, 8, -11, -15, -10, -4, -10, 4, -10, 15, -10, -6, -9, -1, -9, + 1, -9, 6, -9, -11, -8, -8, -8, -3, -8, 0, -8, 3, -8, 8, -8, + 11, -8, -5, -7, -2, -7, 0, -7, 2, -7, 5, -7, -22, -6, -9, -6, + -6, -6, -3, -6, -1, -6, 1, -6, 3, -6, 6, -6, 9, -6, 22, -6, + -17, -5, -7, -5, -4, -5, -2, -5, -1, -5, 0, -5, 1, -5, 2, -5, + 4, -5, 7, -5, 17, -5, -13, -4, -10, -4, -5, -4, -3, -4, -2, -4, + -1, -4, 0, -4, 1, -4, 2, -4, 3, -4, 5, -4, 10, -4, 13, -4, + -8, -3, -6, -3, -4, -3, -3, -3, -2, -3, -1, -3, 0, -3, 1, -3, + 2, -3, 3, -3, 4, -3, 6, -3, 8, -3, -11, -2, -7, -2, -5, -2, + -4, -2, -3, -2, -2, -2, -1, -2, 0, -2, 1, -2, 2, -2, 3, -2, + 4, -2, 5, -2, 7, -2, 11, -2, -9, -1, -6, -1, -5, -1, -4, -1, + -3, -1, -2, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, + 5, -1, 6, -1, 9, -1, -23, 0, -18, 0, -14, 0, -11, 0, -7, 0, + -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 0, -23, 1, 0, 2, 0, + 3, 0, 4, 0, 5, 0, 7, 0, 11, 0, 14, 0, 18, 0, 23, 0, + -9, 1, -6, 1, -5, 1, -4, 1, -3, 1, -2, 1, -1, 1, 0, 1, + 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 9, 1, -11, 2, + -7, 2, -5, 2, -4, 2, -3, 2, -2, 2, -1, 2, 0, 2, 1, 2, + 2, 2, 3, 2, 4, 2, 5, 2, 7, 2, 11, 2, -8, 3, -6, 3, + -4, 3, -3, 3, -2, 3, -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, + 4, 3, 6, 3, 8, 3, -13, 4, -10, 4, -5, 4, -3, 4, -2, 4, + -1, 4, 0, 4, 1, 4, 2, 4, 3, 4, 5, 4, 10, 4, 13, 4, + -17, 5, -7, 5, -4, 5, -2, 5, -1, 5, 0, 5, 1, 5, 2, 5, + 4, 5, 7, 5, 17, 5, -22, 6, -9, 6, -6, 6, -3, 6, -1, 6, + 1, 6, 3, 6, 6, 6, 9, 6, 22, 6, -5, 7, -2, 7, 0, 7, + 2, 7, 5, 7, -11, 8, -8, 8, -3, 8, 0, 8, 3, 8, 8, 8, + 11, 8, -6, 9, -1, 9, 1, 9, 6, 9, -15, 10, -4, 10, 4, 10, + 15, 10, -8, 11, -2, 11, 0, 11, 2, 11, 8, 11, 19, 12, -19, 13, + -4, 13, 4, 13, 0, 14, -10, 15, 10, 15, -5, 17, 5, 17, 0, 18, + -12, 19, 13, 19, -6, 22, 6, 22, 0, 23, +}; + +void SmushPlayer::codec37Maketable(PersistentCodecData37 * pcd, int32 pitch, byte idx) { + int32 i, j; + + if (pcd->table_last_pitch == pitch && pcd->table_last_flags == idx) + return; + + pcd->table_last_pitch = pitch; + pcd->table_last_flags = idx; + + assert(idx * 255 + 254 < (int32)(sizeof(maketable_bytes) / 2)); + + for (i = 0; i < 255; i++) { + j = i + idx * 255; + pcd->table1[i] = maketable_bytes[j * 2 + 1] * pitch + maketable_bytes[j * 2]; + } +} + +bool SmushPlayer::codec37(int32 game, CodecData * cd, PersistentCodecData37 * pcd) { + int32 width_in_blocks, height_in_blocks; + int32 src_pitch; + byte *curbuf; + int32 size; + bool result = false; + + _frameChanged = 1; + + width_in_blocks = (cd->w + 3) >> 2; + height_in_blocks = (cd->h + 3) >> 2; + src_pitch = width_in_blocks * 4; + + codec37Maketable(pcd, src_pitch, cd->src[1]); + + switch (cd->src[0]) { + case 0:{ + curbuf = pcd->deltaBufs[pcd->curtable]; + memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf); + size = READ_LE_UINT32(cd->src + 4); + memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size); + memcpy(curbuf, cd->src + 16, size); + break; + } + + case 2:{ + size = READ_LE_UINT32(cd->src + 4); + curbuf = pcd->deltaBufs[pcd->curtable]; + if (size == 64000) + codec37BompDepack(curbuf, cd->src + 16, size); + else + return (1); + + memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf); + memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size); + break; + } + + case 3:{ + uint16 number = READ_LE_UINT16(cd->src + 2); + + if (number && pcd->flags + 1 != number) + break; + + if (number & 1 && cd->src[12] & 1 && cd->flags & 0x10) { + _frameChanged = 0; + result = true; + break; + } + + if ((number & 1) || !(cd->src[12] & 1)) { + pcd->curtable ^= 1; + } + + codec37Proc5(game, pcd->deltaBufs[pcd->curtable], cd->src + 16, + pcd->deltaBufs[pcd->curtable ^ 1] - + pcd->deltaBufs[pcd->curtable], width_in_blocks, + height_in_blocks, src_pitch, pcd->table1); + break; + + } + case 4:{ + uint16 number = READ_LE_UINT16(cd->src + 2); + + if (number && pcd->flags + 1 != number) + break; + + if (number & 1 && cd->src[12] & 1 && cd->flags & 0x10) { + _frameChanged = 0; + result = true; + break; + } + + if ((number & 1) || !(cd->src[12] & 1)) { + pcd->curtable ^= 1; + } + + codec37Proc4(pcd->deltaBufs[pcd->curtable], cd->src + 16, + pcd->deltaBufs[pcd->curtable ^ 1] - + pcd->deltaBufs[pcd->curtable], width_in_blocks, + height_in_blocks, src_pitch, pcd->table1); + break; + } + + case 1: + warning("SP: code %d", cd->src[0]); + return (1); + + default: + error("SP: codec37 default case"); + } + + pcd->flags = READ_LE_UINT16(cd->src + 2); + + if (result) { + pcd->curtable ^= 1; + } else { + memcpy(cd->out, pcd->deltaBufs[pcd->curtable], 320 * 200); + } + + return (_frameChanged); +} + +void SmushPlayer::codec37Init(PersistentCodecData37 * pcd, int32 width, int32 height) { + pcd->width = width; + pcd->height = height; + pcd->deltaSize = width * height * 2 + 0x3E00 + 0xBA00; + pcd->deltaBuf = (byte *)calloc(pcd->deltaSize, 1); + pcd->deltaBufs[0] = pcd->deltaBuf + 0x3E00; + pcd->deltaBufs[1] = pcd->deltaBuf + width * height + 0xBA00; + pcd->curtable = 0; + pcd->table1 = (int16 *)calloc(255, sizeof(uint16)); +} + +void SmushPlayer::parseFOBJ() { + byte codec; + CodecData cd; + + cd.out = _renderBitmap; + cd.pitch = cd.outwidth = 320; + cd.outheight = 200; + cd.y = 0; + cd.x = 0; + cd.src = _cur + 0xE; + cd.w = READ_LE_UINT16(_cur + 6); + cd.h = READ_LE_UINT16(_cur + 8); + cd.flags = 0; + + codec = _cur[0]; + + switch (codec) { + case 1: + codec1(&cd); + break; + case 37: + _frameChanged = codec37(_scumm->_gameId, &cd, &pcd37); + break; + default: + error("SP: invalid codec %d", codec); + } +} + +void SmushPlayer::parsePSAD() { // FIXME: Needs to append to a sound buffer + uint32 pos, sublen, tag, idx, trk; + bool new_mixer = false; + byte *buf; + pos = 0; + + trk = READ_LE_UINT16(_cur + pos); /* FIXME: is this correct ? */ + pos += 2; + + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_psadTrk[idx] == trk) + break; + } + + if (idx == MAX_STREAMER) { + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_psadTrk[idx] == 0 && _scumm->_mixer->_channels[idx] == NULL) { + _psadTrk[idx] = trk; + _saudSize[idx] = 0; + new_mixer = true; + break; + } + } + } + + if (idx == MAX_STREAMER) { + warning("PSAD table full\n"); + return; + } + + pos += 8; /* FIXME: what are these ? */ + + while (pos < _frmeSize) { + + if (_saudSize[idx] == 0) { + tag = READ_BE_UINT32(_cur + pos); + pos += 4; + if (tag != 'SAUD') // FIXME: DIG specific? + warning("trk %d: SAUD tag not found", trk); + _saudSize[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + } + + if (_saudSubSize[idx] == 0) { + _saudSubTag[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + _saudSubSize[idx] = READ_BE_UINT32(_cur + pos); + pos += 4; + _saudSize[idx] -= 8; + debug(3, "trk %d: tag '%4s' size %x", trk, _cur + pos - 8, _saudSubSize[idx]); + } + + sublen = _saudSubSize[idx] < (_frmeSize - pos) ? _saudSubSize[idx] : (_frmeSize - pos); + + switch (_saudSubTag[idx]) { + case 'STRK': + /* FIXME: what is this stuff ? */ + _strkRate[idx] = 22050; + break; + case 'SDAT': + buf = (byte *)malloc(sublen); + + memcpy(buf, _cur + pos, sublen); + + debug(3, "trk %d: SDAT part len 0x%x rate %d", trk, sublen, _strkRate[idx]); + + _strkBuf[idx] = buf; + _strkFinalSize[idx] = sublen; + _strkNewMixer[idx] = new_mixer; + break; + case 'SMRK': + _psadTrk[idx] = 0; + break; + case 'SHDR': + /* FIXME: what is this stuff ? */ + break; + default: // FIXME: Add FT tags + warning("trk %d: unknown tag inside PSAD", trk); + } + _saudSubSize[idx] -= sublen; + _saudSize[idx] -= sublen; + pos += sublen; + } +} + +void SmushPlayer::parseTRES() { + if (_scumm->_gameId == GID_DIG) { + if ((_scumm->_noSubtitles) && (READ_LE_UINT16(_cur + 4) != 0)) + return; + + byte * txt = getStringTRES (READ_LE_UINT16(_cur + 16)); + drawStringTRES (READ_LE_UINT16(_cur), READ_LE_UINT16(_cur + 2), txt); + if (txt != NULL) + free (txt); + } +} + +void SmushPlayer::parseXPAL() { + int32 num; + int32 i; + + num = READ_LE_UINT16(_cur + 2); + if (num == 0 || num == 0x200) { + if (num == 0x200) + memcpy(_fluPalette, _cur + 0x604, 0x300); + + for (i = 0; i < 0x300; i++) { + _fluPalMul129[i] = _fluPalette[i] * 129; + _fluPalWords[i] = READ_LE_UINT16(_cur + 4 + i * 2); + } + return; + } + + parseNPAL(); + + for (i = 0; i < 0x300; i++) { + _fluPalMul129[i] += _fluPalWords[i]; + _fluPalette[i] = _fluPalMul129[i] >> 7; + } + + _paletteChanged = true; +} + +void SmushPlayer::parseFRME() { + _cur = _block; + + do { + _frmeTag = nextBE32(); + _frmeSize = nextBE32(); + + switch (_frmeTag) { + case 'NPAL': + parseNPAL(); + break; + case 'FOBJ': + parseFOBJ(); + break; + case 'PSAD': + parsePSAD(); + break; + case 'TRES': + parseTRES(); + break; + case 'XPAL': + parseXPAL(); + break; + case 'IACT': + parseIACT(); + break; + case 'STOR': + case 'FTCH': + break; + + default: + error("SP: Encountered invalid block %c%c%c%c", _frmeTag >> 24, _frmeTag >> 16, _frmeTag >> 8, _frmeTag); + } + + _cur += (_frmeSize + 1) & ~1; + } while (_cur + 4 < _block + _blockSize); +} + +void SmushPlayer::init() { + _renderBitmap = _scumm->_videoBuffer; + codec37Init(&pcd37, 320, 200); + + memset(_saudSize, 0, sizeof(_saudSize)); + memset(_saudSubSize, 0, sizeof(_saudSubSize)); + memset(_psadTrk, 0, sizeof(_psadTrk)); + + memset(_imusSize, 0, sizeof(_imusSize)); + memset(_imusSubSize, 0, sizeof(_imusSubSize)); + memset(_imusTrk, 0, sizeof(_imusTrk)); + memset(_imusData, 0, sizeof(_imusData)); + memset(_imusPos, 0, sizeof(_imusPos)); + memset(_imusChan, 0, sizeof(_imusChan)); + + if (_scumm->_gameId == GID_DIG) + { + for (uint8 l = 0; l < SP_MAX_FONTS; l++) { + _fonts[l] = NULL; + } + _bufferTres = NULL; + loadTres(); + loadFonts(); + } + _scumm->_timer->installProcedure(&smush_handler, 75); +} + +void SmushPlayer::deinit() { + if (_scumm->_gameId == GID_DIG) + { + if (_bufferTres != NULL) + free (_bufferTres); + + for (int l = 0; l < SP_MAX_FONTS; l++) { + if (_fonts[l] != NULL) { + free (_fonts[l]); + _fonts[l] = NULL; + } + } + } + _scumm->_timer->releaseProcedure(&smush_handler); +} + +void SmushPlayer::go() { + while (parseTag()) { + } +} + +void SmushPlayer::setPalette() { + int32 i; + byte palette_colors[1024]; + byte *p = palette_colors; + byte *data = _fluPalette; + + for (i = 0; i != 256; i++, data += 3, p += 4) { + p[0] = data[0]; + p[1] = data[1]; + p[2] = data[2]; + p[3] = 0; + } + + _scumm->_system->set_palette(palette_colors, 0, 256); +} + +void SmushPlayer::update() { + _lock = false; +} + +void SmushPlayer::startVideo(short int arg, byte *videoFile) { + int32 frameIndex = 0; + int32 idx; + + _in = NULL; + _paletteChanged = false; + _block = NULL; + _blockTag = 0; + _blockSize = 0; + _cur = NULL; + _renderBitmap = NULL; + _frameSize = 0; + _frmeTag = 0; + _frmeSize = 0; + _deltaBuf = NULL; + _deltaBufSize = 0; + _lock = true; + + memset (&pcd37, 0, sizeof (PersistentCodecData37)); + + _scumm->_sound->pauseBundleMusic(true); + init(); + openFile(videoFile); + + if (_in == NULL) + return; + + if (_scumm->fileReadDwordBE(_in) != 'ANIM') + error("SP: file is not an anim"); + + fileSize = _scumm->fileReadDwordBE(_in); + + _scumm->videoFinished = 0; + _scumm->_insaneState = 1; + + do { + _frameChanged = true; + + if (ftell(_in) >= fileSize) + break; +#ifdef INSANE_DEBUG + warning("Playing frame %d", frameIndex); +#endif + + parseTag(); + frameIndex++; + + do { + _scumm->waitForTimer(1); + } while (_lock); + _lock = true; + + if (_scumm->_gameId == GID_DIG) { + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_imusTrk[idx] != 0) { + if (_imusNewMixer[idx]) { + _scumm->_mixer->play_stream(NULL, idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]); + } else { + _scumm->_mixer->append(idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]); + } + } + } + } + + if (_scumm->_gameId == GID_FT) { + for (idx = 0; idx < MAX_STREAMER; idx++) { + if (_psadTrk[idx] != 0) { + if (_strkNewMixer[idx]) { + _scumm->_mixer->play_stream(NULL, idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + } else { + _scumm->_mixer->append(idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + } + } + } + } + + if (_paletteChanged) { + _paletteChanged = false; + setPalette(); + _scumm->setDirtyColors(0, 255); + } + + if (_frameChanged) { + _scumm->_system->copy_rect(_scumm->_videoBuffer, 320, 0, 0, 320, 200); + _scumm->_system->update_screen(); + } + + _scumm->processKbd(); + + } while (!_scumm->videoFinished); + + deinit(); + + _scumm->_insaneState = 0; + _scumm->exitCutscene(); + _scumm->_sound->pauseBundleMusic(false); +} diff --git a/scumm/object.cpp b/scumm/object.cpp new file mode 100644 index 0000000000..319328c0ee --- /dev/null +++ b/scumm/object.cpp @@ -0,0 +1,1326 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "object.h" +#include "resource.h" + +bool Scumm::getClass(int obj, int cls) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getClass"); + cls &= 0x7F; + checkRange(32, 1, cls, "Class %d out of range in getClass"); + + if (_features & GF_SMALL_HEADER) { + if (cls == 31) // CLASS_PLAYERONLY + cls = 23; + + if (cls == 32) // CLASS_TOUCHABLE + cls = 24; + } + return (_classData[obj] & (1 << (cls - 1))) != 0; +} + +void Scumm::putClass(int obj, int cls, bool set) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putClass"); + cls &= 0x7F; + checkRange(32, 1, cls, "Class %d out of range in putClass"); + + + if (_features & GF_SMALL_HEADER) { + if (cls == 31) // CLASS_PLAYERONLY + cls = 23; + + if (cls == 32) // CLASS_TOUCHABLE + cls = 24; + } + + if (set) + _classData[obj] |= (1 << (cls - 1)); + else + _classData[obj] &= ~(1 << (cls - 1)); + + if (1 <= obj && obj < NUM_ACTORS) { + _actors[obj].classChanged(cls, set); + } +} + +int Scumm::getOwner(int obj) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getOwner"); + return _objectOwnerTable[obj]; +} + +void Scumm::putOwner(int obj, int owner) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putOwner"); + checkRange(0xFF, 0, owner, "Owner %d out of range in putOwner"); + _objectOwnerTable[obj] = owner; +} + +int Scumm::getState(int obj) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getState"); + return _objectStateTable[obj]; +} + +void Scumm::putState(int obj, int state) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putState"); + checkRange(0xFF, 0, state, "State %d out of range in putState"); + _objectStateTable[obj] = state; +} + +int Scumm::getObjectRoom(int obj) +{ + checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getObjectRoom"); + return _objectRoomTable[obj]; +} + +int Scumm::getObjectIndex(int object) +{ + int i; + + /* OF_OWNER_ROOM should be 0xFF for full throttle, else 0xF */ + if (_objectOwnerTable[object] != OF_OWNER_ROOM) { + for (i = 0; i < _maxInventoryItems; i++) + if (_inventory[i] == object) + return i; + return -1; + } else { + for (i = _numObjectsInRoom; i > 0; i--) { + if (_objs[i].obj_nr == object) + return i; + } + return -1; + } +} + +int Scumm::whereIsObject(int object) +{ + int i; + + if (object >= _numGlobalObjects) + return WIO_NOT_FOUND; + + if (_objectOwnerTable[object] != OF_OWNER_ROOM) { + for (i = 0; i < _maxInventoryItems; i++) + if (_inventory[i] == object) + return WIO_INVENTORY; + return WIO_NOT_FOUND; + } + + for (i = _numObjectsInRoom; i > 0; i--) + if (_objs[i].obj_nr == object) { + if (_objs[i].fl_object_index) + return WIO_FLOBJECT; + return WIO_ROOM; + } + return WIO_NOT_FOUND; +} + +int Scumm::getObjectOrActorXY(int object, int &x, int &y) +{ + if (object < NUM_ACTORS) { + Actor *act = derefActorSafe(object, "getObjectOrActorXY"); + if (!act) + return 0; + else + return act->getActorXYPos(x, y); + } + + switch (whereIsObject(object)) { + case WIO_NOT_FOUND: + return -1; + case WIO_INVENTORY: + if (_objectOwnerTable[object] < NUM_ACTORS) + return derefActorSafe(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y); + else + return 0xFF; + } + getObjectXYPos(object, x, y); + return 0; +} + +/* Return the position of an object. + Returns X, Y and direction in angles + */ +void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) +{ + ObjectData *od = &_objs[getObjectIndex(object)]; + int state; + byte *ptr; + ImageHeader *imhd; + + if (!(_features & GF_SMALL_HEADER)) { + if (_features & GF_AFTER_V6) { + state = getState(object) - 1; + if (state < 0) + state = 0; + + if (od->fl_object_index) { + ptr = getResourceAddress(rtFlObject, od->fl_object_index); + ptr = findResource(MKID('OBIM'), ptr); + } else { + ptr = getResourceAddress(rtRoom, _roomResource); + ptr += od->offs_obim_to_room; + } + assert(ptr); + imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); + if (_features & GF_AFTER_V7) { + x = od->x_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].x); + y = od->y_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].y); + } else { + x = od->x_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].x); + y = od->y_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].y); + } + } else { + x = od->walk_x; + y = od->walk_y; + } + dir = oldDirToNewDir(od->actordir & 3); + } else { + x = od->walk_x; + y = od->walk_y; + dir = oldDirToNewDir(od->actordir & 3); + } +} + +int Scumm::getObjActToObjActDist(int a, int b) +{ + int x, y, x2, y2; + Actor *acta = NULL; + Actor *actb = NULL; + + if (a < NUM_ACTORS) + acta = derefActorSafe(a, "getObjActToObjActDist"); + + if (b < NUM_ACTORS) + actb = derefActorSafe(b, "getObjActToObjActDist(2)"); + + if (acta && actb && acta->getRoom() == actb->getRoom() && acta->getRoom() && !acta->isInCurrentRoom()) + return 0; + + if (getObjectOrActorXY(a, x, y) == -1) + return 0xFF; + + if (getObjectOrActorXY(b, x2, y2) == -1) + return 0xFF; + + if (acta) { + AdjustBoxResult r = acta->adjustXYToBeInBox(x2, y2, -1); + x2 = r.x; + y2 = r.y; + } + + y = abs(y - y2); + x = abs(x - x2); + + if (y > x) + x = y; + return x; +} + +int Scumm::findObject(int x, int y) +{ + int i, b; + byte a; + + for (i = 1; i <= _numObjectsInRoom; i++) { + if (!_objs[i].obj_nr || getClass(_objs[i].obj_nr, 32)) + continue; + b = i; + do { + a = _objs[b].parentstate; + b = _objs[b].parent; + if (b == 0) { + if (_objs[i].x_pos <= x && + _objs[i].width + _objs[i].x_pos > x && + _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) + return _objs[i].obj_nr; + break; + } + } while (_objs[b].state == a); + } + return 0; +} + +void Scumm::drawRoomObject(int i, int arg) +{ + ObjectData *od; + byte a; + + od = &_objs[i]; + if (!od->obj_nr || !od->state) + return; + + do { + a = od->parentstate; + if (!od->parent) { + drawObject(i, arg); + break; + } + od = &_objs[od->parent]; + } while (od->state == a); +} + +void Scumm::drawRoomObjects(int arg) +{ + int i; + + if (_features & GF_DRAWOBJ_OTHER_ORDER) { + for (i = 1; i <= _numObjectsInRoom; i++) + drawRoomObject(i, arg); + } else { + for (i = _numObjectsInRoom; i != 0; i--) + drawRoomObject(i, arg); + } +} + +const uint32 IMxx_tags[] = { + MKID('IM00'), + MKID('IM01'), + MKID('IM02'), + MKID('IM03'), + MKID('IM04'), + MKID('IM05'), + MKID('IM06'), + MKID('IM07'), + MKID('IM08'), + MKID('IM09'), + MKID('IM0A'), + MKID('IM0B'), + MKID('IM0C'), + MKID('IM0D'), + MKID('IM0E'), + MKID('IM0F') +}; + +void Scumm::drawObject(int obj, int arg) +{ + ObjectData *od; + int xpos, ypos, height, width; + byte *ptr; + int x, a, numstrip; + int tmp; + + if (_BgNeedsRedraw) + arg = 0; + + _curVirtScreen = &virtscr[0]; + + od = &_objs[obj]; + + xpos = od->x_pos >> 3; + ypos = od->y_pos; + + width = od->width >> 3; + height = od->height &= 0xF8; // Ender + + if (width == 0 || xpos > _screenEndStrip || xpos + width < _screenStartStrip) + return; + + if (od->fl_object_index) { + ptr = getResourceAddress(rtFlObject, od->fl_object_index); + ptr = findResource(MKID('OBIM'), ptr); + } else { + ptr = getResourceAddress(rtRoom, _roomResource); + ptr = ptr + od->offs_obim_to_room; + } + + if (_features & GF_SMALL_HEADER) + ptr += 8; + else + ptr = findResource(IMxx_tags[getState(od->obj_nr)], ptr); + if (!ptr) + return; + + x = 0xFFFF; + + for (a = numstrip = 0; a < width; a++) { + tmp = xpos + a; + if (arg == 1 && _screenStartStrip != tmp) + continue; + if (arg == 2 && _screenEndStrip != tmp) + continue; + if (tmp < _screenStartStrip || tmp > _screenEndStrip) + continue; + gfxUsageBits[tmp] |= 0x80000000; + if (tmp < x) + x = tmp; + numstrip++; + } + + if (numstrip != 0) { + byte flags = Gdi::dbAllowMaskOr; + if (_features & GF_AFTER_V7 && getClass(od->obj_nr, 22)) + flags |= Gdi::dbDrawMaskOnBoth; + gdi.drawBitmap(ptr, _curVirtScreen, x, ypos, height, x - xpos, numstrip, flags); + } +} + +void Scumm::loadRoomObjects() +{ + int i, j; + ObjectData *od; + byte *ptr; + uint16 obim_id; + byte *room, *searchptr; + ImageHeader *imhd; + RoomHeader *roomhdr; + CodeHeader *cdhd; + + CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); + roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); + + if (_features & GF_AFTER_V7) + _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->v7.numObjects)); + else + _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); + + if (_numObjectsInRoom == 0) + return; + + if (_numObjectsInRoom > _numLocalObjects) + error("More than %d objects in room %d", _numLocalObjects, _roomResource); + + od = &_objs[1]; + searchptr = room; + for (i = 0; i < _numObjectsInRoom; i++, od++) { + ptr = findResource(MKID('OBCD'), searchptr); + if (ptr == NULL) + error("Room %d missing object code block(s)", _roomResource); + + od->offs_obcd_to_room = ptr - room; + cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), ptr); + + if (_features & GF_AFTER_V7) + od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id)); + else if (_features & GF_AFTER_V6) + od->obj_nr = READ_LE_UINT16(&(cdhd->v6.obj_id)); + else + od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id)); + +#ifdef DUMP_SCRIPTS + do { + char buf[32]; + sprintf(buf, "roomobj-%d-", _roomResource); + dumpResource(buf, od->obj_nr, ptr); + } while (0); +#endif + searchptr = NULL; + } + + searchptr = room; + for (i = 0; i < _numObjectsInRoom; i++) { + ptr = findResource(MKID('OBIM'), searchptr); + if (ptr == NULL) + error("Room %d missing image blocks(s)", _roomResource); + + imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); + if (_features & GF_AFTER_V7) + obim_id = READ_LE_UINT16(&imhd->v7.obj_id); + else + obim_id = READ_LE_UINT16(&imhd->old.obj_id); + + for (j = 1; j <= _numObjectsInRoom; j++) { + if (_objs[j].obj_nr == obim_id) + _objs[j].offs_obim_to_room = ptr - room; + } + searchptr = NULL; + } + + od = &_objs[1]; + for (i = 1; i <= _numObjectsInRoom; i++, od++) { + setupRoomObject(od, room); + } + +CHECK_HEAP} + +void Scumm::loadRoomObjectsSmall() +{ + int i, j; + ObjectData *od; + byte *ptr; + uint16 obim_id; + byte *room, *searchptr; + RoomHeader *roomhdr; + + CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); + roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); + + _numObjectsInRoom = READ_LE_UINT16(&(roomhdr->old.numObjects)); + + if (_numObjectsInRoom == 0) + return; + + if (_numObjectsInRoom > _numLocalObjects) + error("More than %d objects in room %d", _numLocalObjects, _roomResource); + + od = &_objs[1]; + searchptr = room; + for (i = 0; i < _numObjectsInRoom; i++, od++) { + ptr = findResourceSmall(MKID('OBCD'), searchptr); + if (ptr == NULL) + error("Room %d missing object code block(s)", _roomResource); + + od->offs_obcd_to_room = ptr - room; + od->obj_nr = READ_LE_UINT16(ptr + 6); + +#ifdef DUMP_SCRIPTS + do { + char buf[32]; + sprintf(buf, "roomobj-%d-", _roomResource); + dumpResource(buf, od->obj_nr, ptr); + } while (0); +#endif + searchptr = NULL; + } + + searchptr = room; + for (i = 0; i < _numObjectsInRoom; i++) { + ptr = findResourceSmall(MKID('OBIM'), searchptr); + if (ptr == NULL) + error("Room %d missing image blocks(s)", _roomResource); + + obim_id = READ_LE_UINT16(ptr + 6); + + for (j = 1; j <= _numObjectsInRoom; j++) { + if (_objs[j].obj_nr == obim_id) + _objs[j].offs_obim_to_room = ptr - room; + } + searchptr = NULL; + } + + od = &_objs[1]; + for (i = 1; i <= _numObjectsInRoom; i++, od++) { + setupRoomObject(od, room); + } + +CHECK_HEAP} + +void Scumm::setupRoomObject(ObjectData *od, byte *room) +{ + CodeHeader *cdhd; + ImageHeader *imhd; + + if (_features & GF_SMALL_HEADER) { + + byte *ptr = room + od->offs_obcd_to_room; + + od->obj_nr = READ_LE_UINT16(ptr + 6); // ok + + od->width = *(ptr + 11) << 3; // ok + od->x_pos = *(ptr + 9) << 3; // ok + + if (*(ptr + 10) & 0x80) { + od->parentstate = 1; // it's 0x10 in the original code + } else { + od->parentstate = 0; + } + + od->y_pos = ((*(ptr + 10)) & 0x7F) << 3; + + od->parent = *(ptr + 12); + od->walk_x = READ_LE_UINT16(ptr + 13); + + od->walk_y = READ_LE_UINT16(ptr + 15); + + od->actordir = (*(ptr + 17)) & 7; + od->height = *(ptr + 17); // ok + + + + return; + } + + cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), room + od->offs_obcd_to_room); + if (_features & GF_AFTER_V7) + od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id)); + else if (_features & GF_AFTER_V6) + od->obj_nr = READ_LE_UINT16(&(cdhd->v6.obj_id)); + else + od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id)); + + if (!(_features & GF_AFTER_V7)) { + if (_features & GF_AFTER_V6) { + od->width = READ_LE_UINT16(&cdhd->v6.w); + od->height = READ_LE_UINT16(&cdhd->v6.h); + od->x_pos = ((int16)READ_LE_UINT16(&cdhd->v6.x)); + od->y_pos = ((int16)READ_LE_UINT16(&cdhd->v6.y)); + if (cdhd->v6.flags == 0x80) { + od->parentstate = 1; + } else { + od->parentstate = (cdhd->v6.flags & 0xF); + } + od->parent = cdhd->v6.parent; + od->actordir = cdhd->v6.actordir; + } else { + od->width = cdhd->v5.w << 3; + od->height = cdhd->v5.h << 3; + od->x_pos = cdhd->v5.x << 3; + od->y_pos = cdhd->v5.y << 3; + if (cdhd->v5.flags == 0x80) { + od->parentstate = 1; + } else { + od->parentstate = (cdhd->v5.flags & 0xF); + } + od->parent = cdhd->v5.parent; + od->walk_x = READ_LE_UINT16(&cdhd->v5.walk_x); + od->walk_y = READ_LE_UINT16(&cdhd->v5.walk_y); + od->actordir = cdhd->v5.actordir; + } + } else { + od->parent = cdhd->v7.parent; + od->parentstate = cdhd->v7.parentstate; + + imhd = (ImageHeader *)findResourceData(MKID('IMHD'), room + od->offs_obim_to_room); + od->x_pos = READ_LE_UINT16(&imhd->v7.x_pos); + od->y_pos = READ_LE_UINT16(&imhd->v7.y_pos); + od->width = READ_LE_UINT16(&imhd->v7.width); + od->height = READ_LE_UINT16(&imhd->v7.height); + od->actordir = READ_LE_UINT16(&imhd->v7.actordir); + + } + od->fl_object_index = 0; +} + +void Scumm::fixObjectFlags() +{ + int i; + ObjectData *od = &_objs[1]; + for (i = 1; i <= _numObjectsInRoom; i++, od++) { + od->state = _objectStateTable[od->obj_nr]; + } +} + +void Scumm::processDrawQue() +{ + int i, j; + for (i = 0; i < _drawObjectQueNr; i++) { + j = _drawObjectQue[i]; + if (j) + drawObject(j, 0); + } + _drawObjectQueNr = 0; +} + +void Scumm::clearOwnerOf(int obj) +{ + int i, j; + uint16 *a; + + stopObjectScript(obj); + + if (getOwner(obj) == OF_OWNER_ROOM) { + i = 0; + do { + if (_objs[i].obj_nr == obj) { + if (!_objs[i].fl_object_index) + return; + nukeResource(rtFlObject, _objs[i].fl_object_index); + _objs[i].obj_nr = 0; + _objs[i].fl_object_index = 0; + } + } while (++i <= _numObjectsInRoom); + return; + } + + for (i = 1; i < _maxInventoryItems; i++) { + if (_inventory[i] == obj) { + j = whereIsObject(obj); + if (j == WIO_INVENTORY) { + nukeResource(rtInventory, i); + _inventory[i] = 0; + } + a = &_inventory[1]; + for (i = 1; i < _maxInventoryItems - 1; i++, a++) { + if (!a[0] && a[1]) { + a[0] = a[1]; + a[1] = 0; + _baseInventoryItems[i] = _baseInventoryItems[i + 1]; + _baseInventoryItems[i + 1] = NULL; + } + } + return; + } + } +} + +void Scumm::removeObjectFromRoom(int obj) +{ + int i, cnt; + uint32 *ptr; + + for (i = 1; i <= _numObjectsInRoom; i++) { + if (_objs[i].obj_nr == (uint16)obj) { + if (_objs[i].width != 0) { + ptr = &gfxUsageBits[_objs[i].x_pos >> 3]; + cnt = _objs[i].width >> 3; + do { + *ptr++ |= 0x80000000; + } while (--cnt); + } + _BgNeedsRedraw = true; + return; + } + } +} + +void Scumm::addObjectToDrawQue(int object) +{ + _drawObjectQue[_drawObjectQueNr++] = object; + if ((unsigned int)_drawObjectQueNr > sizeof(_drawObjectQue) / sizeof(_drawObjectQue[0])) + error("Draw Object Que overflow"); +} + +void Scumm::clearDrawObjectQueue() +{ + _drawObjectQueNr = 0; +} + +byte *Scumm::getObjOrActorName(int obj) +{ + byte *objptr; + int i; + + if (obj < NUM_ACTORS) + return derefActorSafe(obj, "getObjOrActorName")->getActorName(); + + if (_features & GF_SMALL_HEADER) { + byte offset = 0; + + objptr = getOBCDFromObject(obj); + if (objptr) + offset = READ_LE_UINT16(objptr + 18); + return (objptr + offset); + } + + if (_features & GF_AFTER_V6) { + for (i = 1; i < 50; i++) { + if (_newNames[i] == obj) { + debug(5, "Found new name for object %d at _newNames[i]", obj, i); + return getResourceAddress(rtObjectName, i); + break; + } + } + } + + objptr = getOBCDFromObject(obj); + if (objptr == NULL) + return (byte *)" "; + + return findResourceData(MKID('OBNA'), objptr); +} + +uint32 Scumm::getOBCDOffs(int object) +{ + int i; + + if (_objectOwnerTable[object] != OF_OWNER_ROOM) + return 0; + for (i = _numObjectsInRoom; i > 0; i--) { + if (_objs[i].obj_nr == object) { + if (_objs[i].fl_object_index != 0) + return 8; + return _objs[i].offs_obcd_to_room; + } + } + return 0; +} + +byte *Scumm::getOBCDFromObject(int obj) +{ + int i; + + if (_objectOwnerTable[obj] != OF_OWNER_ROOM) { + for (i = 0; i < _maxInventoryItems; i++) { + if (_inventory[i] == obj) + return getResourceAddress(rtInventory, i); + } + } else { + for (i = _numObjectsInRoom; i > 0; --i) { + if (_objs[i].obj_nr == obj) { + if (_objs[i].fl_object_index) + return getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; + return getResourceAddress(rtRoom, _roomResource) + _objs[i].offs_obcd_to_room; + } + } + } + return 0; +} + +void Scumm::addObjectToInventory(uint obj, uint room) +{ + int i, slot; + uint32 size; + byte *obcdptr, *ptr; + FindObjectInRoom foir; + + debug(1, "Adding object %d from room %d into inventory", obj, room); + + CHECK_HEAP if (whereIsObject(obj) == WIO_FLOBJECT) { + i = getObjectIndex(obj); + ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; + size = READ_BE_UINT32_UNALIGNED(ptr + 4); + slot = getInventorySlot(); + _inventory[slot] = obj; + createResource(rtInventory, slot, size); + ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index) + 8; + memcpy(getResourceAddress(rtInventory, slot), ptr, size); + } else { + findObjectInRoom(&foir, foCodeHeader, obj, room); + if (_features & GF_SMALL_HEADER) + size = READ_LE_UINT32(foir.obcd); + else + size = READ_BE_UINT32_UNALIGNED(foir.obcd + 4); + slot = getInventorySlot(); + _inventory[slot] = obj; + createResource(rtInventory, slot, size); + obcdptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obcd; + memcpy(getResourceAddress(rtInventory, slot), obcdptr, size); + } + +CHECK_HEAP} + +void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) +{ + CodeHeader *cdhd; + int i, numobj; + byte *roomptr, *obcdptr, *obimptr, *searchptr; + RoomHeader *roomhdr; + ImageHeader *imhd; + int id2; + int id3; + + if (findWhat & foCheckAlreadyLoaded && getObjectIndex(id) != -1) { + fo->obcd = obcdptr = getOBCDFromObject(id); + assert((byte *)obcdptr > (byte *)256); + fo->obim = obimptr = obcdptr + RES_SIZE(obcdptr); + fo->cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); + fo->imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr); + return; + } + + fo->roomptr = roomptr = getResourceAddress(rtRoom, room); + if (!roomptr) + error("findObjectInRoom: failed getting roomptr to %d", room); + + roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr); + + if (_features & GF_AFTER_V7) + numobj = READ_LE_UINT16(&(roomhdr->v7.numObjects)); + else + numobj = READ_LE_UINT16(&(roomhdr->old.numObjects)); + + if (numobj == 0) + error("findObjectInRoom: No object found in room %d", room); + if (numobj > _numLocalObjects) + error("findObjectInRoom: More (%d) than %d objects in room %d", numobj, _numLocalObjects, room); + + if (findWhat & foCodeHeader) { + searchptr = roomptr; + for (i = 0;;) { + if (_features & GF_SMALL_HEADER) + obcdptr = findResourceSmall(MKID('OBCD'), searchptr); + else + obcdptr = findResource(MKID('OBCD'), searchptr); + if (obcdptr == NULL) + error("findObjectInRoom: Not enough code blocks in room %d", room); + if (_features & GF_SMALL_HEADER) { + if (READ_LE_UINT16(obcdptr + 6) == (uint16)id) { + fo->cdhd = NULL; + fo->obcd = obcdptr; + break; + } + } else { + cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); + if (_features & GF_AFTER_V7) + id2 = READ_LE_UINT16(&(cdhd->v7.obj_id)); + else if (_features & GF_AFTER_V6) + id2 = READ_LE_UINT16(&(cdhd->v6.obj_id)); + else + id2 = READ_LE_UINT16(&(cdhd->v5.obj_id)); + + if (id2 == (uint16)id) { + fo->cdhd = cdhd; + fo->obcd = obcdptr; + break; + } + } + if (++i == numobj) + error("findObjectInRoom: Object %d not found in room %d", id, room); + searchptr = NULL; + } + } + + if (findWhat & foImageHeader) { + searchptr = roomptr; + for (i = 0;;) { + if (_features & GF_SMALL_HEADER) + obimptr = findResourceSmall(MKID('OBIM'), searchptr); + else + obimptr = findResource(MKID('OBIM'), searchptr); + if (obimptr == NULL) + error("findObjectInRoom: Not enough image blocks in room %d", room); + imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obimptr); + if (_features & GF_SMALL_HEADER) { + if (READ_LE_UINT16(obimptr + 6) == (uint16)id) { + fo->obim = obimptr; + fo->imhd = imhd; + break; + } + } else { + if (_features & GF_AFTER_V7) + id3 = READ_LE_UINT16(&imhd->v7.obj_id); + else + id3 = READ_LE_UINT16(&imhd->old.obj_id); + if (id3 == (uint16)id) { + fo->obim = obimptr; + fo->imhd = imhd; + break; + } + } + if (++i == numobj) + error("findObjectInRoom: Object %d image not found in room %d", id, room); + searchptr = NULL; + } + } +} + +int Scumm::getInventorySlot() +{ + int i; + for (i = 1; i <= _maxInventoryItems; i++) { + if (_inventory[i] == 0) + return i; + } + error("Inventory full, %d max items", _maxInventoryItems); + return -1; +} + +void Scumm::SamInventoryHack(int obj) +{ // FIXME: Sam and Max hack + int base = 6; + + while (base < 80) { + int value = readArray(178, 0, base); + if (value == obj) + return; + if (value == 0) { + _vars[179]++; + writeArray(178, 0, base, obj); + return; + } + base++; + } +} + +void Scumm::setOwnerOf(int obj, int owner) +{ + ScriptSlot *ss; + if (owner == 0) { + clearOwnerOf(obj); + ss = &vm.slot[_currentScript]; + if (ss->where == WIO_INVENTORY && _inventory[ss->number] == obj) { + putOwner(obj, 0); + runHook(0); + stopObjectCode(); + return; + } + } + if ((owner == 2) && (_gameId == GID_SAMNMAX)) + SamInventoryHack(obj); + + putOwner(obj, owner); + runHook(0); +} + +int Scumm::getObjX(int obj) +{ + if (obj < NUM_ACTORS) { + if (obj < 1) + return 0; /* fix for indy4's map */ + return derefActorSafe(obj, "getObjX")->x; + } else { + if (whereIsObject(obj) == WIO_NOT_FOUND) + return -1; + int x, y; + getObjectOrActorXY(obj, x, y); + return x; + } +} + +int Scumm::getObjY(int obj) +{ + if (obj < NUM_ACTORS) { + if (obj < 1) + return 0; /* fix for indy4's map */ + return derefActorSafe(obj, "getObjY")->y; + } else { + if (whereIsObject(obj) == WIO_NOT_FOUND) + return -1; + int x, y; + getObjectOrActorXY(obj, x, y); + return y; + } +} + +int Scumm::getObjOldDir(int obj) +{ + if (obj < NUM_ACTORS) { + return newDirToOldDir(derefActorSafe(obj, "getObjOldDir")->facing); + } else { + int x, y, dir; + getObjectXYPos(obj, x, y, dir); + return dir; + } +} + +int Scumm::getObjNewDir(int obj) +{ + if (obj < NUM_ACTORS) { + return derefActorSafe(obj, "getObjNewDir")->facing; + } else { + int x, y, dir; + getObjectXYPos(obj, x, y, dir); + return oldDirToNewDir(dir); + } +} + +int Scumm::findInventory(int owner, int idx) +{ + int count = 1, i, obj; + for (i = 0; i != _maxInventoryItems; i++) { + obj = _inventory[i]; + if (obj && getOwner(obj) == owner && count++ == idx) + return obj; + } + return 0; +} + +int Scumm::getInventoryCount(int owner) +{ + int i, obj; + int count = 0; + for (i = 0; i != _maxInventoryItems; i++) { + obj = _inventory[i]; + if (obj && getOwner(obj) == owner) + count++; + } + return count; +} + +void Scumm::setObjectState(int obj, int state, int x, int y) +{ + int i; + + i = getObjectIndex(obj); + if (i == -1) { + warning("setObjectState: no such object"); + return; + } + + if (x != -1) { + _objs[i].x_pos = x << 3; + _objs[i].y_pos = y << 3; + } + + addObjectToDrawQue(i); + putState(obj, state); +} + +static int getDist(int x, int y, int x2, int y2) +{ + int a = abs(y - y2); + int b = abs(x - x2); + if (a > b) + return a; + return b; +} + +int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f) +{ + int i, j; + int x, y; + int x2, y2; + + j = i = 0xFF; + + if (is_obj_1) { + if (getObjectOrActorXY(b, x, y) == -1) + return -1; + if (b < NUM_ACTORS) + i = derefActorSafe(b, "unkObjProc1")->scalex; + } else { + x = b; + y = c; + } + + if (is_obj_2) { + if (getObjectOrActorXY(e, x2, y2) == -1) + return -1; + if (e < NUM_ACTORS) + j = derefActorSafe(e, "unkObjProc1(2)")->scalex; + } else { + x2 = e; + y2 = f; + } + + return getDist(x, y, x2, y2) * 0xFF / ((i + j) >> 1); +} + +void Scumm::setCursorImg(uint img, uint room, uint imgindex) +{ + int w, h; + byte *dataptr, *bomp; + uint32 size; + FindObjectInRoom foir; + + if (room == (uint) - 1) + room = getObjectRoom(img); + + findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room); + + if (_features & GF_AFTER_V7) + setCursorHotspot2(READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x), + READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y)); + else + setCursorHotspot2(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x), + READ_LE_UINT16(&foir.imhd->old.hotspot[0].y)); + + + if (!(_features & GF_AFTER_V7)) { + w = READ_LE_UINT16(&foir.cdhd->v6.w) >> 3; + h = READ_LE_UINT16(&foir.cdhd->v6.h) >> 3; + } else { + w = READ_LE_UINT16(&foir.imhd->v7.width) >> 3; + h = READ_LE_UINT16(&foir.imhd->v7.height) >> 3; + } + + dataptr = findResource(IMxx_tags[imgindex], foir.obim); + if (dataptr == NULL) + error("setCursorImg: No such image"); + + size = READ_BE_UINT32_UNALIGNED(dataptr + 4); + if (size > sizeof(_grabbedCursor)) + error("setCursorImg: Cursor image too large"); + + if ((bomp = findResource(MKID('BOMP'), dataptr)) != NULL) + useBompCursor(bomp, w, h); + else + useIm01Cursor(dataptr, w, h); + +} + +void Scumm::nukeFlObjects(int min, int max) +{ + ObjectData *od; + int i; + + warning("nukeFlObjects(%d,%d)", min, max); + + for (i = _numObjectsInRoom, od = _objs; --i >= 0; od++) + if (od->fl_object_index && od->obj_nr >= min && od->obj_nr <= max) { + nukeResource(rtFlObject, od->fl_object_index); + od->obj_nr = 0; + od->fl_object_index = 0; + } +} + +void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, + int objectHeight, int f, int g, int image, int mode) +{ + BlastObject *eo; + ObjectData *od; + + if (_enqueuePos == sizeof(_enqueuedObjects) / sizeof(_enqueuedObjects[0])) + error("enqueueObject: overflow"); + + eo = &_enqueuedObjects[_enqueuePos++]; + eo->number = objectNumber; + eo->areaX = _enqueue_b; + eo->areaY = _enqueue_c; + eo->areaWidth = _enqueue_d; + eo->areaHeight = _enqueue_e; + eo->posX = objectX + (camera._cur.x & 7); + eo->posY = objectY + (camera._cur.y - 100); + if (objectWidth == 0) { + od = &_objs[getObjectIndex(objectNumber)]; + eo->width = od->width; + } else { + eo->width = objectWidth; + } + if (objectHeight == 0) { + od = &_objs[getObjectIndex(objectNumber)]; + eo->height = od->height; + } else { + eo->height = objectHeight; + } + + eo->unk3 = f; + eo->unk4 = g; + eo->image = image; + + eo->mode = mode; +} + +void Scumm::drawBlastObjects() +{ + BlastObject *eo; + int i; + + eo = _enqueuedObjects; + for (i = 0; i < _enqueuePos; i++, eo++) { + drawBlastObject(eo); + } +} + + +void Scumm::drawBlastObject(BlastObject *eo) +{ + VirtScreen *vs; + byte *bomp, *ptr, *img; + int idx; + BompDrawData bdd; + + vs = &virtscr[0]; + + _lastXstart = vs->xstart; + + checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d"); + + idx = _objs[getObjectIndex(eo->number)].fl_object_index; + + if (idx) { + ptr = getResourceAddress(rtFlObject, idx); + ptr = findResource(MKID('OBIM'), ptr); + } else { + idx = getObjectIndex(eo->number); + assert(idx != -1); + ptr = getResourceAddress(1, _roomResource) + _objs[idx].offs_obim_to_room; + } + if (!ptr) + error("BlastObject object %d image not found", eo->number); + + img = findResource(IMxx_tags[eo->image], ptr); + if (!img) + img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects + if (!img) + error("blast-object %d invalid image %d (1-x)", eo->number, eo->image); + + bomp = findResourceData(MKID('BOMP'), img); + if (!bomp) + error("object %d is not a blast object", eo->number); + + bdd.srcwidth = READ_LE_UINT16(&((BompHeader *)bomp)->width); + bdd.srcheight = READ_LE_UINT16(&((BompHeader *)bomp)->height); + + bdd.out = vs->screenPtr + vs->xstart; + bdd.outwidth = vs->width; + bdd.outheight = vs->height; + bdd.dataptr = bomp + 10; + bdd.x = eo->posX; + bdd.y = eo->posY; + bdd.scale_x = (unsigned char)eo->unk3; + bdd.scale_y = (unsigned char)eo->unk4; + + drawBomp(&bdd, 0, bdd.dataptr, 1, 0); + updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0); +} + +void Scumm::removeBlastObjects() +{ + BlastObject *eo; + int i; + + eo = _enqueuedObjects; + for (i = 0; i < _enqueuePos; i++, eo++) { + removeBlastObject(eo); + } + + clearEnqueue(); +} + +void Scumm::removeBlastObject(BlastObject *eo) +{ + restoreBG(eo->posX, eo->posY, eo->posX + eo->width, eo->posY + eo->height); +} + +int Scumm::findFlObjectSlot() +{ + int i; + for (i = 1; i < _maxFLObject; i++) { + if (_baseFLObject[i] == NULL) + return i; + } + error("findFlObjectSlot: Out of FLObject slots"); + return -1; +} + +void Scumm::loadFlObject(uint object, uint room) +{ + FindObjectInRoom foir; + int slot; + ObjectData *od; + byte *flob, *roomptr; + uint32 obcd_size, obim_size, flob_size; + + /* Don't load an already loaded object */ + if (whereIsObject(object) != WIO_NOT_FOUND) + return; + + /* Locate the object in the room resource */ + findObjectInRoom(&foir, foImageHeader | foCodeHeader, object, room); + + /* Add an entry for the new floating object in the local object table */ + if (++_numObjectsInRoom > _numLocalObjects) + error("loadFlObject: Local Object Table overflow"); + od = &_objs[_numObjectsInRoom]; + + /* Setup sizes */ + obcd_size = READ_BE_UINT32_UNALIGNED(foir.obcd + 4); + od->offs_obcd_to_room = 8; + od->offs_obim_to_room = obcd_size + 8; + obim_size = READ_BE_UINT32_UNALIGNED(foir.obim + 4); + flob_size = obcd_size + obim_size + 8; + + /* Allocate slot & memory for floating object */ + slot = findFlObjectSlot(); + createResource(rtFlObject, slot, flob_size); + + /* Copy object code + object image to floating object */ + roomptr = getResourceAddress(rtRoom, room); + flob = getResourceAddress(rtFlObject, slot); + ((uint32 *)flob)[0] = MKID('FLOB'); + ((uint32 *)flob)[1] = TO_BE_32(flob_size); + memcpy(flob + 8, roomptr - foir.roomptr + foir.obcd, obcd_size); + memcpy(flob + 8 + obcd_size, roomptr - foir.roomptr + foir.obim, obim_size); + + /* Setup local object flags */ + setupRoomObject(od, flob); + + od->fl_object_index = slot; +} diff --git a/scumm/object.h b/scumm/object.h new file mode 100644 index 0000000000..39787ca0a3 --- /dev/null +++ b/scumm/object.h @@ -0,0 +1,122 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef OBJECT_H +#define OBJECT_H + +#if !defined(__GNUC__) + #pragma START_PACK_STRUCTS +#endif + +struct RoomHeader { + union { + struct { + uint32 version; + uint16 width, height; + uint16 numObjects; + } GCC_PACK v7; + struct { + uint16 width, height; + uint16 numObjects; + } GCC_PACK old; + } GCC_PACK; +} GCC_PACK; + +struct CodeHeader { + union { + struct { + uint16 obj_id; + byte x, y, w, h; + byte flags; + byte parent; + int16 walk_x; + int16 walk_y; + byte actordir; + } GCC_PACK v5; + + struct { + uint16 obj_id; + int16 x, y; + uint16 w, h; + byte flags, parent; + uint16 unk1; + uint16 unk2; + byte actordir; + } GCC_PACK v6; + + struct { + uint32 version; + uint16 obj_id; + byte parent; + byte parentstate; + } GCC_PACK v7; + + } GCC_PACK; +} GCC_PACK; + +struct ImageHeader { /* file format */ + union { + struct { + uint16 obj_id; + uint16 unk[5]; + uint16 width; + uint16 height; + uint16 unk_2; + struct { + int16 x, y; + } GCC_PACK hotspot[15]; + } GCC_PACK old; + + struct { + uint32 version; + uint16 obj_id; + uint16 unk[1]; + int16 x_pos, y_pos; + uint16 width, height; + byte unk2[3]; + byte actordir; + uint16 unk_2; + struct { + int16 x, y; + } GCC_PACK hotspot[15]; + } GCC_PACK v7; + } GCC_PACK; +} GCC_PACK; + +#if !defined(__GNUC__) + #pragma END_PACK_STRUCTS +#endif + +struct FindObjectInRoom { + CodeHeader *cdhd; + byte *obcd; + ImageHeader *imhd; + byte *obim; + byte *roomptr; +}; + +enum FindObjectWhat { + foCodeHeader = 1, + foImageHeader = 2, + foCheckAlreadyLoaded = 4 +}; + + +#endif diff --git a/scumm/resource.cpp b/scumm/resource.cpp new file mode 100644 index 0000000000..89e825481f --- /dev/null +++ b/scumm/resource.cpp @@ -0,0 +1,1428 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "resource.h" + +#include + + +uint16 newTag2Old(uint32 oldTag); + + +/* Open a room */ +void Scumm::openRoom(int room) +{ + int room_offs, roomlimit; + char buf[256]; + + debug(9, "openRoom(%d)", room); + + /* Don't load the same room again */ + if (_lastLoadedRoom == room) + return; + _lastLoadedRoom = room; + + /* Room -1 means close file */ + if (room == -1) { + _encbyte = 0; + deleteRoomOffsets(); + fileClose(_fileHandle); + _fileHandle = NULL; + return; + } + + /* Either xxx.lfl or monkey.xxx file name */ + while (!_resFilePrefix) { + if (_features & GF_SMALL_NAMES) + roomlimit = 98; + else + roomlimit = 900; + if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) + room_offs = 0; + else + room_offs = room ? _roomFileOffsets[room] : 0; + + if (room_offs == (int)0xFFFFFFFF) + break; + + if (room_offs != 0 && room != 0) { + _fileOffset = _roomFileOffsets[room]; + return; + } + if (!(_features & GF_SMALL_HEADER)) { + + if (_features & GF_AFTER_V7) + sprintf(buf, "%s%s.la%d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); + else if (_features & GF_HUMONGOUS) + sprintf(buf, "%s%s.he%.1d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); + else + sprintf(buf, "%s%s.%.3d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]); + + _encbyte = (_features & GF_USE_KEY) ? 0x69 : 0; + } else if (!(_features & GF_SMALL_NAMES)) { + if (room == 0 || room >= 900) { + sprintf(buf, "%s%.3d.lfl", _gameDataPath, room); + _encbyte = 0; + if (openResourceFile(buf)) { + return; + } + askForDisk(buf); + + } else { + sprintf(buf, "%sdisk%.2d.lec", _gameDataPath, res.roomno[rtRoom][room]); + _encbyte = 0x69; + } + } else { + sprintf(buf, "%s%.2d.lfl", _gameDataPath, room); + if (_features & GF_OLD_BUNDLE) + _encbyte = 0xFF; + else + _encbyte = 0; + } + + if (openResourceFile(buf)) { + if (room == 0) + return; + if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) + return; + readRoomsOffsets(); + _fileOffset = _roomFileOffsets[room]; + + if (_fileOffset != 8) + return; + + error("Room %d not in %s", room, buf); + return; + } + askForDisk(buf); + } + + do { + sprintf(buf, "%.3d.lfl", room); + _encbyte = 0; + if (openResourceFile(buf)) + break; + askForDisk(buf); + } while (1); + + deleteRoomOffsets(); + _fileOffset = 0; /* start of file */ +} + +/* Delete the currently loaded room offsets */ +void Scumm::deleteRoomOffsets() +{ + if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets) + return; + + for (int i = 0; i < _maxRooms; i++) { + if (_roomFileOffsets[i] != 0xFFFFFFFF) + _roomFileOffsets[i] = 0; + } +} + +/* Read room offsets */ +void Scumm::readRoomsOffsets() +{ + int num, room; + + debug(9, "readRoomOffsets()"); + + deleteRoomOffsets(); + if (_features & GF_SMALL_NAMES) + return; + + if (!(_features & GF_SMALL_HEADER)) { + if (!_dynamicRoomOffsets) + return; + + fileSeek(_fileHandle, 16, SEEK_SET); + } else { + fileSeek(_fileHandle, 12, SEEK_SET); // Directlry searching for the room offset block would be more generic... + } + + num = fileReadByte(); + while (num) { + num--; + + room = fileReadByte(); + if (_roomFileOffsets[room] != 0xFFFFFFFF) { + _roomFileOffsets[room] = fileReadDwordLE(); + } else { + fileReadDwordLE(); + } + } +} + +bool Scumm::openResourceFile(const char *filename) +{ + char buf[256]; + + debug(9, "openResourceFile(%s)", filename); + + if (_fileHandle != NULL) { + fileClose(_fileHandle); + _fileHandle = NULL; + } + + strcpy(buf, filename); + _fileHandle = fileOpen(buf, 1); + if (!_fileHandle) { + char *e = strrchr(buf, '/'); + if (!e) + e = buf; + do + *e = tolower(*e); + while (*e++); + _fileHandle = fileOpen(buf, 1); + } + + if (!_fileHandle) { + char *e = strrchr(buf, '/'); + if (!e) + e = buf; + do + *e = toupper(*e); + while (*e++); + _fileHandle = fileOpen(buf, 1); + } + + return _fileHandle != NULL; +} + +void Scumm::askForDisk(const char *filename) +{ + error("ask Cannot find '%s'", filename); +} + +void Scumm::readIndexFile() +{ + uint32 blocktype, itemsize; + int numblock = 0; + int num, i; + + debug(9, "readIndexFile()"); + + openRoom(-1); + openRoom(0); + + if (!(_features & GF_AFTER_V6)) { + /* Figure out the sizes of various resources */ + while (!fileEof(_fileHandle)) { + blocktype = fileReadDword(); + itemsize = fileReadDwordBE(); + if (fileReadFailed(_fileHandle)) + break; + switch (blocktype) { + case MKID('DOBJ'): + _numGlobalObjects = fileReadWordLE(); + itemsize -= 2; + break; + case MKID('DROO'): + _numRooms = fileReadWordLE(); + itemsize -= 2; + break; + + case MKID('DSCR'): + _numScripts = fileReadWordLE(); + itemsize -= 2; + break; + + case MKID('DCOS'): + _numCostumes = fileReadWordLE(); + itemsize -= 2; + break; + + case MKID('DSOU'): + _numSounds = fileReadWordLE(); + itemsize -= 2; + break; + } + fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); + } + clearFileReadFailed(_fileHandle); + fileSeek(_fileHandle, 0, SEEK_SET); + } + + while (1) { + blocktype = fileReadDword(); + + if (fileReadFailed(_fileHandle)) + break; + itemsize = fileReadDwordBE(); + + numblock++; + + switch (blocktype) { + case MKID('DCHR'): + readResTypeList(rtCharset, MKID('CHAR'), "charset"); + break; + + case MKID('DOBJ'): + if (_features & GF_AFTER_V8) + num = fileReadDwordLE(); + else + num = fileReadWordLE(); + assert(num == _numGlobalObjects); + + if (_features & GF_AFTER_V8) { /* FIXME: Not sure.. */ + for (i = 0; i < num; i++) { + fileSeek(_fileHandle, 40, SEEK_CUR); + _objectStateTable[i] = fileReadByte(); + _objectRoomTable[i] = fileReadByte(); + _classData[i] = fileReadDwordLE(); + } + memset(_objectOwnerTable, 0xFF, num); + } else if (_features & GF_AFTER_V7) { + fileRead(_fileHandle, _objectStateTable, num); + fileRead(_fileHandle, _objectRoomTable, num); + memset(_objectOwnerTable, 0xFF, num); + } else { + fileRead(_fileHandle, _objectOwnerTable, num); + for (i = 0; i < num; i++) { + _objectStateTable[i] = _objectOwnerTable[i] >> OF_STATE_SHL; + _objectOwnerTable[i] &= OF_OWNER_MASK; + } + } + + if (!(_features & GF_AFTER_V8)) { + fileRead(_fileHandle, _classData, num * sizeof(uint32)); + + // Swap flag endian where applicable +#if defined(SCUMM_BIG_ENDIAN) + for (i = 0; i != num; i++) + _classData[i] = FROM_LE_32(_classData[i]); +#endif + } + break; + + case MKID('RNAM'): + case MKID('ANAM'): + fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); + break; + + case MKID('DROO'): + readResTypeList(rtRoom, MKID('ROOM'), "room"); + break; + + case MKID('DRSC'): // FIXME: Verify + readResTypeList(rtRoomScripts, MKID('RMSC'), "room script"); + break; + + case MKID('DSCR'): + readResTypeList(rtScript, MKID('SCRP'), "script"); + break; + + case MKID('DCOS'): + readResTypeList(rtCostume, MKID('COST'), "costume"); + break; + + case MKID('MAXS'): + readMAXS(); + break; + + case MKID('DSOU'): + readResTypeList(rtSound, MKID('SOUN'), "sound"); + break; + + case MKID('AARY'): + readArrayFromIndexFile(); + break; + + default: + error("Bad ID %c%c%c%c found in directory!", blocktype & 0xFF, + blocktype >> 8, blocktype >> 16, blocktype >> 24); + return; + } + } + +// if (numblock!=9) +// error("Not enough blocks read from directory"); + + openRoom(-1); +} + +void Scumm::readArrayFromIndexFile() +{ + int num; + int a, b, c; + + while ((num = fileReadWordLE()) != 0) { + a = fileReadWordLE(); + b = fileReadWordLE(); + c = fileReadWordLE(); + if (c == 1) + defineArray(num, 1, a, b); + else + defineArray(num, 5, a, b); + } +} + +void Scumm::readResTypeList(int id, uint32 tag, const char *name) +{ + int num; + int i; + + debug(9, "readResTypeList(%s,%x,%s)", resTypeFromId(id), FROM_LE_32(tag), name); + + if (_features & GF_AFTER_V8) + num = fileReadDwordLE(); + else + num = fileReadWordLE(); + + if (1 || _features & GF_AFTER_V6) { + if (num != res.num[id]) { + error("Invalid number of %ss (%d) in directory", name, num); + } + } else { + if (num >= 0xFF) { + error("Too many %ss (%d) in directory", name, num); + } + allocResTypeData(id, tag, num, name, 1); + } + + if (_features & GF_SMALL_HEADER) { + for (i = 0; i < num; i++) { + res.roomno[id][i] = fileReadByte(); + res.roomoffs[id][i] = fileReadDword(); + } + } else { + fileRead(_fileHandle, res.roomno[id], num * sizeof(uint8)); + fileRead(_fileHandle, res.roomoffs[id], num * sizeof(uint32)); + } + +#if defined(SCUMM_BIG_ENDIAN) + for (i = 0; i < num; i++) + res.roomoffs[id][i] = FROM_LE_32(res.roomoffs[id][i]); +#endif +} + + +void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, int mode) +{ + debug(9, "allocResTypeData(%s/%s,%x,%d,%d)", resTypeFromId(id), name, FROM_LE_32(tag), num, mode); + assert(id >= 0 && id < (int)(sizeof(res.mode) / sizeof(res.mode[0]))); + + if (num >= 2000) { + error("Too many %ss (%d) in directory", name, num); + } + + res.mode[id] = mode; + res.num[id] = num; + res.tags[id] = tag; + res.name[id] = name; + res.address[id] = (byte **)calloc(num, sizeof(void *)); + res.flags[id] = (byte *)calloc(num, sizeof(byte)); + + if (mode) { + res.roomno[id] = (byte *)calloc(num, sizeof(byte)); + res.roomoffs[id] = (uint32 *)calloc(num, sizeof(uint32)); + } +} + +void Scumm::loadCharset(int no) +{ + int i; + byte *ptr; + + debug(9, "loadCharset(%d)", no); + + /* FIXME - hack around crash in Indy4 (occurs if you try to load after dieing) */ + if (_gameId == GID_INDY4 && no == 0) + no = 1; + + memset(_charsetData, 0, sizeof(_charsetData)); + + assert(no < (int)sizeof(_charsetData) / 16); + checkRange(_maxCharsets - 1, 1, no, "Loading illegal charset %d"); + +// ensureResourceLoaded(6, no); + ptr = getResourceAddress(6, no); + + for (i = 0; i < 15; i++) { + _charsetData[no][i + 1] = ptr[i + 14]; + } +} + +void Scumm::nukeCharset(int i) +{ + checkRange(_maxCharsets - 1, 1, i, "Nuking illegal charset %d"); + nukeResource(rtCharset, i); +} + +void Scumm::ensureResourceLoaded(int type, int i) +{ + void *addr; + + debug(9, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); + + if (type == rtRoom && i > 127) { + i = _resourceMapper[i & 127]; + } + + if (i == 0) + return; + + addr = res.address[type][i]; + if (addr) + return; + + loadResource(type, i); + + if (!(_features & GF_AFTER_V7) && !(_features & GF_SMALL_HEADER)) + if (type == rtRoom && i == _roomResource) + _vars[VAR_ROOM_FLAG] = 1; +} + +int Scumm::loadResource(int type, int idx) +{ + int roomNr, i; + uint32 fileOffs; + uint32 size, tag; + + // debug(1, "loadResource(%s,%d)", resTypeFromId(type),idx); + + if (type == rtCharset && (_features & GF_SMALL_HEADER)) { + loadCharset(idx); + return (1); + } + + roomNr = getResourceRoomNr(type, idx); + + if (idx >= res.num[type]) + error("%s %d undefined %d %d", res.name[type], idx, res.num[type], roomNr); + + if (roomNr == 0) + roomNr = _roomResource; + + if (type == rtRoom) { + fileOffs = 0; + } else { + fileOffs = res.roomoffs[type][idx]; + if (fileOffs == 0xFFFFFFFF) + return 0; + } + + do { + for (i = 0; i < 5; i++) { + openRoom(roomNr); + + fileSeek(_fileHandle, fileOffs + _fileOffset, SEEK_SET); + + if (_features & GF_SMALL_HEADER) { + if (!(_features & GF_SMALL_NAMES)) + fileSeek(_fileHandle, 8, SEEK_CUR); + size = fileReadDwordLE(); + tag = fileReadWordLE(); + fileSeek(_fileHandle, -6, SEEK_CUR); + } else { + if (type == rtSound) { + fileReadDwordLE(); + fileReadDwordLE(); + return readSoundResource(type, idx); + } + + tag = fileReadDword(); + + if (tag != res.tags[type]) { + error("%s %d not in room %d at %d+%d", res.name[type], type, roomNr, _fileOffset, fileOffs); + } + + size = fileReadDwordBE(); + fileSeek(_fileHandle, -8, SEEK_CUR); + } + fileRead(_fileHandle, createResource(type, idx, size), size); + + /* dump the resource */ +#ifdef DUMP_SCRIPTS + if (type == rtScript) { + dumpResource("script-", idx, getResourceAddress(rtScript, idx)); + } +#endif + + if (!fileReadFailed(_fileHandle)) { + return 1; + } + + nukeResource(type, idx); + } + + error("Cannot read resource"); + } while (1); +} + +int Scumm::readSoundResource(int type, int idx) +{ + uint32 pos, total_size, size, tag, basetag; + int pri, best_pri; + uint32 best_size = 0, best_offs = 0; + + debug(9, "readSoundResource(%s,%d)", resTypeFromId(type), idx); + + pos = 0; + + basetag = fileReadDword(); + total_size = fileReadDwordBE(); + + debug(8, " basetag: %c%c%c%c, total_size=%d", + (char)((basetag >> 24) & 0xff), + (char)((basetag >> 16) & 0xff), + (char)((basetag >> 8) & 0xff), (char)(basetag & 0xff), total_size); + + //if (_gameId == GID_SAMNMAX || _features & GF_AFTER_V7) { + if (basetag == MKID('MIDI') || basetag == MKID('iMUS')) { + fileSeek(_fileHandle, -8, SEEK_CUR); + fileRead(_fileHandle, createResource(type, idx, total_size + 8), total_size + 8); + return 1; + } else if (basetag == MKID('SOU ')) { + best_pri = -1; + while (pos < total_size) { + tag = fileReadDword(); + size = fileReadDwordBE() + 8; + pos += size; + + pri = -1; + + switch (tag) { + case MKID('SBL '): + pri = 15; + break; + case MKID('ADL '): + if (_use_adlib) + pri = 10; + break; + case MKID('ROL '): + if (!_use_adlib) + pri = 2; + break; + case MKID('GMD '): + if (!_use_adlib) + pri = 3; + break; + case MKID('MAC '): + if (!_use_adlib) + pri = 1; + break; + case MKID('SPK '): + if (!_use_adlib) + pri = 0; + break; + } + + debug(8, " tag: %c%c%c%c, total_size=%d, pri=%d", + (char)((tag >> 24) & 0xff), + (char)((tag >> 16) & 0xff), (char)((tag >> 8) & 0xff), (char)(tag & 0xff), size, pri); + + + if (pri > best_pri) { + best_pri = pri; + best_size = size; + best_offs = filePos(_fileHandle); + } + + fileSeek(_fileHandle, size - 8, SEEK_CUR); + } + + if (best_pri != -1) { + fileSeek(_fileHandle, best_offs - 8, SEEK_SET); + fileRead(_fileHandle, createResource(type, idx, best_size), best_size); + return 1; + } + } else if (FROM_LE_32(basetag) == 24) { + fileSeek(_fileHandle, -12, SEEK_CUR); + total_size = fileReadDwordBE(); + fileSeek(_fileHandle, -8, SEEK_CUR); + fileRead(_fileHandle, createResource(type, idx, total_size), total_size); + return 1; + } else if (basetag == MKID('Mac0')) { + debug(1, "Found base tag Mac0 in sound %d, size %d", idx, total_size); + debug(1, "It was at position %d", filePos(_fileHandle)); + + /* Offset + 0x14, 0x1C, 0x20, 0x24 - offsets of channel 1/2/3/4 chunk- + Each channel has tag "Chan", followed by its length. At the end + of each chan follows either an empty "Done" chunk (length 0) or an + empty "Loop" chunk. Maybe "Loop" indicates the song should be + played forever?!?. + + There can be various different subchunks it seems. The + following combinations appear in Monkey Island: + 100: ORGA, TROM, BASS, + 101: ORGA, SHAK, BASS, + 103: PIPE, PIPE, PIPE, + 104: VIBE, WHIS, BASS, + 108: ORGA, MARI, BASS, + 110: ORGA, SHAK, VIBE, + 111: MARI, SHAK, BASS, + 115: PLUC, SHAK, WHIS, + One guess is that these are instrument names: Organ, Marimba, Whistle... + Maybe there is a mapping table someplace? Maybe these are even mapped to + Mac1 type "instruments" ? + + What follows are four byte "commands" it seems, like this (hex): + 01 68 4F 49 + 01 68 00 40 + 01 68 4F 49 + ... + 01 68 00 40 + 02 1C 5B 40 + 00 B4 00 40 + ... + 01 68 37 3C + 00 18 37 38 + 04 20 3E 34 + 01 68 4A 3C + + More data: + 00 09 3E 10 + 01 5F 00 40 + 00 9C 36 40 + 00 CC 00 40 + 00 18 42 49 + 00 18 45 3C + 01 29 4A 3C + 00 0F 00 40 + + Maybe I am mistaken when I think it's four byte, some other parts + seem to suggest it's 2 byte oriented, or even variable length... + */ + fileSeek(_fileHandle, -12, SEEK_CUR); + total_size = fileReadDwordBE(); + fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); + return 1; + } else if (basetag == MKID('Mac1')) { + fileSeek(_fileHandle, -12, SEEK_CUR); + total_size = fileReadDwordBE(); + fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); + return 1; + } else if (basetag == MKID('DIGI')) { + // Use in Putt-Putt Demo + debug(1, "Found base tag DIGI in sound %d, size %d", idx, total_size); + debug(1, "It was at position %d", filePos(_fileHandle)); + + fileSeek(_fileHandle, -12, SEEK_CUR); + total_size = fileReadDwordBE(); + fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); + return 1; + } else if (basetag == MKID('Crea')) { + fileSeek(_fileHandle, -12, SEEK_CUR); + total_size = fileReadDwordBE(); + fileRead(_fileHandle, createResource(type, idx, total_size), total_size - 8); + return 1; + } else { + fprintf(stderr, "WARNING: Unrecognized base tag 0x%08lx in sound %d\n", basetag, idx); + } + res.roomoffs[type][idx] = 0xFFFFFFFF; + return 0; +} + +int Scumm::getResourceRoomNr(int type, int idx) +{ + if (type == rtRoom) + return idx; + return res.roomno[type][idx]; +} + +byte *Scumm::getResourceAddress(int type, int idx) +{ + byte *ptr; + + + CHECK_HEAP validateResource("getResourceAddress", type, idx); + if (!res.address[type]) { + debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); + return NULL; + } + + if (res.mode[type] && !res.address[type][idx]) { + ensureResourceLoaded(type, idx); + } + + + if (!(ptr = (byte *)res.address[type][idx])) { + debug(9, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); + return NULL; + } + + setResourceCounter(type, idx, 1); + + debug(9, "getResourceAddress(%s,%d) == %ld", resTypeFromId(type), idx, ptr + sizeof(MemBlkHeader)); + return ptr + sizeof(MemBlkHeader); +} + +byte *Scumm::getStringAddress(int i) +{ + byte *b = getResourceAddress(rtString, i); + if (!b) + return b; + + if (_features & GF_NEW_OPCODES) + return ((ArrayHeader *)b)->data; + return b; +} + + + +byte *Scumm::getStringAddressVar(int i) +{ + byte *addr; + + addr = getResourceAddress(rtString, _vars[i]); + if (addr == NULL) + error("NULL string var %d slot %d", i, _vars[i]); + + if (_features & GF_NEW_OPCODES) + return ((ArrayHeader *)addr)->data; + + return (addr); +} + +void Scumm::setResourceCounter(int type, int idx, byte flag) +{ + res.flags[type][idx] &= ~RF_USAGE; + res.flags[type][idx] |= flag; +} + +/* 2 bytes safety area to make "precaching" of bytes in the gdi drawer easier */ +#define SAFETY_AREA 2 + +byte *Scumm::createResource(int type, int idx, uint32 size) +{ + byte *ptr; + + CHECK_HEAP debug(9, "createResource(%s,%d,%d)", resTypeFromId(type), idx, size); + + validateResource("allocating", type, idx); + nukeResource(type, idx); + + expireResources(size); + + CHECK_HEAP ptr = (byte *)calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); + if (ptr == NULL) { + error("Out of memory while allocating %d", size); + } + + _allocatedSize += size; + + res.address[type][idx] = ptr; + ((MemBlkHeader *)ptr)->size = size; + setResourceCounter(type, idx, 1); + return ptr + sizeof(MemBlkHeader); /* skip header */ +} + +void Scumm::validateResource(const char *str, int type, int idx) +{ + if (type < rtFirst || type > rtLast || (uint) idx >= (uint) res.num[type]) { + warning("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); + } +} + +void Scumm::nukeResource(int type, int idx) +{ + byte *ptr; + + + CHECK_HEAP if (!res.address[type]) + return; + + assert(idx >= 0 && idx < res.num[type]); + + if ((ptr = res.address[type][idx]) != NULL) { + debug(9, "nukeResource(%s,%d)", resTypeFromId(type), idx); + res.address[type][idx] = 0; + res.flags[type][idx] = 0; + _allocatedSize -= ((MemBlkHeader *)ptr)->size; + free(ptr); + } +} + +byte *Scumm::findResourceData(uint32 tag, byte *ptr) +{ + if (_features & GF_SMALL_HEADER) { + ptr = findResourceSmall(tag, ptr, 0); + if (ptr == NULL) + return NULL; + return ptr + 6; + } + + ptr = findResource(tag, ptr, 0); + if (ptr == NULL) + return NULL; + return ptr + 8; +} + +int Scumm::getResourceDataSize(byte *ptr) +{ + if (ptr == NULL) + return 0; + + if (_features & GF_SMALL_HEADER) + return READ_LE_UINT32(ptr) - 6; + else + return READ_BE_UINT32_UNALIGNED(ptr - 4) - 8; +} + +struct FindResourceState { + uint32 size, pos; + byte *ptr; +}; + +/* just O(N) complexity when iterating with this function */ +byte *findResource(uint32 tag, byte *searchin) +{ + uint32 size; + static FindResourceState frs; + FindResourceState *f = &frs; /* easier to make it thread safe like this */ + + if (searchin) { + f->size = READ_BE_UINT32_UNALIGNED(searchin + 4); + f->pos = 8; + f->ptr = searchin + 8; + goto StartScan; + } + + do { + size = READ_BE_UINT32_UNALIGNED(f->ptr + 4); + if ((int32)size <= 0) + return NULL; + + f->pos += size; + f->ptr += size; + + StartScan: + if (f->pos >= f->size) + return NULL; + } while (READ_UINT32_UNALIGNED(f->ptr) != tag); + + return f->ptr; +} + +byte *findResourceSmall(uint32 tag, byte *searchin) +{ + uint32 size; + static FindResourceState frs; + FindResourceState *f = &frs; /* easier to make it thread safe like this */ + uint16 smallTag; + + smallTag = newTag2Old(tag); + + if (searchin) { + f->size = READ_LE_UINT32(searchin); + f->pos = 6; + f->ptr = searchin + 6; + goto StartScan; + } + + do { + size = READ_LE_UINT32(f->ptr); + if ((int32)size <= 0) + return NULL; + + f->pos += size; + f->ptr += size; + + StartScan: + if (f->pos >= f->size) + return NULL; + } while (READ_LE_UINT16(f->ptr + 4) != smallTag); + + return f->ptr; +} + +byte *findResource(uint32 tag, byte *searchin, int idx) +{ + uint32 curpos, totalsize, size; + + assert(searchin); + + searchin += 4; + totalsize = READ_BE_UINT32_UNALIGNED(searchin); + curpos = 8; + searchin += 4; + + while (curpos < totalsize) { + if (READ_UINT32_UNALIGNED(searchin) == tag && !idx--) + return searchin; + + size = READ_BE_UINT32_UNALIGNED(searchin + 4); + if ((int32)size <= 0) { + error("(%c%c%c%c) Not found in %d... illegal block len %d", + tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF, 0, size); + return NULL; + } + + curpos += size; + searchin += size; + } + + return NULL; +} + +byte *findResourceSmall(uint32 tag, byte *searchin, int idx) +{ + uint32 curpos, totalsize, size; + uint16 smallTag; + + smallTag = newTag2Old(tag); + + assert(searchin); + + totalsize = READ_LE_UINT32(searchin); + searchin += 6; + curpos = 6; + + while (curpos < totalsize) { + size = READ_LE_UINT32(searchin); + + if (READ_LE_UINT16(searchin + 4) == smallTag && !idx--) + return searchin; + + if ((int32)size <= 0) { + error("(%c%c%c%c) Not found in %d... illegal block len %d", + tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF, 0, size); + return NULL; + } + + curpos += size; + searchin += size; + } + + return NULL; +} + +void Scumm::lock(int type, int i) +{ + validateResource("Locking", type, i); + res.flags[type][i] |= RF_LOCK; + +// debug(1, "locking %d,%d", type, i); +} + +void Scumm::unlock(int type, int i) +{ + validateResource("Unlocking", type, i); + res.flags[type][i] &= ~RF_LOCK; + +// debug(1, "unlocking %d,%d", type, i); +} + +bool Scumm::isResourceInUse(int type, int i) +{ + validateResource("isResourceInUse", type, i); + switch (type) { + case rtRoom: + return _roomResource == (byte)i; + case rtScript: + return isScriptInUse(i); + case rtCostume: + return isCostumeInUse(i); + case rtSound: + return _sound->isSoundRunning(i) != 0; + default: + return false; + } +} + +void Scumm::increaseResourceCounter() +{ + int i, j; + byte counter; + + for (i = rtFirst; i <= rtLast; i++) { + for (j = res.num[i]; --j >= 0;) { + counter = res.flags[i][j] & RF_USAGE; + if (counter && counter < RF_USAGE_MAX) { + setResourceCounter(i, j, counter + 1); + } + } + } +} + +void Scumm::expireResources(uint32 size) +{ + int i, j; + byte flag; + byte best_counter; + int best_type, best_res = 0; + uint32 oldAllocatedSize; + +// return; + + if (_expire_counter != 0xFF) { + _expire_counter = 0xFF; + increaseResourceCounter(); + } + + if (size + _allocatedSize < _maxHeapThreshold) + return; + + oldAllocatedSize = _allocatedSize; + + do { + best_type = 0; + best_counter = 2; + + for (i = rtFirst; i <= rtLast; i++) + if (res.mode[i]) { + for (j = res.num[i]; --j >= 0;) { + flag = res.flags[i][j]; + if (!(flag & 0x80) && flag >= best_counter && res.address[i][j] && !isResourceInUse(i, j)) { + best_counter = flag; + best_type = i; + best_res = j; + } + } + } + + if (!best_type) + break; + nukeResource(best_type, best_res); + } while (size + _allocatedSize > _minHeapThreshold); + + increaseResourceCounter(); + + debug(5, "Expired resources, mem %d -> %d", oldAllocatedSize, _allocatedSize); +} + +void Scumm::freeResources() +{ + int i, j; + for (i = rtFirst; i <= rtLast; i++) { + for (j = res.num[i]; --j >= 0;) { + if (isResourceLoaded(i, j)) + nukeResource(i, j); + } + free(res.address[i]); + free(res.flags[i]); + free(res.roomno[i]); + free(res.roomoffs[i]); + } +} + +void Scumm::loadPtrToResource(int type, int resindex, byte *source) +{ + byte *alloced; + int i, len; + + nukeResource(type, resindex); + + len = getStringLen(source); + + if (len <= 0) + return; + + alloced = createResource(type, resindex, len); + + if (!source) { + alloced[0] = fetchScriptByte(); + for (i = 1; i < len; i++) + alloced[i] = *_scriptPointer++; + } else { + for (i = 0; i < len; i++) + alloced[i] = source[i]; + } +} + +bool Scumm::isResourceLoaded(int type, int idx) +{ + validateResource("isLoaded", type, idx); + return res.address[type][idx] != NULL; +} + +void Scumm::resourceStats() +{ + int i, j; + uint32 lockedSize = 0, lockedNum = 0; + byte flag; + + for (i = rtFirst; i <= rtLast; i++) + for (j = res.num[i]; --j >= 0;) { + flag = res.flags[i][j]; + if (flag & 0x80 && res.address[i][j]) { + lockedSize += ((MemBlkHeader *)res.address[i][j])->size; + lockedNum++; + } + } + + printf("Total allocated size=%ld, locked=%ld(%ld)\n", _allocatedSize, lockedSize, lockedNum); +} + +void Scumm::heapClear(int mode) +{ +} + +void Scumm::unkHeapProc2(int a, int b) +{ +} + +void Scumm::readMAXS() +{ + if (_features & GF_AFTER_V8) { + fileSeek(_fileHandle, 50 + 50, SEEK_CUR); + _numVariables = fileReadDwordLE(); /* ? 1500 */ + _numBitVariables = fileReadDwordLE(); /* ? 2048 */ + fileReadDwordLE(); /* 40 */ + _numScripts = fileReadDwordLE(); + _numSounds = fileReadDwordLE(); + _numCharsets = fileReadDwordLE(); + _numCostumes = fileReadDwordLE(); + _numRooms = fileReadDwordLE(); + _numInventory = fileReadDwordLE(); + _numGlobalObjects = fileReadDwordLE(); + _numFlObject = fileReadDwordLE(); + _numLocalObjects = fileReadDwordLE(); + _numVerbs = fileReadDwordLE(); + _numNewNames = fileReadDwordLE(); + fileReadDwordLE(); + fileReadDwordLE(); + _numArray = fileReadDwordLE(); + + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + _numGlobalScripts = 2000; + + _shadowPaletteSize = NUM_SHADOW_PALETTE * 256; + } else if (_features & GF_AFTER_V7) { + fileSeek(_fileHandle, 50 + 50, SEEK_CUR); + _numVariables = fileReadWordLE(); + _numBitVariables = fileReadWordLE(); + fileReadWordLE(); + _numGlobalObjects = fileReadWordLE(); + _numLocalObjects = fileReadWordLE(); + _numNewNames = fileReadWordLE(); + _numVerbs = fileReadWordLE(); + _numFlObject = fileReadWordLE(); + _numInventory = fileReadWordLE(); + _numArray = fileReadWordLE(); + _numRooms = fileReadWordLE(); + _numScripts = fileReadWordLE(); + _numSounds = fileReadWordLE(); + _numCharsets = fileReadWordLE(); + _numCostumes = fileReadWordLE(); + + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + _numGlobalScripts = 2000; + + _shadowPaletteSize = NUM_SHADOW_PALETTE * 256; + } else if (_features & GF_AFTER_V6) { + _numVariables = fileReadWordLE(); + fileReadWordLE(); + _numBitVariables = fileReadWordLE(); + _numLocalObjects = fileReadWordLE(); + _numArray = fileReadWordLE(); + fileReadWordLE(); + _numVerbs = fileReadWordLE(); + _numFlObject = fileReadWordLE(); + _numInventory = fileReadWordLE(); + _numRooms = fileReadWordLE(); + _numScripts = fileReadWordLE(); + _numSounds = fileReadWordLE(); + _numCharsets = fileReadWordLE(); + _numCostumes = fileReadWordLE(); + _numGlobalObjects = fileReadWordLE(); + _numNewNames = 50; + + _objectRoomTable = NULL; + _numGlobalScripts = 200; + + _shadowPaletteSize = 256; + } else { + _numVariables = fileReadWordLE(); /* 800 */ + fileReadWordLE(); /* 16 */ + _numBitVariables = fileReadWordLE(); /* 2048 */ + _numLocalObjects = fileReadWordLE(); /* 200 */ + _numArray = 50; + _numVerbs = 100; + _numNewNames = 0; + _objectRoomTable = NULL; + + fileReadWordLE(); /* 50 */ + _numCharsets = fileReadWordLE(); /* 9 */ + fileReadWordLE(); /* 100 */ + fileReadWordLE(); /* 50 */ + _numInventory = fileReadWordLE(); /* 80 */ + _numGlobalScripts = 200; + + _shadowPaletteSize = 256; + + _numFlObject = 50; + } + + if (_shadowPaletteSize) + _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); + + allocateArrays(); + _dynamicRoomOffsets = 1; +} + +void Scumm::allocateArrays() +{ + // Note: Buffers are now allocated in scummMain to allow for + // early GUI init. + + _objectOwnerTable = (byte *)calloc(_numGlobalObjects, 1); + _objectStateTable = (byte *)calloc(_numGlobalObjects, 1); + _classData = (uint32 *)calloc(_numGlobalObjects, sizeof(uint32)); + _arrays = (byte *)calloc(_numArray, 1); + _newNames = (uint16 *)calloc(_numNewNames, sizeof(uint16)); + + _inventory = (uint16 *)calloc(_numInventory, sizeof(uint16)); + _verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot)); + _objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData)); + _vars = (int16 *)calloc(_numVariables, sizeof(int16)); + _bitVars = (byte *)calloc(_numBitVariables >> 3, 1); + + allocResTypeData(rtCostume, + (_features & GF_NEW_COSTUMES) ? MKID('AKOS') : + MKID('COST'), _numCostumes, "costume", 1); + + allocResTypeData(rtRoom, MKID('ROOM'), _numRooms, "room", 1); + allocResTypeData(rtRoomScripts, MKID('RMSC'), _numRooms, "room script", 1); + allocResTypeData(rtSound, MKID('SOUN'), _numSounds, "sound", 1); + allocResTypeData(rtScript, MKID('SCRP'), _numScripts, "script", 1); + allocResTypeData(rtCharset, MKID('CHAR'), _numCharsets, "charset", 1); + allocResTypeData(rtObjectName, MKID('NONE'), _numNewNames, "new name", 0); + allocResTypeData(rtInventory, MKID('NONE'), _numInventory, "inventory", 0); + allocResTypeData(rtTemp, MKID('NONE'), 10, "temp", 0); + allocResTypeData(rtScaleTable, MKID('NONE'), 5, "scale table", 0); + allocResTypeData(rtActorName, MKID('NONE'), NUM_ACTORS, "actor name", 0); + allocResTypeData(rtVerb, MKID('NONE'), _numVerbs, "verb", 0); + allocResTypeData(rtString, MKID('NONE'), _numArray, "array", 0); + allocResTypeData(rtFlObject, MKID('NONE'), _numFlObject, "flobject", 0); + allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0); +} + + + + +bool Scumm::isGlobInMemory(int type, int idx) +{ + validateResource("isGlobInMemory", type, idx); + + return res.address[type][idx] != NULL; +} + + +uint16 newTag2Old(uint32 oldTag) +{ + switch (oldTag) { + case (MKID('RMHD')): + return (0x4448); // HD + break; + case (MKID('IM00')): + return (0x4D42); // BM + break; + case (MKID('EXCD')): + return (0x5845); // EX + break; + case (MKID('ENCD')): + return (0x4E45); // EN + break; + case (MKID('SCAL')): + return (0x4153); // SA + break; + case (MKID('LSCR')): + return (0x534C); // LS + break; + case (MKID('OBCD')): + return (0x434F); // OC + break; + case (MKID('OBIM')): + return (0x494F); // OI + break; + case (MKID('SMAP')): + return (0x4D42); // BM + break; + case (MKID('CLUT')): + return (0x4150); // PA + break; + case (MKID('BOXD')): + return (0x5842); // BX + break; + default: + return (0); + } +} + + +char *Scumm::resTypeFromId(int id) +{ + static char buf[100]; + + switch (id) { + case rtRoom: + sprintf(buf, "Room"); + break; + case rtScript: + sprintf(buf, "Script"); + break; + case rtCostume: + sprintf(buf, "Costume"); + break; + case rtSound: + sprintf(buf, "Sound"); + break; + case rtInventory: + sprintf(buf, "Inventory"); + break; + case rtCharset: + sprintf(buf, "Charset"); + break; + case rtString: + sprintf(buf, "String"); + break; + case rtVerb: + sprintf(buf, "Verb"); + break; + case rtActorName: + sprintf(buf, "ActorName"); + break; + case rtBuffer: + sprintf(buf, "Buffer"); + break; + case rtScaleTable: + sprintf(buf, "ScaleTable"); + break; + case rtTemp: + sprintf(buf, "Temp"); + break; + case rtFlObject: + sprintf(buf, "FlObject"); + break; + case rtMatrix: + sprintf(buf, "Matrix"); + break; + case rtBox: + sprintf(buf, "Box"); + break; + case rtLast: + sprintf(buf, "Last"); + break; + case rtNumTypes: + sprintf(buf, "NumTypes"); + break; + default: + sprintf(buf, "%d", id); + } + return buf; +} diff --git a/scumm/resource.h b/scumm/resource.h new file mode 100644 index 0000000000..0628189cb2 --- /dev/null +++ b/scumm/resource.h @@ -0,0 +1,58 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef RESOURCE_H +#define RESOURCE_H + +#if !defined(__GNUC__) + #pragma START_PACK_STRUCTS +#endif + +struct ResHdr { + uint32 tag, size; +} GCC_PACK; + +#if !defined(__GNUC__) + #pragma END_PACK_STRUCTS +#endif + +#define RES_DATA(x) (((byte*)x) + sizeof(ResHdr)) +#define RES_SIZE(x) (READ_BE_UINT32_UNALIGNED(&((ResHdr* )x)->size)) + +enum { + OF_OWNER_MASK = 0x0F, + OF_STATE_MASK = 0xF0, + + OF_STATE_SHL = 4 +}; + +enum { + RF_LOCK = 0x80, + RF_USAGE = 0x7F, + RF_USAGE_MAX = RF_USAGE +}; + + +byte *findResource(uint32 tag, byte *searchin, int index); +byte *findResourceSmall(uint32 tag, byte *searchin, int index); +byte *findResource(uint32 tag, byte *searchin); +byte *findResourceSmall(uint32 tag, byte *searchin); + +#endif diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp new file mode 100644 index 0000000000..c3af1c9ef2 --- /dev/null +++ b/scumm/resource_v3.cpp @@ -0,0 +1,161 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "resource.h" + + +void Scumm_v3::readIndexFile() +{ + uint16 blocktype; + uint32 itemsize; + int numblock = 0; + int num, i; + + debug(9, "readIndexFile()"); + + openRoom(-1); + openRoom(0); + + while (!fileEof(_fileHandle)) { + itemsize = fileReadDwordLE(); + blocktype = fileReadWordLE(); + if (fileReadFailed(_fileHandle)) + break; + + switch (blocktype) { + case 0x4E52: // 'NR' + fileReadWordLE(); + break; + case 0x5230: // 'R0' + _numRooms = fileReadWordLE(); + break; + case 0x5330: // 'S0' + _numScripts = fileReadWordLE(); + break; + case 0x4E30: // 'N0' + _numSounds = fileReadWordLE(); + break; + case 0x4330: // 'C0' + _numCostumes = fileReadWordLE(); + break; + case 0x4F30: // 'O0' + _numGlobalObjects = fileReadWordLE(); + break; + } + fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); + } + + clearFileReadFailed(_fileHandle); + fileSeek(_fileHandle, 0, SEEK_SET); + + /* I'm not sure for those values yet, they will have to be rechecked */ + + _numVariables = 800; /* 800 */ + _numBitVariables = 4096; /* 2048 */ + _numLocalObjects = 200; /* 200 */ + _numArray = 50; + _numVerbs = 100; + _numNewNames = 0; + _objectRoomTable = NULL; + _numCharsets = 9; /* 9 */ + _numInventory = 80; /* 80 */ + _numGlobalScripts = 200; + + _shadowPaletteSize = 256; + _shadowPalette = (byte *) calloc(_shadowPaletteSize, 1); // stupid for now. Need to be removed later + _numFlObject = 50; + allocateArrays(); + + while (1) { + itemsize = fileReadDwordLE(); + + if (fileReadFailed(_fileHandle)) + break; + + blocktype = fileReadWordLE(); + + numblock++; + + switch (blocktype) { + + case 0x4E52: // 'NR' + fileSeek(_fileHandle, itemsize - 6, SEEK_CUR); + break; + + case 0x5230: // 'R0' + readResTypeList(rtRoom, MKID('ROOM'), "room"); + break; + + case 0x5330: // 'S0' + readResTypeList(rtScript, MKID('SCRP'), "script"); + break; + + case 0x4E30: // 'N0' + readResTypeList(rtSound, MKID('SOUN'), "sound"); + break; + + case 0x4330: // 'C0' + readResTypeList(rtCostume, MKID('COST'), "costume"); + break; + + case 0x4F30: // 'O0' + num = fileReadWordLE(); + assert(num == _numGlobalObjects); + for (i = 0; i != num; i++) { + uint32 bits = fileReadByte(); + byte tmp; + bits |= fileReadByte() << 8; + bits |= fileReadByte() << 16; + _classData[i] = bits; + tmp = fileReadByte(); + _objectOwnerTable[i] = tmp & OF_OWNER_MASK; + _objectStateTable[i] = tmp >> OF_STATE_SHL; + } + + break; + + default: + error("Bad ID %c%c found in directory!", blocktype & 0xFF, blocktype >> 8); + return; + } + } + + openRoom(-1); +} + +void Scumm_v3::loadCharset(int no) +{ + uint32 size; + memset(_charsetData, 0, sizeof(_charsetData)); + + checkRange(4, 0, no, "Loading illegal charset %d"); + openRoom(-1); + + openRoom(98 + no); + + size = fileReadWordLE(); + + fileRead(_fileHandle, createResource(6, no, size), size); + openRoom(-1); +} diff --git a/scumm/resource_v4.cpp b/scumm/resource_v4.cpp new file mode 100644 index 0000000000..64ba6c2255 --- /dev/null +++ b/scumm/resource_v4.cpp @@ -0,0 +1,40 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" + +void Scumm_v4::loadCharset(int no) +{ + uint32 size; + memset(_charsetData, 0, sizeof(_charsetData)); + + checkRange(4, 0, no, "Loading illegal charset %d"); + openRoom(-1); + + openRoom(900 + no); + + size = fileReadDwordLE() + 11; + + fileRead(_fileHandle, createResource(6, no, size), size); + openRoom(-1); +} diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp new file mode 100644 index 0000000000..0f3011721b --- /dev/null +++ b/scumm/saveload.cpp @@ -0,0 +1,891 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "sound/mididrv.h" +#include "scumm/imuse.h" +#include "actor.h" +#include "config-file.h" +#include "resource.h" +#include "saveload.h" + +struct SaveGameHeader { + uint32 type; + uint32 size; + uint32 ver; + char name[32]; +}; + +// Support for "old" savegames (made with 2501 CVS build) +// Can be useful for other ports too :) + +#define VER_V9 9 +#define VER_V8 8 +#define VER_V7 7 + +#define CURRENT_VER VER_V9 + +static uint32 _current_version = CURRENT_VER; + +bool Scumm::saveState(int slot, bool compat) +{ + char filename[256]; + SerializerStream out; + SaveGameHeader hdr; + Serializer ser; + + makeSavegameName(filename, slot, compat); + + if (!out.fopen(filename, "wb")) + return false; + + memcpy(hdr.name, _saveLoadName, sizeof(hdr.name)); + + hdr.type = MKID('SCVM'); + hdr.size = 0; + hdr.ver = TO_LE_32(_current_version); + + out.fwrite(&hdr, sizeof(hdr), 1); + + ser._saveLoadStream = out; + ser._saveOrLoad = true; + saveOrLoad(&ser); + + out.fclose(); + debug(1, "State saved as '%s'", filename); + return true; +} + +bool Scumm::loadState(int slot, bool compat) +{ + char filename[256]; + SerializerStream out; + int i, j; + SaveGameHeader hdr; + Serializer ser; + int sb, sh; + + makeSavegameName(filename, slot, compat); + if (!out.fopen(filename, "rb")) + return false; + + out.fread(&hdr, sizeof(hdr), 1); + if (hdr.type != MKID('SCVM')) { + warning("Invalid savegame '%s'", filename); + out.fclose(); + return false; + } + + if (hdr.ver < VER_V7 || hdr.ver > _current_version) + hdr.ver = TO_LE_32(hdr.ver); + if (hdr.ver < VER_V7 || hdr.ver > _current_version) + { + warning("Invalid version of '%s'", filename); + out.fclose(); + return false; + } + + _current_version = hdr.ver; + memcpy(_saveLoadName, hdr.name, sizeof(hdr.name)); + + _sound->pauseSounds(true); + + CHECK_HEAP openRoom(-1); + memset(_inventory, 0, sizeof(_inventory[0]) * _numInventory); + + /* Nuke all resources */ + for (i = rtFirst; i <= rtLast; i++) + if (i != rtTemp && i != rtBuffer) + for (j = 0; j < res.num[i]; j++) { + nukeResource(i, j); + res.flags[i][j] = 0; + } + + initScummVars(); + + ser._saveLoadStream = out; + ser._saveOrLoad = false; + saveOrLoad(&ser); + out.fclose(); + + sb = _screenB; + sh = _screenH; + + gdi._mask_left = -1; + + initScreens(0, 0, 320, 200); + + // Force a fade to black + int old_screenEffectFlag = _screenEffectFlag; + _screenEffectFlag = true; + fadeOut(129); + _screenEffectFlag = old_screenEffectFlag; + + initScreens(0, sb, 320, sh); + + _completeScreenRedraw = true; + setDirtyColors(0, 255); + + _lastCodePtr = NULL; + + _drawObjectQueNr = 0; + _verbMouseOver = 0; + + if (_features & GF_AFTER_V7) + cameraMoved(); + + initBGBuffers(_scrHeight); + + CHECK_HEAP debug(1, "State loaded from '%s'", filename); + + + _sound->pauseSounds(false); + + return true; +} + +void Scumm::makeSavegameName(char *out, int slot, bool compatible) +{ + const char *dir = getSavePath(); + + // snprintf should be used here, but it's not portable enough + sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c' : 's', slot); +} + +bool Scumm::getSavegameName(int slot, char *desc) +{ + char filename[256]; + SerializerStream out; + SaveGameHeader hdr; + int len; + + makeSavegameName(filename, slot, false); + if (!out.fopen(filename, "rb")) { + strcpy(desc, ""); + return false; + } + len = out.fread(&hdr, sizeof(hdr), 1); + out.fclose(); + + if (len != 1 || hdr.type != MKID('SCVM')) { + strcpy(desc, "Invalid savegame"); + return false; + } + + if (hdr.ver < VER_V7 || hdr.ver > _current_version) + hdr.ver = TO_LE_32(hdr.ver); + if (hdr.ver < VER_V7 || hdr.ver > _current_version) { + strcpy(desc, "Invalid version"); + return false; + } + + memcpy(desc, hdr.name, sizeof(hdr.name)); + desc[sizeof(hdr.name) - 1] = 0; + return true; +} + +#define OFFS(type,item) ((int)(&((type*)0)->item)) +#define SIZE(type,item) sizeof(((type*)0)->item) +#define MKLINE(type,item,saveas) {OFFS(type,item),saveas,SIZE(type,item)} +#define MKARRAY(type,item,saveas,num) {OFFS(type,item),128|saveas,SIZE(type,item)}, {num,0,0} +#define MKEND() {0xFFFF,0xFF,0xFF} + +void Scumm::saveOrLoad(Serializer *s) +{ + const SaveLoadEntry objectEntries[] = { + MKLINE(ObjectData, offs_obim_to_room, sleUint32), + MKLINE(ObjectData, offs_obcd_to_room, sleUint32), + MKLINE(ObjectData, walk_x, sleUint16), + MKLINE(ObjectData, walk_y, sleUint16), + MKLINE(ObjectData, obj_nr, sleUint16), + MKLINE(ObjectData, x_pos, sleInt16), + MKLINE(ObjectData, y_pos, sleInt16), + MKLINE(ObjectData, width, sleUint16), + MKLINE(ObjectData, height, sleUint16), + MKLINE(ObjectData, actordir, sleByte), + MKLINE(ObjectData, parentstate, sleByte), + MKLINE(ObjectData, parent, sleByte), + MKLINE(ObjectData, state, sleByte), + MKLINE(ObjectData, fl_object_index, sleByte), + MKEND() + }; + + const SaveLoadEntry actorEntries[] = { + MKLINE(Actor, x, sleInt16), + MKLINE(Actor, y, sleInt16), + MKLINE(Actor, top, sleInt16), + MKLINE(Actor, bottom, sleInt16), + MKLINE(Actor, elevation, sleInt16), + MKLINE(Actor, width, sleUint16), + MKLINE(Actor, facing, sleUint16), + MKLINE(Actor, costume, sleUint16), + MKLINE(Actor, room, sleByte), + MKLINE(Actor, talkColor, sleByte), + MKLINE(Actor, scalex, sleByte), + MKLINE(Actor, scaley, sleByte), + MKLINE(Actor, charset, sleByte), + MKARRAY(Actor, sound[0], sleByte, 8), + MKARRAY(Actor, animVariable[0], sleUint16, 8), + MKLINE(Actor, newDirection, sleUint16), + MKLINE(Actor, moving, sleByte), + MKLINE(Actor, ignoreBoxes, sleByte), + MKLINE(Actor, forceClip, sleByte), + MKLINE(Actor, initFrame, sleByte), + MKLINE(Actor, walkFrame, sleByte), + MKLINE(Actor, standFrame, sleByte), + MKLINE(Actor, talkFrame1, sleByte), + MKLINE(Actor, talkFrame2, sleByte), + MKLINE(Actor, speedx, sleUint16), + MKLINE(Actor, speedy, sleUint16), + MKLINE(Actor, cost.animCounter1, sleUint16), + MKLINE(Actor, cost.animCounter2, sleByte), + MKARRAY(Actor, palette[0], sleByte, 64), + MKLINE(Actor, mask, sleByte), + MKLINE(Actor, shadow_mode, sleByte), + MKLINE(Actor, visible, sleByte), + MKLINE(Actor, frame, sleByte), + MKLINE(Actor, animSpeed, sleByte), + MKLINE(Actor, animProgress, sleByte), + MKLINE(Actor, walkbox, sleByte), + MKLINE(Actor, needRedraw, sleByte), + MKLINE(Actor, needBgReset, sleByte), + MKLINE(Actor, costumeNeedsInit, sleByte), + + MKLINE(Actor, new_1, sleInt16), + MKLINE(Actor, new_2, sleInt16), + MKLINE(Actor, new_3, sleByte), + + MKLINE(Actor, layer, sleByte), + + MKLINE(Actor, talk_script, sleUint16), + MKLINE(Actor, walk_script, sleUint16), + + MKLINE(Actor, walkdata.destx, sleInt16), + MKLINE(Actor, walkdata.desty, sleInt16), + MKLINE(Actor, walkdata.destbox, sleByte), + MKLINE(Actor, walkdata.destdir, sleUint16), + MKLINE(Actor, walkdata.curbox, sleByte), + MKLINE(Actor, walkdata.x, sleInt16), + MKLINE(Actor, walkdata.y, sleInt16), + MKLINE(Actor, walkdata.newx, sleInt16), + MKLINE(Actor, walkdata.newy, sleInt16), + MKLINE(Actor, walkdata.XYFactor, sleInt32), + MKLINE(Actor, walkdata.YXFactor, sleInt32), + MKLINE(Actor, walkdata.xfrac, sleUint16), + MKLINE(Actor, walkdata.yfrac, sleUint16), + + MKARRAY(Actor, cost.active[0], sleByte, 16), + MKLINE(Actor, cost.stopped, sleUint16), + MKARRAY(Actor, cost.curpos[0], sleUint16, 16), + MKARRAY(Actor, cost.start[0], sleUint16, 16), + MKARRAY(Actor, cost.end[0], sleUint16, 16), + MKARRAY(Actor, cost.frame[0], sleUint16, 16), + MKEND() + }; + + const SaveLoadEntry verbEntries[] = { + MKLINE(VerbSlot, x, sleInt16), + MKLINE(VerbSlot, y, sleInt16), + MKLINE(VerbSlot, right, sleInt16), + MKLINE(VerbSlot, bottom, sleInt16), + MKLINE(VerbSlot, oldleft, sleInt16), + MKLINE(VerbSlot, oldtop, sleInt16), + MKLINE(VerbSlot, oldright, sleInt16), + MKLINE(VerbSlot, oldbottom, sleInt16), + MKLINE(VerbSlot, verbid, sleByte), + MKLINE(VerbSlot, color, sleByte), + MKLINE(VerbSlot, hicolor, sleByte), + MKLINE(VerbSlot, dimcolor, sleByte), + MKLINE(VerbSlot, bkcolor, sleByte), + MKLINE(VerbSlot, type, sleByte), + MKLINE(VerbSlot, charset_nr, sleByte), + MKLINE(VerbSlot, curmode, sleByte), + MKLINE(VerbSlot, saveid, sleByte), + MKLINE(VerbSlot, key, sleByte), + MKLINE(VerbSlot, center, sleByte), + MKLINE(VerbSlot, field_1B, sleByte), + MKLINE(VerbSlot, imgindex, sleUint16), + MKEND() + }; + + const SaveLoadEntry mainEntriesV9[] = { + MKLINE(Scumm, _scrWidth, sleUint16), + MKLINE(Scumm, _scrHeight, sleUint16), + MKLINE(Scumm, _ENCD_offs, sleUint32), + MKLINE(Scumm, _EXCD_offs, sleUint32), + MKLINE(Scumm, _IM00_offs, sleUint32), + MKLINE(Scumm, _CLUT_offs, sleUint32), + MKLINE(Scumm, _EPAL_offs, sleUint32), + MKLINE(Scumm, _PALS_offs, sleUint32), + MKLINE(Scumm, _curPalIndex, sleByte), + MKLINE(Scumm, _currentRoom, sleByte), + MKLINE(Scumm, _roomResource, sleByte), + MKLINE(Scumm, _numObjectsInRoom, sleByte), + MKLINE(Scumm, _currentScript, sleByte), + MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT), + MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17), + MKARRAY(Scumm, _resourceMapper[0], sleByte, 128), + MKARRAY(Scumm, charset._colorMap[0], sleByte, 16), + MKARRAY(Scumm, _charsetData[0][0], sleByte, 10 * 16), + MKLINE(Scumm, _curExecScript, sleUint16), + + MKLINE(Scumm, camera._dest.x, sleInt16), + MKLINE(Scumm, camera._dest.y, sleInt16), + MKLINE(Scumm, camera._cur.x, sleInt16), + MKLINE(Scumm, camera._cur.y, sleInt16), + MKLINE(Scumm, camera._last.x, sleInt16), + MKLINE(Scumm, camera._last.y, sleInt16), + MKLINE(Scumm, camera._accel.x, sleInt16), + MKLINE(Scumm, camera._accel.y, sleInt16), + MKLINE(Scumm, _screenStartStrip, sleInt16), + MKLINE(Scumm, _screenEndStrip, sleInt16), + MKLINE(Scumm, camera._mode, sleByte), + MKLINE(Scumm, camera._follows, sleByte), + MKLINE(Scumm, camera._leftTrigger, sleInt16), + MKLINE(Scumm, camera._rightTrigger, sleInt16), + MKLINE(Scumm, camera._movingToActor, sleUint16), + + MKLINE(Scumm, _actorToPrintStrFor, sleByte), + MKLINE(Scumm, _charsetColor, sleByte), + /* XXX Convert into word next time format changes */ + MKLINE(Scumm, charset._bufPos, sleByte), + MKLINE(Scumm, _haveMsg, sleByte), + MKLINE(Scumm, _useTalkAnims, sleByte), + + MKLINE(Scumm, _talkDelay, sleInt16), + MKLINE(Scumm, _defaultTalkDelay, sleInt16), + MKLINE(Scumm, _numInMsgStack, sleInt16), + MKLINE(Scumm, _sentenceNum, sleByte), + + MKLINE(Scumm, vm.cutSceneStackPointer, sleByte), + MKARRAY(Scumm, vm.cutScenePtr[0], sleUint32, 5), + MKARRAY(Scumm, vm.cutSceneScript[0], sleByte, 5), + MKARRAY(Scumm, vm.cutSceneData[0], sleInt16, 5), + MKLINE(Scumm, vm.cutSceneScriptIndex, sleInt16), + + /* nest */ + MKLINE(Scumm, _numNestedScripts, sleByte), + MKLINE(Scumm, _userPut, sleByte), + MKLINE(Scumm, _cursorState, sleByte), + MKLINE(Scumm, gdi._cursorActive, sleByte), + MKLINE(Scumm, gdi._currentCursor, sleByte), + + MKLINE(Scumm, _doEffect, sleByte), + MKLINE(Scumm, _switchRoomEffect, sleByte), + MKLINE(Scumm, _newEffect, sleByte), + MKLINE(Scumm, _switchRoomEffect2, sleByte), + MKLINE(Scumm, _BgNeedsRedraw, sleByte), + + MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 200), + MKLINE(Scumm, gdi._transparency, sleByte), + MKARRAY(Scumm, _currentPalette[0], sleByte, 768), + + MKARRAY(Scumm, _proc_special_palette[0], sleByte, 256), + /* virtscr */ + + MKARRAY(Scumm, charset._buffer[0], sleByte, 256), + + MKLINE(Scumm, _egoPositioned, sleByte), + + MKARRAY(Scumm, gdi._imgBufOffs[0], sleUint16, 4), + MKLINE(Scumm, gdi._numZBuffer, sleByte), + + MKLINE(Scumm, _screenEffectFlag, sleByte), + + MKLINE(Scumm, _randSeed1, sleUint32), + MKLINE(Scumm, _randSeed2, sleUint32), + + /* XXX: next time the save game format changes, + * convert _shakeEnabled to boolean and add a _shakeFrame field */ + MKLINE(Scumm, _shakeEnabled, sleInt16), + + MKLINE(Scumm, _keepText, sleByte), + + MKLINE(Scumm, _screenB, sleUint16), + MKLINE(Scumm, _screenH, sleUint16), + + MKLINE(Scumm, _cd_track, sleInt16), + MKLINE(Scumm, _cd_loops, sleInt16), + MKLINE(Scumm, _cd_frame, sleInt16), + MKLINE(Scumm, _cd_end, sleInt16), + + MKEND() + }; + + const SaveLoadEntry mainEntriesV8[] = { + MKLINE(Scumm, _scrWidth, sleUint16), + MKLINE(Scumm, _scrHeight, sleUint16), + MKLINE(Scumm, _ENCD_offs, sleUint32), + MKLINE(Scumm, _EXCD_offs, sleUint32), + MKLINE(Scumm, _IM00_offs, sleUint32), + MKLINE(Scumm, _CLUT_offs, sleUint32), + MKLINE(Scumm, _EPAL_offs, sleUint32), + MKLINE(Scumm, _PALS_offs, sleUint32), + MKLINE(Scumm, _curPalIndex, sleByte), + MKLINE(Scumm, _currentRoom, sleByte), + MKLINE(Scumm, _roomResource, sleByte), + MKLINE(Scumm, _numObjectsInRoom, sleByte), + MKLINE(Scumm, _currentScript, sleByte), + MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT), + MKARRAY(Scumm, vm.localvar[0][0], sleUint16, 25 * 17), + MKARRAY(Scumm, _resourceMapper[0], sleByte, 128), + MKARRAY(Scumm, charset._colorMap[0], sleByte, 16), + MKARRAY(Scumm, _charsetData[0][0], sleByte, 10 * 16), + MKLINE(Scumm, _curExecScript, sleUint16), + + MKLINE(Scumm, camera._dest.x, sleInt16), + MKLINE(Scumm, camera._dest.y, sleInt16), + MKLINE(Scumm, camera._cur.x, sleInt16), + MKLINE(Scumm, camera._cur.y, sleInt16), + MKLINE(Scumm, camera._last.x, sleInt16), + MKLINE(Scumm, camera._last.y, sleInt16), + MKLINE(Scumm, camera._accel.x, sleInt16), + MKLINE(Scumm, camera._accel.y, sleInt16), + MKLINE(Scumm, _screenStartStrip, sleInt16), + MKLINE(Scumm, _screenEndStrip, sleInt16), + MKLINE(Scumm, camera._mode, sleByte), + MKLINE(Scumm, camera._follows, sleByte), + MKLINE(Scumm, camera._leftTrigger, sleInt16), + MKLINE(Scumm, camera._rightTrigger, sleInt16), + MKLINE(Scumm, camera._movingToActor, sleUint16), + + MKLINE(Scumm, _actorToPrintStrFor, sleByte), + MKLINE(Scumm, _charsetColor, sleByte), + /* XXX Convert into word next time format changes */ + MKLINE(Scumm, charset._bufPos, sleByte), + MKLINE(Scumm, _haveMsg, sleByte), + MKLINE(Scumm, _useTalkAnims, sleByte), + + MKLINE(Scumm, _talkDelay, sleInt16), + MKLINE(Scumm, _defaultTalkDelay, sleInt16), + MKLINE(Scumm, _numInMsgStack, sleInt16), + MKLINE(Scumm, _sentenceNum, sleByte), + + MKLINE(Scumm, vm.cutSceneStackPointer, sleByte), + MKARRAY(Scumm, vm.cutScenePtr[0], sleUint32, 5), + MKARRAY(Scumm, vm.cutSceneScript[0], sleByte, 5), + MKARRAY(Scumm, vm.cutSceneData[0], sleInt16, 5), + MKLINE(Scumm, vm.cutSceneScriptIndex, sleInt16), + + /* nest */ + MKLINE(Scumm, _numNestedScripts, sleByte), + MKLINE(Scumm, _userPut, sleByte), + MKLINE(Scumm, _cursorState, sleByte), + MKLINE(Scumm, gdi._cursorActive, sleByte), + MKLINE(Scumm, gdi._currentCursor, sleByte), + + MKLINE(Scumm, _doEffect, sleByte), + MKLINE(Scumm, _switchRoomEffect, sleByte), + MKLINE(Scumm, _newEffect, sleByte), + MKLINE(Scumm, _switchRoomEffect2, sleByte), + MKLINE(Scumm, _BgNeedsRedraw, sleByte), + + MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 200), + MKLINE(Scumm, gdi._transparency, sleByte), + MKARRAY(Scumm, _currentPalette[0], sleByte, 768), + + MKARRAY(Scumm, _proc_special_palette[0], sleByte, 256), + /* virtscr */ + + MKARRAY(Scumm, charset._buffer[0], sleByte, 256), + + MKLINE(Scumm, _egoPositioned, sleByte), + + MKARRAY(Scumm, gdi._imgBufOffs[0], sleUint16, 4), + MKLINE(Scumm, gdi._numZBuffer, sleByte), + + MKLINE(Scumm, _screenEffectFlag, sleByte), + + MKLINE(Scumm, _randSeed1, sleUint32), + MKLINE(Scumm, _randSeed2, sleUint32), + + /* XXX: next time the save game format changes, + * convert _shakeEnabled to boolean and add a _shakeFrame field */ + MKLINE(Scumm, _shakeEnabled, sleInt16), + + MKLINE(Scumm, _keepText, sleByte), + + MKLINE(Scumm, _screenB, sleUint16), + MKLINE(Scumm, _screenH, sleUint16), + + MKEND() + }; + + const SaveLoadEntry scriptSlotEntries[] = { + MKLINE(ScriptSlot, offs, sleUint32), + MKLINE(ScriptSlot, delay, sleInt32), + MKLINE(ScriptSlot, number, sleUint16), + MKLINE(ScriptSlot, newfield, sleUint16), + MKLINE(ScriptSlot, status, sleByte), + MKLINE(ScriptSlot, where, sleByte), + MKLINE(ScriptSlot, unk1, sleByte), + MKLINE(ScriptSlot, unk2, sleByte), + MKLINE(ScriptSlot, freezeCount, sleByte), + MKLINE(ScriptSlot, didexec, sleByte), + MKLINE(ScriptSlot, cutsceneOverride, sleByte), + MKLINE(ScriptSlot, unk5, sleByte), + MKEND() + }; + + const SaveLoadEntry nestedScriptEntries[] = { + MKLINE(NestedScript, number, sleUint16), + MKLINE(NestedScript, where, sleByte), + MKLINE(NestedScript, slot, sleByte), + MKEND() + }; + + const SaveLoadEntry sentenceTabEntries[] = { + MKLINE(SentenceTab, unk5, sleUint8), + MKLINE(SentenceTab, unk2, sleUint8), + MKLINE(SentenceTab, unk4, sleUint16), + MKLINE(SentenceTab, unk3, sleUint16), + MKLINE(SentenceTab, unk, sleUint8), + MKEND() + }; + + const SaveLoadEntry stringTabEntries[] = { + MKLINE(StringTab, xpos, sleInt16), + MKLINE(StringTab, t_xpos, sleInt16), + MKLINE(StringTab, ypos, sleInt16), + MKLINE(StringTab, t_ypos, sleInt16), + MKLINE(StringTab, right, sleInt16), + MKLINE(StringTab, t_right, sleInt16), + MKLINE(StringTab, color, sleInt8), + MKLINE(StringTab, t_color, sleInt8), + MKLINE(StringTab, charset, sleInt8), + MKLINE(StringTab, t_charset, sleInt8), + MKLINE(StringTab, center, sleByte), + MKLINE(StringTab, t_center, sleByte), + MKLINE(StringTab, overhead, sleByte), + MKLINE(StringTab, t_overhead, sleByte), + MKLINE(StringTab, no_talk_anim, sleByte), + MKLINE(StringTab, t_no_talk_anim, sleByte), + MKEND() + }; + + const SaveLoadEntry colorCycleEntries[] = { + MKLINE(ColorCycle, delay, sleUint16), + MKLINE(ColorCycle, counter, sleUint16), + MKLINE(ColorCycle, flags, sleUint16), + MKLINE(ColorCycle, start, sleByte), + MKLINE(ColorCycle, end, sleByte), + MKEND() + }; + + int i, j; + int var120Backup; + int var98Backup; + + if (_mixer && !s->isSaving()) + _mixer->stop_all(); + + if (_current_version == VER_V9) + s->saveLoadEntries(this, mainEntriesV9); + else + s->saveLoadEntries(this, mainEntriesV8); + + s->saveLoadArrayOf(_actors, NUM_ACTORS, sizeof(_actors[0]), actorEntries); + + if (_current_version < VER_V9) + s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries); + else + s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries); + s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]), objectEntries); + s->saveLoadArrayOf(_verbs, _numVerbs, sizeof(_verbs[0]), verbEntries); + s->saveLoadArrayOf(vm.nest, 16, sizeof(vm.nest[0]), nestedScriptEntries); + s->saveLoadArrayOf(sentence, 6, sizeof(sentence[0]), sentenceTabEntries); + s->saveLoadArrayOf(string, 6, sizeof(string[0]), stringTabEntries); + s->saveLoadArrayOf(_colorCycle, 16, sizeof(_colorCycle[0]), colorCycleEntries); + + for (i = rtFirst; i <= rtLast; i++) + if (res.mode[i] == 0) + for (j = 1; j < res.num[i]; j++) + saveLoadResource(s, i, j); + + s->saveLoadArrayOf(_objectOwnerTable, _numGlobalObjects, sizeof(_objectOwnerTable[0]), sleByte); + s->saveLoadArrayOf(_objectStateTable, _numGlobalObjects, sizeof(_objectStateTable[0]), sleByte); + if (_objectRoomTable) + s->saveLoadArrayOf(_objectRoomTable, _numGlobalObjects, sizeof(_objectRoomTable[0]), sleByte); + + if (_shadowPaletteSize) + s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); + + s->saveLoadArrayOf(_classData, _numGlobalObjects, sizeof(_classData[0]), sleUint32); + + var120Backup = _vars[120]; + var98Backup = _vars[98]; + + s->saveLoadArrayOf(_vars, _numVariables, sizeof(_vars[0]), sleInt16); + + if (_gameId == GID_TENTACLE) // Maybe misplaced, but that's the main idea + _vars[120] = var120Backup; + if (_gameId == GID_INDY4) + _vars[98] = var98Backup;; + + s->saveLoadArrayOf(_bitVars, _numBitVariables >> 3, 1, sleByte); + + /* Save or load a list of the locked objects */ + if (s->isSaving()) { + for (i = rtFirst; i <= rtLast; i++) + for (j = 1; j < res.num[i]; j++) { + if (res.flags[i][j] & RF_LOCK) { + s->saveByte(i); + s->saveWord(j); + } + } + s->saveByte(0xFF); + } else { + int r; + while ((r = s->loadByte()) != 0xFF) { + res.flags[r][s->loadWord()] |= RF_LOCK; + } + } + + if (_imuse) + _imuse->save_or_load(s, this); +} + +void Scumm::saveLoadResource(Serializer *ser, int type, int idx) +{ + byte *ptr; + uint32 size; + + /* don't save/load these resource types */ + if (type == rtTemp || type == rtBuffer || res.mode[type]) + return; + + if (ser->isSaving()) { + ptr = res.address[type][idx]; + if (ptr == NULL) { + ser->saveUint32(0); + return; + } + + size = ((MemBlkHeader *)ptr)->size; + + ser->saveUint32(size); + ser->saveLoadBytes(ptr + sizeof(MemBlkHeader), size); + + if (type == rtInventory) { + ser->saveWord(_inventory[idx]); + } + } else { + size = ser->loadUint32(); + if (size) { + createResource(type, idx, size); + ser->saveLoadBytes(getResourceAddress(type, idx), size); + if (type == rtInventory) { + _inventory[idx] = ser->loadWord(); + } + } + } +} + +void Serializer::saveLoadBytes(void *b, int len) +{ + if (_saveOrLoad) + _saveLoadStream.fwrite(b, 1, len); + else + _saveLoadStream.fread(b, 1, len); +} + +#ifdef _WIN32_WCE + +// Perhaps not necessary anymore with latest checks + +bool Serializer::checkEOFLoadStream() +{ + if (!fseek(_saveLoadStream.out, 1, SEEK_CUR)) + return true; + if (feof(_saveLoadStream.out)) + return true; + fseek(_saveLoadStream.out, -1, SEEK_CUR); + return false; +} + +#endif + + +void Serializer::saveUint32(uint32 d) +{ + uint32 e = FROM_LE_32(d); + saveLoadBytes(&e, 4); +} + +void Serializer::saveWord(uint16 d) +{ + uint16 e = FROM_LE_16(d); + saveLoadBytes(&e, 2); +} + +void Serializer::saveByte(byte b) +{ + saveLoadBytes(&b, 1); +} + +uint32 Serializer::loadUint32() +{ + uint32 e; + saveLoadBytes(&e, 4); + return FROM_LE_32(e); +} + +uint16 Serializer::loadWord() +{ + uint16 e; + saveLoadBytes(&e, 2); + return FROM_LE_16(e); +} + +byte Serializer::loadByte() +{ + byte e; + saveLoadBytes(&e, 1); + return e; +} + +void Serializer::saveLoadArrayOf(void *b, int len, int datasize, byte filetype) +{ + byte *at = (byte *)b; + uint32 data; + + /* speed up byte arrays */ + if (datasize == 1 && filetype == sleByte) { + saveLoadBytes(b, len); + return; + } + + while (--len >= 0) { + if (_saveOrLoad) { + /* saving */ + if (datasize == 1) { + data = *(byte *)at; + at += 1; + } else if (datasize == 2) { + data = *(uint16 *)at; + at += 2; + } else if (datasize == 4) { + data = *(uint32 *)at; + at += 4; + } else { + error("saveLoadArrayOf: invalid size %d", datasize); + } + switch (filetype) { + case sleByte: + saveByte((byte)data); + break; + case sleUint16: + case sleInt16: + saveWord((int16)data); + break; + case sleInt32: + case sleUint32: + saveUint32(data); + break; + default: + error("saveLoadArrayOf: invalid filetype %d", filetype); + } + } else { + /* loading */ + switch (filetype) { + case sleByte: + data = loadByte(); + break; + case sleUint16: + data = loadWord(); + break; + case sleInt16: + data = (int16)loadWord(); + break; + case sleUint32: + data = loadUint32(); + break; + case sleInt32: + data = (int32)loadUint32(); + break; + default: + error("saveLoadArrayOf: invalid filetype %d", filetype); + } + if (datasize == 1) { + *(byte *)at = (byte)data; + at += 1; + } else if (datasize == 2) { + *(uint16 *)at = (uint16)data; + at += 2; + } else if (datasize == 4) { + *(uint32 *)at = data; + at += 4; + } else { + error("saveLoadArrayOf: invalid size %d", datasize); + } + } + } +} + +void Serializer::saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle) +{ + byte *data = (byte *)b; + + while (--num >= 0) { + saveLoadEntries(data, sle); + data += datasize; + } +} + + +void Serializer::saveLoadEntries(void *d, const SaveLoadEntry *sle) +{ + int replen; + byte type; + byte *at; + int size; + int num; + void *ptr; + + while (sle->offs != 0xFFFF) { + at = (byte *)d + sle->offs; + size = sle->size; + type = sle->type; + + if (size == 0xFF) { + if (_saveOrLoad) { + /* save reference */ + ptr = *((void **)at); + saveWord(ptr ? ((*_save_ref) (_ref_me, type, ptr) + 1) : 0); + } else { + /* load reference */ + num = loadWord(); + *((void **)at) = num ? (*_load_ref) (_ref_me, type, num - 1) : NULL; + } + } else { + replen = 1; + if (type & 128) { + sle++; + replen = sle->offs; + type &= ~128; + } + saveLoadArrayOf(at, replen, size, type); + } + sle++; + } +} diff --git a/scumm/saveload.h b/scumm/saveload.h new file mode 100644 index 0000000000..8b715de3f6 --- /dev/null +++ b/scumm/saveload.h @@ -0,0 +1,101 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef SAVELOAD_H +#define SAVELOAD_H + +enum { + sleByte = 1, + sleUint8 = 1, + sleInt8 = 1, + sleInt16 = 2, + sleUint16 = 3, + sleInt32 = 4, + sleUint32 = 5 +}; + +struct SaveLoadEntry { + uint32 offs; + uint8 type; + uint8 size; +}; + +struct SerializerStream { +#ifdef NONSTANDARD_SAVE + void *context; + + bool fopen(const char *filename, const char *mode); + void fclose(); + int fread(void *buf, int size, int cnt); + int fwrite(void *buf, int size, int cnt); +#else + FILE *out; + + FILE *fopen(const char *filename, const char *mode) { + return out = ::fopen(filename, mode); + } + void fclose() { + ::fclose(out); + } + int fread(void *buf, int size, int cnt) { + return ::fread(buf, size, cnt, out); + } + int fwrite(void *buf, int size, int cnt) { + return ::fwrite(buf, size, cnt, out); + } +#endif +}; + +typedef int SerializerSaveReference(void *me, byte type, void *ref); +typedef void *SerializerLoadReference(void *me, byte type, int ref); + +struct Serializer { + SerializerStream _saveLoadStream; + + union { + SerializerSaveReference *_save_ref; + SerializerLoadReference *_load_ref; + void *_saveload_ref; + }; + void *_ref_me; + + bool _saveOrLoad; + + void saveLoadBytes(void *b, int len); + void saveLoadArrayOf(void *b, int len, int datasize, byte filetype); + void saveLoadEntries(void *d, const SaveLoadEntry *sle); + void saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle); + + void saveUint32(uint32 d); + void saveWord(uint16 d); + void saveByte(byte b); + + byte loadByte(); + uint16 loadWord(); + uint32 loadUint32(); + + bool isSaving() { return _saveOrLoad; } + + bool checkEOFLoadStream(); + +}; + +#endif diff --git a/scumm/scaler.cpp b/scumm/scaler.cpp new file mode 100644 index 0000000000..3f6b3b9f09 --- /dev/null +++ b/scumm/scaler.cpp @@ -0,0 +1,814 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scummsys.h" +#include "scaler.h" + +/********** 2XSAI Filter *****************/ +static uint32 colorMask = 0xF7DEF7DE; +static uint32 lowPixelMask = 0x08210821; +static uint32 qcolorMask = 0xE79CE79C; +static uint32 qlowpixelMask = 0x18631863; +static uint32 redblueMask = 0xF81F; +static uint32 greenMask = 0x7E0; + +int Init_2xSaI(uint32 BitFormat) +{ + if (BitFormat == 565) { + colorMask = 0xF7DEF7DE; + lowPixelMask = 0x08210821; + qcolorMask = 0xE79CE79C; + qlowpixelMask = 0x18631863; + redblueMask = 0xF81F; + greenMask = 0x7E0; + } else if (BitFormat == 555) { + colorMask = 0x7BDE7BDE; + lowPixelMask = 0x04210421; + qcolorMask = 0x739C739C; + qlowpixelMask = 0x0C630C63; + redblueMask = 0x7C1F; + greenMask = 0x3E0; + } else { + return 0; + } + + return 1; +} + +static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) + x += 1; + else if (B == C) + y += 1; + if (A == D) + x += 1; + else if (B == D) + y += 1; + if (x <= 1) + r += 1; + if (y <= 1) + r -= 1; + return r; +} + +static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) + x += 1; + else if (B == C) + y += 1; + if (A == D) + x += 1; + else if (B == D) + y += 1; + if (x <= 1) + r -= 1; + if (y <= 1) + r += 1; + return r; +} + +static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) +{ + int x = 0; + int y = 0; + int r = 0; + + if (A == C) + x += 1; + else if (B == C) + y += 1; + if (A == D) + x += 1; + else if (B == D) + y += 1; + if (x <= 1) + r += 1; + if (y <= 1) + r -= 1; + return r; +} + +static inline uint32 INTERPOLATE(uint32 A, uint32 B) +{ + if (A != B) { + return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)); + } else + return A; +} + +static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D) +{ + register uint32 x = ((A & qcolorMask) >> 2) + + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2); + register uint32 y = (A & qlowpixelMask) + + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask); + + y = (y >> 2) & qlowpixelMask; + return x + y; +} + +#define BLUE_MASK565 0x001F001F +#define RED_MASK565 0xF800F800 +#define GREEN_MASK565 0x07E007E0 + +#define BLUE_MASK555 0x001F001F +#define RED_MASK555 0x7C007C00 +#define GREEN_MASK555 0x03E003E0 + +void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, + uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint16 *bP; + uint8 *dP; + uint32 inc_bP; + + { + uint32 Nextline = srcPitch >> 1; + inc_bP = 1; + + while (height--) { + bP = (uint16 *)srcPtr; + dP = (uint8 *)dstPtr; + + for (uint32 finish = width; finish; finish -= inc_bP) { + uint32 color4, color5, color6; + uint32 color1, color2, color3; + uint32 colorA0, colorA1, colorA2, colorA3, colorB0, colorB1, colorB2, colorB3, colorS1, colorS2; + uint32 product1a, product1b, product2a, product2b; + +//--------------------------------------- B1 B2 +// 4 5 6 S2 +// 1 2 3 S1 +// A1 A2 + + colorB0 = *(bP - Nextline - 1); + colorB1 = *(bP - Nextline); + colorB2 = *(bP - Nextline + 1); + colorB3 = *(bP - Nextline + 2); + + color4 = *(bP - 1); + color5 = *(bP); + color6 = *(bP + 1); + colorS2 = *(bP + 2); + + color1 = *(bP + Nextline - 1); + color2 = *(bP + Nextline); + color3 = *(bP + Nextline + 1); + colorS1 = *(bP + Nextline + 2); + + colorA0 = *(bP + Nextline + Nextline - 1); + colorA1 = *(bP + Nextline + Nextline); + colorA2 = *(bP + Nextline + Nextline + 1); + colorA3 = *(bP + Nextline + Nextline + 2); + +//-------------------------------------- + if (color2 == color6 && color5 != color3) { + product2b = product1b = color2; + } else if (color5 == color3 && color2 != color6) { + product2b = product1b = color5; + } else if (color5 == color3 && color2 == color6) { + register int r = 0; + + r += GetResult(color6, color5, color1, colorA1); + r += GetResult(color6, color5, color4, colorB1); + r += GetResult(color6, color5, colorA2, colorS1); + r += GetResult(color6, color5, colorB2, colorS2); + + if (r > 0) + product2b = product1b = color6; + else if (r < 0) + product2b = product1b = color5; + else { + product2b = product1b = INTERPOLATE(color5, color6); + } + } else { + if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) + product2b = Q_INTERPOLATE(color3, color3, color3, color2); + else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3) + product2b = Q_INTERPOLATE(color2, color2, color2, color3); + else + product2b = INTERPOLATE(color2, color3); + + if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0) + product1b = Q_INTERPOLATE(color6, color6, color6, color5); + else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3) + product1b = Q_INTERPOLATE(color6, color5, color5, color5); + else + product1b = INTERPOLATE(color5, color6); + } + + if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2) + product2a = INTERPOLATE(color2, color5); + else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0) + product2a = INTERPOLATE(color2, color5); + else + product2a = color2; + + if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2) + product1a = INTERPOLATE(color2, color5); + else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0) + product1a = INTERPOLATE(color2, color5); + else + product1a = color5; + +#ifdef SCUMM_LITTLE_ENDIAN + product1a = product1a | (product1b << 16); + product2a = product2a | (product2b << 16); +#endif + +#ifdef SCUMM_BIG_ENDIAN + product1a = product1b | (product1a << 16); + product2a = product2b | (product2a << 16); +#endif + *((uint32 *)dP) = product1a; + *((uint32 *)(dP + dstPitch)) = product2a; + + bP += inc_bP; + dP += sizeof(uint32); + } // end of for ( finish= width etc..) + + srcPtr += srcPitch; + dstPtr += dstPitch * 2; + deltaPtr += srcPitch; + } // while (height--) + } +} + +void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint8 *dP; + uint16 *bP; + uint32 inc_bP; + + { + inc_bP = 1; + + uint32 Nextline = srcPitch >> 1; + + while (height--) { + bP = (uint16 *)srcPtr; + dP = dstPtr; + for (uint32 finish = width; finish; finish -= inc_bP) { + uint32 color4, color5, color6; + uint32 color1, color2, color3; + uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2; + uint32 product1a, product1b, product2a, product2b; + + colorB1 = *(bP - Nextline); + colorB2 = *(bP - Nextline + 1); + + color4 = *(bP - 1); + color5 = *(bP); + color6 = *(bP + 1); + colorS2 = *(bP + 2); + + color1 = *(bP + Nextline - 1); + color2 = *(bP + Nextline); + color3 = *(bP + Nextline + 1); + colorS1 = *(bP + Nextline + 2); + + colorA1 = *(bP + Nextline + Nextline); + colorA2 = *(bP + Nextline + Nextline + 1); + + // -------------------------------------- + if (color2 == color6 && color5 != color3) { + product1b = product2a = color2; + if ((color1 == color2) || (color6 == colorB2)) { + product1a = INTERPOLATE(color2, color5); + product1a = INTERPOLATE(color2, product1a); + } else { + product1a = INTERPOLATE(color5, color6); + } + + if ((color6 == colorS2) || (color2 == colorA1)) { + product2b = INTERPOLATE(color2, color3); + product2b = INTERPOLATE(color2, product2b); + } else { + product2b = INTERPOLATE(color2, color3); + } + } else if (color5 == color3 && color2 != color6) { + product2b = product1a = color5; + + if ((colorB1 == color5) || (color3 == colorS1)) { + product1b = INTERPOLATE(color5, color6); + product1b = INTERPOLATE(color5, product1b); + } else { + product1b = INTERPOLATE(color5, color6); + } + + if ((color3 == colorA2) || (color4 == color5)) { + product2a = INTERPOLATE(color5, color2); + product2a = INTERPOLATE(color5, product2a); + } else { + product2a = INTERPOLATE(color2, color3); + } + + } else if (color5 == color3 && color2 == color6) { + register int r = 0; + + r += GetResult(color6, color5, color1, colorA1); + r += GetResult(color6, color5, color4, colorB1); + r += GetResult(color6, color5, colorA2, colorS1); + r += GetResult(color6, color5, colorB2, colorS2); + + if (r > 0) { + product1b = product2a = color2; + product1a = product2b = INTERPOLATE(color5, color6); + } else if (r < 0) { + product2b = product1a = color5; + product1b = product2a = INTERPOLATE(color5, color6); + } else { + product2b = product1a = color5; + product1b = product2a = color2; + } + } else { + product2b = product1a = INTERPOLATE(color2, color6); + product2b = Q_INTERPOLATE(color3, color3, color3, product2b); + product1a = Q_INTERPOLATE(color5, color5, color5, product1a); + + product2a = product1b = INTERPOLATE(color5, color3); + product2a = Q_INTERPOLATE(color2, color2, color2, product2a); + product1b = Q_INTERPOLATE(color6, color6, color6, product1b); + } +#ifdef SCUMM_LITTLE_ENDIAN + product1a = product1a | (product1b << 16); + product2a = product2a | (product2b << 16); +#endif + +#ifdef SCUMM_BIG_ENDIAN + product1a = product1b | (product1a << 16); + product2a = product2b | (product2a << 16); +#endif + *((uint32 *)dP) = product1a; + *((uint32 *)(dP + dstPitch)) = product2a; + + bP += inc_bP; + dP += sizeof(uint32); + } // end of for ( finish= width etc..) + + srcPtr += srcPitch; + dstPtr += dstPitch * 2; + deltaPtr += srcPitch; + } // endof: while (height--) + } +} + +void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height) +{ + uint8 *dP; + uint16 *bP; + uint32 inc_bP; + + + { + inc_bP = 1; + + uint32 Nextline = srcPitch >> 1; + + while (height--) { + bP = (uint16 *)srcPtr; + dP = dstPtr; + + for (uint32 finish = width; finish; finish -= inc_bP) { + + register uint32 colorA, colorB; + uint32 colorC, colorD, + colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP; + uint32 product, product1, product2; + +//--------------------------------------- +// Map of the pixels: I|E F|J +// G|A B|K +// H|C D|L +// M|N O|P + colorI = *(bP - Nextline - 1); + colorE = *(bP - Nextline); + colorF = *(bP - Nextline + 1); + colorJ = *(bP - Nextline + 2); + + colorG = *(bP - 1); + colorA = *(bP); + colorB = *(bP + 1); + colorK = *(bP + 2); + + colorH = *(bP + Nextline - 1); + colorC = *(bP + Nextline); + colorD = *(bP + Nextline + 1); + colorL = *(bP + Nextline + 2); + + colorM = *(bP + Nextline + Nextline - 1); + colorN = *(bP + Nextline + Nextline); + colorO = *(bP + Nextline + Nextline + 1); + colorP = *(bP + Nextline + Nextline + 2); + + if ((colorA == colorD) && (colorB != colorC)) { + if (((colorA == colorE) && (colorB == colorL)) || ((colorA == colorC) && (colorA == colorF) + && (colorB != colorE) + && (colorB == colorJ))) { + product = colorA; + } else { + product = INTERPOLATE(colorA, colorB); + } + + if (((colorA == colorG) && (colorC == colorO)) || ((colorA == colorB) && (colorA == colorH) + && (colorG != colorC) + && (colorC == colorM))) { + product1 = colorA; + } else { + product1 = INTERPOLATE(colorA, colorC); + } + product2 = colorA; + } else if ((colorB == colorC) && (colorA != colorD)) { + if (((colorB == colorF) && (colorA == colorH)) || ((colorB == colorE) && (colorB == colorD) + && (colorA != colorF) + && (colorA == colorI))) { + product = colorB; + } else { + product = INTERPOLATE(colorA, colorB); + } + + if (((colorC == colorH) && (colorA == colorF)) || ((colorC == colorG) && (colorC == colorD) + && (colorA != colorH) + && (colorA == colorI))) { + product1 = colorC; + } else { + product1 = INTERPOLATE(colorA, colorC); + } + product2 = colorB; + } else if ((colorA == colorD) && (colorB == colorC)) { + if (colorA == colorB) { + product = colorA; + product1 = colorA; + product2 = colorA; + } else { + register int r = 0; + + product1 = INTERPOLATE(colorA, colorC); + product = INTERPOLATE(colorA, colorB); + + r += GetResult1(colorA, colorB, colorG, colorE, colorI); + r += GetResult2(colorB, colorA, colorK, colorF, colorJ); + r += GetResult2(colorB, colorA, colorH, colorN, colorM); + r += GetResult1(colorA, colorB, colorL, colorO, colorP); + + if (r > 0) + product2 = colorA; + else if (r < 0) + product2 = colorB; + else { + product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD); + } + } + } else { + product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD); + + if ((colorA == colorC) && (colorA == colorF) + && (colorB != colorE) && (colorB == colorJ)) { + product = colorA; + } else if ((colorB == colorE) && (colorB == colorD) + && (colorA != colorF) && (colorA == colorI)) { + product = colorB; + } else { + product = INTERPOLATE(colorA, colorB); + } + + if ((colorA == colorB) && (colorA == colorH) + && (colorG != colorC) && (colorC == colorM)) { + product1 = colorA; + } else if ((colorC == colorG) && (colorC == colorD) + && (colorA != colorH) && (colorA == colorI)) { + product1 = colorC; + } else { + product1 = INTERPOLATE(colorA, colorC); + } + } + +#ifdef SCUMM_LITTLE_ENDIAN + product = colorA | (product << 16); + product1 = product1 | (product2 << 16); +#endif + +#ifdef SCUMM_BIG_ENDIAN + product = (colorA << 16) | product; + product1 = (product1 << 16) | product2; +#endif + *((int32 *)dP) = product; + *((uint32 *)(dP + dstPitch)) = product1; + + bP += inc_bP; + dP += sizeof(uint32); + } // end of for ( finish= width etc..) + + srcPtr += srcPitch; + dstPtr += dstPitch * 2; + deltaPtr += srcPitch; + } // endof: while (height--) + } +} + +static uint32 Bilinear(uint32 A, uint32 B, uint32 x) +{ + unsigned long areaA, areaB; + unsigned long result; + + if (A == B) + return A; + + areaB = (x >> 11) & 0x1f; // reduce 16 bit fraction to 5 bits + areaA = 0x20 - areaB; + + A = (A & redblueMask) | ((A & greenMask) << 16); + B = (B & redblueMask) | ((B & greenMask) << 16); + + result = ((areaA * A) + (areaB * B)) >> 5; + + return (result & redblueMask) | ((result >> 16) & greenMask); + +} + +static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x, uint32 y) +{ + unsigned long areaA, areaB, areaC, areaD; + unsigned long result, xy; + + x = (x >> 11) & 0x1f; + y = (y >> 11) & 0x1f; + xy = (x * y) >> 5; + + A = (A & redblueMask) | ((A & greenMask) << 16); + B = (B & redblueMask) | ((B & greenMask) << 16); + C = (C & redblueMask) | ((C & greenMask) << 16); + D = (D & redblueMask) | ((D & greenMask) << 16); + + areaA = 0x20 + xy - x - y; + areaB = x - xy; + areaC = y - xy; + areaD = xy; + + result = ((areaA * A) + (areaB * B) + (areaC * C) + (areaD * D)) >> 5; + + return (result & redblueMask) | ((result >> 16) & greenMask); +} + +void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 * /* deltaPtr */ , + uint8 *dstPtr, uint32 dstPitch, + uint32 dstWidth, uint32 dstHeight, int width, int height) +{ + uint8 *dP; + uint16 *bP; + + uint32 w; + uint32 h; + uint32 dw; + uint32 dh; + uint32 hfinish; + uint32 wfinish; + + uint32 Nextline = srcPitch >> 1; + + wfinish = (width - 1) << 16; // convert to fixed point + dw = wfinish / (dstWidth - 1); + hfinish = (height - 1) << 16; // convert to fixed point + dh = hfinish / (dstHeight - 1); + + for (h = 0; h < hfinish; h += dh) { + uint32 y1, y2; + + y1 = h & 0xffff; // fraction part of fixed point + bP = (uint16 *)(srcPtr + ((h >> 16) * srcPitch)); + dP = dstPtr; + y2 = 0x10000 - y1; + + w = 0; + + for (; w < wfinish;) { + uint32 A, B, C, D; + uint32 E, F, G, H; + uint32 I, J, K, L; + uint32 x1, x2, a1, f1, f2; + uint32 position, product1; + + position = w >> 16; + A = bP[position]; // current pixel + B = bP[position + 1]; // next pixel + C = bP[position + Nextline]; + D = bP[position + Nextline + 1]; + E = bP[position - Nextline]; + F = bP[position - Nextline + 1]; + G = bP[position - 1]; + H = bP[position + Nextline - 1]; + I = bP[position + 2]; + J = bP[position + Nextline + 2]; + K = bP[position + Nextline + Nextline]; + L = bP[position + Nextline + Nextline + 1]; + + x1 = w & 0xffff; // fraction part of fixed point + x2 = 0x10000 - x1; + + /*0 */ + if (A == B && C == D && A == C) + product1 = A; + else + /*1 */ + if (A == D && B != C) { + f1 = (x1 >> 1) + (0x10000 >> 2); + f2 = (y1 >> 1) + (0x10000 >> 2); + if (y1 <= f1 && A == J && A != E) // close to B + { + a1 = f1 - y1; + product1 = Bilinear(A, B, a1); + } else if (y1 >= f1 && A == G && A != L) // close to C + { + a1 = y1 - f1; + product1 = Bilinear(A, C, a1); + } else if (x1 >= f2 && A == E && A != J) // close to B + { + a1 = x1 - f2; + product1 = Bilinear(A, B, a1); + } else if (x1 <= f2 && A == L && A != G) // close to C + { + a1 = f2 - x1; + product1 = Bilinear(A, C, a1); + } else if (y1 >= x1) // close to C + { + a1 = y1 - x1; + product1 = Bilinear(A, C, a1); + } else if (y1 <= x1) // close to B + { + a1 = x1 - y1; + product1 = Bilinear(A, B, a1); + } + } else + /*2 */ + if (B == C && A != D) { + f1 = (x1 >> 1) + (0x10000 >> 2); + f2 = (y1 >> 1) + (0x10000 >> 2); + if (y2 >= f1 && B == H && B != F) // close to A + { + a1 = y2 - f1; + product1 = Bilinear(B, A, a1); + } else if (y2 <= f1 && B == I && B != K) // close to D + { + a1 = f1 - y2; + product1 = Bilinear(B, D, a1); + } else if (x2 >= f2 && B == F && B != H) // close to A + { + a1 = x2 - f2; + product1 = Bilinear(B, A, a1); + } else if (x2 <= f2 && B == K && B != I) // close to D + { + a1 = f2 - x2; + product1 = Bilinear(B, D, a1); + } else if (y2 >= x1) // close to A + { + a1 = y2 - x1; + product1 = Bilinear(B, A, a1); + } else if (y2 <= x1) // close to D + { + a1 = x1 - y2; + product1 = Bilinear(B, D, a1); + } + } + /*3 */ + else { + product1 = Bilinear4(A, B, C, D, x1, y1); + } + +//end First Pixel + *(uint32 *)dP = product1; + dP += 2; + w += dw; + } + dstPtr += dstPitch; + } +} + +void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, + int width, int height) +{ + unsigned int nextlineSrc = srcPitch / sizeof(short); + short *p = (short *)srcPtr; + + unsigned nextlineDst = dstPitch / sizeof(short); + short *q = (short *)dstPtr; + + while (height--) { + for (int i = 0; i < width; ++i) { + // short A = *(p + i - nextlineSrc - 1); + short B = *(p + i - nextlineSrc); + // short C = *(p + i - nextlineSrc + 1); + short D = *(p + i - 1); + short E = *(p + i); + short F = *(p + i + 1); + // short G = *(p + i + nextlineSrc - 1); + short H = *(p + i + nextlineSrc); + // short I = *(p + i + nextlineSrc + 1); + + *(q + (i << 1)) = D == B && B != F && D != H ? D : E; + *(q + (i << 1) + 1) = B == F && B != D && F != H ? F : E; + *(q + (i << 1) + nextlineDst) = D == H && D != B && H != F ? D : E; + *(q + (i << 1) + nextlineDst + 1) = H == F && D != H && B != F ? F : E; + } + p += nextlineSrc; + q += nextlineDst << 1; + } +} + + +/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ +void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, + int width, int height) +{ + uint8 *r; + + while (height--) { + r = dstPtr; + for (int i = 0; i < width; ++i, ++r) { + uint8 color = *(srcPtr + i); + + *r = color; + } + srcPtr += srcPitch; + dstPtr += dstPitch; + } +} + +/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ +void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, + int width, int height) +{ + uint8 *r; + + while (height--) { + r = dstPtr; + for (int i = 0; i < width; ++i, r += 2) { + uint8 color = *(srcPtr + i); + + *(r) = color; + *(r + 1) = color; + *(r + dstPitch) = color; + *(r + dstPitch + 1) = color; + } + srcPtr += srcPitch; + dstPtr += dstPitch << 1; + } +} + +/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */ +void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, + int width, int height) +{ + uint8 *r; + uint32 dstPitch2 = dstPitch << 1; + + while (height--) { + r = dstPtr; + for (int i = 0; i < width; ++i, r += 3) { + uint8 color = *(srcPtr + i); + + *(r + 0) = color; + *(r + 1) = color; + *(r + 2) = color; + *(r + 0 + dstPitch) = color; + *(r + 1 + dstPitch) = color; + *(r + 2 + dstPitch) = color; + *(r + 0 + dstPitch2) = color; + *(r + 1 + dstPitch2) = color; + *(r + 2 + dstPitch2) = color; + } + srcPtr += srcPitch; + dstPtr += dstPitch * 3; + } +} diff --git a/scumm/scaler.h b/scumm/scaler.h new file mode 100644 index 0000000000..f3675ccdce --- /dev/null +++ b/scumm/scaler.h @@ -0,0 +1,40 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef SCALER_H +#define SCALER_H + +extern int Init_2xSaI (uint32 BitFormat); +extern void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr, + uint32 dstPitch, int width, int height); +extern void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height); +extern void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, + uint8 *dstPtr, uint32 dstPitch, int width, int height); +extern void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, + uint8 *dstPtr, uint32 dstPitch, int width, int height); +extern void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, + uint8 *dstPtr, uint32 dstPitch, int width, int height); +extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, + uint8 *dstPtr, uint32 dstPitch, int width, int height); +extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, + uint8 *dstPtr, uint32 dstPitch, int width, int height); + +#endif diff --git a/scumm/script.cpp b/scumm/script.cpp new file mode 100644 index 0000000000..f46bd4bb24 --- /dev/null +++ b/scumm/script.cpp @@ -0,0 +1,1113 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "resource.h" + +/* Script status type (slot.status) */ +enum { + ssDead = 0, + ssPaused = 1, + ssRunning = 2 +}; + + +/* Start executing script 'script' with parameters 'a' and 'b' */ +void Scumm::runScript(int script, int a, int b, int16 *lvarptr) +{ + byte *scriptPtr; + uint32 scriptOffs; + byte scriptType; + int slot; + ScriptSlot *s; + + + if (script == 0) + return; + + if (b == 0) + stopScriptNr(script); + + if (script < _numGlobalScripts) { + scriptPtr = getResourceAddress(rtScript, script); + scriptOffs = _resourceHeaderSize; + scriptType = WIO_GLOBAL; + } else { + scriptOffs = _localScriptList[script - _numGlobalScripts]; + if (scriptOffs == 0) + error("Local script %d is not in room %d", script, _roomResource); + scriptType = WIO_LOCAL; + } + + slot = getScriptSlot(); + + s = &vm.slot[slot]; + s->number = script; + s->offs = scriptOffs; + s->status = 2; + s->where = scriptType; + s->unk1 = a; + s->unk2 = b; + s->freezeCount = 0; + + initializeLocals(slot, lvarptr); + + runScriptNested(slot); +} + +/* Stop script 'script' */ +void Scumm::stopScriptNr(int script) +{ + ScriptSlot *ss; + NestedScript *nest; + int i, num; + + if (script == 0) + return; + + ss = &vm.slot[1]; + + for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (script != ss->number || ss->where != WIO_GLOBAL && ss->where != WIO_LOCAL || ss->status == 0) + continue; + + if (ss->cutsceneOverride) + error("Script %d stopped with active cutscene/override", script); + ss->number = 0; + ss->status = ssDead; + if (_currentScript == i) + _currentScript = 0xFF; + } + + if (_numNestedScripts == 0) + return; + + nest = &vm.nest[0]; + num = _numNestedScripts; + + do { + if (nest->number == script && (nest->where == WIO_GLOBAL || nest->where == WIO_LOCAL)) { + nest->number = 0xFF; + nest->slot = 0xFF; + nest->where = 0xFF; + } + } while (nest++, --num); +} + +/* Stop an object script 'script'*/ +void Scumm::stopObjectScript(int script) +{ + ScriptSlot *ss; + NestedScript *nest; + int i, num; + + if (script == 0) + return; + + ss = &vm.slot[1]; + + for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (script == ss->number && (ss->where == WIO_ROOM || + ss->where == WIO_INVENTORY || ss->where == WIO_FLOBJECT) + && ss->status != 0) { + if (ss->cutsceneOverride) + error("Object %d stopped with active cutscene/override", script); + ss->number = 0; + ss->status = ssDead; + if (_currentScript == i) + _currentScript = 0xFF; + } + } + + if (_numNestedScripts == 0) + return; + + nest = &vm.nest[0]; + num = _numNestedScripts; + + do { + if (nest->number == script && + (nest->where == WIO_ROOM || nest->where == WIO_FLOBJECT || nest->where == WIO_INVENTORY)) { + nest->number = 0xFF; + nest->slot = 0xFF; + nest->where = 0xFF; + } + } while (nest++, --num); +} + +/* Return a free script slot */ +int Scumm::getScriptSlot() +{ + ScriptSlot *ss; + int i; + ss = &vm.slot[1]; + + for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (ss->status == 0) + return i; + } + error("Too many scripts running, %d max", NUM_SCRIPT_SLOT); + return -1; +} + +/* Run script 'script' nested - eg, within the parent script.*/ +void Scumm::runScriptNested(int script) +{ + NestedScript *nest; + ScriptSlot *slot; + + updateScriptPtr(); + + nest = &vm.nest[_numNestedScripts]; + + if (_currentScript == 0xFF) { + nest->number = 0xFF; + nest->where = 0xFF; + } else { + slot = &vm.slot[_currentScript]; + nest->number = slot->number; + nest->where = slot->where; + nest->slot = _currentScript; + } + + if (++_numNestedScripts > sizeof(vm.nest) / sizeof(vm.nest[0])) + error("Too many nested scripts"); + + _currentScript = script; + + getScriptBaseAddress(); + getScriptEntryPoint(); + executeScript(); + + _numNestedScripts--; + + nest = &vm.nest[_numNestedScripts]; + + if (nest->number != 0xFF) { + slot = &vm.slot[nest->slot]; + if (slot->number == nest->number && slot->where == nest->where && + slot->status != 0 && slot->freezeCount == 0) { + _currentScript = nest->slot; + getScriptBaseAddress(); + getScriptEntryPoint(); + return; + } + } + _currentScript = 0xFF; +} + +void Scumm::updateScriptPtr() +{ + if (_currentScript == 0xFF) + return; + + vm.slot[_currentScript].offs = _scriptPointer - _scriptOrgPointer; +} + +/* Get the code pointer to a script */ +void Scumm::getScriptBaseAddress() +{ + ScriptSlot *ss; + int idx; + + if (_currentScript == 0xFF) + return; + + ss = &vm.slot[_currentScript]; + switch (ss->where) { + case WIO_INVENTORY: /* inventory script * */ + idx = getObjectIndex(ss->number); + _scriptOrgPointer = getResourceAddress(rtInventory, idx); + _lastCodePtr = &_baseInventoryItems[idx]; + break; + + case 3: + case WIO_ROOM: /* room script */ + _scriptOrgPointer = getResourceAddress(rtRoom, _roomResource); + _lastCodePtr = &_baseRooms[_roomResource]; + break; + + case WIO_GLOBAL: /* global script */ + _scriptOrgPointer = getResourceAddress(rtScript, ss->number); + _lastCodePtr = &_baseScripts[ss->number]; + break; + + case WIO_FLOBJECT: /* flobject script */ + idx = getObjectIndex(ss->number); + _scriptOrgPointer = getResourceAddress(rtFlObject, _objs[idx].fl_object_index); + _lastCodePtr = &_baseFLObject[ss->number]; + break; + default: + error("Bad type while getting base address"); + } +} + + +void Scumm::getScriptEntryPoint() +{ + if (_currentScript == 0xFF) + return; + _scriptPointer = _scriptOrgPointer + vm.slot[_currentScript].offs; +} + +/* Execute a script - Read opcode, and execute it from the table */ +void Scumm::executeScript() +{ + + OpcodeProc op; + while (_currentScript != 0xFF) { + _opcode = fetchScriptByte(); + _scriptPointerStart = _scriptPointer; + vm.slot[_currentScript].didexec = 1; + debug(8, "Script %d: [%X] %s()", vm.slot[_currentScript].number, _opcode, _opcodes_lookup[_opcode]); + op = getOpcode(_opcode); + (this->*op) (); + } +CHECK_HEAP} + +byte Scumm::fetchScriptByte() +{ + if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { + uint32 oldoffs = _scriptPointer - _scriptOrgPointer; + getScriptBaseAddress(); + _scriptPointer = _scriptOrgPointer + oldoffs; + } + return *_scriptPointer++; +} + +int Scumm::fetchScriptWord() +{ + int a; + if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { + uint32 oldoffs = _scriptPointer - _scriptOrgPointer; + getScriptBaseAddress(); + _scriptPointer = _scriptOrgPointer + oldoffs; + } + a = READ_LE_UINT16(_scriptPointer); + _scriptPointer += 2; + return a; +} + +#ifndef BYPASS_COPY_PROT +#define BYPASS_COPY_PROT +#endif + +int Scumm::readVar(uint var) +{ + int a; +#ifdef BYPASS_COPY_PROT + static byte copyprotbypassed; +#endif + debug(9, "readvar=%d", var); + if (!(var & 0xF000)) { +#if defined(BYPASS_COPY_PROT) + if (var == 490 && _gameId == GID_MONKEY2 && !copyprotbypassed) { + copyprotbypassed = true; + var = 518; + } +#endif + checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); + return _vars[var]; + } + + if (var & 0x2000 && !(_features & GF_NEW_OPCODES)) { + a = fetchScriptWord(); + if (a & 0x2000) + var = (var + readVar(a & ~0x2000)) & ~0x2000; + else + var = (var + (a & 0xFFF)) & ~0x2000; + } + + if (!(var & 0xF000)) + return _vars[var]; + + if (var & 0x8000) { + if (_gameId == GID_ZAK256) { + // Emulate a wierd hack in Zak256 to read individual + // bits of a normal global + int b = (var & 0x000F); + var &= 0x0FFF; + var >>= 4; + checkRange(_numVariables - 1, 0, var, "Variable %d out of range(rzb)"); + return (_vars[ var ] & ( 1 << b ) ) ? 1 : 0; + } + + var &= 0x7FFF; + checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(r)"); + return (_bitVars[var >> 3] & (1 << (var & 7))) ? 1 : 0; + } + + if (var & 0x4000) { + var &= 0xFFF; + checkRange(0x10, 0, var, "Local variable %d out of range(r)"); + return vm.localvar[_currentScript][var]; + } + + error("Illegal varbits (r)"); + return -1; +} + +void Scumm::writeVar(uint var, int value) +{ + if (!(var & 0xF000)) { + checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)"); + + // FIXME: Find some better place to put this. + if (var == VAR_CHARINC) + _vars[VAR_CHARINC] = _defaultTalkDelay / 20; + else + _vars[var] = value; + + if ((_varwatch == (int)var) || (_varwatch == 0)) { + if (vm.slot[_currentScript].number < 100) + debug(0, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); + else + debug(0, "vars[%d] = %d (via room-%d-%d)", var, value, _currentRoom, + vm.slot[_currentScript].number); + } + return; + } + + if (var & 0x8000) { + if (_gameId == GID_ZAK256) { + // Emulate a wierd hack in Zak256 to read individual + // bits of a normal global + int b = (var & 0x000F); + var &= 0x7FFF; + var >>= 4; + checkRange(_numVariables - 1, 0, var, "Variable %d out of range(wzb)"); + if(value) + _vars[ var ] |= ( 1 << b ); + else + _vars[ var ] &= ~( 1 << b ); + return; + } + var &= 0x7FFF; + checkRange(_numBitVariables - 1, 0, var, "Bit variable %d out of range(w)"); + + /* FIXME: Enable Indy4 mousefighting by default. + is there a better place to put this? */ + if (_gameId == GID_INDY4 && var == 107 && vm.slot[_currentScript].number == 1) + value = 1; + + if (value) + _bitVars[var >> 3] |= (1 << (var & 7)); + else + _bitVars[var >> 3] &= ~(1 << (var & 7)); + return; + } + + if (var & 0x4000) { + var &= 0xFFF; + checkRange(0x10, 0, var, "Local variable %d out of range(w)"); + vm.localvar[_currentScript][var] = value; + return; + } + + error("Illegal varbits (w)"); +} + +void Scumm::getResultPos() +{ + int a; + + _resultVarNumber = fetchScriptWord(); + if (_resultVarNumber & 0x2000) { + a = fetchScriptWord(); + if (a & 0x2000) { + _resultVarNumber += readVar(a & ~0x2000); + } else { + _resultVarNumber += a & 0xFFF; + } + _resultVarNumber &= ~0x2000; + } +} + +void Scumm::setResult(int value) +{ + writeVar(_resultVarNumber, value); +} + +void Scumm::drawBox(int x, int y, int x2, int y2, int color) +{ + int top, bottom, count; + VirtScreen *vs; + byte *backbuff, *bgbuff; + + if ((vs = findVirtScreen(y)) == NULL) + return; + + top = vs->topline; + bottom = top + vs->height; + + if (x > x2) + SWAP(x, x2); + + if (y > y2) + SWAP(y, y2); + + x2++; + y2++; + + if (x > 319) + return; + if (x < 0) + x = 0; + if (y < 0) + y = 0; + if (x2 < 0) + return; + if (x2 > 320) + x2 = 320; + if (y2 > bottom) + y2 = bottom; + + updateDirtyRect(vs->number, x, x2, y - top, y2 - top, 0); + + backbuff = vs->screenPtr + vs->xstart + (y - top) * 320 + x; + + if (color == -1) { + if (vs->number != 0) + error("can only copy bg to main window"); + bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * 320 + x; + blit(backbuff, bgbuff, x2 - x, y2 - y); + } else { + count = y2 - y; + while (count) { + memset(backbuff, color, x2 - x); + backbuff += 320; + count--; + } + } +} + + +void Scumm::stopObjectCode() +{ + ScriptSlot *ss; + + ss = &vm.slot[_currentScript]; + if (ss->cutsceneOverride == 255) { /* FIXME: What does this? */ + warning("Cutscene for script %d has overflown. Resetting.", ss->number); + ss->cutsceneOverride = 0; + } + + if (ss->where != WIO_GLOBAL && ss->where != WIO_LOCAL) { + if (ss->cutsceneOverride) { + warning("Object %d ending with active cutscene/override", ss->number); + ss->cutsceneOverride = 0; + } + } else { + if (ss->cutsceneOverride) { + warning("Script %d ending with active cutscene/override (%d)", ss->number, ss->cutsceneOverride); + ss->cutsceneOverride = 0; + } + } + ss->number = 0; + ss->status = 0; + _currentScript = 0xFF; +} + +bool Scumm::isScriptInUse(int script) +{ + ScriptSlot *ss; + int i; + + ss = vm.slot; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (ss->number == script) + return true; + } + return false; +} + + +void Scumm::runHook(int i) +{ + int16 tmp[16]; + tmp[0] = i; + if (_vars[VAR_HOOK_SCRIPT]) { + runScript(_vars[VAR_HOOK_SCRIPT], 0, 0, tmp); + } +} + +void Scumm::freezeScripts(int flag) +{ + int i; + + for (i = 1; i < NUM_SCRIPT_SLOT; i++) { + if (_currentScript != i && vm.slot[i].status != ssDead && (vm.slot[i].unk1 == 0 || flag >= 0x80)) { + vm.slot[i].status |= 0x80; + vm.slot[i].freezeCount++; + } + } + + for (i = 0; i < 6; i++) + sentence[i].unk++; + + if (vm.cutSceneScriptIndex != 0xFF) { + vm.slot[vm.cutSceneScriptIndex].status &= 0x7F; + vm.slot[vm.cutSceneScriptIndex].freezeCount = 0; + } +} + +void Scumm::unfreezeScripts() +{ + int i; + for (i = 1; i < NUM_SCRIPT_SLOT; i++) { + if (vm.slot[i].status & 0x80) { + if (!--vm.slot[i].freezeCount) { + vm.slot[i].status &= 0x7F; + } + } + } + + for (i = 0; i < 6; i++) { + if (((int8)--sentence[i].unk) < 0) + sentence[i].unk = 0; + } +} + +void Scumm::runAllScripts() +{ + int i; + + for (i = 0; i < NUM_SCRIPT_SLOT; i++) + vm.slot[i].didexec = 0; + + _currentScript = 0xFF; + for (_curExecScript = 0; _curExecScript < NUM_SCRIPT_SLOT; _curExecScript++) { + if (vm.slot[_curExecScript].status == ssRunning && vm.slot[_curExecScript].didexec == 0) { + _currentScript = (char)_curExecScript; + getScriptBaseAddress(); + getScriptEntryPoint(); + executeScript(); + } + } +} + +void Scumm::runExitScript() +{ + if (_vars[VAR_EXIT_SCRIPT]) + runScript(_vars[VAR_EXIT_SCRIPT], 0, 0, 0); + if (_EXCD_offs) { + int slot = getScriptSlot(); + vm.slot[slot].status = ssRunning; + vm.slot[slot].number = 10001; + vm.slot[slot].where = WIO_ROOM; + vm.slot[slot].offs = _EXCD_offs; + vm.slot[slot].unk1 = 0; + vm.slot[slot].unk2 = 0; + vm.slot[slot].freezeCount = 0; + runScriptNested(slot); + } + if (_vars[VAR_EXIT_SCRIPT2]) + runScript(_vars[VAR_EXIT_SCRIPT2], 0, 0, 0); +} + +void Scumm::runEntryScript() +{ + if (_vars[VAR_ENTRY_SCRIPT]) + runScript(_vars[VAR_ENTRY_SCRIPT], 0, 0, 0); + if (_ENCD_offs) { + int slot = getScriptSlot(); + vm.slot[slot].status = ssRunning; + vm.slot[slot].number = 10002; + vm.slot[slot].where = WIO_ROOM; + vm.slot[slot].offs = _ENCD_offs; + vm.slot[slot].unk1 = 0; + vm.slot[slot].unk2 = 0; + vm.slot[slot].freezeCount = 0; + runScriptNested(slot); + } + if (_vars[VAR_ENTRY_SCRIPT2]) + runScript(_vars[VAR_ENTRY_SCRIPT2], 0, 0, 0); +} + +void Scumm::killScriptsAndResources() +{ + ScriptSlot *ss; + int i; + + ss = &vm.slot[1]; + + for (i = 1; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (ss->where == WIO_ROOM || ss->where == WIO_FLOBJECT) { + if (ss->cutsceneOverride) + error("Object %d stopped with active cutscene/override in exit", ss->number); + ss->status = 0; + } else if (ss->where == WIO_LOCAL) { + if (ss->cutsceneOverride) + error("Script %d stopped with active cutscene/override in exit", ss->number); + ss->status = 0; + } + } + + /* Nuke FL objects */ + i = 0; + do { + if (_objs[i].fl_object_index) + nukeResource(rtFlObject, _objs[i].fl_object_index); + } while (++i <= _numObjectsInRoom); + + /* Nuke local object names */ + if (_newNames) { + for (i = 0; i < _numNewNames; i++) { + int j = _newNames[i]; + if (j && getOwner(j) == 0) { + _newNames[i] = 0; + nukeResource(rtObjectName, i); + } + } + } +} + +void Scumm::checkAndRunVar33() +{ + int i; + ScriptSlot *ss; + + memset(_localParamList, 0, sizeof(_localParamList)); + if (isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) { + ss = vm.slot; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) + if (ss->number == _vars[VAR_SENTENCE_SCRIPT] && ss->status != 0 && ss->freezeCount == 0) + return; + } + + if (!_sentenceNum || sentence[_sentenceNum - 1].unk) + return; + + _sentenceNum--; + + if (!(_features & GF_AFTER_V7)) + if (sentence[_sentenceNum].unk2 && sentence[_sentenceNum].unk3 == sentence[_sentenceNum].unk4) + return; + + _localParamList[0] = sentence[_sentenceNum].unk5; + _localParamList[1] = sentence[_sentenceNum].unk4; + _localParamList[2] = sentence[_sentenceNum].unk3; + _currentScript = 0xFF; + if (_vars[VAR_SENTENCE_SCRIPT]) + runScript(_vars[VAR_SENTENCE_SCRIPT], 0, 0, _localParamList); +} + +void Scumm::runInputScript(int a, int cmd, int mode) +{ + int16 args[16]; + memset(args, 0, sizeof(args)); + args[0] = a; + args[1] = cmd; + args[2] = mode; + if (_vars[VAR_VERB_SCRIPT]) + runScript(_vars[VAR_VERB_SCRIPT], 0, 0, args); +} + +void Scumm::decreaseScriptDelay(int amount) +{ + ScriptSlot *ss = &vm.slot[0]; + int i; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { + if (ss->status == 1) { + ss->delay -= amount; + if (ss->delay < 0) { + ss->status = 2; + ss->delay = 0; + } + } + } +} + +void Scumm::runVerbCode(int object, int entry, int a, int b, int16 *vars) +{ + uint32 obcd; + int slot, where, offs; + + if (!object) + return; + if (!b) + stopObjectScript(object); + + where = whereIsObject(object); + + if (where == WIO_NOT_FOUND) { + warning("Code for object %d not in room %d", object, _roomResource); + return; + } + + obcd = getOBCDOffs(object); + slot = getScriptSlot(); + + offs = getVerbEntrypoint(object, entry); + if (offs == 0) + return; + + vm.slot[slot].number = object; + vm.slot[slot].offs = obcd + offs; + vm.slot[slot].status = ssRunning; + vm.slot[slot].where = where; + vm.slot[slot].unk1 = a; + vm.slot[slot].unk2 = b; + vm.slot[slot].freezeCount = 0; + vm.slot[slot].newfield = 0; + + initializeLocals(slot, vars); + + runScriptNested(slot); +} + +void Scumm::initializeLocals(int slot, int16 *vars) +{ + int i; + if (!vars) { + for (i = 0; i < 16; i++) + vm.localvar[slot][i] = 0; + } else { + for (i = 0; i < 16; i++) + vm.localvar[slot][i] = vars[i]; + } +} + +int Scumm::getVerbEntrypoint(int obj, int entry) +{ + byte *objptr, *verbptr; + int verboffs; + + if (whereIsObject(obj) == WIO_NOT_FOUND) + return 0; + + objptr = getOBCDFromObject(obj); + assert(objptr); + + if (_features & GF_SMALL_HEADER) + verbptr = objptr + 19; + else + verbptr = findResource(MKID('VERB'), objptr); + + if (verbptr == NULL) + error("No verb block in object %d", obj); + + verboffs = verbptr - objptr; + + if (!(_features & GF_SMALL_HEADER)) + verbptr += _resourceHeaderSize; + + do { + if (!*verbptr) + return 0; + if (*verbptr == entry || *verbptr == 0xFF) + break; + verbptr += 3; + } while (1); + + if (_features & GF_SMALL_HEADER) + return READ_LE_UINT16(verbptr + 1); + else + return verboffs + READ_LE_UINT16(verbptr + 1); +} + + +void Scumm::push(int a) +{ + assert(_scummStackPos >= 0 && (unsigned int)_scummStackPos <= ARRAYSIZE(_scummStack)); + _scummStack[_scummStackPos++] = a; +} + +int Scumm::pop() +{ + assert(_scummStackPos > 0 && (unsigned int)_scummStackPos <= ARRAYSIZE(_scummStack)); + return _scummStack[--_scummStackPos]; +} + + +void Scumm::endCutscene() +{ + ScriptSlot *ss = &vm.slot[_currentScript]; + uint32 *csptr; + int16 args[16]; + + memset(args, 0, sizeof(args)); + + if (ss->cutsceneOverride > 0) // Only terminate if active + ss->cutsceneOverride--; + + args[0] = vm.cutSceneData[vm.cutSceneStackPointer]; + _vars[VAR_OVERRIDE] = 0; + + csptr = &vm.cutScenePtr[vm.cutSceneStackPointer]; + if (*csptr && (ss->cutsceneOverride > 0)) // Only terminate if active + ss->cutsceneOverride--; + + vm.cutSceneScript[vm.cutSceneStackPointer] = 0; + *csptr = 0; + vm.cutSceneStackPointer--; + + if (_vars[VAR_CUTSCENE_END_SCRIPT]) + runScript(_vars[VAR_CUTSCENE_END_SCRIPT], 0, 0, args); +} + +void Scumm::cutscene(int16 *args) +{ + int scr = _currentScript; + vm.slot[scr].cutsceneOverride++; + + if (++vm.cutSceneStackPointer > sizeof(vm.cutSceneData) / sizeof(vm.cutSceneData[0])) + error("Cutscene stack overflow"); + + vm.cutSceneData[vm.cutSceneStackPointer] = args[0]; + vm.cutSceneScript[vm.cutSceneStackPointer] = 0; + vm.cutScenePtr[vm.cutSceneStackPointer] = 0; + + vm.cutSceneScriptIndex = scr; + if (_vars[VAR_CUTSCENE_START_SCRIPT]) + runScript(_vars[VAR_CUTSCENE_START_SCRIPT], 0, 0, args); + vm.cutSceneScriptIndex = 0xFF; +} + +void Scumm::faceActorToObj(int act, int obj) +{ + int x, x2, y, dir; + + if (getObjectOrActorXY(act, x, y) == -1) + return; + + if (getObjectOrActorXY(obj, x2, y) == -1) + return; + + dir = (x2 > x) ? 90 : 270; + derefActorSafe(act, "faceActorToObj")->turnToDirection(dir); +} + +bool Scumm::isScriptRunning(int script) +{ + int i; + ScriptSlot *ss = vm.slot; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) + if (ss->number == script && (ss->where == WIO_GLOBAL || ss->where == WIO_LOCAL) && ss->status) + return true; + return false; +} + +bool Scumm::isRoomScriptRunning(int script) +{ + int i; + ScriptSlot *ss = vm.slot; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) + if (ss->number == script && ss->where == WIO_ROOM && ss->status) + return true; + return false; + +} + + +void Scumm::beginOverride() +{ + int idx; + uint32 *ptr; + + idx = vm.cutSceneStackPointer; + ptr = &vm.cutScenePtr[idx]; + + *ptr = _scriptPointer - _scriptOrgPointer; + vm.cutSceneScript[idx] = _currentScript; + + fetchScriptByte(); + fetchScriptWord(); + _vars[VAR_OVERRIDE] = 0; +} + +void Scumm::endOverride() +{ + int idx; + uint32 *ptr; + + idx = vm.cutSceneStackPointer; + ptr = &vm.cutScenePtr[idx]; + + *ptr = 0; + vm.cutSceneScript[idx] = 0; + _vars[VAR_OVERRIDE] = 0; +} + + +int Scumm::defineArray(int array, int type, int dim2, int dim1) +{ + int id; + int size; + ArrayHeader *ah; + + if (type != 5 && type != 4) + type = 5; + + nukeArray(array); + + id = getArrayId(); + + if (array & 0x4000) { + _arrays[id] = (char)vm.slot[_currentScript].number; + } + + if (array & 0x8000) { + error("Can't define bit variable as array pointer"); + } + + writeVar(array, id); + + size = (type == 5) ? 16 : 8; + size *= dim2 + 1; + size *= dim1 + 1; + size >>= 3; + + ah = (ArrayHeader *)createResource(rtString, id, size + sizeof(ArrayHeader)); + + ah->type = type; + ah->dim1_size = dim1 + 1; + ah->dim2_size = dim2 + 1; + + return id; +} + +void Scumm::nukeArray(int a) +{ + int data; + + data = readVar(a); + + if (data) + nukeResource(rtString, data); + _arrays[data] = 0; + + writeVar(a, 0); +} + +int Scumm::getArrayId() +{ + byte **addr = _baseArrays; + int i; + + for (i = 1; i < _numArray; i++) { + if (!addr[i]) + return i; + } + error("Out of array pointers, %d max", _numArray); + return -1; +} + +void Scumm::arrayop_1(int a, byte *ptr) +{ + ArrayHeader *ah; + int r; + int len = getStringLen(ptr); + + r = defineArray(a, 4, 0, len); + ah = (ArrayHeader *)getResourceAddress(rtString, r); + copyString(ah->data, ptr, len); +} + +void Scumm::copyString(byte *dst, byte *src, int len) +{ + if (!src) { + while (--len >= 0) + *dst++ = fetchScriptByte(); + } else { + while (--len >= 0) + *dst++ = *src++; + } +} + +int Scumm::getStringLen(byte *ptr) +{ + int len; + byte c; + if (!ptr) + ptr = _scriptPointer; + len = 0; + do { + c = *ptr++; + if (!c) + break; + len++; + if (c == 0xFF) + ptr += 3, len += 3; + } while (1); + return len + 1; +} + +void Scumm::exitCutscene() +{ + uint32 offs = vm.cutScenePtr[vm.cutSceneStackPointer]; + if (offs) { + ScriptSlot *ss = &vm.slot[vm.cutSceneScript[vm.cutSceneStackPointer]]; + ss->offs = offs; + ss->status = 2; + ss->freezeCount = 0; + + if (ss->cutsceneOverride > 0) + ss->cutsceneOverride--; + + _vars[VAR_OVERRIDE] = 1; + vm.cutScenePtr[vm.cutSceneStackPointer] = 0; + } +} +void Scumm::doSentence(int c, int b, int a) +{ + if (_features & GF_AFTER_V7) { + SentenceTab *st; + + if (b == a) + return; + + st = &sentence[_sentenceNum - 1]; + + if (_sentenceNum && st->unk5 == c && st->unk4 == b && st->unk3 == a) + return; + + _sentenceNum++; + st++; + + st->unk5 = c; + st->unk4 = b; + st->unk3 = a; + st->unk = 0; + + warning("dosentence(%d,%d,%d)", c, b, a); + + } else { + + SentenceTab *st; + + st = &sentence[_sentenceNum++]; + + st->unk5 = c; + st->unk4 = b; + st->unk3 = a; + + if (!(st->unk3 & 0xFF00)) + st->unk2 = 0; + else + st->unk2 = 1; + + st->unk = 0; + } +} diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp new file mode 100644 index 0000000000..333b35120c --- /dev/null +++ b/scumm/script_v1.cpp @@ -0,0 +1,2799 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" + +void Scumm::setupOpcodes() +{ + static const OpcodeProc opcode_list[] = { + /* 00 */ + &Scumm::o5_stopObjectCode, + &Scumm::o5_putActor, + &Scumm::o5_startMusic, + &Scumm::o5_getActorRoom, + /* 04 */ + &Scumm::o5_isGreaterEqual, + &Scumm::o5_drawObject, + &Scumm::o5_getActorElevation, + &Scumm::o5_setState, + /* 08 */ + &Scumm::o5_isNotEqual, + &Scumm::o5_faceActor, + &Scumm::o5_startScript, + &Scumm::o5_getVerbEntrypoint, + /* 0C */ + &Scumm::o5_resourceRoutines, + &Scumm::o5_walkActorToActor, + &Scumm::o5_putActorAtObject, + &Scumm::o5_getObjectState, + /* 10 */ + &Scumm::o5_getObjectOwner, + &Scumm::o5_animateActor, + &Scumm::o5_panCameraTo, + &Scumm::o5_actorSet, + /* 14 */ + &Scumm::o5_print, + &Scumm::o5_actorFromPos, + &Scumm::o5_getRandomNr, + &Scumm::o5_and, + /* 18 */ + &Scumm::o5_jumpRelative, + &Scumm::o5_doSentence, + &Scumm::o5_move, + &Scumm::o5_multiply, + /* 1C */ + &Scumm::o5_startSound, + &Scumm::o5_ifClassOfIs, + &Scumm::o5_walkActorTo, + &Scumm::o5_isActorInBox, + /* 20 */ + &Scumm::o5_stopMusic, + &Scumm::o5_putActor, + &Scumm::o5_getAnimCounter, + &Scumm::o5_getActorY, + /* 24 */ + &Scumm::o5_loadRoomWithEgo, + &Scumm::o5_pickupObject, + &Scumm::o5_setVarRange, + &Scumm::o5_stringOps, + /* 28 */ + &Scumm::o5_equalZero, + &Scumm::o5_setOwnerOf, + &Scumm::o5_startScript, + &Scumm::o5_delayVariable, + /* 2C */ + &Scumm::o5_cursorCommand, + &Scumm::o5_putActorInRoom, + &Scumm::o5_delay, + &Scumm::o5_getObjectState, + /* 30 */ + &Scumm::o5_matrixOps, + &Scumm::o5_getInventoryCount, + &Scumm::o5_setCameraAt, + &Scumm::o5_roomOps, + /* 34 */ + &Scumm::o5_getDist, + &Scumm::o5_findObject, + &Scumm::o5_walkActorToObject, + &Scumm::o5_startObject, + /* 38 */ + &Scumm::o5_lessOrEqual, + &Scumm::o5_doSentence, + &Scumm::o5_subtract, + &Scumm::o5_getActorScale, + /* 3C */ + &Scumm::o5_stopSound, + &Scumm::o5_findInventory, + &Scumm::o5_walkActorTo, + &Scumm::o5_drawBox, + /* 40 */ + &Scumm::o5_cutscene, + &Scumm::o5_putActor, + &Scumm::o5_chainScript, + &Scumm::o5_getActorX, + /* 44 */ + &Scumm::o5_isLess, + &Scumm::o5_drawObject, + &Scumm::o5_increment, + &Scumm::o5_setState, + /* 48 */ + &Scumm::o5_isEqual, + &Scumm::o5_faceActor, + &Scumm::o5_startScript, + &Scumm::o5_getVerbEntrypoint, + /* 4C */ + &Scumm::o5_soundKludge, + &Scumm::o5_walkActorToActor, + &Scumm::o5_putActorAtObject, + &Scumm::o5_badOpcode, + /* 50 */ + &Scumm::o5_pickupObjectOld, + &Scumm::o5_animateActor, + &Scumm::o5_actorFollowCamera, + &Scumm::o5_actorSet, + /* 54 */ + &Scumm::o5_setObjectName, + &Scumm::o5_actorFromPos, + &Scumm::o5_getActorMoving, + &Scumm::o5_or, + /* 58 */ + &Scumm::o5_overRide, + &Scumm::o5_doSentence, + &Scumm::o5_add, + &Scumm::o5_divide, + /* 5C */ + &Scumm::o5_oldRoomEffect, + &Scumm::o5_setClass, + &Scumm::o5_walkActorTo, + &Scumm::o5_isActorInBox, + /* 60 */ + &Scumm::o5_freezeScripts, + &Scumm::o5_putActor, + &Scumm::o5_stopScript, + &Scumm::o5_getActorFacing, + /* 64 */ + &Scumm::o5_loadRoomWithEgo, + &Scumm::o5_pickupObject, + &Scumm::o5_getClosestObjActor, + &Scumm::o5_dummy, + /* 68 */ + &Scumm::o5_getScriptRunning, + &Scumm::o5_setOwnerOf, + &Scumm::o5_startScript, + &Scumm::o5_debug, + /* 6C */ + &Scumm::o5_getActorWidth, + &Scumm::o5_putActorInRoom, + &Scumm::o5_stopObjectScript, + &Scumm::o5_badOpcode, + /* 70 */ + &Scumm::o5_lights, + &Scumm::o5_getActorCostume, + &Scumm::o5_loadRoom, + &Scumm::o5_roomOps, + /* 74 */ + &Scumm::o5_getDist, + &Scumm::o5_findObject, + &Scumm::o5_walkActorToObject, + &Scumm::o5_startObject, + /* 78 */ + &Scumm::o5_isGreater, /* less? */ + &Scumm::o5_doSentence, + &Scumm::o5_verbOps, + &Scumm::o5_getActorWalkBox, + /* 7C */ + &Scumm::o5_isSoundRunning, + &Scumm::o5_findInventory, + &Scumm::o5_walkActorTo, + &Scumm::o5_drawBox, + /* 80 */ + &Scumm::o5_breakHere, + &Scumm::o5_putActor, + &Scumm::o5_startMusic, + &Scumm::o5_getActorRoom, + /* 84 */ + &Scumm::o5_isGreaterEqual, /* less equal? */ + &Scumm::o5_drawObject, + &Scumm::o5_getActorElevation, + &Scumm::o5_setState, + /* 88 */ + &Scumm::o5_isNotEqual, + &Scumm::o5_faceActor, + &Scumm::o5_startScript, + &Scumm::o5_getVerbEntrypoint, + /* 8C */ + &Scumm::o5_resourceRoutines, + &Scumm::o5_walkActorToActor, + &Scumm::o5_putActorAtObject, + &Scumm::o5_getObjectState, + /* 90 */ + &Scumm::o5_getObjectOwner, + &Scumm::o5_animateActor, + &Scumm::o5_panCameraTo, + &Scumm::o5_actorSet, + /* 94 */ + &Scumm::o5_print, + &Scumm::o5_actorFromPos, + &Scumm::o5_getRandomNr, + &Scumm::o5_and, + /* 98 */ + &Scumm::o5_quitPauseRestart, + &Scumm::o5_doSentence, + &Scumm::o5_move, + &Scumm::o5_multiply, + /* 9C */ + &Scumm::o5_startSound, + &Scumm::o5_ifClassOfIs, + &Scumm::o5_walkActorTo, + &Scumm::o5_isActorInBox, + /* A0 */ + &Scumm::o5_stopObjectCode, + &Scumm::o5_putActor, + &Scumm::o5_getAnimCounter, + &Scumm::o5_getActorY, + /* A4 */ + &Scumm::o5_loadRoomWithEgo, + &Scumm::o5_pickupObject, + &Scumm::o5_setVarRange, + &Scumm::o5_dummy, + /* A8 */ + &Scumm::o5_notEqualZero, + &Scumm::o5_setOwnerOf, + &Scumm::o5_startScript, + &Scumm::o5_saveRestoreVerbs, + /* AC */ + &Scumm::o5_expression, + &Scumm::o5_putActorInRoom, + &Scumm::o5_wait, + &Scumm::o5_badOpcode, + /* B0 */ + &Scumm::o5_matrixOps, + &Scumm::o5_getInventoryCount, + &Scumm::o5_setCameraAt, + &Scumm::o5_roomOps, + /* B4 */ + &Scumm::o5_getDist, + &Scumm::o5_findObject, + &Scumm::o5_walkActorToObject, + &Scumm::o5_startObject, + /* B8 */ + &Scumm::o5_lessOrEqual, + &Scumm::o5_doSentence, + &Scumm::o5_subtract, + &Scumm::o5_getActorScale, + /* BC */ + &Scumm::o5_stopSound, + &Scumm::o5_findInventory, + &Scumm::o5_walkActorTo, + &Scumm::o5_drawBox, + /* C0 */ + &Scumm::o5_endCutscene, + &Scumm::o5_putActor, + &Scumm::o5_chainScript, + &Scumm::o5_getActorX, + /* C4 */ + &Scumm::o5_isLess, + &Scumm::o5_drawObject, + &Scumm::o5_decrement, + &Scumm::o5_setState, + /* C8 */ + &Scumm::o5_isEqual, + &Scumm::o5_faceActor, + &Scumm::o5_startScript, + &Scumm::o5_getVerbEntrypoint, + /* CC */ + &Scumm::o5_pseudoRoom, + &Scumm::o5_walkActorToActor, + &Scumm::o5_putActorAtObject, + &Scumm::o5_badOpcode, + /* D0 */ + &Scumm::o5_pickupObjectOld, + &Scumm::o5_animateActor, + &Scumm::o5_actorFollowCamera, + &Scumm::o5_actorSet, + /* D4 */ + &Scumm::o5_setObjectName, + &Scumm::o5_actorFromPos, + &Scumm::o5_getActorMoving, + &Scumm::o5_or, + /* D8 */ + &Scumm::o5_printEgo, + &Scumm::o5_doSentence, + &Scumm::o5_add, + &Scumm::o5_divide, + /* DC */ + &Scumm::o5_oldRoomEffect, + &Scumm::o5_setClass, + &Scumm::o5_walkActorTo, + &Scumm::o5_isActorInBox, + /* E0 */ + &Scumm::o5_freezeScripts, + &Scumm::o5_putActor, + &Scumm::o5_stopScript, + &Scumm::o5_getActorFacing, + /* E4 */ + &Scumm::o5_loadRoomWithEgo, + &Scumm::o5_pickupObject, + &Scumm::o5_getClosestObjActor, + &Scumm::o5_dummy, + /* E8 */ + &Scumm::o5_getScriptRunning, + &Scumm::o5_setOwnerOf, + &Scumm::o5_startScript, + &Scumm::o5_debug, + /* EC */ + &Scumm::o5_getActorWidth, + &Scumm::o5_putActorInRoom, + &Scumm::o5_stopObjectScript, + &Scumm::o5_badOpcode, + /* F0 */ + &Scumm::o5_lights, + &Scumm::o5_getActorCostume, + &Scumm::o5_loadRoom, + &Scumm::o5_roomOps, + /* F4 */ + &Scumm::o5_getDist, + &Scumm::o5_findObject, + &Scumm::o5_walkActorToObject, + &Scumm::o5_startObject, + /* F8 */ + &Scumm::o5_isGreater, + &Scumm::o5_doSentence, + &Scumm::o5_verbOps, + &Scumm::o5_getActorWalkBox, + /* FC */ + &Scumm::o5_isSoundRunning, + &Scumm::o5_findInventory, + &Scumm::o5_walkActorTo, + &Scumm::o5_drawBox + }; + + static const char *opcode_lookup[] = { + /* 00 */ + "o5_stopObjectCode", + "o5_putActor", + "o5_startMusic", + "o5_getActorRoom", + /* 04 */ + "o5_isGreaterEqual", + "o5_drawObject", + "o5_getActorElevation", + "o5_setState", + /* 08 */ + "o5_isNotEqual", + "o5_faceActor", + "o5_startScript", + "o5_getVerbEntrypoint", + /* 0C */ + "o5_resourceRoutines", + "o5_walkActorToActor", + "o5_putActorAtObject", + "o5_getObjectState", + /* 10 */ + "o5_getObjectOwner", + "o5_animateActor", + "o5_panCameraTo", + "o5_actorSet", + /* 14 */ + "o5_print", + "o5_actorFromPos", + "o5_getRandomNr", + "o5_and", + /* 18 */ + "o5_jumpRelative", + "o5_doSentence", + "o5_move", + "o5_multiply", + /* 1C */ + "o5_startSound", + "o5_ifClassOfIs", + "o5_walkActorTo", + "o5_isActorInBox", + /* 20 */ + "o5_stopMusic", + "o5_putActor", + "o5_getAnimCounter", + "o5_getActorY", + /* 24 */ + "o5_loadRoomWithEgo", + "o5_pickupObject", + "o5_setVarRange", + "o5_stringOps", + /* 28 */ + "o5_equalZero", + "o5_setOwnerOf", + "o5_startScript", + "o5_delayVariable", + /* 2C */ + "o5_cursorCommand", + "o5_putActorInRoom", + "o5_delay", + "o5_badOpcode", + /* 30 */ + "o5_matrixOps", + "o5_getInventoryCount", + "o5_setCameraAt", + "o5_roomOps", + /* 34 */ + "o5_getDist", + "o5_findObject", + "o5_walkActorToObject", + "o5_startObject", + /* 38 */ + "o5_lessOrEqual", + "o5_doSentence", + "o5_subtract", + "o5_getActorScale", + /* 3C */ + "o5_stopSound", + "o5_findInventory", + "o5_walkActorTo", + "o5_drawBox", + /* 40 */ + "o5_cutscene", + "o5_putActor", + "o5_chainScript", + "o5_getActorX", + /* 44 */ + "o5_isLess", + "o5_badOpcode", + "o5_increment", + "o5_setState", + /* 48 */ + "o5_isEqual", + "o5_faceActor", + "o5_startScript", + "o5_getVerbEntrypoint", + /* 4C */ + "o5_soundKludge", + "o5_walkActorToActor", + "o5_putActorAtObject", + "o5_badOpcode", + /* 50 */ + "o5_pickupObjectOld", + "o5_animateActor", + "o5_actorFollowCamera", + "o5_actorSet", + /* 54 */ + "o5_setObjectName", + "o5_actorFromPos", + "o5_getActorMoving", + "o5_or", + /* 58 */ + "o5_overRide", + "o5_doSentence", + "o5_add", + "o5_divide", + /* 5C */ + "o5_oldRoomEffect", + "o5_setClass", + "o5_walkActorTo", + "o5_isActorInBox", + /* 60 */ + "o5_freezeScripts", + "o5_putActor", + "o5_stopScript", + "o5_getActorFacing", + /* 64 */ + "o5_loadRoomWithEgo", + "o5_pickupObject", + "o5_getClosestObjActor", + "o5_dummy", + /* 68 */ + "o5_getScriptRunning", + "o5_setOwnerOf", + "o5_startScript", + "o5_debug", + /* 6C */ + "o5_getActorWidth", + "o5_putActorInRoom", + "o5_stopObjectScript", + "o5_badOpcode", + /* 70 */ + "o5_lights", + "o5_getActorCostume", + "o5_loadRoom", + "o5_roomOps", + /* 74 */ + "o5_getDist", + "o5_findObject", + "o5_walkActorToObject", + "o5_startObject", + /* 78 */ + "o5_isGreater", /* less? */ + "o5_doSentence", + "o5_verbOps", + "o5_getActorWalkBox", + /* 7C */ + "o5_isSoundRunning", + "o5_findInventory", + "o5_walkActorTo", + "o5_drawBox", + /* 80 */ + "o5_breakHere", + "o5_putActor", + "o5_startMusic", + "o5_getActorRoom", + /* 84 */ + "o5_isGreaterEqual", /* less equal? */ + "o5_drawObject", + "o5_getActorElevation", + "o5_setState", + /* 88 */ + "o5_isNotEqual", + "o5_faceActor", + "o5_startScript", + "o5_getVerbEntrypoint", + /* 8C */ + "o5_resourceRoutines", + "o5_walkActorToActor", + "o5_putActorAtObject", + "o5_getObjectState", + /* 90 */ + "o5_getObjectOwner", + "o5_animateActor", + "o5_panCameraTo", + "o5_actorSet", + /* 94 */ + "o5_print", + "o5_actorFromPos", + "o5_getRandomNr", + "o5_and", + /* 98 */ + "o5_quitPauseRestart", + "o5_doSentence", + "o5_move", + "o5_multiply", + /* 9C */ + "o5_startSound", + "o5_ifClassOfIs", + "o5_walkActorTo", + "o5_isActorInBox", + /* A0 */ + "o5_stopObjectCode", + "o5_putActor", + "o5_getAnimCounter", + "o5_getActorY", + /* A4 */ + "o5_loadRoomWithEgo", + "o5_pickupObject", + "o5_setVarRange", + "o5_dummy", + /* A8 */ + "o5_notEqualZero", + "o5_setOwnerOf", + "o5_startScript", + "o5_saveRestoreVerbs", + /* AC */ + "o5_expression", + "o5_putActorInRoom", + "o5_wait", + "o5_badOpcode", + /* B0 */ + "o5_matrixOps", + "o5_getInventoryCount", + "o5_setCameraAt", + "o5_roomOps", + /* B4 */ + "o5_getDist", + "o5_findObject", + "o5_walkActorToObject", + "o5_startObject", + /* B8 */ + "o5_lessOrEqual", + "o5_doSentence", + "o5_subtract", + "o5_getActorScale", + /* BC */ + "o5_stopSound", + "o5_findInventory", + "o5_walkActorTo", + "o5_drawBox", + /* C0 */ + "o5_endCutscene", + "o5_putActor", + "o5_chainScript", + "o5_getActorX", + /* C4 */ + "o5_isLess", + "o5_badOpcode", + "o5_decrement", + "o5_setState", + /* C8 */ + "o5_isEqual", + "o5_faceActor", + "o5_startScript", + "o5_getVerbEntrypoint", + /* CC */ + "o5_pseudoRoom", + "o5_walkActorToActor", + "o5_putActorAtObject", + "o5_badOpcode", + /* D0 */ + "o5_pickupObjectOld", + "o5_animateActor", + "o5_actorFollowCamera", + "o5_actorSet", + /* D4 */ + "o5_setObjectName", + "o5_actorFromPos", + "o5_getActorMoving", + "o5_or", + /* D8 */ + "o5_printEgo", + "o5_doSentence", + "o5_add", + "o5_divide", + /* DC */ + "o5_oldRoomEffect", + "o5_setClass", + "o5_walkActorTo", + "o5_isActorInBox", + /* E0 */ + "o5_freezeScripts", + "o5_putActor", + "o5_stopScript", + "o5_getActorFacing", + /* E4 */ + "o5_loadRoomWithEgo", + "o5_pickupObject", + "o5_getClosestObjActor", + "o5_dummy", + /* E8 */ + "o5_getScriptRunning", + "o5_setOwnerOf", + "o5_startScript", + "o5_debug", + /* EC */ + "o5_getActorWidth", + "o5_putActorInRoom", + "o5_stopObjectScript", + "o5_badOpcode", + /* F0 */ + "o5_lights", + "o5_getActorCostume", + "o5_loadRoom", + "o5_roomOps", + /* F4 */ + "o5_getDist", + "o5_findObject", + "o5_walkActorToObject", + "o5_startObject", + /* F8 */ + "o5_isGreater", + "o5_doSentence", + "o5_verbOps", + "o5_getActorWalkBox", + /* FC */ + "o5_isSoundRunning", + "o5_findInventory", + "o5_walkActorTo", + "o5_drawBox", + }; + + + _opcodes = opcode_list; + _opcodes_lookup = opcode_lookup; +} + +void Scumm::o5_actorFollowCamera() +{ + actorFollowCamera(getVarOrDirectByte(0x80)); +} + +void Scumm::o5_actorFromPos() +{ + int x, y; + getResultPos(); + x = getVarOrDirectWord(0x80); + y = getVarOrDirectWord(0x40); + setResult(getActorFromPos(x, y)); +} + +void Scumm::o5_actorSet() +{ + static const byte convertTable[20] = + { 1, 0, 0, 2, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20 }; + int act = getVarOrDirectByte(0x80); + Actor *a; + int i, j; + + if (act == 0) + act = 1; + + a = derefActorSafe(act, "actorSet"); + + while ((_opcode = fetchScriptByte()) != 0xFF) { + if (_features & GF_SMALL_HEADER) + _opcode = (_opcode & 0xE0) | convertTable[(_opcode & 0x1F) - 1]; + + if (!a) + return; + + switch (_opcode & 0x1F) { + case 0: /* dummy case */ + getVarOrDirectByte(0x80); + break; + case 1: /* costume */ + a->setActorCostume(getVarOrDirectByte(0x80)); + break; + case 2: /* walkspeed */ + i = getVarOrDirectByte(0x80); + j = getVarOrDirectByte(0x40); + a->setActorWalkSpeed(i, j); + break; + case 3: /* sound */ + a->sound[0] = getVarOrDirectByte(0x80); + break; + case 4: /* walkanim */ + a->walkFrame = getVarOrDirectByte(0x80); + break; + case 5: /* talkanim */ + a->talkFrame1 = getVarOrDirectByte(0x80); + a->talkFrame2 = getVarOrDirectByte(0x40); + break; + case 6: /* standanim */ + a->standFrame = getVarOrDirectByte(0x80); + break; + case 7: /* ignore */ + getVarOrDirectByte(0x80); + getVarOrDirectByte(0x40); + getVarOrDirectByte(0x20); + break; + case 8: /* init */ + a->initActor(0); + break; + case 9: /* elevation */ + a->elevation = getVarOrDirectWord(0x80); + a->needRedraw = true; + a->needBgReset = true; + break; + case 10: /* defaultanims */ + a->initFrame = 1; + a->walkFrame = 2; + a->standFrame = 3; + a->talkFrame1 = 4; + a->talkFrame2 = 5; + break; + case 11: /* palette */ + i = getVarOrDirectByte(0x80); + j = getVarOrDirectByte(0x40); + checkRange(31, 0, i, "Illegal palet slot %d"); + a->palette[i] = j; + a->needRedraw = true; + break; + case 12: /* talk color */ + a->talkColor = getVarOrDirectByte(0x80); + break; + case 13: /* name */ + loadPtrToResource(rtActorName, a->number, NULL); + break; + case 14: /* initanim */ + a->initFrame = getVarOrDirectByte(0x80); + break; + case 15: /* unk */ + error("o5_actorset:unk not implemented"); +#if 0 + int16 args[16] = + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + }; + getWordVararg(args); + for (i = 0; i < 16; i++) + if (args[i] != 0xFF) + a->palette[i] = args[i]; +#endif + break; + case 16: /* width */ + a->width = getVarOrDirectByte(0x80); + break; + case 17: /* scale */ + if (_gameId == GID_MONKEY_VGA) { + a->scalex = a->scaley = getVarOrDirectByte(0x80); + } else { + a->scalex = getVarOrDirectByte(0x80); + a->scaley = getVarOrDirectByte(0x40); + } + + if (a->scalex > 255 || a->scaley > 255) + error("Setting an bad actor scale!"); + a->needRedraw = true; + a->needBgReset = true; + break; + case 18: /* neverzclip */ + a->forceClip = 0; + break; + case 19: /* setzclip */ + a->forceClip = getVarOrDirectByte(0x80); + break; + case 20: /* ignoreboxes */ + case 21: /* followboxes */ + a->ignoreBoxes = !(_opcode & 1); + a->forceClip = 0; + if (a->isInCurrentRoom()) + a->putActor(a->x, a->y, a->room); + break; + + case 22: /* animspeed */ + a->animSpeed = getVarOrDirectByte(0x80); + a->animProgress = 0; + break; + case 23: /* unk2 */ + a->shadow_mode = getVarOrDirectByte(0x80); /* shadow mode */ + break; + default: + warning("o5_actorSet: default case"); + } + } +} + +void Scumm::o5_setClass() +{ + int obj = getVarOrDirectWord(0x80); + int newClass; + + while ((_opcode = fetchScriptByte()) != 0xFF) { + newClass = getVarOrDirectWord(0x80); + if (newClass == 0) { + _classData[obj] = 0; + if ((_features & GF_SMALL_HEADER) && obj <= NUM_ACTORS) { + Actor *a; + a = derefActorSafe(obj, "setClass"); + a->ignoreBoxes = 0; + a->forceClip = 0; + } + continue; + } + + if (_gameId == GID_INDY3_256) + newClass--; + + putClass(obj, newClass, (newClass & 0x80)); + } +} + +void Scumm::o5_add() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + setResult(readVar(_resultVarNumber) + a); +} + +void Scumm::o5_and() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + setResult(readVar(_resultVarNumber) & a); +} + +void Scumm::o5_animateActor() +{ + int act = getVarOrDirectByte(0x80); + int anim = getVarOrDirectByte(0x40); + + Actor *a = derefActorSafe(act, "o5_animateActor"); + if (!a) + return; + + a->animateActor(anim); +} + +void Scumm::o5_badOpcode() +{ + error("Scumm opcode %d illegal", _opcode); +} + +void Scumm::o5_breakHere() +{ + updateScriptPtr(); + _currentScript = 0xFF; +} + +void Scumm::o5_chainScript() +{ + int16 vars[16]; + int data; + int cur; + + data = getVarOrDirectByte(0x80); + + getWordVararg(vars); + + cur = _currentScript; + + vm.slot[cur].number = 0; + vm.slot[cur].status = 0; + _currentScript = 0xFF; + + runScript(data, vm.slot[cur].unk1, vm.slot[cur].unk2, vars); +} + +void Scumm::o5_cursorCommand() +{ + int i, j, k; + int16 table[16]; + switch ((_opcode = fetchScriptByte()) & 0x1F) { + case 1: /* cursor show */ + _cursorState = 1; + verbMouseOver(0); + break; + case 2: /* cursor hide */ + _cursorState = 0; + verbMouseOver(0); + break; + case 3: /* userput on */ + _userPut = 1; + break; + case 4: /* userput off */ + _userPut = 0; + break; + case 5: /* cursor soft on */ + _cursorState++; + verbMouseOver(0); + break; + case 6: /* cursor soft off */ + _cursorState--; + verbMouseOver(0); + break; + case 7: /* userput soft on */ + _userPut++; + break; + case 8: /* userput soft off */ + _userPut--; + break; + case 10: /* set cursor img */ + i = getVarOrDirectByte(0x80); + j = getVarOrDirectByte(0x40); + if (_gameId != GID_LOOM256) + setCursorImg(i, j, 1); + break; + case 11: /* set cursor hotspot */ + i = getVarOrDirectByte(0x80); + j = getVarOrDirectByte(0x40); + k = getVarOrDirectByte(0x20); + setCursorHotspot2(j, k); + break; + + case 12: /* init cursor */ + setCursor(getVarOrDirectByte(0x80)); + break; + case 13: /* init charset */ + initCharset(getVarOrDirectByte(0x80)); + break; + case 14: /* unk */ + getWordVararg(table); + for (i = 0; i < 16; i++) + charset._colorMap[i] = _charsetData[string[1].t_charset][i] = (unsigned char)table[i]; + break; + } + + _vars[VAR_CURSORSTATE] = _cursorState; + _vars[VAR_USERPUT] = _userPut; +} + +void Scumm::o5_cutscene() +{ + int16 args[16]; + getWordVararg(args); + cutscene(args); +} + +void Scumm::o5_endCutscene() +{ + endCutscene(); +} + +void Scumm::o5_debug() +{ + getVarOrDirectWord(0x80); +} + +void Scumm::o5_decrement() +{ + getResultPos(); + setResult(readVar(_resultVarNumber) - 1); +} + +void Scumm::o5_delay() +{ + int delay = fetchScriptByte(); + delay |= fetchScriptByte() << 8; + delay |= fetchScriptByte() << 16; + vm.slot[_currentScript].delay = delay; + vm.slot[_currentScript].status = 1; + + o5_breakHere(); +} + +void Scumm::o5_delayVariable() +{ + vm.slot[_currentScript].delay = readVar(fetchScriptWord()); + vm.slot[_currentScript].status = 1; + o5_breakHere(); +} + +void Scumm::o5_divide() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + if (a == 0) { + error("Divide by zero"); + setResult(0); + } else + setResult(readVar(_resultVarNumber) / a); +} + +void Scumm::o5_doSentence() +{ + int a, b; + SentenceTab *st; + + a = getVarOrDirectByte(0x80); + if (a == 0xFE) { + _sentenceNum = 0; + stopScriptNr(_vars[VAR_SENTENCE_SCRIPT]); + clearClickedStatus(); + return; + } + + st = &sentence[_sentenceNum++]; + + st->unk5 = a; + st->unk4 = getVarOrDirectWord(0x40); + b = st->unk3 = getVarOrDirectWord(0x20); + if (b == 0) { + st->unk2 = 0; + } else { + st->unk2 = 1; + } + st->unk = 0; +} + +void Scumm::o5_drawBox() +{ + int x, y, x2, y2, color; + + x = getVarOrDirectWord(0x80); + y = getVarOrDirectWord(0x40); + + _opcode = fetchScriptByte(); + x2 = getVarOrDirectWord(0x80); + y2 = getVarOrDirectWord(0x40); + color = getVarOrDirectByte(0x20); + + drawBox(x, y, x2, y2, color); +} + +void Scumm::o5_drawObject() +{ + int state, obj, idx, i; + ObjectData *od; + uint16 x, y, w, h; + int xpos, ypos; + + state = 1; + xpos = ypos = 255; + obj = getVarOrDirectWord(0x80); + + if (_features & GF_SMALL_HEADER) { + xpos = getVarOrDirectWord(0x40); + ypos = getVarOrDirectWord(0x20); + } else { + switch ((_opcode = fetchScriptByte()) & 0x1F) { + case 1: /* draw at */ + xpos = getVarOrDirectWord(0x80); + ypos = getVarOrDirectWord(0x40); + break; + case 2: /* set state */ + state = getVarOrDirectWord(0x80); + break; + case 0x1F: /* neither */ + break; + default: + error("o5_drawObject: default case"); + } + } + + idx = getObjectIndex(obj); + if (idx == -1) + return; + + od = &_objs[idx]; + if (xpos != 0xFF) { + od->walk_x += (xpos << 3) - od->x_pos; + od->x_pos = xpos << 3; + od->walk_y += (ypos << 3) - od->y_pos; + od->y_pos = ypos << 3; + } + addObjectToDrawQue(idx); + + x = od->x_pos; + y = od->y_pos; + w = od->width; + h = od->height; + + i = _numObjectsInRoom; + do { + if (_objs[i].x_pos == x && _objs[i].y_pos == y && _objs[i].width == w && _objs[i].height == h) + putState(_objs[i].obj_nr, 0); + } while (--i); + + putState(obj, state); +} + +void Scumm::o5_dummy() +{ + /* nothing */ +} + + +void Scumm::o5_expression() +{ + int dst, i; + + _scummStackPos = 0; + getResultPos(); + dst = _resultVarNumber; + + while ((_opcode = fetchScriptByte()) != 0xFF) { + switch (_opcode & 0x1F) { + case 1: /* varordirect */ + push(getVarOrDirectWord(0x80)); + break; + case 2: /* add */ + i = pop(); + push(i + pop()); + break; + case 3: /* sub */ + i = pop(); + push(pop() - i); + break; + case 4: /* mul */ + i = pop(); + push(i * pop()); + break; + case 5: /* div */ + i = pop(); + if (i == 0) + error("Divide by zero"); + push(pop() / i); + break; + case 6: /* normal opcode */ + _opcode = fetchScriptByte(); + (this->*(getOpcode(_opcode))) (); + push(_vars[0]); + break; + } + } + + _resultVarNumber = dst; + setResult(pop()); +} + +void Scumm::o5_faceActor() +{ + int act, obj; + act = getVarOrDirectByte(0x80); + obj = getVarOrDirectWord(0x40); + faceActorToObj(act, obj); +} + +void Scumm::o5_findInventory() +{ + int t; + getResultPos(); + t = getVarOrDirectByte(0x80); + setResult(findInventory(t, getVarOrDirectByte(0x40))); +} + +void Scumm::o5_findObject() +{ + int t; + getResultPos(); + t = getVarOrDirectWord(0x80); + setResult(findObject(t, getVarOrDirectWord(0x40))); +} + +void Scumm::o5_freezeScripts() +{ + int scr = getVarOrDirectByte(0x80); + + if (scr != 0) + freezeScripts(scr); + else + unfreezeScripts(); +} + +void Scumm::o5_getActorCostume() +{ + getResultPos(); + setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorCostume")->costume); +} + +void Scumm::o5_getActorElevation() +{ + getResultPos(); + setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorElevation")->elevation); +} + +void Scumm::o5_getActorFacing() +{ + getResultPos(); + setResult(newDirToOldDir(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorFacing")->facing)); +} + +void Scumm::o5_getActorMoving() +{ + getResultPos(); + setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorMoving")->moving); +} + +void Scumm::o5_getActorRoom() +{ + int temp; + Actor *act; + getResultPos(); + temp = getVarOrDirectByte(0x80); + + act = derefActorSafe(temp, "o5_getActorRoom"); + if (!act) + return; + + setResult(act->room); +} + +void Scumm::o5_getActorScale() +{ + if (_gameId == GID_INDY3_256) { + getVarOrDirectByte(0x80); /*FIXME: missing stuff here */ + return; + } + getResultPos(); + setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorScale")->scalex); +} + +void Scumm::o5_getActorWalkBox() +{ + Actor *a; + getResultPos(); + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorWalkbox"); + if (a) // FIXME - bug 572977 workaround + setResult(a->walkbox); + else + setResult(0); +} + +void Scumm::o5_getActorWidth() +{ + getResultPos(); + setResult(derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorWidth")->width); +} + +void Scumm::o5_getActorX() +{ + int a; + getResultPos(); + + if (_gameId == GID_INDY3_256) + a = getVarOrDirectByte(0x80); + else + a = getVarOrDirectWord(0x80); + + setResult(getObjX(a)); +} + +void Scumm::o5_getActorY() +{ + int a; + getResultPos(); + + if (_gameId == GID_INDY3_256) + a = getVarOrDirectByte(0x80); + else + a = getVarOrDirectWord(0x80); + + setResult(getObjY(a)); +} + +void Scumm::o5_getAnimCounter() +{ + Actor *a; + getResultPos(); + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_getActorAnimCounter"); + + if (a) // FIXME + setResult(a->cost.animCounter1); + else + setResult(0); +} + +void Scumm::o5_getClosestObjActor() +{ + int obj; + int act; + int closest_obj = 0xFF, closest_dist = 0xFF; + int dist; + + getResultPos(); + + act = getVarOrDirectWord(0x80); + obj = _vars[VAR_V5_OBJECT_HI]; + + do { + dist = getObjActToObjActDist(act, obj); + if (dist < closest_dist) { + closest_dist = dist; + closest_obj = obj; + } + } while (--obj >= _vars[VAR_V5_OBJECT_LO]); + + setResult(closest_dist); +} + +void Scumm::o5_getDist() +{ + int o1, o2; + int r; + getResultPos(); + o1 = getVarOrDirectWord(0x80); + o2 = getVarOrDirectWord(0x40); + r = getObjActToObjActDist(o1, o2); + + /* FIXME: MI2 race workaround, see bug 597022 */ + if (_gameId == GID_MONKEY2 && vm.slot[_currentScript].number == 40 && r < 60) + r = 60; + + setResult(r); +} + +void Scumm::o5_getInventoryCount() +{ + getResultPos(); + setResult(getInventoryCount(getVarOrDirectByte(0x80))); +} + +void Scumm::o5_getObjectOwner() +{ + getResultPos(); + setResult(getOwner(getVarOrDirectWord(0x80))); +} + +void Scumm::o5_getObjectState() +{ + if (_features & GF_SMALL_HEADER) { + int a = getVarOrDirectWord(0x80); + int b = getVarOrDirectByte(0x40); + + if ((getState(a) & 0xF0 >> 4) != b) + o5_jumpRelative(); + else + ignoreScriptWord(); + } else { + getResultPos(); + setResult(getState(getVarOrDirectWord(0x80))); + } +} + +void Scumm::o5_getRandomNr() +{ + getResultPos(); + setResult(getRandomNumber(getVarOrDirectByte(0x80))); +} + +void Scumm::o5_getScriptRunning() +{ + getResultPos(); + setResult(isScriptRunning(getVarOrDirectByte(0x80))); +} + +void Scumm::o5_getVerbEntrypoint() +{ + int a, b; + getResultPos(); + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + + setResult(getVerbEntrypoint(a, b)); +} + +void Scumm::o5_ifClassOfIs() +{ + int act, cls, b = 0; + bool cond = true; + + act = getVarOrDirectWord(0x80); + + while ((_opcode = fetchScriptByte()) != 0xFF) { + cls = getVarOrDirectWord(0x80); + + if (!cls) // FIXME: Ender can't remember why this is here, + b=false; // but it fixes an oddball zak256 crash + else + b = getClass(act, cls); + + if (cls & 0x80 && !b || !(cls & 0x80) && b) + cond = false; + } + if (cond) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_increment() +{ + getResultPos(); + setResult(readVar(_resultVarNumber) + 1); +} + +void Scumm::o5_isActorInBox() +{ + int box; + Actor *a; + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_isActorInBox"); + box = getVarOrDirectByte(0x40); + + if (!checkXYInBoxBounds(box, a->x, a->y)) + o5_jumpRelative(); + else + ignoreScriptWord(); +} + +void Scumm::o5_isEqual() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + if (b == a) + ignoreScriptWord(); + else + o5_jumpRelative(); + +} + +void Scumm::o5_isGreater() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + if (b > a) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_isGreaterEqual() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + if (b >= a) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_isLess() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + + if (b < a) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_lessOrEqual() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + if (b <= a) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_isNotEqual() +{ + int16 a = readVar(fetchScriptWord()); + int16 b = getVarOrDirectWord(0x80); + if (b != a) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_notEqualZero() +{ + int a = readVar(fetchScriptWord()); + if (a != 0) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_equalZero() +{ + int a = readVar(fetchScriptWord()); + if (a == 0) + ignoreScriptWord(); + else + o5_jumpRelative(); +} + +void Scumm::o5_isSoundRunning() +{ + int snd; + getResultPos(); + snd = getVarOrDirectByte(0x80); + if (snd) + snd = _sound->isSoundRunning(snd); + setResult(snd); +} + +void Scumm::o5_jumpRelative() +{ + _scriptPointer += (int16)fetchScriptWord(); +} + +void Scumm::o5_lights() +{ + int a, b, c; + + a = getVarOrDirectByte(0x80); + b = fetchScriptByte(); + c = fetchScriptByte(); + + if (c == 0) + _vars[VAR_CURRENT_LIGHTS] = a; + else if (c == 1) { + _flashlightXStrips = a; + _flashlightYStrips = b; + } + _fullRedraw = 1; +} + +void Scumm::o5_loadRoom() +{ + int room; + + room = getVarOrDirectByte(0x80); + startScene(room, 0, 0); + _fullRedraw = 1; +} + +void Scumm::o5_loadRoomWithEgo() +{ + Actor *a; + int obj, room, x, y; + + obj = getVarOrDirectWord(0x80); + room = getVarOrDirectByte(0x40); + + a = derefActorSafe(_vars[VAR_EGO], "o5_loadRoomWithEgo"); + + a->putActor(0, 0, room); + _egoPositioned = false; + + x = (int16)fetchScriptWord(); + y = (int16)fetchScriptWord(); + + _vars[VAR_WALKTO_OBJ] = obj; + startScene(a->room, a, obj); + _vars[VAR_WALKTO_OBJ] = 0; + + camera._dest.x = camera._cur.x = a->x; + setCameraAt(a->x, a->y); + setCameraFollows(a); + + _fullRedraw = 1; + + if (x != -1) { + a->startWalkActor(x, y, -1); + } +} + +void Scumm::o5_matrixOps() +{ + int a, b; + + if (_features & GF_OLD256) { + a = getVarOrDirectByte(0x80); + b = fetchScriptByte(); + setBoxFlags(a, b); + return; + } + + _opcode = fetchScriptByte(); + switch (_opcode & 0x1F) { + case 1: + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + setBoxFlags(a, b); + break; + case 2: + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + setBoxScale(a, b); + break; + case 3: + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + setBoxScale(a, (b - 1) | 0x8000); + break; + case 4: + createBoxMatrix(); + break; + } +} + +void Scumm::o5_move() +{ + getResultPos(); + setResult(getVarOrDirectWord(0x80)); +} + +void Scumm::o5_multiply() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + setResult(readVar(_resultVarNumber) * a); +} + + +void Scumm::o5_or() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + setResult(readVar(_resultVarNumber) | a); +} + +void Scumm::o5_overRide() +{ + if (fetchScriptByte() != 0) + beginOverride(); + else + endOverride(); +} + +void Scumm::o5_panCameraTo() +{ + panCameraTo(getVarOrDirectWord(0x80), 0); +} + +void Scumm::o5_pickupObject() +{ + int obj, room; + if (_features & GF_OLD256) { + o5_drawObject(); + return; + } + + obj = getVarOrDirectWord(0x80); + room = getVarOrDirectByte(0x40); + if (room == 0) + room = _roomResource; + addObjectToInventory(obj, room); + putOwner(obj, _vars[VAR_EGO]); + putClass(obj, 32, 1); + putState(obj, 1); + removeObjectFromRoom(obj); + clearDrawObjectQueue(); + runHook(1); +} + +void Scumm::o5_print() +{ + _actorToPrintStrFor = getVarOrDirectByte(0x80); + decodeParseString(); +} + +void Scumm::o5_printEgo() +{ + _actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; + decodeParseString(); +} + +void Scumm::o5_pseudoRoom() +{ + int i = fetchScriptByte(), j; + while ((j = fetchScriptByte()) != 0) { + if (j >= 0x80) { + _resourceMapper[j & 0x7F] = i; + } + } +} + +void Scumm::o5_putActor() +{ + int x, y; + Actor *a; + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActor"); + if (!a) + return; + x = getVarOrDirectWord(0x40); + y = getVarOrDirectWord(0x20); + + a->putActor(x, y, a->room); +} + + +void Scumm::o5_putActorAtObject() +{ + int obj, x, y; + Actor *a; + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActorAtObject"); + obj = getVarOrDirectWord(0x40); + if (whereIsObject(obj) != WIO_NOT_FOUND) + getObjectXYPos(obj, x, y); + else { + x = 240; + y = 120; + } + a->putActor(x, y, a->room); +} + +void Scumm::o5_putActorInRoom() +{ + int room; + Actor *a; + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_putActorInRoom"); + room = getVarOrDirectByte(0x40); + if (a->visible && _currentRoom != room && _vars[VAR_TALK_ACTOR] == a->number) { + clearMsgQueue(); + } + a->room = room; + if (!room) + a->putActor(0, 0, 0); +} + +void Scumm::o5_quitPauseRestart() +{ + switch (fetchScriptByte()) { + case 1: + pauseGame(false); + break; + case 3: + shutDown(0); + break; + } +} + +void Scumm::o5_resourceRoutines() +{ + int resid = 0; + + _opcode = fetchScriptByte(); + if (_opcode != 17) + resid = getVarOrDirectByte(0x80); + if (_features & GF_OLD256) /*FIXME: find a better way to implement this */ + _opcode &= 0x3F; + switch (_opcode & 0x1F) { + case 1: /* load script */ + ensureResourceLoaded(rtScript, resid); + break; + case 2: /* load sound */ + ensureResourceLoaded(rtSound, resid); + break; + case 3: /* load costume */ + ensureResourceLoaded(rtCostume, resid); + break; + case 4: /* load room */ + if (_features & GF_OLD256) + ensureResourceLoaded(rtScript, resid & 0x7F); /*FIXME: missing stuff... */ + else + ensureResourceLoaded(rtRoom, resid); + break; + case 5: /* nuke script */ + setResourceCounter(rtScript, resid, 0x7F); + break; + case 6: /* nuke sound */ + setResourceCounter(rtSound, resid, 0x7F); + break; + case 7: /* nuke costume */ + setResourceCounter(rtCostume, resid, 0x7F); + break; + case 8: /* nuke room */ + setResourceCounter(rtRoom, resid, 0x7F); + break; + case 9: /* lock script */ + if (resid >= _numGlobalScripts) + break; + lock(rtScript, resid); + break; + case 10: /* lock sound */ + lock(rtSound, resid); + break; + case 11: /* lock costume */ + lock(rtCostume, resid); + break; + case 12: /* lock room */ + if (resid > 0x7F) + resid = _resourceMapper[resid & 0x7F]; + lock(rtRoom, resid); + break; + case 13: /* unlock script */ + if (resid >= _numGlobalScripts) + break; + unlock(rtScript, resid); + break; + case 14: /* unlock sound */ + unlock(rtSound, resid); + break; + case 15: /* unlock costume */ + unlock(rtCostume, resid); + break; + case 16: /* unlock room */ + if (resid > 0x7F) + resid = _resourceMapper[resid & 0x7F]; + unlock(rtRoom, resid); + break; + case 17: /* clear heap */ + heapClear(0); + unkHeapProc2(0, 0); + break; + case 18: /* load charset */ + loadCharset(resid); + break; + case 19: /* nuke charset */ + nukeCharset(resid); + break; + case 20: /* load fl object */ + loadFlObject(getVarOrDirectWord(0x40), resid); + break; + default: + warning("Unknown o5_resourcesroutine: %d", _opcode & 0x1F); + break; + } +} + +void Scumm::o5_roomOps() +{ + int a = 0, b = 0, c, d, e; + + if (_features & GF_OLD256) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + + _opcode = fetchScriptByte(); + + switch (_opcode & 0x1F) { + case 1: /* room scroll */ + if (!(_features & GF_OLD256)) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + if (a < 160) + a = 160; + if (b < 160) + b = 160; + if (a > _scrWidth - 160) + a = _scrWidth - 160; + if (b > _scrWidth - 160) + b = _scrWidth - 160; + _vars[VAR_CAMERA_MIN_X] = a; + _vars[VAR_CAMERA_MAX_X] = b; + break; + case 2: /* room color */ + if (_features & GF_SMALL_HEADER) { + if (!(_features & GF_OLD256)) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); + _currentPalette[a] = b; + _fullRedraw = 1; + } else { + error("room-color is no longer a valid command"); + } + break; + + case 3: /* set screen */ + if (!(_features & GF_OLD256)) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + initScreens(0, a, 320, b); + break; + case 4: /* set palette color */ + if (_features & GF_SMALL_HEADER) { + if (!(_features & GF_OLD256)) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); + _shadowPalette[b] = a; + setDirtyColors(b, b); + } else { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + c = getVarOrDirectWord(0x20); + _opcode = fetchScriptByte(); + d = getVarOrDirectByte(0x80); + setPalColor(d, a, b, c); /* index, r, g, b */ + } + break; + case 5: /* shake on */ + setShake(1); + break; + case 6: /* shake off */ + setShake(0); + break; + case 7: /* room scale for old games */ + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + _opcode = fetchScriptByte(); + c = getVarOrDirectByte(0x80); + d = getVarOrDirectByte(0x40); + _opcode = fetchScriptByte(); + e = getVarOrDirectByte(0x40); + setScaleItem(e - 1, b, a, d, c); + break; + case 8: /* room scale? */ + if (_features & GF_SMALL_HEADER) { + if (!(_features & GF_OLD256)) { + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + } + c = getVarOrDirectWord(0x20); + } else { + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + c = getVarOrDirectByte(0x20); + } + darkenPalette(b, c, a, a, a); + break; + case 9: /* ? */ + _saveLoadFlag = getVarOrDirectByte(0x80); + _saveLoadSlot = getVarOrDirectByte(0x40); + _saveLoadSlot = 99; /* use this slot */ + _saveLoadCompatible = true; + break; + case 10: /* ? */ + a = getVarOrDirectWord(0x80); + if (a) { + _switchRoomEffect = (byte)a; + _switchRoomEffect2 = (byte)(a >> 8); + } else { + fadeIn(_newEffect); + } + break; + case 11: /* ? */ + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + c = getVarOrDirectWord(0x20); + _opcode = fetchScriptByte(); + d = getVarOrDirectByte(0x80); + e = getVarOrDirectByte(0x40); + darkenPalette(d, e, a, b, c); + break; + case 12: /* ? */ + a = getVarOrDirectWord(0x80); + b = getVarOrDirectWord(0x40); + c = getVarOrDirectWord(0x20); + _opcode = fetchScriptByte(); + d = getVarOrDirectByte(0x80); + e = getVarOrDirectByte(0x40); + unkRoomFunc3(d, e, a, b, c); + break; + + case 13:{ /* save-string */ + char buf[256], *s; + FILE *out; + + a = getVarOrDirectByte(0x80); + + // FIXME - check for buffer overflow + strcpy(buf, getSavePath()); + s = buf + strlen(buf); + while ((*s++ = fetchScriptByte())); + + // Use buf as filename + out = fopen(buf, "wb"); + if (out) { + byte *ptr; + ptr = getResourceAddress(rtString, a); + fwrite(ptr, getStringLen(ptr) + 1, 1, out); + fclose(out); + } + break; + } + case 14:{ /* load-string */ + char buf[256], *s; + FILE *in; + + a = getVarOrDirectByte(0x80); + + // FIXME - check for buffer overflow + strcpy(buf, getSavePath()); + s = buf + strlen(buf); + while ((*s++ = fetchScriptByte())); + + // Use buf as filename + in = fopen(buf, "rb"); + if (in) { + byte *ptr; + int len; + fseek(in, 0, SEEK_END); + len = ftell(in); // Determine file size + ptr = (byte *)calloc(len + 1, 1); // Create a zero terminated buffer + fseek(in, 0, SEEK_SET); + fread(ptr, len, 1, in); // Read in the data + fclose(in); + loadPtrToResource(rtString, a, ptr); + free(ptr); + } + break; + } + case 15: /* palmanip */ + a = getVarOrDirectByte(0x80); + _opcode = fetchScriptByte(); + b = getVarOrDirectByte(0x80); + c = getVarOrDirectByte(0x40); + _opcode = fetchScriptByte(); + d = getVarOrDirectByte(0x80); + palManipulate(b, c, a, d, 1); + break; + + case 16: + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + if (a < 1) + a = 1; /* FIXME: ZAK256 */ + checkRange(16, 1, a, "o5_roomOps: 16: color cycle out of range (%d)"); + _colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0; + break; + } +} + +void Scumm::o5_saveRestoreVerbs() +{ + int a, b, c, slot, slot2; + + _opcode = fetchScriptByte(); + + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + c = getVarOrDirectByte(0x20); + + switch (_opcode) { + case 1: /* hide verbs */ + while (a <= b) { + slot = getVerbSlot(a, 0); + if (slot && _verbs[slot].saveid == 0) { + _verbs[slot].saveid = c; + drawVerb(slot, 0); + verbMouseOver(0); + } + a++; + } + break; + case 2: /* show verbs */ + while (a <= b) { + slot = getVerbSlot(a, c); + if (slot) { + slot2 = getVerbSlot(a, 0); + if (slot2) + killVerb(slot2); + slot = getVerbSlot(a, c); + _verbs[slot].saveid = 0; + drawVerb(slot, 0); + verbMouseOver(0); + } + a++; + } + break; + case 3: /* kill verbs */ + while (a <= b) { + slot = getVerbSlot(a, c); + if (slot) + killVerb(slot); + a++; + } + break; + default: + error("o5_saveRestoreVerbs: invalid opcode"); + } +} + +void Scumm::o5_setCameraAt() +{ + setCameraAtEx(getVarOrDirectWord(0x80)); +} + +void Scumm::o5_setObjectName() +{ + int obj = getVarOrDirectWord(0x80); + int size; + int a; + int i = 0; + byte *name = NULL; + unsigned char work[255]; + + // Read in new name + while ((a = fetchScriptByte()) != 0) { + work[i++] = a; + if (a == 0xFF) { + work[i++] = fetchScriptByte(); + work[i++] = fetchScriptByte(); + work[i++] = fetchScriptByte(); + } + } + work[i] = 0; + + if (obj < NUM_ACTORS) + error("Can't set actor %d name with new-name-of", obj); + + if (!getOBCDFromObject(obj)) { + // FIXME: Bug 587553. This is an odd one and looks more like + // an actual bug in the original script. Usually we would error + warning("Can't find OBCD to rename object %d to %s", obj, work); + return; + } + + name = getObjOrActorName(obj); + + if (_features & GF_SMALL_HEADER) { + // FIXME this is hack to make MonkeyVGA work. needed at least for the german + // version but possibly for others as well. There is no apparent other + // way to determine the available space that works in all cases... + byte *objptr; + byte offset = 0; + + objptr = getOBCDFromObject(obj); + offset = READ_LE_UINT16(objptr + 18); + size = READ_LE_UINT16(objptr) - offset; + } else { + size = getResourceDataSize(name); + } + + if (i >= size) { + warning("New name of object %d too long (old *%s* new *%s*)", obj, name, work); + i = size - 1; + } + + strcpy((char *)name, (char *)work); + runHook(0); +} + +void Scumm::o5_setOwnerOf() +{ + int obj, owner; + + obj = getVarOrDirectWord(0x80); + owner = getVarOrDirectByte(0x40); + + setOwnerOf(obj, owner); +} + +void Scumm::o5_setState() +{ + int obj, state; + obj = getVarOrDirectWord(0x80); + state = getVarOrDirectByte(0x40); + putState(obj, state); + removeObjectFromRoom(obj); + if (_BgNeedsRedraw) + clearDrawObjectQueue(); +} + +void Scumm::o5_setVarRange() +{ + int a, b; + + getResultPos(); + a = fetchScriptByte(); + do { + if (_opcode & 0x80) + b = fetchScriptWord(); + else + b = fetchScriptByte(); + + setResult(b); + _resultVarNumber++; + } while (--a); +} + +void Scumm::o5_soundKludge() +{ + int16 items[15]; + int i; + + if (_features & GF_SMALL_HEADER) // Is dummy function in + return; // SCUMM V3 + + for (i = 0; i < 15; i++) + items[i] = 0; + + getWordVararg(items); + + _sound->soundKludge(items); +} + +void Scumm::o5_startMusic() +{ + _sound->addSoundToQueue(getVarOrDirectByte(0x80)); +} + +void Scumm::o5_startObject() +{ + int obj, script; + int16 data[16]; + + obj = getVarOrDirectWord(0x80); + script = getVarOrDirectByte(0x40); + + getWordVararg(data); + runVerbCode(obj, script, 0, 0, data); +} + +void Scumm::o5_startScript() +{ + int op, script; + int16 data[16]; + int a, b; + + op = _opcode; + script = getVarOrDirectByte(0x80); + + getWordVararg(data); + + a = b = 0; + if (op & 0x40) + b = 1; + if (op & 0x20) + a = 1; + + runScript(script, a, b, data); +} + +void Scumm::o5_startSound() +{ + + _vars[VAR_MUSIC_FLAG] = 0; + + _sound->addSoundToQueue(getVarOrDirectByte(0x80)); +} + +void Scumm::o5_stopMusic() +{ + _sound->stopAllSounds(); +} + +void Scumm::o5_stopObjectCode() +{ + stopObjectCode(); +} + +void Scumm::o5_stopObjectScript() +{ + stopObjectScript(getVarOrDirectWord(0x80)); +} + +void Scumm::o5_stopScript() +{ + int script; + + script = getVarOrDirectByte(0x80); + if (!script) + stopObjectCode(); + else + stopScriptNr(script); +} + +void Scumm::o5_stopSound() +{ + _sound->stopSound(getVarOrDirectByte(0x80)); +} + +void Scumm::o5_stringOps() +{ + int a, b, c, i; + byte *ptr; + + _opcode = fetchScriptByte(); + switch (_opcode & 0x1F) { + case 1: /* loadstring */ + loadPtrToResource(rtString, getVarOrDirectByte(0x80), NULL); + break; + case 2: /* copystring */ + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + nukeResource(rtString, a); + ptr = getResourceAddress(rtString, b); + if (ptr) + loadPtrToResource(rtString, a, ptr); + break; + case 3: /* set string char */ + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + ptr = getResourceAddress(rtString, a); + if (!(_gameId == GID_LOOM256)) { /* FIXME - LOOM256 */ + if (ptr == NULL) + error("String %d does not exist", a); + c = getVarOrDirectByte(0x20); + ptr[b] = c; + } else + getVarOrDirectByte(0x20); + + break; + + case 4: /* get string char */ + getResultPos(); + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + ptr = getResourceAddress(rtString, a); + if (ptr == NULL) + error("String %d does not exist", a); + setResult(ptr[b]); + break; + + case 5: /* create empty string */ + a = getVarOrDirectByte(0x80); + b = getVarOrDirectByte(0x40); + nukeResource(rtString, a); + if (b) { + ptr = createResource(rtString, a, b); + if (ptr) { + for (i = 0; i < b; i++) + ptr[i] = 0; + } + } + break; + } +} + +void Scumm::o5_subtract() +{ + int a; + getResultPos(); + a = getVarOrDirectWord(0x80); + setResult(readVar(_resultVarNumber) - a); +} + +void Scumm::o5_verbOps() +{ + int verb, slot; + VerbSlot *vs; + int a, b; + byte *ptr; + + verb = getVarOrDirectByte(0x80); + + slot = getVerbSlot(verb, 0); + checkRange(_maxVerbs - 1, 0, slot, "Illegal new verb slot %d"); + + vs = &_verbs[slot]; + vs->verbid = verb; + + while ((_opcode = fetchScriptByte()) != 0xFF) { + switch (_opcode & 0x1F) { + case 1: /* load image */ + a = getVarOrDirectWord(0x80); + if (slot) { + setVerbObject(_roomResource, a, slot); + vs->type = 1; + } + break; + case 2: /* load from code */ + loadPtrToResource(rtVerb, slot, NULL); + if (slot == 0) + nukeResource(rtVerb, slot); + vs->type = 0; + vs->imgindex = 0; + break; + case 3: /* color */ + vs->color = getVarOrDirectByte(0x80); + break; + case 4: /* set hi color */ + vs->hicolor = getVarOrDirectByte(0x80); + break; + case 5: /* set xy */ + vs->x = getVarOrDirectWord(0x80); + vs->y = getVarOrDirectWord(0x40); + // FIXME: hack loom notes into right spot + if (_gameId == GID_LOOM256) { + if ((verb >= 90) && (verb <= 97)) { // Notes + switch (verb) { + case 90: + case 91: + vs->y -= 7; + break; + case 92: + vs->y -= 6; + break; + case 93: + vs->y -= 4; + break; + case 94: + vs->y -= 3; + break; + case 95: + vs->y -= 1; + break; + case 97: + vs->y -= 5; + } + } + } + break; + case 6: /* set on */ + vs->curmode = 1; + break; + case 7: /* set off */ + vs->curmode = 0; + break; + case 8: /* delete */ + killVerb(slot); + break; + case 9: /* new */ + slot = getVerbSlot(verb, 0); + if (slot == 0) { + for (slot = 1; slot < _maxVerbs; slot++) { + if (_verbs[slot].verbid == 0) + break; + } + if (slot == _maxVerbs) + error("Too many verbs"); + } + vs = &_verbs[slot]; + vs->verbid = verb; + vs->color = 2; + vs->hicolor = 0; + vs->dimcolor = 8; + vs->type = 0; + vs->charset_nr = string[0].t_charset; + vs->curmode = 0; + vs->saveid = 0; + vs->key = 0; + vs->center = 0; + vs->imgindex = 0; + break; + + case 16: /* set dim color */ + vs->dimcolor = getVarOrDirectByte(0x80); + break; + case 17: /* dim */ + vs->curmode = 2; + break; + case 18: /* set key */ + vs->key = getVarOrDirectByte(0x80); + break; + case 19: /* set center */ + vs->center = 1; + break; + case 20: /* set to string */ + ptr = getResourceAddress(rtString, getVarOrDirectWord(0x80)); + if (!ptr) + nukeResource(rtVerb, slot); + else { + loadPtrToResource(rtVerb, slot, ptr); + } + if (slot == 0) + nukeResource(rtVerb, slot); + vs->type = 0; + vs->imgindex = 0; + break; + case 22: /* assign object */ + a = getVarOrDirectWord(0x80); + b = getVarOrDirectByte(0x40); + if (slot && vs->imgindex != a) { + setVerbObject(b, a, slot); + vs->type = 1; + vs->imgindex = a; + } + break; + case 23: /* set back color */ + vs->bkcolor = getVarOrDirectByte(0x80); + break; + } + } + drawVerb(slot, 0); + verbMouseOver(0); +} + +void Scumm::o5_wait() +{ + byte *oldaddr; + + + oldaddr = _scriptPointer - 1; + + if (_opcode == 0xAE && _gameId == GID_INDY3_256) { + _opcode = 2; + } else + _opcode = fetchScriptByte(); + + switch (_opcode & 0x1F) { + case 1: /* wait for actor */ + if (derefActorSafe(getVarOrDirectByte(0x80), "o5_wait")->moving) + break; + return; + case 2: /* wait for message */ + if (_vars[VAR_HAVE_MSG]) + break; + return; + case 3: /* wait for camera */ + if (camera._cur.x >> 3 != camera._dest.x >> 3) + break; + return; + case 4: /* wait for sentence */ + if (_sentenceNum) { + if (sentence[_sentenceNum - 1].unk && !isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) + return; + break; + } + if (!isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) + return; + break; + default: + error("o5_wait: default case"); + return; + } + + _scriptPointer = oldaddr; + o5_breakHere(); +} + +void Scumm::o5_walkActorTo() +{ + int x, y; + Actor *a; + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorTo"); + x = getVarOrDirectWord(0x40); + y = getVarOrDirectWord(0x20); + a->startWalkActor(x, y, -1); +} + +void Scumm::o5_walkActorToActor() +{ + int b, x, y; + Actor *a, *a2; + int nr; + int nr2 = getVarOrDirectByte(0x80); + a = derefActorSafe(nr2, "o5_walkActorToActor"); + if (!a) + return; + + if (!a->isInCurrentRoom()) { + getVarOrDirectByte(0x40); + fetchScriptByte(); + return; + } + + nr = getVarOrDirectByte(0x40); + if (nr == 106 && _gameId == GID_INDY4) { + warning("Bypassing Indy4 bug"); + fetchScriptByte(); + return; + } + // warning("walk actor %d to actor %d", nr, nr2); + a2 = derefActorSafe(nr, "o5_walkActorToActor(2)"); + if (!a2) + return; + + if (!a2->isInCurrentRoom()) { + fetchScriptByte(); + return; + } + b = fetchScriptByte(); /* distance from actor */ + if (b == 0xFF) { + b = a2->scalex * a->width / 0xFF; + b = b + b / 2; + } + x = a2->x; + y = a2->y; + if (x < a->x) + x += b; + else + x -= b; + + a->startWalkActor(x, y, -1); +} + +void Scumm::o5_walkActorToObject() +{ + int obj; + Actor *a; + + // warning("walk object to object"); + + a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject"); + obj = getVarOrDirectWord(0x40); + if (whereIsObject(obj) != WIO_NOT_FOUND) { + int x, y, dir; + getObjectXYPos(obj, x, y, dir); + a->startWalkActor(x, y, dir); + } +} + +int Scumm::getWordVararg(int16 *ptr) +{ + int i; + + for (i = 0; i < 15; i++) + ptr[i] = 0; + + i = 0; + while ((_opcode = fetchScriptByte()) != 0xFF) { + ptr[i++] = getVarOrDirectWord(0x80); + } + return i; +} + +int Scumm::getVarOrDirectWord(byte mask) +{ + if (_opcode & mask) + return readVar(fetchScriptWord()); + return (int16)fetchScriptWord(); +} + +int Scumm::getVarOrDirectByte(byte mask) +{ + if (_opcode & mask) + return readVar(fetchScriptWord()); + return fetchScriptByte(); +} + +void Scumm::decodeParseString() +{ + int textSlot; + + switch (_actorToPrintStrFor) { + case 252: + textSlot = 3; + break; + case 253: + textSlot = 2; + break; + case 254: + textSlot = 1; + break; + default: + textSlot = 0; + } + + string[textSlot].xpos = string[textSlot].t_xpos; + string[textSlot].ypos = string[textSlot].t_ypos; + string[textSlot].center = string[textSlot].t_center; + string[textSlot].overhead = string[textSlot].t_overhead; + string[textSlot].right = string[textSlot].t_right; + string[textSlot].color = string[textSlot].t_color; + string[textSlot].charset = string[textSlot].t_charset; + + while ((_opcode = fetchScriptByte()) != 0xFF) { + switch (_opcode & 0xF) { + case 0: /* set string xy */ + string[textSlot].xpos = getVarOrDirectWord(0x80); + string[textSlot].ypos = getVarOrDirectWord(0x40); + string[textSlot].overhead = false; + break; + case 1: /* color */ + string[textSlot].color = getVarOrDirectByte(0x80); + break; + case 2: /* right */ + string[textSlot].right = getVarOrDirectWord(0x80); + break; + case 4: /* center */ + string[textSlot].center = true; + string[textSlot].overhead = false; + break; + case 6: /* left */ + string[textSlot].center = false; + string[textSlot].overhead = false; + break; + case 7: /* overhead */ + string[textSlot].overhead = true; + break; + case 8:{ /* play loom talkie sound - use in other games ? */ + int x = getVarOrDirectWord(0x80); + int offset; + int delay; + + if (x != 0) + offset = (int)((x & 0xffff) * 7.5 - 22650); + else + offset = 0; + delay = (int)((getVarOrDirectWord(0x40) & 0xffff) * 7.5); + if (_gameId == GID_LOOM256) { + _vars[VAR_MI1_TIMER] = 0; + if (offset == 0 && delay == 0) { +#ifdef COMPRESSED_SOUND_FILE + if (_sound->stopMP3CD() == -1) +#endif + _system->stop_cdrom(); + } else { +#ifdef COMPRESSED_SOUND_FILE + if (_sound->playMP3CDTrack(1, 0, offset, delay) == -1) +#endif + _system->play_cdrom(1, 0, offset, delay); + } + } else { + warning("parseString: 8"); + } + } + break; + case 15: + _messagePtr = _scriptPointer; + switch (textSlot) { + case 0: + actorTalk(); + break; + case 1: + drawString(1); + break; + case 2: + unkMessage1(); + break; + case 3: + unkMessage2(); + break; + } + _scriptPointer = _messagePtr; + return; + default: + return; + } + } + + string[textSlot].t_xpos = string[textSlot].xpos; + string[textSlot].t_ypos = string[textSlot].ypos; + string[textSlot].t_center = string[textSlot].center; + string[textSlot].t_overhead = string[textSlot].overhead; + string[textSlot].t_right = string[textSlot].right; + string[textSlot].t_color = string[textSlot].color; + string[textSlot].t_charset = string[textSlot].charset; +} + +void Scumm::o5_oldRoomEffect() +{ + int a; + + _opcode = fetchScriptByte(); + if ((_opcode & 0x1F) == 3) { + a = getVarOrDirectWord(0x80); + if (a) { + _switchRoomEffect = (byte)a; + _switchRoomEffect2 = (byte)(a >> 8); + } else { + fadeIn(_newEffect); + } + } +} + +void Scumm::o5_pickupObjectOld() +{ + int obj = getVarOrDirectWord(0x80); + + // FIXME: Zak256 (Zaire): Why does this happen at all? + if (obj < 1) { + warning("pickupObjectOld received negative index %d (0x%02x)", obj, obj); + return; + } + + if (getObjectIndex(obj) == -1) + return; + + if (whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */ + return; /* object twice */ + + // warning("adding %d from %d to inventoryOld", obj, _currentRoom); + addObjectToInventory(obj, _roomResource); + removeObjectFromRoom(obj); + putOwner(obj, _vars[VAR_EGO]); + putClass(obj, 32, 1); + putState(obj, 1); + clearDrawObjectQueue(); + runHook(1); +} diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp new file mode 100644 index 0000000000..5f85f746c2 --- /dev/null +++ b/scumm/script_v2.cpp @@ -0,0 +1,3141 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" +#include "smush.h" + +#include "sound/mididrv.h" +#include "scumm/imuse.h" + +void Scumm::setupOpcodes2() +{ + static const OpcodeProc opcode_list[256] = { + /* 00 */ + &Scumm::o6_pushByte, + &Scumm::o6_pushWord, + &Scumm::o6_pushByteVar, + &Scumm::o6_pushWordVar, + /* 04 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayRead, + &Scumm::o6_wordArrayRead, + /* 08 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayIndexedRead, + &Scumm::o6_wordArrayIndexedRead, + /* 0C */ + &Scumm::o6_dup, + &Scumm::o6_zero, + &Scumm::o6_eq, + &Scumm::o6_neq, + /* 10 */ + &Scumm::o6_gt, + &Scumm::o6_lt, + &Scumm::o6_le, + &Scumm::o6_ge, + /* 14 */ + &Scumm::o6_add, + &Scumm::o6_sub, + &Scumm::o6_mul, + &Scumm::o6_div, + /* 18 */ + &Scumm::o6_land, + &Scumm::o6_lor, + &Scumm::o6_kill, + &Scumm::o6_invalid, + /* 1C */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 20 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 24 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 28 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 2C */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 30 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 34 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 38 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 3C */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* 40 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_writeByteVar, + &Scumm::o6_writeWordVar, + /* 44 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayWrite, + &Scumm::o6_wordArrayWrite, + /* 48 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayIndexedWrite, + &Scumm::o6_wordArrayIndexedWrite, + /* 4C */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteVarInc, + &Scumm::o6_wordVarInc, + /* 50 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayInc, + &Scumm::o6_wordArrayInc, + /* 54 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteVarDec, + &Scumm::o6_wordVarDec, + /* 58 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_byteArrayDec, + &Scumm::o6_wordArrayDec, + /* 5C */ + &Scumm::o6_jumpTrue, + &Scumm::o6_jumpFalse, + &Scumm::o6_startScriptEx, + &Scumm::o6_startScript, + /* 60 */ + &Scumm::o6_startObject, + &Scumm::o6_setObjectState, + &Scumm::o6_setObjectXY, + &Scumm::o6_drawBlastObject, + /* 64 */ + &Scumm::o6_setBlastObjectWindow, + &Scumm::o6_stopObjectCode, + &Scumm::o6_stopObjectCode, + &Scumm::o6_endCutscene, + /* 68 */ + &Scumm::o6_cutScene, + &Scumm::o6_stopMusic, + &Scumm::o6_freezeUnfreeze, + &Scumm::o6_cursorCommand, + /* 6C */ + &Scumm::o6_breakHere, + &Scumm::o6_ifClassOfIs, + &Scumm::o6_setClass, + &Scumm::o6_getState, + /* 70 */ + &Scumm::o6_setState, + &Scumm::o6_setOwner, + &Scumm::o6_getOwner, + &Scumm::o6_jump, + /* 74 */ + &Scumm::o6_startSound, + &Scumm::o6_stopSound, + &Scumm::o6_startMusic, + &Scumm::o6_stopObjectScript, + /* 78 */ + &Scumm::o6_panCameraTo, + &Scumm::o6_actorFollowCamera, + &Scumm::o6_setCameraAt, + &Scumm::o6_loadRoom, + /* 7C */ + &Scumm::o6_stopScript, + &Scumm::o6_walkActorToObj, + &Scumm::o6_walkActorTo, + &Scumm::o6_putActorInRoom, + /* 80 */ + &Scumm::o6_putActorAtObject, + &Scumm::o6_faceActor, + &Scumm::o6_animateActor, + &Scumm::o6_doSentence, + /* 84 */ + &Scumm::o6_pickupObject, + &Scumm::o6_loadRoomWithEgo, + &Scumm::o6_invalid, + &Scumm::o6_getRandomNumber, + /* 88 */ + &Scumm::o6_getRandomNumberRange, + &Scumm::o6_invalid, + &Scumm::o6_getActorMoving, + &Scumm::o6_getScriptRunning, + /* 8C */ + &Scumm::o6_getActorRoom, + &Scumm::o6_getObjectX, + &Scumm::o6_getObjectY, + &Scumm::o6_getObjectOldDir, + /* 90 */ + &Scumm::o6_getActorWalkBox, + &Scumm::o6_getActorCostume, + &Scumm::o6_findInventory, + &Scumm::o6_getInventoryCount, + /* 94 */ + &Scumm::o6_getVerbFromXY, + &Scumm::o6_beginOverride, + &Scumm::o6_endOverride, + &Scumm::o6_setObjectName, + /* 98 */ + &Scumm::o6_isSoundRunning, + &Scumm::o6_setBoxFlags, + &Scumm::o6_createBoxMatrix, + &Scumm::o6_resourceRoutines, + /* 9C */ + &Scumm::o6_roomOps, + &Scumm::o6_actorSet, + &Scumm::o6_verbOps, + &Scumm::o6_getActorFromXY, + /* A0 */ + &Scumm::o6_findObject, + &Scumm::o6_pseudoRoom, + &Scumm::o6_getActorElevation, + &Scumm::o6_getVerbEntrypoint, + /* A4 */ + &Scumm::o6_arrayOps, + &Scumm::o6_saveRestoreVerbs, + &Scumm::o6_drawBox, + &Scumm::o6_invalid, + /* A8 */ + &Scumm::o6_getActorWidth, + &Scumm::o6_wait, + &Scumm::o6_getActorScaleX, + &Scumm::o6_getActorAnimCounter1, + /* AC */ + &Scumm::o6_soundKludge, + &Scumm::o6_isAnyOf, + &Scumm::o6_quitPauseRestart, + &Scumm::o6_isActorInBox, + /* B0 */ + &Scumm::o6_delay, + &Scumm::o6_delayLonger, + &Scumm::o6_delayVeryLong, + &Scumm::o6_stopSentence, + /* B4 */ + &Scumm::o6_print_0, + &Scumm::o6_print_1, + &Scumm::o6_print_2, + &Scumm::o6_print_3, + /* B8 */ + &Scumm::o6_printActor, + &Scumm::o6_printEgo, + &Scumm::o6_talkActor, + &Scumm::o6_talkEgo, + /* BC */ + &Scumm::o6_dim, + &Scumm::o5_dummy, + &Scumm::o6_runVerbCodeQuick, + &Scumm::o6_runScriptQuick, + /* C0 */ + &Scumm::o6_dim2, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* C4 */ + &Scumm::o6_abs, + &Scumm::o6_distObjectObject, + &Scumm::o6_distObjectPt, + &Scumm::o6_distPtPt, + /* C8 */ + &Scumm::o6_kernelFunction, + &Scumm::o6_miscOps, + &Scumm::o6_breakMaybe, + &Scumm::o6_pickOneOf, + /* CC */ + &Scumm::o6_pickOneOfDefault, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* D0 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_getAnimateVariable, + &Scumm::o6_invalid, + /* D4 */ + &Scumm::o6_invalid, + &Scumm::o6_jumpToScript, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* D8 */ + &Scumm::o6_isRoomScriptRunning, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* DC */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* E0 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* E4 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* E8 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* EC */ + &Scumm::o6_getActorPriority, + &Scumm::o6_getObjectNewDir, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* F0 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* F4 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* F8 */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + /* FC */ + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + &Scumm::o6_invalid, + }; + + static const char *opcode_lookup[] = { + /* 00 */ + "o6_pushByte", + "o6_pushWord", + "o6_pushByteVar", + "o6_pushWordVar", + /* 04 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayRead", + "o6_wordArrayRead", + /* 08 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayIndexedRead", + "o6_wordArrayIndexedRead", + /* 0C */ + "o6_dup", + "o6_zero", + "o6_eq", + "o6_neq", + /* 10 */ + "o6_gt", + "o6_lt", + "o6_le", + "o6_ge", + /* 14 */ + "o6_add", + "o6_sub", + "o6_mul", + "o6_div", + /* 18 */ + "o6_land", + "o6_lor", + "o6_kill", + "o6_invalid", + /* 1C */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 20 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 24 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 28 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 2C */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 30 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 34 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 38 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 3C */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* 40 */ + "o6_invalid", + "o6_invalid", + "o6_writeByteVar", + "o6_writeWordVar", + /* 44 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayWrite", + "o6_wordArrayWrite", + /* 48 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayIndexedWrite", + "o6_wordArrayIndexedWrite", + /* 4C */ + "o6_invalid", + "o6_invalid", + "o6_byteVarInc", + "o6_wordVarInc", + /* 50 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayInc", + "o6_wordArrayInc", + /* 54 */ + "o6_invalid", + "o6_invalid", + "o6_byteVarDec", + "o6_wordVarDec", + /* 58 */ + "o6_invalid", + "o6_invalid", + "o6_byteArrayDec", + "o6_wordArrayDec", + /* 5C */ + "o6_jumpTrue", + "o6_jumpFalse", + "o6_startScriptEx", + "o6_startScript", + /* 60 */ + "o6_startObject", + "o6_setObjectState", + "o6_setObjectXY", + "o6_drawBlastObject", + /* 64 */ + "o6_invalid", + "o6_stopObjectCode", + "o6_stopObjectCode", + "o6_endCutscene", + /* 68 */ + "o6_cutScene", + "o6_stopMusic", + "o6_freezeUnfreeze", + "o6_cursorCommand", + /* 6C */ + "o6_breakHere", + "o6_ifClassOfIs", + "o6_setClass", + "o6_getState", + /* 70 */ + "o6_setState", + "o6_setOwner", + "o6_getOwner", + "o6_jump", + /* 74 */ + "o6_startSound", + "o6_stopSound", + "o6_startMusic", + "o6_stopObjectScript", + /* 78 */ + "o6_panCameraTo", + "o6_actorFollowCamera", + "o6_setCameraAt", + "o6_loadRoom", + /* 7C */ + "o6_stopScript", + "o6_walkActorToObj", + "o6_walkActorTo", + "o6_putActorInRoom", + /* 80 */ + "o6_putActorAtObject", + "o6_faceActor", + "o6_animateActor", + "o6_doSentence", + /* 84 */ + "o6_pickupObject", + "o6_loadRoomWithEgo", + "o6_invalid", + "o6_getRandomNumber", + /* 88 */ + "o6_getRandomNumberRange", + "o6_invalid", + "o6_getActorMoving", + "o6_getScriptRunning", + /* 8C */ + "o6_getActorRoom", + "o6_getObjectX", + "o6_getObjectY", + "o6_getObjectOldDir", + /* 90 */ + "o6_getActorWalkBox", + "o6_getActorCostume", + "o6_findInventory", + "o6_getInventoryCount", + /* 94 */ + "o6_getVerbFromXY", + "o6_beginOverride", + "o6_endOverride", + "o6_setObjectName", + /* 98 */ + "o6_isSoundRunning", + "o6_setBoxFlags", + "o6_createBoxMatrix", + "o6_resourceRoutines", + /* 9C */ + "o6_roomOps", + "o6_actorSet", + "o6_verbOps", + "o6_getActorFromXY", + /* A0 */ + "o6_findObject", + "o6_pseudoRoom", + "o6_getActorElevation", + "o6_getVerbEntrypoint", + /* A4 */ + "o6_arrayOps", + "o6_saveRestoreVerbs", + "o6_drawBox", + "o6_invalid", + /* A8 */ + "o6_getActorWidth", + "o6_wait", + "o6_getActorScaleX", + "o6_getActorAnimCounter1", + /* AC */ + "o6_soundKludge", + "o6_isAnyOf", + "o6_quitPauseRestart", + "o6_isActorInBox", + /* B0 */ + "o6_delay", + "o6_delayLonger", + "o6_delayVeryLong", + "o6_stopSentence", + /* B4 */ + "o6_print_0", + "o6_print_1", + "o6_print_2", + "o6_print_3", + /* B8 */ + "o6_printActor", + "o6_printEgo", + "o6_talkActor", + "o6_talkEgo", + /* BC */ + "o6_dim", + "o6_invalid", + "o6_runVerbCodeQuick", + "o6_runScriptQuick", + /* C0 */ + "o6_dim2", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* C4 */ + "o6_abs", + "o6_distObjectObject", + "o6_distObjectPt", + "o6_distPtPt", + /* C8 */ + "o6_kernelFunction", + "o6_miscOps", + "o6_breakMaybe", + "o6_pickOneOf", + /* CC */ + "o6_pickOneOfDefault", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* D0 */ + "o6_invalid", + "o6_invalid", + "o6_getAnimateVariable", + "o6_invalid", + /* D4 */ + "o6_invalid", + "o6_jumpToScript", + "o6_invalid", + "o6_invalid", + /* D8 */ + "o6_isRoomScriptRunning", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* DC */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* E0 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* E4 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* E8 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* EC */ + "o6_invalid", + "o6_getObjectNewDir", + "o6_invalid", + "o6_invalid", + /* F0 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* F4 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* F8 */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid", + /* FC */ + "o6_invalid", + "o6_invalid", + "o6_invalid", + "o6_invalid" + }; + + _opcodes = opcode_list; + _opcodes_lookup = opcode_lookup; +} +void Scumm::o6_setBlastObjectWindow() +{ // Set BOMP processing window + int a, b, c, d; + + d = pop(); + c = pop(); + b = pop(); + a = pop(); + + warning("o6_bompWindow(%d, %d, %d, %d)", a, b, c, d); + // sub_274EF(a, b, c, d); +} + +int Scumm::popRoomAndObj(int *room) +{ + int obj; + + if (_features & GF_HAS_ROOMTABLE) { + obj = pop(); + *room = getObjectRoom(obj); + } else { + *room = pop(); + obj = pop(); + } + + return obj; +} + + +int Scumm::readArray(int array, int idx, int base) +{ + ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); + + if (ah == NULL) { + error("readArray: invalid array %d (%d)", array, readVar(array)); + } + + base += idx * ah->dim1_size; + + assert(base >= 0 && base < ah->dim1_size * ah->dim2_size); + + if (ah->type == 4) { + return ah->data[base]; + } else { + return (int16)READ_LE_UINT16(ah->data + base * 2); + } +} + +void Scumm::writeArray(int array, int idx, int base, int value) +{ + ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); + assert(ah); + base += idx * ah->dim1_size; + + assert(base >= 0 && base < ah->dim1_size * ah->dim2_size); + + if (ah->type == 4) { + ah->data[base] = value; + } else { + ((uint16 *)ah->data)[base] = TO_LE_16(value); + } +} + +int Scumm::getStackList(int16 *args, uint maxnum) +{ + uint num, i; + + for (i = 0; i < maxnum; i++) + args[i] = 0; + + num = pop(); + + if (num > maxnum) + error("Too many items %d in stack list, max %d", num, maxnum); + + i = num; + while (((int)--i) >= 0) { + args[i] = pop(); + } + + return num; +} + +void Scumm::o6_pushByte() +{ + push(fetchScriptByte()); +} + +void Scumm::o6_pushWord() +{ + push((int16)fetchScriptWord()); +} + +void Scumm::o6_pushByteVar() +{ + push(readVar(fetchScriptByte())); +} + +void Scumm::o6_pushWordVar() +{ + push(readVar(fetchScriptWord())); +} + +void Scumm::o6_invalid() +{ + error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); +} + +void Scumm::o6_byteArrayRead() +{ + int base = pop(); + push(readArray(fetchScriptByte(), 0, base)); +} + +void Scumm::o6_wordArrayRead() +{ + int base = pop(); + push(readArray(fetchScriptWord(), 0, base)); +} + +void Scumm::o6_byteArrayIndexedRead() +{ + int base = pop(); + int idx = pop(); + push(readArray(fetchScriptByte(), idx, base)); +} + +void Scumm::o6_wordArrayIndexedRead() +{ + int base = pop(); + int idx = pop(); + push(readArray(fetchScriptWord(), idx, base)); +} + +void Scumm::o6_dup() +{ + int a = pop(); + push(a); + push(a); +} + +void Scumm::o6_zero() +{ + push(pop() == 0); +} + +void Scumm::o6_eq() +{ + push(pop() == pop()); +} + +void Scumm::o6_neq() +{ + push(pop() != pop()); +} + +void Scumm::o6_gt() +{ + int a = pop(); + push(pop() > a); +} + +void Scumm::o6_lt() +{ + int a = pop(); + push(pop() < a); +} + +void Scumm::o6_le() +{ + int a = pop(); + push(pop() <= a); +} + +void Scumm::o6_ge() +{ + int a = pop(); + push(pop() >= a); +} + +void Scumm::o6_add() +{ + int a = pop(); + push(pop() + a); +} + +void Scumm::o6_sub() +{ + int a = pop(); + push(pop() - a); +} + +void Scumm::o6_mul() +{ + int a = pop(); + push(pop() * a); +} + +void Scumm::o6_div() +{ + int a = pop(); + if (a == 0) + error("division by zero"); + push(pop() / a); +} + +void Scumm::o6_land() +{ + int a = pop(); + push(pop() && a); +} + +void Scumm::o6_lor() +{ + int a = pop(); + push(pop() || a); +} + +void Scumm::o6_kill() +{ + pop(); +} + +void Scumm::o6_writeByteVar() +{ + writeVar(fetchScriptByte(), pop()); +} + +void Scumm::o6_writeWordVar() +{ + writeVar(fetchScriptWord(), pop()); +} + +void Scumm::o6_byteArrayWrite() +{ + int a = pop(); + writeArray(fetchScriptByte(), 0, pop(), a); +} + +void Scumm::o6_wordArrayWrite() +{ + int a = pop(); + writeArray(fetchScriptWord(), 0, pop(), a); +} + +void Scumm::o6_byteArrayIndexedWrite() +{ + int val = pop(); + int base = pop(); + writeArray(fetchScriptByte(), pop(), base, val); +} + +void Scumm::o6_wordArrayIndexedWrite() +{ + int val = pop(); + int base = pop(); + writeArray(fetchScriptWord(), pop(), base, val); +} + +void Scumm::o6_byteVarInc() +{ + int var = fetchScriptByte(); + writeVar(var, readVar(var) + 1); +} + +void Scumm::o6_wordVarInc() +{ + int var = fetchScriptWord(); + writeVar(var, readVar(var) + 1); +} + +void Scumm::o6_byteArrayInc() +{ + int var = fetchScriptByte(); + int base = pop(); + writeArray(var, 0, base, readArray(var, 0, base) + 1); +} + +void Scumm::o6_wordArrayInc() +{ + int var = fetchScriptWord(); + int base = pop(); + writeArray(var, 0, base, readArray(var, 0, base) + 1); +} + + +void Scumm::o6_byteVarDec() +{ + int var = fetchScriptByte(); + writeVar(var, readVar(var) - 1); +} + +void Scumm::o6_wordVarDec() +{ + int var = fetchScriptWord(); + writeVar(var, readVar(var) - 1); +} + +void Scumm::o6_byteArrayDec() +{ + int var = fetchScriptByte(); + int base = pop(); + writeArray(var, 0, base, readArray(var, 0, base) - 1); +} + +void Scumm::o6_wordArrayDec() +{ + int var = fetchScriptWord(); + int base = pop(); + writeArray(var, 0, base, readArray(var, 0, base) - 1); +} + +void Scumm::o6_jumpTrue() +{ + if (pop()) + o6_jump(); + else + fetchScriptWord(); +} + +void Scumm::o6_jumpFalse() +{ + if (!pop()) + o6_jump(); + else + fetchScriptWord(); +} + +void Scumm::o6_jump() +{ + _scriptPointer += (int16)fetchScriptWord(); +} + +void Scumm::o6_startScriptEx() +{ + int16 args[16]; + int script, flags; + + getStackList(args, sizeof(args) / sizeof(args[0])); + script = pop(); + flags = pop(); + runScript(script, flags & 1, flags & 2, args); +} + +void Scumm::o6_jumpToScript() +{ + int16 args[16]; + int script, flags; + + getStackList(args, sizeof(args) / sizeof(args[0])); + script = pop(); + flags = pop(); + o6_stopObjectCode(); + runScript(script, flags & 1, flags & 2, args); +} + +void Scumm::o6_startScript() +{ + int16 args[16]; + int script; + getStackList(args, sizeof(args) / sizeof(args[0])); + script = pop(); + runScript(script, 0, 0, args); +} + +void Scumm::o6_startObject() +{ + int16 args[16]; + int script, entryp; + int flags; + getStackList(args, sizeof(args) / sizeof(args[0])); + entryp = pop(); + script = pop(); + flags = pop(); + runVerbCode(script, entryp, flags & 1, flags & 2, args); +} + +void Scumm::o6_setObjectState() +{ + int a = pop(); + int b = pop(); + if (a == 0) + a = 1; +// debug(1, "setObjectState(%d,%d)", a, b); + + setObjectState(b, a, -1, -1); +} + +void Scumm::o6_setObjectXY() +{ + int y = pop(); + int x = pop(); + int obj = pop(); +// debug(1, "setObjectXY(%d,%d,%d)", obj, x, y); + setObjectState(obj, 1, x, y); +} + +void Scumm::o6_stopObjectCode() +{ + stopObjectCode(); +} + +void Scumm::o6_endCutscene() +{ + endCutscene(); +} + +void Scumm::o6_cutScene() +{ + int16 args[16]; + getStackList(args, sizeof(args) / sizeof(args[0])); + cutscene(args); +} + +void Scumm::o6_stopMusic() +{ + _sound->stopAllSounds(); +} + +void Scumm::o6_freezeUnfreeze() +{ + int a = pop(); + if (a) + freezeScripts(a); + else + unfreezeScripts(); +} + +void Scumm::o6_cursorCommand() +{ + int a, i; + int16 args[16]; + + switch (fetchScriptByte()) { + case 0x90: + _cursorState = 1; + verbMouseOver(0); + break; + case 0x91: + _cursorState = 0; + verbMouseOver(0); + break; + case 0x92: + _userPut = 1; + break; + case 0x93: + _userPut = 0; + break; + case 0x94: + _cursorState++; + if (_cursorState > 1) + error("Cursor state greater than 1 in script"); + verbMouseOver(0); + break; + case 0x95: + _cursorState--; + verbMouseOver(0); + break; + case 0x96: + _userPut++; + break; + case 0x97: + _userPut--; + break; + case 0x99:{ + int room, obj = popRoomAndObj(&room); + setCursorImg(obj, room, 1); + break; + } + case 0x9A: + a = pop(); + setCursorHotspot2(pop(), a); + break; + case 0x9C: /* init charset */ + initCharset(pop()); + break; + case 0x9D: /* set charset colors */ + getStackList(args, sizeof(args) / sizeof(args[0])); + for (i = 0; i < 16; i++) + charset._colorMap[i] = _charsetData[string[1].t_charset][i] = (unsigned char)args[i]; + break; + case 0xD6: + makeCursorColorTransparent(pop()); + break; + default: + error("o6_cursorCommand: default case"); + } + + _vars[VAR_CURSORSTATE] = _cursorState; + _vars[VAR_USERPUT] = _userPut; +} + +void Scumm::o6_breakHere() +{ + updateScriptPtr(); + _currentScript = 0xFF; +} + +void Scumm::o6_ifClassOfIs() +{ + int16 args[16]; + int num, obj, cls; + bool b; + int cond = 1; + + num = getStackList(args, sizeof(args) / sizeof(args[0])); + obj = pop(); + + while (--num >= 0) { + cls = args[num]; + b = getClass(obj, cls); + if (cls & 0x80 && !b || !(cls & 0x80) && b) + cond = 0; + } + push(cond); +} + +void Scumm::o6_setClass() +{ + int16 args[16]; + int num, obj, cls; + + num = getStackList(args, sizeof(args) / sizeof(args[0])); + obj = pop(); + + while (--num >= 0) { + cls = args[num]; + if (cls == 0) + _classData[num] = 0; + else if (cls & 0x80) + putClass(obj, cls, 1); + else + putClass(obj, cls, 0); + } +} + +void Scumm::o6_getState() +{ + push(getState(pop())); +} + +void Scumm::o6_setState() +{ + int state = pop(); + int obj = pop(); + +// debug(1, "setState(%d,%d)", obj, state); + + putState(obj, state); + removeObjectFromRoom(obj); + if (_BgNeedsRedraw) + clearDrawObjectQueue(); +} + +void Scumm::o6_setOwner() +{ + int owner = pop(); + int obj = pop(); + + setOwnerOf(obj, owner); +} + +void Scumm::o6_getOwner() +{ + push(getOwner(pop())); +} + +void Scumm::o6_startSound() +{ + _sound->addSoundToQueue(pop()); +} + +void Scumm::o6_stopSound() +{ + _sound->stopSound(pop()); +} + +void Scumm::o6_startMusic() +{ + _sound->addSoundToQueue(pop()); +} + +void Scumm::o6_stopObjectScript() +{ + stopObjectScript(pop()); +} + +void Scumm::o6_panCameraTo() +{ + if (_features & GF_AFTER_V7) { + int y = pop(); + int x = pop(); + panCameraTo(x, y); + } else { + panCameraTo(pop(), 0); + } +} + +void Scumm::o6_actorFollowCamera() +{ + if (_features & GF_AFTER_V7) + setCameraFollows(derefActorSafe(pop(), "actorFollowCamera")); + else + actorFollowCamera(pop()); + +} + +void Scumm::o6_setCameraAt() +{ + if (_features & GF_AFTER_V7) { + int x, y; + + camera._follows = 0; + + y = pop(); + x = pop(); + + setCameraAt(x, y); + } else { + setCameraAtEx(pop()); + } +} + +void Scumm::o6_loadRoom() +{ + int room; + /* Begin: Autosave + _saveLoadSlot = 0; + sprintf(_saveLoadName, "Autosave", _saveLoadSlot); + _saveLoadFlag = 1; + _saveLoadCompatible = false; + End: Autosave */ + + room = pop(); + startScene(room, 0, 0); + _fullRedraw = 1; +} + +void Scumm::o6_stopScript() +{ + int script = pop(); + if (script == 0) + stopObjectCode(); + else + stopScriptNr(script); +} + +void Scumm::o6_walkActorToObj() +{ + int obj, dist; + Actor *a, *a2; + int x; + + dist = pop(); + obj = pop(); + a = derefActorSafe(pop(), "o6_walkActorToObj"); + if (!a) + return; + + if (obj >= NUM_ACTORS) { + if (whereIsObject(obj) == WIO_NOT_FOUND) + return; + int x, y, dir; + getObjectXYPos(obj, x, y, dir); + a->startWalkActor(x, y, dir); + } else { + a2 = derefActorSafe(obj, "o6_walkActorToObj(2)"); + if (!a2) + return; + if (!a->isInCurrentRoom() || !a2->isInCurrentRoom()) + return; + if (dist == 0) { + dist = a2->scalex * a2->width / 0xFF; + dist += dist >> 1; + } + x = a2->x; + if (x < a->x) + x += dist; + else + x -= dist; + a->startWalkActor(x, a2->y, -1); + } +} + +void Scumm::o6_walkActorTo() +{ + int x, y; + y = pop(); + x = pop(); + derefActorSafe(pop(), "o6_walkActorTo")->startWalkActor(x, y, -1); +} + +void Scumm::o6_putActorInRoom() +{ + int room, x, y; + Actor *a; + + room = pop(); + y = pop(); + x = pop(); + a = derefActorSafe(pop(), "o6_putActorInRoom"); + if (!a) + return; + + if (room == 0xFF) { + room = a->room; + } else { + if (a->visible && _currentRoom != room && _vars[VAR_TALK_ACTOR] == a->number) { + clearMsgQueue(); + } + if (room != 0) + a->room = room; + } + a->putActor(x, y, room); +} + + +void Scumm::o6_putActorAtObject() +{ + int room, obj, x, y; + Actor *a; + + obj = popRoomAndObj(&room); + + a = derefActorSafe(pop(), "o6_putActorAtObject"); + if (whereIsObject(obj) != WIO_NOT_FOUND) { + getObjectXYPos(obj, x, y); + } else { + x = 160; + y = 120; + } + if (room == 0xFF) + room = a->room; + a->putActor(x, y, room); +} + +void Scumm::o6_faceActor() +{ + int act, obj; + obj = pop(); + act = pop(); + faceActorToObj(act, obj); +} + +void Scumm::o6_animateActor() +{ + int anim = pop(); + int act = pop(); + + Actor *a = derefActorSafe(act, "o6_animateActor"); + if (!a) + return; + + a->animateActor(anim); +} + +void Scumm::o6_doSentence() +{ + int a, b, c; + + a = pop(); + pop(); //dummy pop + b = pop(); + c = pop(); + + doSentence(c, b, a); +} + +void Scumm::o6_pickupObject() +{ + int obj, room; + int i; + + obj = popRoomAndObj(&room); + if (room == 0) + room = _roomResource; + + for (i = 1; i < _maxInventoryItems; i++) { + if (_inventory[i] == (uint16)obj) { + putOwner(obj, _vars[VAR_EGO]); + runHook(obj); + return; + } + } + + addObjectToInventory(obj, room); + putOwner(obj, _vars[VAR_EGO]); + putClass(obj, 32, 1); + putState(obj, 1); + removeObjectFromRoom(obj); + clearDrawObjectQueue(); + runHook(obj); /* Difference */ +} + +void Scumm::o6_loadRoomWithEgo() +{ + Actor *a; + int obj, room, x, y; + + y = pop(); + x = pop(); + + obj = popRoomAndObj(&room); + + a = derefActorSafe(_vars[VAR_EGO], "o6_loadRoomWithEgo"); + + a->putActor(0, 0, room); + _egoPositioned = false; + + _vars[VAR_WALKTO_OBJ] = obj; + startScene(a->room, a, obj); + _vars[VAR_WALKTO_OBJ] = 0; + + /* startScene maybe modifies VAR_EGO, i hope not */ + + if (!(_features & GF_AFTER_V7)) { + setCameraAt(a->x, a->y); + setCameraFollows(a); + } + + _fullRedraw = 1; + + if (x != -1) { + a->startWalkActor(x, y, -1); + } +} + +void Scumm::o6_getRandomNumber() +{ + int rnd; + rnd = getRandomNumber(pop()); + _vars[VAR_V6_RANDOM_NR] = rnd; + push(rnd); +} + +void Scumm::o6_getRandomNumberRange() +{ + int max = pop(); + int min = pop(); + int rnd = getRandomNumberRng(min, max); + _vars[VAR_V6_RANDOM_NR] = rnd; + push(rnd); +} + +void Scumm::o6_getActorMoving() +{ + push(derefActorSafe(pop(), "o6_getActorMoving")->moving); +} + +void Scumm::o6_getScriptRunning() +{ + push(isScriptRunning(pop())); +} + +void Scumm::o6_isRoomScriptRunning() +{ + push(isRoomScriptRunning(pop())); +} + +void Scumm::o6_getActorRoom() +{ + push(derefActorSafe(pop(), "o6_getActorRoom")->room); +} + +void Scumm::o6_getObjectX() +{ + push(getObjX(pop())); +} + +void Scumm::o6_getObjectY() +{ + push(getObjY(pop())); +} + +void Scumm::o6_getObjectOldDir() +{ + push(getObjOldDir(pop())); +} + +void Scumm::o6_getObjectNewDir() +{ + push(getObjNewDir(pop())); +} + +void Scumm::o6_getActorWalkBox() +{ + Actor *a = derefActorSafe(pop(), "o6_getActorWalkBox"); + push(a->ignoreBoxes ? 0 : a->walkbox); +} + +void Scumm::o6_getActorCostume() +{ + push(derefActorSafe(pop(), "o6_getActorCostume")->costume); +} + +void Scumm::o6_findInventory() +{ + int idx = pop(); + int owner = pop(); + push(findInventory(owner, idx)); +} + +void Scumm::o6_getInventoryCount() +{ + push(getInventoryCount(pop())); +} + +void Scumm::o6_getVerbFromXY() +{ + int y = pop(); + int x = pop(); + int over = checkMouseOver(x, y); + if (over) + over = _verbs[over].verbid; + push(over); +} + +void Scumm::o6_beginOverride() +{ + beginOverride(); +} + +void Scumm::o6_endOverride() +{ + endOverride(); +} + +void Scumm::o6_setObjectName() +{ + int obj = pop(); + int i; + + if (obj < NUM_ACTORS) + error("Can't set actor %d name with new-name-of", obj); + + if (!(_features & GF_AFTER_V7) && !getOBCDFromObject(obj)) + error("Can't set name of object %d", obj); + + for (i = 1; i < 50; i++) { + if (_newNames[i] == obj) { + nukeResource(rtObjectName, i); + _newNames[i] = 0; + break; + } + } + + for (i = 1; i < 50; i++) { + if (_newNames[i] == 0) { + loadPtrToResource(rtObjectName, i, NULL); + _newNames[i] = obj; + runHook(0); + return; + } + } + + error("New name of %d overflows name table (max = %d)", obj, 50); +} + +void Scumm::o6_isSoundRunning() +{ + int snd = pop(); + + // FIXME: This fixes wak-a-rat until we correctly implement + // sam and max iMUSE + if (_gameId == GID_SAMNMAX && _currentRoom == 18 && snd == 23) { + _sound->stopSound(snd); + push(0); + return; + } + + if (snd) + snd = _sound->isSoundRunning(snd); + + push(snd); +} + +void Scumm::o6_setBoxFlags() +{ + int16 table[65]; + int num, value; + + value = pop(); + num = getStackList(table, sizeof(table) / sizeof(table[0])); + + while (--num >= 0) { + setBoxFlags(table[num], value); + } +} + +void Scumm::o6_createBoxMatrix() +{ + createBoxMatrix(); +} + +void Scumm::o6_resourceRoutines() +{ + int resid; + + switch (fetchScriptByte()) { + case 100: /* load script */ + resid = pop(); + if (_features & GF_AFTER_V7) + if (resid >= _numGlobalScripts) + break; + ensureResourceLoaded(rtScript, resid); + break; + case 101: /* load sound */ + resid = pop(); + ensureResourceLoaded(rtSound, resid); + break; + case 102: /* load costume */ + resid = pop(); + ensureResourceLoaded(rtCostume, resid); + break; + case 103: /* load room */ + resid = pop(); + ensureResourceLoaded(rtRoom, resid); + break; + case 104: /* nuke script */ + resid = pop(); + if (_features & GF_AFTER_V7) + if (resid >= _numGlobalScripts) + break; + setResourceCounter(rtScript, resid, 0x7F); + debug(5, "nuke script %d", resid); + break; + case 105: /* nuke sound */ + resid = pop(); + setResourceCounter(rtSound, resid, 0x7F); + break; + case 106: /* nuke costume */ + resid = pop(); + setResourceCounter(rtCostume, resid, 0x7F); + break; + case 107: /* nuke room */ + resid = pop(); + setResourceCounter(rtRoom, resid, 0x7F); + break; + case 108: /* lock script */ + resid = pop(); + if (resid >= _numGlobalScripts) + break; + lock(rtScript, resid); + break; + case 109: /* lock sound */ + resid = pop(); + lock(rtSound, resid); + break; + case 110: /* lock costume */ + resid = pop(); + lock(rtCostume, resid); + break; + case 111: /* lock room */ + resid = pop(); + if (resid > 0x7F) + resid = _resourceMapper[resid & 0x7F]; + lock(rtRoom, resid); + break; + case 112: /* unlock script */ + resid = pop(); + if (resid >= _numGlobalScripts) + break; + unlock(rtScript, resid); + break; + case 113: /* unlock sound */ + resid = pop(); + unlock(rtSound, resid); + break; + case 114: /* unlock costume */ + resid = pop(); + unlock(rtCostume, resid); + break; + case 115: /* unlock room */ + resid = pop(); + if (resid > 0x7F) + resid = _resourceMapper[resid & 0x7F]; + unlock(rtRoom, resid); + break; + case 116: /* clear heap */ + /* this is actually a scumm message */ + error("clear heap not working yet"); + break; + case 117: /* load charset */ + resid = pop(); + loadCharset(resid); + break; + case 118: /* nuke charset */ + resid = pop(); + nukeCharset(resid); + break; + case 119:{ /* load fl object */ + int room, obj = popRoomAndObj(&room); + loadFlObject(obj, room); + break; + } + default: + error("o6_resourceRoutines: default case"); + } +} + +void Scumm::o6_roomOps() +{ + int a, b, c, d, e; + + switch (fetchScriptByte()) { + case 172: /* room scroll */ + b = pop(); + a = pop(); + if (a < 160) + a = 160; + if (b < 160) + b = 160; + if (a > _scrWidth - 160) + a = _scrWidth - 160; + if (b > _scrWidth - 160) + b = _scrWidth - 160; + _vars[VAR_CAMERA_MIN_X] = a; + _vars[VAR_CAMERA_MAX_X] = b; + break; + + case 174: /* set screen */ + b = pop(); + a = pop(); + initScreens(0, a, 320, b); + break; + + case 175: /* set palette color */ + d = pop(); + c = pop(); + b = pop(); + a = pop(); + setPalColor(d, a, b, c); + break; + + case 176: /* shake on */ + setShake(1); + break; + + case 177: /* shake off */ + setShake(0); + break; + + case 179: + c = pop(); + b = pop(); + a = pop(); + darkenPalette(b, c, a, a, a); + break; + + case 180: + _saveLoadCompatible = true; + _saveLoadSlot = pop(); + _saveLoadFlag = pop(); + warning("o6_roomops:180: partially unimplemented"); + break; + + case 181: + a = pop(); + if (a) { + _switchRoomEffect = (byte)(a); + _switchRoomEffect2 = (byte)(a >> 8); + } else { + fadeIn(_newEffect); + } + break; + + case 182: + e = pop(); + d = pop(); + c = pop(); + b = pop(); + a = pop(); + darkenPalette(d, e, a, b, c); + break; + + case 183: + e = pop(); + d = pop(); + c = pop(); + b = pop(); + a = pop(); + unkRoomFunc3(d, e, a, b, c); + break; + + case 184: + error("save string not implemented"); + break; + + case 185: + error("load string not implemented"); + break; + + case 186: /* palmanip? */ + d = pop(); + c = pop(); + b = pop(); + a = pop(); + palManipulate(a, b, c, d, 1); + break; + + case 187: /* color cycle delay */ + b = pop(); + a = pop(); + checkRange(16, 1, a, "o6_roomOps: 187: color cycle out of range (%d)"); + _colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0; + break; + + case 213: /* set palette */ + // One case where this is used is to turn off Sam & Max film + // noir mode. Unfortunately it only restores color to the + // palette, it doesn't take palette manipulation (darkening, + // etc.) into account. So, for instance, if you turn on film + // noir mode in Sam & Max's office, turn off the light and turn + // off film noir mode, the room will no longer look dark. + // + // This bug is present in the original interpreter, so it may + // not be worth the trouble fixing it. + setPalette(pop()); + break; + + default: + error("o6_roomOps: default case"); + } +} + +void Scumm::o6_actorSet() +{ + Actor *a; + int i, j, k; + int16 args[8]; + byte b; + + b = fetchScriptByte(); + if (b == 197) { + _curActor = pop(); + return; + } + + a = derefActorSafe(_curActor, "o6_actorSet"); + if (!a) + return; + + switch (b) { + case 76: /* actor-costume */ + a->setActorCostume(pop()); + break; + case 77: /* actor-speed */ + j = pop(); + i = pop(); + a->setActorWalkSpeed(i, j); + break; + case 78: /* actor-sound */ + k = getStackList(args, sizeof(args) / sizeof(args[0])); + for (i = 0; i < k; i++) + a->sound[i] = args[i]; + break; + case 79: /* actor-walkframe */ + a->walkFrame = pop(); + break; + case 80: /* actor-talkframe */ + a->talkFrame2 = pop(); + a->talkFrame1 = pop(); + break; + case 81: /* actor-standframe */ + a->standFrame = pop(); + break; + case 82: + pop(); + pop(); + pop(); + break; + case 83: + a->initActor(0); + break; + case 84: /* actor-elevation */ + a->elevation = pop(); + a->needRedraw = true; + a->needBgReset = true; + break; + case 85: /* actor-defaultanims */ + a->initFrame = 1; + a->walkFrame = 2; + a->standFrame = 3; + a->talkFrame1 = 4; + a->talkFrame2 = 5; + break; + case 86: /* actor-palette */ + j = pop(); + i = pop(); + checkRange(31, 0, i, "Illegal palet slot %d"); + a->palette[i] = j; + a->needRedraw = true; + break; + case 87: /* actor-talkcolor */ + a->talkColor = pop(); + break; + case 88: /* actor-name */ + loadPtrToResource(rtActorName, a->number, NULL); + break; + case 89: /* actor-initframe */ + a->initFrame = pop(); + break; + case 91: + a->width = pop(); + break; + case 92: + a->scalex = a->scaley = pop(); + a->needRedraw = true; + a->needBgReset = true; + break; + case 93: + a->forceClip = 0; + break; + case 225: + case 94: + a->forceClip = pop(); + break; + case 95: + a->ignoreBoxes = 1; + if (_features & GF_AFTER_V7) // yazoo: I don't know if it's supposed to be 100 in other games too... + a->forceClip = 100; + else + a->forceClip = 0; + FixRooms:; + if (a->isInCurrentRoom()) + a->putActor(a->x, a->y, a->room); + break; + case 96: + a->ignoreBoxes = 0; + if (_features & GF_AFTER_V7) // yazoo: I don't know if it's supposed to be 100 in other games too... + a->forceClip = 100; + else + a->forceClip = 0; + goto FixRooms; + case 97: + a->animSpeed = pop(); + a->animProgress = 0; + break; + case 98: + a->shadow_mode = pop(); + break; + case 99: + a->new_1 = pop(); + a->new_2 = pop(); + break; + case 198: /* set anim variable */ + i = pop(); /* value */ + a->setAnimVar(pop(), i); + break; + case 215: + a->new_3 = 1; + break; + case 216: + a->new_3 = 0; + break; + case 217: + a->initActor(2); + break; + case 227: /* actor_layer */ + a->layer = pop(); + break; + case 228: /* walk script */ + a->walk_script = pop(); + break; + case 235: /* talk_script */ + a->talk_script = pop(); + break; + case 229: /* stand */ + a->stopActorMoving(); + a->startAnimActor(a->standFrame); + break; + case 230: /* set direction */ + a->moving &= ~MF_TURN; + a->setDirection(pop()); + break; + case 231: /* turn to direction */ + a->turnToDirection(pop()); + break; + case 233: /* freeze actor */ + a->moving |= 0x80; + break; + case 234: /* unfreeze actor */ + a->moving &= ~0x7f; + break; + default: + error("o6_actorset: default case %d", b); + } +} + +void Scumm::o6_verbOps() +{ + int slot, a, b; + VerbSlot *vs; + byte *ptr, op; + + op = fetchScriptByte(); + if (op == 196) { + _curVerb = pop(); + _curVerbSlot = getVerbSlot(_curVerb, 0); + checkRange(_maxVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d"); + return; + } + vs = &_verbs[_curVerbSlot]; + slot = _curVerbSlot; + switch (op) { + case 124: /* load img */ + a = pop(); + if (_curVerbSlot) { + setVerbObject(_roomResource, a, slot); + vs->type = 1; + } + break; + case 125: + loadPtrToResource(rtVerb, slot, NULL); + vs->type = 0; + vs->imgindex = 0; + break; + case 126: + vs->color = pop(); + break; + case 127: + vs->hicolor = pop(); + break; + case 128: + vs->y = pop(); + vs->x = pop(); + break; + case 129: + vs->curmode = 1; + break; + case 130: + vs->curmode = 0; + break; + case 131: + killVerb(slot); + break; + case 132: + slot = getVerbSlot(_curVerb, 0); + if (slot == 0) { + for (slot = 1; slot < _maxVerbs; slot++) { + if (_verbs[slot].verbid == 0) + break; + } + if (slot == _maxVerbs) + error("Too many verbs"); + _curVerbSlot = slot; + } + vs = &_verbs[slot]; + vs->verbid = _curVerb; + vs->color = 2; + vs->hicolor = 0; + vs->dimcolor = 8; + vs->type = 0; + vs->charset_nr = string[0].t_charset; + vs->curmode = 0; + vs->saveid = 0; + vs->key = 0; + vs->center = 0; + vs->imgindex = 0; + break; + case 133: + vs->dimcolor = pop(); + break; + case 134: + vs->curmode = 2; + break; + case 135: + vs->key = pop(); + break; + case 136: + vs->center = 1; + break; + case 137: + a = pop(); + if (a == 0) { + ptr = (byte *)""; + } else { + ptr = getStringAddress(a); + } + loadPtrToResource(rtVerb, slot, ptr); + vs->type = 0; + vs->imgindex = 0; + break; + case 139: + b = pop(); + a = pop(); + if (slot && a != vs->imgindex) { + setVerbObject(b, a, slot); + vs->type = 1; + vs->imgindex = a; + } + break; + case 140: + vs->bkcolor = pop(); + break; + case 255: + drawVerb(slot, 0); + verbMouseOver(0); + break; + default: + error("o6_verbops: default case"); + } +} + +void Scumm::o6_getActorFromXY() +{ + int y = pop(); + int x = pop(); + push(getActorFromPos(x, y)); +} + +void Scumm::o6_findObject() +{ + int y = pop(); + int x = pop(); + int r = findObject(x, y); + push(r); +} + +void Scumm::o6_pseudoRoom() +{ + int16 list[100]; + int num, a, value; + + num = getStackList(list, sizeof(list) / sizeof(list[0])); + value = pop(); + + while (--num >= 0) { + a = list[num]; + if (a > 0x7F) + _resourceMapper[a & 0x7F] = value; + } +} + +void Scumm::o6_getActorElevation() +{ + push(derefActorSafe(pop(), "o6_getActorElevation")->elevation); +} + +void Scumm::o6_getVerbEntrypoint() +{ + int e = pop(); + int v = pop(); + push(getVerbEntrypoint(v, e)); +} + +void Scumm::o6_arrayOps() +{ + int a, b, c, d, num; + int16 list[128]; + + switch (fetchScriptByte()) { + case 205: + a = fetchScriptWord(); + pop(); + arrayop_1(a, NULL); + break; + case 208: + a = fetchScriptWord(); + b = pop(); + c = pop(); + d = readVar(a); + if (d == 0) { + defineArray(a, 5, 0, b + c); + } + while (c--) { + writeArray(a, 0, b + c, pop()); + } + break; + case 212: + a = fetchScriptWord(); + b = pop(); + num = getStackList(list, sizeof(list) / sizeof(list[0])); + d = readVar(a); + if (d == 0) + error("Must DIM a two dimensional array before assigning"); + c = pop(); + while (--num >= 0) { + writeArray(a, c, b + num, list[num]); + } + break; + default: + error("o6_arrayOps: default case"); + } +} + +void Scumm::o6_saveRestoreVerbs() +{ + int a, b, c; + int slot, slot2; + + c = pop(); + b = pop(); + a = pop(); + + switch (fetchScriptByte()) { + case 141: + while (a <= b) { + slot = getVerbSlot(a, 0); + if (slot && _verbs[slot].saveid == 0) { + _verbs[slot].saveid = c; + drawVerb(slot, 0); + verbMouseOver(0); + } + a++; + } + break; + case 142: + while (a <= b) { + slot = getVerbSlot(a, c); + if (slot) { + slot2 = getVerbSlot(a, 0); + if (slot2) + killVerb(slot2); + slot = getVerbSlot(a, c); + _verbs[slot].saveid = 0; + drawVerb(slot, 0); + verbMouseOver(0); + } + a++; + } + break; + case 143: + while (a <= b) { + slot = getVerbSlot(a, c); + if (slot) + killVerb(slot); + a++; + } + break; + default: + error("o6_saveRestoreVerbs: default case"); + } +} + +void Scumm::o6_drawBox() +{ + int x, y, x2, y2, color; + color = pop(); + y2 = pop(); + x2 = pop(); + y = pop(); + x = pop(); + drawBox(x, y, x2, y2, color); +} + +void Scumm::o6_getActorWidth() +{ + push(derefActorSafe(pop(), "o6_getActorWidth")->width); +} + +void Scumm::o6_wait() +{ + switch (fetchScriptByte()) { + case 168:{ + int offs = (int16)fetchScriptWord(); + if (derefActorSafe(pop(), "o6_wait")->moving) { + _scriptPointer += offs; + o6_breakHere(); + } + return; + } + case 169: + //printf("waiting for message: %d\n", _vars[VAR_HAVE_MSG]); + + if (_vars[VAR_HAVE_MSG]) + break; + return; + case 170: + if (!(_features & GF_AFTER_V7)) { + if (camera._cur.x >> 3 != camera._dest.x >> 3) + break; + } else { + if (camera._dest.x != camera._cur.x || camera._dest.y != camera._cur.y) + break; + } + + return; + case 171: + printf("wait for sentence"); + if (_sentenceNum) { + if (sentence[_sentenceNum - 1].unk && !isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) + return; + break; + } + if (!isScriptInUse(_vars[VAR_SENTENCE_SCRIPT])) + return; + break; + case 226:{ /* wait until actor drawn */ + Actor *a = derefActorSafe(pop(), "o6_wait:226"); + int offs = (int16)fetchScriptWord(); + if (a && a->isInCurrentRoom() && a->needRedraw) { + _scriptPointer += offs; + o6_breakHere(); + } + return; + } + case 232:{ /* wait until actor stops turning */ + Actor *a = derefActorSafe(pop(), "o6_wait:226"); + int offs = (int16)fetchScriptWord(); + if (a && a->isInCurrentRoom() && a->moving & MF_TURN) { + _scriptPointer += offs; + o6_breakHere(); + } + return; + } + default: + error("o6_wait: default case"); + } + + _scriptPointer -= 2; + o6_breakHere(); +} + +void Scumm::o6_getActorScaleX() +{ + push(derefActorSafe(pop(), "o6_getActorScale")->scalex); +} + +void Scumm::o6_getActorAnimCounter1() +{ + push(derefActorSafe(pop(), "o6_getActorAnimCounter")->cost.animCounter1); +} + +void Scumm::o6_getAnimateVariable() +{ + int var = pop(); + push(derefActorSafe(pop(), "o6_getAnimateVariable")->getAnimVar(var)); +} + +void Scumm::o6_soundKludge() +{ + int16 list[16]; + getStackList(list, sizeof(list) / sizeof(list[0])); + + /* (yazoo): I don't know enought about the sound code to + * fix the looping sound bug. FIXME !*/ + + if (list[1] == 163 && _gameId == GID_DIG) + return; + + _sound->soundKludge(list); +} + +void Scumm::o6_isAnyOf() +{ + int16 list[100]; + int num; + int16 val; + + num = getStackList(list, sizeof(list) / sizeof(list[0])); + val = pop(); + + while (--num >= 0) { + if (list[num] == val) { + push(1); + return; + } + } + push(0); + return; +} + +void Scumm::o6_quitPauseRestart() +{ + switch (fetchScriptByte()) { + case 158: + pauseGame(false); + break; + case 160: + shutDown(0); + break; + default: + error("o6_quitPauseRestart: invalid case"); + } +} + +void Scumm::o6_isActorInBox() +{ + int box = pop(); + Actor *a = derefActorSafe(pop(), "o6_isActorInBox"); + push(checkXYInBoxBounds(box, a->x, a->y)); +} + +void Scumm::o6_delay() +{ + uint32 delay = (uint16)pop(); + vm.slot[_currentScript].delay = delay; + vm.slot[_currentScript].status = 1; + o6_breakHere(); +} + +void Scumm::o6_delayLonger() +{ + uint32 delay = (uint16)pop() * 60; + vm.slot[_currentScript].delay = delay; + vm.slot[_currentScript].status = 1; + o6_breakHere(); +} + +void Scumm::o6_delayVeryLong() +{ + uint32 delay = (uint16)pop() * 3600; + vm.slot[_currentScript].delay = delay; + vm.slot[_currentScript].status = 1; + o6_breakHere(); +} + +void Scumm::o6_stopSentence() +{ + _sentenceNum = 0; + stopScriptNr(_vars[VAR_SENTENCE_SCRIPT]); + clearClickedStatus(); +} + +void Scumm::o6_print_0() +{ + _actorToPrintStrFor = 0xFF; + decodeParseString2(0, 0); +} + +void Scumm::o6_print_1() +{ + decodeParseString2(1, 0); +} + +void Scumm::o6_print_2() +{ + decodeParseString2(2, 0); +} + +void Scumm::o6_print_3() +{ + decodeParseString2(3, 0); +} + +void Scumm::o6_printActor() +{ + decodeParseString2(0, 1); +} + +void Scumm::o6_printEgo() +{ + push(_vars[VAR_EGO]); + decodeParseString2(0, 1); +} + +void Scumm::o6_talkActor() +{ + _actorToPrintStrFor = pop(); + _messagePtr = _scriptPointer; + + if (_scriptPointer[0] == '/') { + char *pointer = strtok((char *)_scriptPointer, "/"); + int bunsize = strlen(pointer) + 2; + _sound->playBundleSound(pointer); + _scriptPointer += bunsize; + _messagePtr = _scriptPointer; + } + + setStringVars(0); + actorTalk(); + _scriptPointer = _messagePtr; +} + +void Scumm::o6_talkEgo() +{ + _actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; + _messagePtr = _scriptPointer; + + if (_scriptPointer[0] == '/') { + char *pointer = strtok((char *)_scriptPointer, "/"); + int bunsize = strlen(pointer) + 2; + _sound->playBundleSound(pointer); + _scriptPointer += bunsize; + _messagePtr = _scriptPointer; + } + + setStringVars(0); + actorTalk(); + _scriptPointer = _messagePtr; +} + +void Scumm::o6_dim() +{ + int data; + + switch (fetchScriptByte()) { + case 199: + data = 5; + break; + case 200: + data = 1; + break; + case 201: + data = 2; + break; + case 202: + data = 3; + break; + case 203: + data = 4; + break; + case 204: + nukeArray(fetchScriptWord()); + return; + default: + error("o6_dim : default case"); + } + + defineArray(fetchScriptWord(), data, 0, pop()); +} + +void Scumm::o6_runVerbCodeQuick() +{ + int16 args[16]; + int script, entryp; + getStackList(args, sizeof(args) / sizeof(args[0])); + entryp = pop(); + script = pop(); + runVerbCode(script, entryp, 0, 1, args); +} + +void Scumm::o6_runScriptQuick() +{ + int16 args[16]; + int script; + getStackList(args, sizeof(args) / sizeof(args[0])); + script = pop(); + runScript(script, 0, 1, args); +} + +void Scumm::o6_dim2() +{ + int a, b, data; + switch (fetchScriptByte()) { + case 199: + data = 5; + break; + case 200: + data = 1; + break; + case 201: + data = 2; + break; + case 202: + data = 3; + break; + case 203: + data = 4; + break; + default: + error("o6_dim2: default case"); + } + + b = pop(); + a = pop(); + defineArray(fetchScriptWord(), data, a, b); +} + +void Scumm::o6_abs() +{ + push(abs(pop())); +} + + +void Scumm::o6_distObjectObject() +{ + int a, b; + b = pop(); + a = pop(); + push(getDistanceBetween(true, a, 0, true, b, 0)); +} + +void Scumm::o6_distObjectPt() +{ + int a, b, c; + c = pop(); + b = pop(); + a = pop(); + push(getDistanceBetween(true, a, 0, false, b, c)); +} + +void Scumm::o6_distPtPt() +{ + int a, b, c, d; + d = pop(); + c = pop(); + b = pop(); + a = pop(); + push(getDistanceBetween(false, a, b, false, c, d)); +} + +void Scumm::o6_dummy_stacklist() +{ + error("opcode o6_dummy_stacklist invalid"); +} + +void Scumm::o6_drawBlastObject() +{ + int16 args[16]; + int a, b, c, d, e; + + getStackList(args, sizeof(args) / sizeof(args[0])); + e = pop(); + d = pop(); + c = pop(); + b = pop(); + a = pop(); + enqueueObject(a, b, c, d, e, 0xFF, 0xFF, 1, 0); +} + +void Scumm::o6_miscOps() +{ + int16 args[30]; + int i; + Actor *a; + + IMuse *se = _imuse; //yazoo: not very nice + SmushPlayer * sp; + + getStackList(args, sizeof(args) / sizeof(args[0])); + + if (_features & GF_AFTER_V7) { + switch (args[0]) { + case 4: + grabCursor(args[1], args[2], args[3], args[4]); + break; + case 6: + sp = new SmushPlayer(this); + sp->startVideo(args[1], getStringAddressVar(VAR_VIDEONAME)); + delete sp; + break; + case 7: + warning("o6_miscOps: stub7()"); + break; + case 10: + warning("o6_miscOps: stub10(%d,%d,%d,%d)", args[1], args[2], args[3], args[4]); + break; + case 11: + warning("o6_miscOps: stub11(%d)", args[1]); + break; + case 12: + setCursorImg(args[1], (uint) - 1, args[2]); + break; + case 13: + derefActorSafe(args[1], "o6_miscOps:14")->remapActorPalette(args[2], args[3], args[4], -1); + break; + case 14: + derefActorSafe(args[1], "o6_miscOps:14")->remapActorPalette(args[2], args[3], args[4], args[5]); + break; + case 15: + _insaneFlag = args[1]; + break; + case 16: + if (_gameId == GID_DIG) { + _msgPtrToAdd = charset._buffer; + addMessageToStack(getStringAddressVar(VAR_STRING2DRAW)); + i = 0; + while (charset._buffer[i] != 0) { + if (charset._buffer[i] == '/') { + charset._bufPos = i + 1; + } + i++; + } + description(); + } + break; + case 17: + warning("o6_miscOps: stub17(%d,%d,%d,%d)", args[1], args[2], args[3], args[4]); + break; + case 18: + warning("o6_miscOps: stub18(%d,%d)", args[1], args[2]); + break; + case 107: + a = derefActorSafe(args[1], "o6_miscops: 107"); + a->scalex = (unsigned char)args[2]; + a->needBgReset = true; + a->needRedraw = true; + break; + case 108: + setupShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]); + break; + case 109: + setupShadowPalette(0, args[1], args[2], args[3], args[4], args[5]); + break; + case 114: + warning("o6_miscOps: stub114()"); + break; + case 117: + freezeScripts(2); + break; + case 118: + enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 3); + break; + case 119: + enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0); + break; + case 120: + warning("o6_miscOps: stub120(%d,%d)", args[1], args[2]); + break; + case 124: + warning("o6_miscOps: stub124(%d)", args[1]); + break; + } + } else { + switch (args[0]) { + case 3: + warning("o6_miscOps: nothing in 3"); + break; + case 4: + grabCursor(args[1], args[2], args[3], args[4]); + break; + case 5: + fadeOut(args[1]); + break; + case 6: + _fullRedraw = 1; + redrawBGAreas(); + for (i = 0; i < NUM_ACTORS; i++) + derefActor(i)->needRedraw = true; + processActors(); + fadeIn(args[1]); + break; + case 8: + startManiac(); + break; + case 9: + unkMiscOp9(); + break; + + case 104: /* samnmax */ + nukeFlObjects(args[2], args[3]); + break; + + case 106: + error("stub o6_miscOps_106()"); + break; + + case 107: /* set actor scale */ + a = derefActorSafe(args[1], "o6_miscops: 107"); + a->scalex = (unsigned char)args[2]; + a->needBgReset = true; + a->needRedraw = true; + break; + + case 108: /* create proc_special_palette */ + case 109: + + createSpecialPalette(args[1], args[2], args[3], args[4], args[5], 0, 256); + break; + + case 110: + gdi.clearUpperMask(); + break; + + case 111: + a = derefActorSafe(args[1], "o6_miscops: 111"); + a->shadow_mode = args[2] + args[3]; + break; + + case 112: /* palette shift? */ + createSpecialPalette(args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + break; + + case 114: + // Sam & Max film noir mode + if (_gameId == GID_SAMNMAX) { + // At this point ScummVM will already have set + // variable 0x8000 to indicate that the game is + // in film noir mode. All we have to do here is + // to mark the palette as "dirty", and the next + // call to updatePalette() will take care of + // the rest. + // + // Actually, for extra bug-compatibility we + // should call desaturatePalette() here only, + // instead of in updatePalette(). To see the + // difference in behaviour, try turning on film + // noir mode in Sam & Max's office. The + // background will be grayscale, but Sam and + // Max themselves will be in color. + setDirtyColors(0, 255); + } else + warning("stub o6_miscOps_114()"); + break; + + case 117: + warning("stub o6_miscOps_117()"); + break; + + case 118: + error("stub o6_miscOps_118(%d,%d,%d,%d,%d,%d,%d)", + args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + break; + + case 119: + enqueueObject(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], 0); + break; + + case 120: + swapPalColors(args[1], args[2]); + break; + + case 121: + error("stub o6_miscOps_121(%d)", args[1]); + break; + + case 122: + + _vars[VAR_SOUNDRESULT] = + (short)se->do_command(args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8] + ); + break; + + case 123: + swapPalColors(args[1], args[2]); + break; + + case 124: /* samnmax */ + warning("o6_miscOps: _saveSound=%d", args[1]); + _saveSound = args[1]; + break; + + default: + error("o6_miscOps: default case %d", args[0]); + } + } +} + +void Scumm::o6_kernelFunction() +{ + int16 args[30]; + int i; + Actor *a; + + getStackList(args, sizeof(args) / sizeof(args[0])); + + switch (args[0]) { + case 113: + // Do something to [1] x [2] (x/y) + warning("o6_kernelFunction: stub113(%d,%d)", args[1], args[2]); + push(0); + break; + case 115: + push(getSpecialBox(args[1], args[2])); + break; + case 116: + push(checkXYInBoxBounds(args[3], args[1], args[2])); + break; + case 206: + push(remapPaletteColor(args[1], args[2], args[3], (uint) - 1)); + break; + case 207: + i = getObjectIndex(pop()); + push(_objs[i].x_pos); + break; + case 208: + i = getObjectIndex(pop()); + push(_objs[i].y_pos); + break; + case 209: + i = getObjectIndex(pop()); + push(_objs[i].width); + break; + case 210: + i = getObjectIndex(pop()); + push(_objs[i].height); + break; + case 211: + warning("o6_kernelFunction: getInput(%d)", args[1]); + /* + 13 = thrust + 336 = thrust + 328 = thrust + 27 = abord + 97 = left + 331 = left + 115 = right + 333 = tight + */ + push(0); + break; + case 212: + a = derefActorSafe(args[1], "o6_kernelFunction:212"); + push(a->frame); + break; + case 215: + if (_extraBoxFlags[args[1]] & 0x00FF == 0x00C0) { + push(_extraBoxFlags[args[1]]); + } else { + byte *temp = (byte *)getBoxBaseAddr(args[1]); + push((byte)(*(temp + 17))); + } + break; + default: + error("o6_kernelFunction: default case %d", args[0]); + } +} + +void Scumm::o6_breakMaybe() +{ + ScriptSlot *ss = &vm.slot[_currentScript]; + if (ss->newfield == 0) { + ss->newfield = pop(); + } else { + ss->newfield--; + } + if (ss->newfield) { + _scriptPointer--; + o6_breakHere(); + } +} + +void Scumm::o6_pickOneOf() +{ + int16 args[100]; + int i, num; + + num = getStackList(args, sizeof(args) / sizeof(args[0])); + i = pop(); + if (i < 0 || i >= num) + error("o6_pickOneOf: out of range"); + push(args[i]); +} + +void Scumm::o6_pickOneOfDefault() +{ + int16 args[100]; + int i, num, def; + + def = pop(); + num = getStackList(args, sizeof(args) / sizeof(args[0])); + i = pop(); + if (i < 0 || i >= num) + i = def; + else + i = args[i]; + push(i); +} + +void Scumm::o6_getActorPriority() +{ + Actor *a; + + a = derefActorSafe(pop(), "getActorPriority"); + + push(a->layer); +} + +void Scumm::decodeParseString2(int m, int n) +{ + byte b; + + b = fetchScriptByte(); + + switch (b) { + case 65: + string[m].ypos = pop(); + string[m].xpos = pop(); + string[m].overhead = false; + break; + case 66: + string[m].color = pop(); + break; + case 67: + string[m].right = pop(); + break; + case 69: + string[m].center = true; + string[m].overhead = false; + break; + case 71: + string[m].center = false; + string[m].overhead = false; + break; + case 72: + string[m].overhead = true; + string[m].no_talk_anim = false; + break; + case 73: + error("decodeParseString2: case 73"); + break; + case 74: + string[m].no_talk_anim = true; + break; + case 75:{ + _messagePtr = _scriptPointer; + + if (_scriptPointer[0] == '/') { + char *pointer = strtok((char *)_scriptPointer, "/"); + int bunsize = strlen(pointer) + 2; + _sound->playBundleSound(pointer); + _scriptPointer += bunsize; + _messagePtr = _scriptPointer; + } + + switch (m) { + case 0: + actorTalk(); + break; + case 1: + drawString(1); + break; + case 2: + unkMessage1(); + break; + case 3: + unkMessage2(); + break; + } + _scriptPointer = _messagePtr; + return; + } + case 0xFE: + setStringVars(m); + if (n) + _actorToPrintStrFor = pop(); + return; + case 0xFF: + string[m].t_xpos = string[m].xpos; + string[m].t_ypos = string[m].ypos; + string[m].t_center = string[m].center; + string[m].t_overhead = string[m].overhead; + string[m].t_no_talk_anim = string[m].no_talk_anim; + string[m].t_right = string[m].right; + string[m].t_color = string[m].color; + string[m].t_charset = string[m].charset; + return; + default: + error("decodeParseString: default case"); + } +} + +void Scumm::setupShadowPalette(int slot, int rfact, int gfact, int bfact, int from, int to) +{ + byte *table; + int i, num; + byte *curpal; + + if (slot < 0 || slot > 7) + error("setupShadowPalette: invalid slot %d", slot); + + if (from < 0 || from > 255 || to < 0 || from > 255 || to < from) + error("setupShadowPalette: invalid range from %d to %d", from, to); + + table = _shadowPalette + slot * 256; + for (i = 0; i < 256; i++) + table[i] = i; + + table += from; + curpal = _currentPalette + from * 3; + num = to - from + 1; + do { + *table++ = remapPaletteColor((curpal[0] * rfact) >> 8, + curpal[1] * gfact >> 8, curpal[2] * bfact >> 8, (uint) - 1); + curpal += 3; + } while (--num); +} diff --git a/scumm/scumm.h b/scumm/scumm.h new file mode 100644 index 0000000000..930d25e5d5 --- /dev/null +++ b/scumm/scumm.h @@ -0,0 +1,1414 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef SCUMM_H +#define SCUMM_H + +#include "engine.h" +#include "bundle.h" +#include "timer.h" +#include "sound.h" + +#define SCUMMVM_VERSION "0.2.2 CVS" +#define SCUMMVM_CVS "2002-08-03" + +#define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0) +#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) + +class GameDetector; +class Gui; +class NewGui; +class Scumm; +class IMuse; +class Actor; +struct ScummDebugger; +struct Serializer; +struct FindObjectInRoom; + +typedef void (Scumm::*OpcodeProc)(); + +// Use g_scumm from error() ONLY +extern Scumm *g_scumm; + +/* System Wide Constants */ +enum { + NUM_MIXER = 4, + NUM_SCRIPT_SLOT = 40, + NUM_LOCALSCRIPT = 60, + NUM_SHADOW_PALETTE = 8, + MAX_ACTORS = 30, + KEY_SET_OPTIONS = 3456 // WinCE +}; + +enum { + kDefaultMasterVolume = 192, + kDefaultSFXVolume = 192, + kDefaultMusicVolume = 192 +}; + +struct ScummPoint { + int x, y; +}; + +struct MemBlkHeader { + uint32 size; +}; + +struct VerbSlot { + int16 x, y; + int16 right, bottom; + int16 oldleft, oldtop, oldright, oldbottom; + uint8 verbid; + uint8 color, hicolor, dimcolor, bkcolor, type; + uint8 charset_nr, curmode; + uint8 saveid; + uint8 key; + bool center; + uint8 field_1B; + uint16 imgindex; +}; + +class ObjectData { +public: + uint32 offs_obim_to_room; + uint32 offs_obcd_to_room; + int16 walk_x, walk_y; + uint16 obj_nr; + int16 x_pos; + int16 y_pos; + uint16 width; + uint16 height; + byte actordir; + byte parent; + byte parentstate; + byte state; + byte fl_object_index; +}; + +struct ScriptSlot { + uint32 offs; + int32 delay; + uint16 number; + uint16 newfield; + byte status; + byte where; + byte unk1, unk2, freezeCount, didexec; + byte cutsceneOverride; + byte unk5; +}; + +struct NestedScript { + uint16 number; + uint8 where; + uint8 slot; +}; + +enum ResTypes { + rtFirst = 1, + rtRoom = 1, + rtScript = 2, + rtCostume = 3, + rtSound = 4, + rtInventory = 5, + rtCharset = 6, + rtString = 7, + rtVerb = 8, + rtActorName = 9, + rtBuffer = 10, + rtScaleTable = 11, + rtTemp = 12, + rtFlObject = 13, + rtMatrix = 14, + rtBox = 15, + rtObjectName = 16, + rtRoomScripts = 17, + rtLast = 17, + rtNumTypes = 18 +}; + +enum { + LIGHTMODE_dark = 0, + LIGHTMODE_actor_base = 1, + LIGHTMODE_screen = 2, + LIGHTMODE_flashlight = 4, + LIGHTMODE_actor_color = 8 +}; + +enum { + MBS_LEFT_CLICK = 0x8000, + MBS_RIGHT_CLICK = 0x4000, + MBS_MOUSE_MASK = (MBS_LEFT_CLICK | MBS_RIGHT_CLICK), + MBS_MAX_KEY = 0x0200 +}; + +#define _maxRooms res.num[rtRoom] +#define _maxScripts res.num[rtScript] +#define _maxCostumes res.num[rtCostume] +#define _maxInventoryItems res.num[rtInventory] +#define _maxCharsets res.num[rtCharset] +#define _maxStrings res.num[rtString] +#define _maxVerbs res.num[rtVerb] +#define _maxActorNames res.num[rtActorName] +#define _maxBuffer res.num[rtBuffer] +#define _maxScaleTable res.num[rtScaleTable] +#define _maxTemp res.num[rtTemp] +#define _maxFLObject res.num[rtFlObject] +#define _maxMatrixes res.num[rtMatrix] +#define _maxBoxes res.num[rtBox] + +#define _baseRooms res.address[rtRoom] +#define _baseScripts res.address[rtScript] +#define _baseInventoryItems res.address[rtInventory] +#define _baseFLObject res.address[rtFlObject] +#define _baseArrays res.address[rtString] + +#define _roomFileOffsets res.roomoffs[rtRoom] + +struct CharsetRenderer { + Scumm *_vm; + int _top; + int _drawTop; + int _left, _left2; + byte _center; + int _right; + byte _color; + bool _hasMask; + bool _blitAlso; + + int _strLeft, _strRight, _strTop, _strBottom; + byte _curId; + + int _xpos2, _ypos2; + + int _bufPos; + byte _unk12, _disableOffsX; + byte *_ptr; + byte _unk2, _bpp; + byte _invNumBits; + uint32 _charOffs; + byte *_charPtr; + int _width, _height; + int _offsX, _offsY; + byte _bitMask, _revBitMask; + int _bottom; + int _virtScreenHeight; + + byte _ignoreCharsetMask; + + byte *_backbuff_ptr, *_bgbak_ptr; + byte *_mask_ptr; + byte *_dest_ptr; + + byte _colorMap[16]; + byte _buffer[512]; + + void drawBits(); + void printChar(int chr); + void printCharOld(int chr); + int getSpacing(char chr); + int getStringWidth(int a, byte *str, int pos); + void addLinebreaks(int a, byte *str, int pos, int maxwidth); +}; + +#define ARRAY_HDR_SIZE 6 +struct ArrayHeader { + int16 dim1_size; + int16 type; + int16 dim2_size; + byte data[1]; +}; + +struct SentenceTab { + byte unk5; + byte unk2; + uint16 unk4; + uint16 unk3; + byte unk; + byte pad; +}; + +struct StringTab { + int16 t_xpos, t_ypos; + int16 t_right; + int16 xpos, ypos; + int16 right; + byte color, t_color; + byte charset, t_charset; + bool center, t_center; + bool overhead, t_overhead; + bool no_talk_anim, t_no_talk_anim; +}; + +enum GameId { + GID_TENTACLE = 1, + GID_MONKEY2 = 2, + GID_INDY4 = 3, + GID_MONKEY = 4, + GID_SAMNMAX = 5, + GID_MONKEY_EGA = 6, + GID_LOOM256 = 7, + GID_ZAK256 = 8, + GID_INDY3_256 = 9, + GID_LOOM = 10, + GID_FT = 11, + GID_DIG = 12, + GID_MONKEY_VGA = 13, + GID_CMI = 14, + + /* Simon the Sorcerer */ + GID_SIMON_FIRST = 20, + GID_SIMON_LAST = GID_SIMON_FIRST + 3, +}; + +enum GameFeatures { + GF_NEW_OPCODES = 1, + GF_AFTER_V6 = 2, + GF_AFTER_V7 = 4, + GF_HAS_ROOMTABLE = GF_AFTER_V7, + GF_USE_KEY = 8, + GF_NEW_COSTUMES = GF_AFTER_V7, + GF_USE_ANGLES = GF_AFTER_V7, + GF_DRAWOBJ_OTHER_ORDER = 16, + + GF_DEFAULT = GF_USE_KEY, + + GF_SMALL_HEADER = 32, + GF_EXTERNAL_CHARSET = GF_SMALL_HEADER, + GF_SMALL_NAMES = 64, + GF_OLD_BUNDLE = 128, + GF_16COLOR = 256, + GF_OLD256 = 512, + GF_AUDIOTRACKS = 1024, + GF_NO_SCALLING = 2048, + GF_ADLIB_DEFAULT = 4096, + GF_AMIGA = 8192, + GF_HUMONGOUS = 16384, + GF_AFTER_V8 = 32768 +}; + +enum WhereIsObject { + WIO_NOT_FOUND = -1, + WIO_INVENTORY = 0, + WIO_ROOM = 1, + WIO_GLOBAL = 2, + WIO_LOCAL = 3, + WIO_FLOBJECT = 4 +}; + +enum MouseButtonStatus { + msDown = 1, + msClicked = 2 +}; + +#include "gfx.h" +#include "boxes.h" + +class Scumm : public Engine { +public: + /* Put often used variables at the top. + * That results in a shorter form of the opcode + * on some architectures. */ + IMuse *_imuse; + Gui *_gui; + NewGui *_newgui; + uint32 _features; + VerbSlot *_verbs; + ObjectData *_objs; + ScummDebugger *_debugger; + Bundle * _bundle; + Timer * _timer; + Sound * _sound; + + struct { + byte mode[rtNumTypes]; + uint16 num[rtNumTypes]; + uint32 tags[rtNumTypes]; + const char *name[rtNumTypes]; + byte **address[rtNumTypes]; + byte *flags[rtNumTypes]; + byte *roomno[rtNumTypes]; + uint32 *roomoffs[rtNumTypes]; + } res; + + struct { + uint32 cutScenePtr[5]; + byte cutSceneScript[5]; + int16 cutSceneData[5]; + int16 cutSceneScriptIndex; + byte cutSceneStackPointer; + ScriptSlot slot[NUM_SCRIPT_SLOT]; + NestedScript nest[15]; + int16 localvar[NUM_SCRIPT_SLOT][17]; + } vm; + + struct { + int16 x, y; + } mouse; + + /* Init functions, etc */ + byte _fastMode; + char *getGameName(); + + /* video buffer */ + byte *_videoBuffer; + + /* system call object */ + + /* Scumm main loop */ + + void mainRun(); + + /* _insane vars */ + + int _insaneFlag; + int _insaneState; + int videoFinished; + + + void scummInit(); + void scummMain(int argc, char **argv); // is it still used ? + int scummLoop(int delta); + void initScummVars(); + + void pauseGame(bool user); + void shutDown(int i); + void setOptions(void); + + void main(); + void parseCommandLine(int argc, char **argv); + void showHelpAndExit(); + bool detectGame(); + void processKbd(); + void clear_fullRedraw(); + + int checkKeyHit(); + void convertKeysToClicks(); + + /* Random number generation */ + uint32 _randSeed1, _randSeed2; + void initRandSeeds(); + uint getRandomNumber(uint max); + uint getRandomNumberRng(uint min, uint max); + + /* Core variable definitions */ + byte _gameId; + const char *_gameText; + + /* Core class/array definitions */ + Gdi gdi; + + Actor *_actors; // Has MAX_ACTORS elements + + uint16 *_inventory; + byte *_arrays; + uint16 *_newNames; + int16 *_vars; + int16 _varwatch; + byte *_bitVars; + + /* Global resource tables */ + int _numVariables, _numBitVariables, _numLocalObjects; + int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; + int _numInventory, _numRooms, _numScripts, _numSounds; + int _numCharsets, _numCostumes, _numNewNames, _numGlobalScripts; + int NUM_ACTORS; + + /* Current objects - can go in their respective classes */ + byte _curActor; + int _curVerb; + int _curVerbSlot; + int _curPalIndex; + byte _currentRoom; + VirtScreen *_curVirtScreen; + + bool _egoPositioned; + int _keyPressed; + uint16 _lastKeyHit; + uint16 _mouseButStat; + byte _leftBtnPressed, _rightBtnPressed; + + int16 _virtual_mouse_x, _virtual_mouse_y, _bootParam; + uint16 _debugMode, _currentDrive, _soundCardType; + byte _mousePresent; + + /* Not sure where this stuff goes */ + byte isMaskActiveAt(int l, int t, int r, int b, byte *mem); + void startScene(int room, Actor *a, int b); + void setupScummVarsOld(); // Both of these will simply be one + void setupScummVarsNew(); // 'setupScummVars' in each Scumm_Vx + byte *_objectOwnerTable, *_objectRoomTable, *_objectStateTable; + byte _numObjectsInRoom; + int8 _userPut; + int _resourceHeaderSize; + void unkRoomFunc3(int a, int b, int c, int d, int e); + void palManipulate(int a, int b, int c, int d, int e); + void setScaleItem(int slot, int a, int b, int c, int d); + void clearClickedStatus(); + void startManiac(); + + /* GUI class */ + void drawString(int a); + int getKeyInput(int a); + + /* Save/Load class - some of this may be GUI */ + byte _saveLoadFlag, _saveLoadSlot; + bool _doAutosave; + bool _saveLoadCompatible; + char _saveLoadName[32]; + + bool saveState(int slot, bool compat); + bool loadState(int slot, bool compat); + void saveOrLoad(Serializer *s); + + bool getSavegameName(int slot, char *desc); + void makeSavegameName(char *out, int slot, bool compatible); + void saveLoadResource(Serializer *ser, int type, int index); + + /* Heap and memory management */ + uint32 _maxHeapThreshold, _minHeapThreshold; + void checkRange(int max, int min, int no, const char *str); + void lock(int type, int i); + void unlock(int type, int i); + void heapClear(int mode); + void unkHeapProc2(int a, int b); + + /* Script VM - should be in Script class */ + uint32 _localScriptList[NUM_LOCALSCRIPT]; + byte *_scriptPointer, *_scriptOrgPointer, *_scriptPointerStart; + byte _opcode, _numNestedScripts, _currentScript; + uint16 _curExecScript; + const OpcodeProc *_opcodes; + const char **_opcodes_lookup; + byte **_lastCodePtr; + int _resultVarNumber, _scummStackPos; + int16 _localParamList[16], _scummStack[150]; + + OpcodeProc getOpcode(int i) { return _opcodes[i]; } + void initializeLocals(int slot, int16 *vars); + int getScriptSlot(); + void runScript(int script, int a, int b, int16 *lvarptr); + void stopScriptNr(int script); + void runScriptNested(int script); + void executeScript(); + void updateScriptPtr(); + void getScriptBaseAddress(); + void getScriptEntryPoint(); + byte fetchScriptByte(); + int fetchScriptWord(); + void ignoreScriptWord() { fetchScriptWord(); } + void ignoreScriptByte() { fetchScriptByte(); } + int getVarOrDirectWord(byte mask); + int getVarOrDirectByte(byte mask); + void getResultPos(); + void setResult(int result); + int readVar(uint var); + void writeVar(uint var, int value); + void push(int a); + int pop(); + void runHook(int i); + bool isScriptInUse(int script); + int getStringLen(byte *ptr); + + void freezeScripts(int scr); + void unfreezeScripts(); + void runAllScripts(); + void setupOpcodes(); + void setupOpcodes2(); + void cutscene(int16 *args); + void endCutscene(); + void exitCutscene(); + void runExitScript(); + void runEntryScript(); + + void beginOverride(); + void endOverride(); + void killScriptsAndResources(); + void checkAndRunVar33(); + void decreaseScriptDelay(int amount); + bool isScriptRunning(int script); + bool isRoomScriptRunning(int script); + void arrayop_1(int a, byte *ptr); + void copyString(byte *dst, byte *src, int len); + void doSentence(int c, int b, int a); + int popRoomAndObj(int *room); + int getWordVararg(int16 *ptr); + void decodeParseString(); + void decodeParseString2(int a, int b); + + /* Script VM or Object class? */ + void stopObjectCode(); + void stopObjectScript(int script); + + /* Should be in Resource class */ + byte _encbyte; + void *_fileHandle; + char *_resFilePrefix, *_resFilePath; + uint32 _fileOffset; + char *_exe_name; + bool _dynamicRoomOffsets; + byte _resourceMapper[128]; + uint32 _allocatedSize; + byte _expire_counter; + + void allocateArrays(); + void openRoom(int room); + void deleteRoomOffsets(); + void readRoomsOffsets(); + void askForDisk(const char *filename); + bool openResourceFile(const char *filename); + void loadPtrToResource(int type, int i, byte *ptr); + void readResTypeList(int id, uint32 tag, const char *name); + char *resTypeFromId(int id); + void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); + byte *createResource(int type, int index, uint32 size); + void nukeResource(int type, int i); + byte *getResourceAddress(int type, int i); + byte *getStringAddress(int i); + byte *getStringAddressVar(int i); + void ensureResourceLoaded(int type, int i); + int loadResource(int type, int i); + int getResourceRoomNr(int type, int index); + int readSoundResource(int type, int index); + void setResourceCounter(int type, int index, byte flag); + void validateResource(const char *str, int type, int index); + void increaseResourceCounter(); + bool isResourceInUse(int type, int i); + bool isResourceLoaded(int type, int index); + void initRoomSubBlocks(); + void loadRoomObjects(); + void loadRoomObjectsSmall(); + void readArrayFromIndexFile(); + void readMAXS(); + bool isGlobInMemory(int type, int index); + virtual void readIndexFile(); + virtual void loadCharset(int i); + void nukeCharset(int i); + + bool fileReadFailed(void *handle); + void clearFileReadFailed(void *handle); + + int _lastLoadedRoom, _roomResource; + byte _resFilePathId, _fileReadFailed; + byte *findResourceData(uint32 tag, byte *ptr); + int getResourceDataSize(byte *ptr); + + int getArrayId(); + void nukeArray(int a); + int defineArray(int a, int b, int c, int d); + int readArray(int array, int index, int base); + void writeArray(int array, int index, int base, int value); + + void resourceStats(); + void expireResources(uint32 size); + void freeResources(); + void destroy(); + void dumpResource(char *tag, int index, byte *ptr); + + + /* Should be in Object class */ + byte OF_OWNER_ROOM; + int getInventorySlot(); + void SamInventoryHack(int obj); // FIXME: Sam and Max hack + int findInventory(int owner, int index); + int getInventoryCount(int owner); + + void setupRoomObject(ObjectData *od, byte *room); + void removeObjectFromRoom(int obj); + void loadFlObject(uint object, uint room); + void nukeFlObjects(int min, int max); + int findFlObjectSlot(); + void addObjectToInventory(uint obj, uint room); + void fixObjectFlags(); + bool getClass(int obj, int cls); + void putClass(int obj, int cls, bool set); + int getState(int obj); + void putState(int obj, int state); + void setObjectState(int obj, int state, int x, int y); + int getOwner(int obj); + void putOwner(int obj, int owner); + void setOwnerOf(int obj, int owner); + void clearOwnerOf(int obj); + int getObjectRoom(int obj); + int getObjX(int obj); + int getObjY(int obj); + void getObjectXYPos(int object, int &x, int &y) { int dir; getObjectXYPos(object, x, y, dir); } + void getObjectXYPos(int object, int &x, int &y, int &dir); + int getObjOldDir(int obj); + int getObjNewDir(int obj); + int getObjectIndex(int object); + int whereIsObject(int object); + int findObject(int x, int y); + void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room); + int getObjectOrActorXY(int object, int &x, int &y); // Object and Actor... + int getObjActToObjActDist(int a, int b); // Not sure how to handle + byte *getObjOrActorName(int obj); // these three.. + + void addObjectToDrawQue(int object); + void clearDrawObjectQueue(); + void processDrawQue(); + + uint32 getOBCDOffs(int object); + byte *getOBCDFromObject(int obj); + int getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f); + + /* Should be in Costume class */ + void cost_decodeData(Actor *a, int frame, uint usemask); + int cost_frameToAnim(Actor *a, int frame); + + + /* Should be in Verb class */ + uint16 _verbMouseOver; + int _inventoryOffset; + void redrawVerbs(); + void checkExecVerbs(); + void verbMouseOver(int verb); + int checkMouseOver(int x, int y); + void drawVerb(int verb, int mode); + void runInputScript(int a, int cmd, int mode); + void restoreVerbBG(int verb); + void drawVerbBitmap(int verb, int x, int y); + int getVerbEntrypoint(int obj, int entry); + int getVerbSlot(int id, int mode); + void killVerb(int slot); + void runVerbCode(int script, int entry, int a, int b, int16 *vars); + void setVerbObject(uint room, uint object, uint verb); + + /* Should be in Actor class */ + Actor *derefActor(int id); + Actor *derefActorSafe(int id, const char *errmsg); + Actor *getFirstActor() { return _actors; } + void showActors(); + + uint32 *_classData; + + int getAngleFromPos(int x, int y); + + void walkActors(); + void playActorSounds(); + void setActorRedrawFlags(); + void resetActorBgs(); + void processActors(); + int getActorFromPos(int x, int y); + void faceActorToObj(int act, int obj); + void actorFollowCamera(int act); + + bool isCostumeInUse(int i); + + /* Actor talking stuff */ + byte _actorToPrintStrFor; + int _sentenceNum; + SentenceTab sentence[6]; + StringTab string[6]; + void actorTalk(); + void stopTalk(); + + /* Akos Class */ + + bool akos_increaseAnims(byte *akos, Actor *a); + bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo); + + void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2); + bool akos_compare(int a, int b, byte cmd); + void akos_decodeData(Actor *a, int frame, uint usemask); + int akos_frameToAnim(Actor *a, int frame); + bool akos_hasManyDirections(Actor *a); + + + /* Should be in Graphics class? */ + uint16 _screenB, _screenH; + int _scrHeight, _scrWidth, _realHeight, _realWidth; + VirtScreen virtscr[4]; // Virtual screen areas + CameraData camera; // 'Camera' - viewport + ColorCycle _colorCycle[16]; // Palette cycles + + uint32 _ENCD_offs, _EXCD_offs; + uint32 _CLUT_offs, _EPAL_offs; + uint32 _IM00_offs, _PALS_offs; + + //ender: fullscreen + bool _fullRedraw, _BgNeedsRedraw, _shakeEnabled; + bool _screenEffectFlag, _completeScreenRedraw; + + int _cursorHotspotX, _cursorHotspotY, _cursorWidth, _cursorHeight; + byte _cursorAnimate, _cursorAnimateIndex, _grabbedCursor[2048]; + int8 _cursorState; + + byte _newEffect, _switchRoomEffect2, _switchRoomEffect; + bool _doEffect; + + uint16 _flashlightXStrips, _flashlightYStrips; + bool _flashlightIsDrawn; + + void getGraphicsPerformance(); + void initScreens(int a, int b, int w, int h); + void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool fourextra); + void initBGBuffers(int height); + void initCycl(byte *ptr); // Color cycle + + void createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, int16 colorMin, int16 colorMax); + + void drawObject(int obj, int arg); + void drawRoomObjects(int arg); + void drawRoomObject(int i, int arg); + void drawBox(int x, int y, int x2, int y2, int color); + void drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, int param3); + + void restoreBG(int left, int top, int right, int bottom); + void redrawBGStrip(int start, int num); + void redrawBGAreas(); + + void moveCamera(); + void cameraMoved(); + void setCameraAtEx(int at); + void setCameraAt(int pos_x, int pos_y); + void panCameraTo(int x, int y); + void setCameraFollows(Actor *a); + void clampCameraPos(ScummPoint *pt); + + byte *getPalettePtr(); + void setPalette(int pal); + void setPaletteFromPtr(byte *ptr); + void setPaletteFromRes(); + void setPalColor(int index, int r, int g, int b); + void setDirtyColors(int min, int max); + byte *findPalInPals(byte *pal, int index); + void swapPalColors(int a, int b); + void cyclePalette(); + void stopCycle(int i); + void palManipulate(); + int remapPaletteColor(int r, int g, int b, uint threshold); + void moveMemInPalRes(int start, int end, byte direction); + void setupShadowPalette(int slot, int rfact, int gfact, int bfact, int from, int to); + void darkenPalette(int a, int b, int c, int d, int e); + void desaturatePalette(); + + void setShake(int mode); + + void setCursor(int cursor); + void setCursorImg(uint img, uint room, uint imgindex); + void setCursorHotspot2(int x, int y); + void grabCursor(int x, int y, int w, int h); + void grabCursor(byte *ptr, int width, int height); + void makeCursorColorTransparent(int a); + void setupCursor() { _cursorAnimate = 1; } + void decompressDefaultCursor(int index); + void useIm01Cursor(byte *im, int w, int h); + void useBompCursor(byte *im, int w, int h); + + + void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits); + void setDirtyRange(int slot, int a, int height); + void drawDirtyScreenParts(); + void updateDirtyScreen(int slot); + + VirtScreen *findVirtScreen(int y); + static void setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom); + + void drawFlashlight(); + + void fadeIn(int effect); + void fadeOut(int effect); + + void unkScreenEffect1(); + void unkScreenEffect2(); + void unkScreenEffect3(); + void unkScreenEffect4(); + void unkScreenEffect5(int a); + void unkScreenEffect6(); + void transitionEffect(int a); // former unkScreenEffect7 + + void decompressBomp(byte *dst, byte *src, int w, int h); + uint _shakeFrame; + int _screenStartStrip, _screenEndStrip; + int _screenLeft, _screenTop; + uint16 _enqueue_b, _enqueue_c, _enqueue_d, _enqueue_e; + int _enqueuePos; + BlastObject _enqueuedObjects[32]; + + void enqueueObject(int a, int b, int c, int d, int e, int f, int g, int h, int mode); + void clearEnqueue() { _enqueuePos = 0; } + void drawBlastObjects(); + void drawBlastObject(BlastObject *eo); + void removeBlastObjects(); + void removeBlastObject(BlastObject *eo); + + int _drawObjectQueNr; + byte _drawObjectQue[200]; + int16 _palManipStart, _palManipEnd, _palManipCounter; + uint32 gfxUsageBits[200]; + byte *_shadowPalette; + int _shadowPaletteSize; + byte _currentPalette[0x300]; + + byte _proc_special_palette[256]; + int _palDirtyMin, _palDirtyMax; + byte _bkColor; + uint16 _lastXstart; + + byte _haveMsg; + bool _useTalkAnims; + uint16 _defaultTalkDelay; + bool _use_adlib; + int tempMusic; + int _saveSound; + uint16 _soundParam, _soundParam2, _soundParam3; + int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end; + + /* Walkbox / Navigation class */ + int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem; + byte *_boxMatrixPtr4, *_boxMatrixPtr1, *_boxMatrixPtr3; + + uint16 _extraBoxFlags[65]; + + PathNode *unkMatrixProc2(PathVertex *vtx, int i); + bool areBoxesNeighbours(int i, int j); + void addToBoxMatrix(byte b); + bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3); + void *addToBoxVertexHeap(int size); + PathVertex *addPathVertex(); + bool checkXYInBoxBounds(int box, int x, int y); + uint distanceFromPt(int x, int y, int ptx, int pty); + ScummPoint closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); + void getBoxCoordinates(int boxnum, BoxCoords *bc); + byte getMaskFromBox(int box); + Box *getBoxBaseAddr(int box); + byte getBoxFlags(int box); + int getBoxScale(int box); + byte getNumBoxes(); + byte *getBoxMatrixBaseAddr(); + int getPathToDestBox(byte from, byte to); + bool findPathTowards(Actor *a, byte box, byte box2, byte box3, int16 &foundPathX, int16 &foundPathY); + void findPathTowardsOld(Actor *a, byte box, byte box2, byte box3, ScummPoint gateLoc[5]); + void getGates(int trap1, int trap2, ScummPoint gateA[2], ScummPoint gateB[2]); + bool inBoxQuickReject(int box, int x, int y, int threshold); + AdjustBoxResult getClosestPtOnBox(int box, int x, int y); + int getSpecialBox(int param1, int param2); + + void setBoxFlags(int box, int val); + void setBoxScale(int box, int b); + void createBoxMatrix(); + + + /* String class */ + CharsetRenderer charset; + byte _charsetColor; + uint16 _noSubtitles; // Skip all subtitles? + byte _charsetData[15][16]; + void initCharset(int charset); + void restoreCharsetBg(); + int hasCharsetMask(int x, int y, int x2, int y2); + void CHARSET_1(); + void description(); + byte *_msgPtrToAdd; + byte *addMessageToStack(byte *msg); + void unkAddMsgToStack2(int var); + void unkAddMsgToStack3(int var); + void unkAddMsgToStack4(int var); + void unkAddMsgToStack5(int var); + void unkMessage1(); + void unkMessage2(); + void clearMsgQueue(); + int _numInMsgStack; + byte *_messagePtr; + int16 _talkDelay; + bool _keepText; + + + /* Should be in System class */ + void fileClose(void *file); + void *fileOpen(const char *filename, int mode); + void fileSeek(void *file, long offs, int whence); + void fileRead(void *handle, void *ptr, uint32 size); + bool fileEof(void *handle); + uint32 filePos(void *handle); + bool checkFixedDisk(); + int _cdrom; + + int fileReadByte(); + uint32 fileReadDwordLE(); + uint32 fileReadDwordBE(); + int fileReadByte(void *handle); + uint32 fileReadDwordLE(void *handle); + uint32 fileReadDwordBE(void *handle); + +#if defined(SCUMM_LITTLE_ENDIAN) + uint32 fileReadDword() { return fileReadDwordLE(); } + uint32 fileReadDword(void *handle) { return fileReadDwordLE(handle); } +#elif defined(SCUMM_BIG_ENDIAN) + uint32 fileReadDword() { return fileReadDwordBE(); } + uint32 fileReadDword(void *handle) { return fileReadDwordBE(handle); } +#endif + uint fileReadWordLE(); + uint fileReadWordBE(); + uint fileReadWordLE(void *handle); + uint fileReadWordBE(void *handle); + + /* Version 5 script opcodes */ + void o5_actorFollowCamera(); + void o5_actorFromPos(); + void o5_actorSet(); + void o5_add(); + void o5_and(); + void o5_animateActor(); + void o5_badOpcode(); + void o5_breakHere(); + void o5_chainScript(); + void o5_cursorCommand(); + void o5_cutscene(); + void o5_debug(); + void o5_decrement(); + void o5_delay(); + void o5_delayVariable(); + void o5_divide(); + void o5_doSentence(); + void o5_drawBox(); + void o5_drawObject(); + void o5_dummy(); + void o5_endCutscene(); + void o5_equalZero(); + void o5_expression(); + void o5_faceActor(); + void o5_findInventory(); + void o5_findObject(); + void o5_freezeScripts(); + void o5_getActorCostume(); + void o5_getActorElevation(); + void o5_getActorFacing(); + void o5_getActorMoving(); + void o5_getActorRoom(); + void o5_getActorScale(); + void o5_getActorWalkBox(); + void o5_getActorWidth(); + void o5_getActorX(); + void o5_getActorY(); + void o5_getAnimCounter(); + void o5_getClosestObjActor(); + void o5_getDist(); + void o5_getInventoryCount(); + void o5_getObjectOwner(); + void o5_getObjectState(); + void o5_getRandomNr(); + void o5_getScriptRunning(); + void o5_getVerbEntrypoint(); + void o5_ifClassOfIs(); + void o5_increment(); + void o5_isActorInBox(); + void o5_isEqual(); + void o5_isGreater(); + void o5_isGreaterEqual(); + void o5_isLess(); + void o5_isNotEqual(); + void o5_isSoundRunning(); + void o5_jumpRelative(); + void o5_lessOrEqual(); + void o5_lights(); + void o5_loadRoom(); + void o5_loadRoomWithEgo(); + void o5_matrixOps(); + void o5_move(); + void o5_multiply(); + void o5_notEqualZero(); + void o5_or(); + void o5_overRide(); + void o5_panCameraTo(); + void o5_pickupObject(); + void o5_print(); + void o5_printEgo(); + void o5_pseudoRoom(); + void o5_putActor(); + void o5_putActorAtObject(); + void o5_putActorInRoom(); + void o5_quitPauseRestart(); + void o5_resourceRoutines(); + void o5_roomOps(); + void o5_saveRestoreVerbs(); + void o5_setCameraAt(); + void o5_setClass(); + void o5_setObjectName(); + void o5_setOwnerOf(); + void o5_setState(); + void o5_setVarRange(); + void o5_soundKludge(); + void o5_startMusic(); + void o5_startObject(); + void o5_startScript(); + void o5_startSound(); + void o5_stopMusic(); + void o5_stopObjectCode(); + void o5_stopObjectScript(); + void o5_stopScript(); + void o5_stopSound(); + void o5_stringOps(); + void o5_subtract(); + void o5_verbOps(); + void o5_wait(); + void o5_walkActorTo(); + void o5_walkActorToActor(); + void o5_walkActorToObject(); + void o5_oldRoomEffect(); + void o5_pickupObjectOld(); + + /* Version 6 script opcodes */ + int getStackList(int16 *args, uint maxnum); + void setStringVars(int i); + void unkMiscOp9(); + + void o6_setBlastObjectWindow(); + void o6_pushByte(); + void o6_pushWord(); + void o6_pushByteVar(); + void o6_pushWordVar(); + void o6_invalid(); + void o6_byteArrayRead(); + void o6_wordArrayRead(); + void o6_byteArrayIndexedRead(); + void o6_wordArrayIndexedRead(); + void o6_dup(); + void o6_zero(); + void o6_eq(); + void o6_neq(); + void o6_gt(); + void o6_lt(); + void o6_le(); + void o6_ge(); + void o6_add(); + void o6_sub(); + void o6_mul(); + void o6_div(); + void o6_land(); + void o6_lor(); + void o6_kill(); + void o6_writeByteVar(); + void o6_writeWordVar(); + void o6_byteArrayWrite(); + void o6_wordArrayWrite(); + void o6_byteArrayIndexedWrite(); + void o6_wordArrayIndexedWrite(); + void o6_byteVarInc(); + void o6_wordVarInc(); + void o6_byteArrayInc(); + void o6_wordArrayInc(); + void o6_byteVarDec(); + void o6_wordVarDec(); + void o6_byteArrayDec(); + void o6_wordArrayDec(); + void o6_jumpTrue(); + void o6_jumpFalse(); + void o6_jump(); + void o6_startScriptEx(); + void o6_startScript(); + void o6_startObject(); + void o6_setObjectState(); + void o6_setObjectXY(); + void o6_stopObjectCode(); + void o6_endCutscene(); + void o6_cutScene(); + void o6_stopMusic(); + void o6_freezeUnfreeze(); + void o6_cursorCommand(); + void o6_breakHere(); + void o6_ifClassOfIs(); + void o6_setClass(); + void o6_getState(); + void o6_setState(); + void o6_setOwner(); + void o6_getOwner(); + void o6_startSound(); + void o6_stopSound(); + void o6_startMusic(); + void o6_stopObjectScript(); + void o6_panCameraTo(); + void o6_actorFollowCamera(); + void o6_setCameraAt(); + void o6_loadRoom(); + void o6_stopScript(); + void o6_walkActorToObj(); + void o6_walkActorTo(); + void o6_putActorInRoom(); + void o6_putActorAtObject(); + void o6_faceActor(); + void o6_animateActor(); + void o6_doSentence(); + void o6_pickupObject(); + void o6_loadRoomWithEgo(); + void o6_getRandomNumber(); + void o6_getRandomNumberRange(); + void o6_getActorMoving(); + void o6_getScriptRunning(); + void o6_getActorRoom(); + void o6_getObjectX(); + void o6_getObjectY(); + void o6_getObjectOldDir(); + void o6_getObjectNewDir(); + void o6_getActorWalkBox(); + void o6_getActorCostume(); + void o6_findInventory(); + void o6_getInventoryCount(); + void o6_getVerbFromXY(); + void o6_beginOverride(); + void o6_endOverride(); + void o6_setObjectName(); + void o6_isSoundRunning(); + void o6_setBoxFlags(); + void o6_createBoxMatrix(); + void o6_resourceRoutines(); + void o6_roomOps(); + void o6_actorSet(); + void o6_verbOps(); + void o6_getActorFromXY(); + void o6_findObject(); + void o6_pseudoRoom(); + void o6_getActorElevation(); + void o6_getVerbEntrypoint(); + void o6_arrayOps(); + void o6_saveRestoreVerbs(); + void o6_drawBox(); + void o6_getActorWidth(); + void o6_wait(); + void o6_getActorScaleX(); + void o6_getActorAnimCounter1(); + void o6_soundKludge(); + void o6_isAnyOf(); + void o6_quitPauseRestart(); + void o6_isActorInBox(); + void o6_delay(); + void o6_delayLonger(); + void o6_delayVeryLong(); + void o6_stopSentence(); + void o6_print_0(); + void o6_print_1(); + void o6_print_2(); + void o6_print_3(); + void o6_printActor(); + void o6_printEgo(); + void o6_talkActor(); + void o6_talkEgo(); + void o6_dim(); + void o6_runVerbCodeQuick(); + void o6_runScriptQuick(); + void o6_dim2(); + void o6_abs(); + void o6_distObjectObject(); + void o6_distObjectPt(); + void o6_distPtPt(); + void o6_dummy_stacklist(); + void o6_miscOps(); + void o6_breakMaybe(); + void o6_pickOneOf(); + void o6_pickOneOfDefault(); + void o6_jumpToScript(); + void o6_isRoomScriptRunning(); + void o6_kernelFunction(); + void o6_getAnimateVariable(); + void o6_drawBlastObject(); + void o6_getActorPriority(); + + /* Scumm Vars */ + byte VAR_EGO; + byte VAR_CAMERA_POS_X; + byte VAR_HAVE_MSG; + byte VAR_ROOM; + byte VAR_OVERRIDE; + byte VAR_MACHINE_SPEED; + byte VAR_ME; + byte VAR_NUM_ACTOR; + byte VAR_CURRENT_LIGHTS; + byte VAR_CURRENTDRIVE; + byte VAR_TMR_1; + byte VAR_TMR_2; + byte VAR_TMR_3; + byte VAR_MUSIC_FLAG; + byte VAR_ACTOR_RANGE_MIN; + byte VAR_ACTOR_RANGE_MAX; + byte VAR_CAMERA_MIN_X; + byte VAR_CAMERA_MAX_X; + byte VAR_TIMER_NEXT; + byte VAR_VIRT_MOUSE_X; + byte VAR_VIRT_MOUSE_Y; + byte VAR_ROOM_RESOURCE; + byte VAR_LAST_SOUND; + byte VAR_CUTSCENEEXIT_KEY; + byte VAR_OPTIONS_KEY; + byte VAR_TALK_ACTOR; + byte VAR_CAMERA_FAST_X; + byte VAR_SCROLL_SCRIPT; + byte VAR_ENTRY_SCRIPT; + byte VAR_ENTRY_SCRIPT2; + byte VAR_EXIT_SCRIPT; + byte VAR_EXIT_SCRIPT2; + byte VAR_VERB_SCRIPT; + byte VAR_SENTENCE_SCRIPT; + byte VAR_HOOK_SCRIPT; + byte VAR_CUTSCENE_START_SCRIPT; + byte VAR_CUTSCENE_END_SCRIPT; + byte VAR_CHARINC; + byte VAR_WALKTO_OBJ; + byte VAR_DEBUGMODE; + byte VAR_HEAPSPACE; + byte VAR_RESTART_KEY; + byte VAR_PAUSE_KEY; + byte VAR_MOUSE_X; + byte VAR_MOUSE_Y; + byte VAR_TIMER; + byte VAR_TMR_4; + byte VAR_SOUNDCARD; + byte VAR_VIDEOMODE; + byte VAR_SAVELOADDIALOG_KEY; + byte VAR_FIXEDDISK; + byte VAR_CURSORSTATE; + byte VAR_USERPUT; + byte VAR_SOUNDRESULT; + byte VAR_TALKSTOP_KEY; + byte VAR_59; + + byte VAR_SOUNDPARAM; + byte VAR_SOUNDPARAM2; + byte VAR_SOUNDPARAM3; + byte VAR_MOUSEPRESENT; + byte VAR_PERFORMANCE_1; + byte VAR_PERFORMANCE_2; + byte VAR_ROOM_FLAG; + byte VAR_GAME_LOADED; + byte VAR_NEW_ROOM; + byte VAR_VERSION; + + byte VAR_V5_DRAWFLAGS; + byte VAR_MI1_TIMER; + byte VAR_V5_OBJECT_LO; + byte VAR_V5_OBJECT_HI; + byte VAR_V5_TALK_STRING_Y; + byte VAR_V5_CHARFLAG; + + byte VAR_V6_SCREEN_WIDTH; + byte VAR_V6_SCREEN_HEIGHT; + byte VAR_V6_EMSSPACE; + byte VAR_V6_RANDOM_NR; + + byte VAR_STRING2DRAW; + byte VAR_CAMERA_POS_Y; + + byte VAR_CAMERA_MIN_Y; + byte VAR_CAMERA_MAX_Y; + byte VAR_CAMERA_THRESHOLD_X; + byte VAR_CAMERA_THRESHOLD_Y; + byte VAR_CAMERA_SPEED_X; + byte VAR_CAMERA_SPEED_Y; + byte VAR_CAMERA_ACCEL_X; + byte VAR_CAMERA_ACCEL_Y; + + byte VAR_CAMERA_DEST_X; + + byte VAR_CAMERA_DEST_Y; + + byte VAR_CAMERA_FOLLOWED_ACTOR; + + byte VAR_LEFTBTN_DOWN; + byte VAR_RIGHTBTN_DOWN; + byte VAR_LEFTBTN_HOLD; + byte VAR_RIGHTBTN_HOLD; + + byte VAR_UNK_SCRIPT; + byte VAR_UNK_SCRIPT_2; + + byte VAR_DEFAULT_TALK_DELAY; + byte VAR_CHARSET_MASK; + + byte VAR_CUSTOMSCALETABLE; + byte VAR_VIDEONAME; + + void launch(); + + Scumm(GameDetector *detector, OSystem *syst); + virtual ~Scumm(); + + void go(); + + void setupGUIColors(); + byte getDefaultGUIColor(int color); + void waitForTimer(int msec_delay); + + void updateCursor(); + void animateCursor(); + void updatePalette(); +}; + +class Scumm_v3 : public Scumm +{ +public: + Scumm_v3(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} + + void readIndexFile(); + virtual void loadCharset(int no); +}; + +class Scumm_v4 : public Scumm_v3 +{ +public: + Scumm_v4(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} + + void loadCharset(int no); +}; + +class Scumm_v5 : public Scumm +{ +public: + Scumm_v5(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} +}; + +class Scumm_v6 : public Scumm +{ +public: + Scumm_v6(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} +}; + +class Scumm_v7 : public Scumm +{ +public: + Scumm_v7(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} +}; + +extern uint16 _debugLevel; + +extern const byte revBitMask[8]; +//void blitToScreen(Scumm *s, byte *src, int x, int y, int w, int h); + +#if defined(__GNUC__) +void CDECL error(const char *s, ...) NORETURN; +#else +void CDECL NORETURN error(const char *s, ...); +#endif + +void CDECL warning(const char *s, ...); +void CDECL debug(int level, const char *s, ...); +void checkHeap(); + +/* Direction conversion functions (between old dir and new dir format) */ +int newDirToOldDir(int dir); +int oldDirToNewDir(int dir); + +int normalizeAngle(int angle); +int fromSimpleDir(int dirtype, int dir); +int toSimpleDir(int dirtype, int dir); +int numSimpleDirDirections(int dirType); + + +#endif diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp new file mode 100644 index 0000000000..845a8fb4d3 --- /dev/null +++ b/scumm/scummvm.cpp @@ -0,0 +1,1677 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "sound/mixer.h" +#include "sound/mididrv.h" +#include "scumm/imuse.h" +#include "actor.h" +#include "debug.h" +#include "gameDetector.h" +#include "gui/gui.h" +#include "gui/newgui.h" +#include "object.h" +#include "resource.h" +#include "string.h" + +#ifdef _WIN32_WCE +extern void GraphicsOff(void); +#endif + +// Use g_scumm from error() ONLY +Scumm *g_scumm = 0; + + +void autosave(Scumm * scumm) +{ + scumm->_doAutosave = true; +} + +void Scumm::initRandSeeds() +{ + _randSeed1 = 0xA943DE33; + _randSeed2 = 0x37A9ED29; +} + +uint Scumm::getRandomNumber(uint max) +{ + /* TODO: my own random number generator */ + _randSeed1 = 0xDEADBF03 * (_randSeed1 + 1); + _randSeed1 = (_randSeed1 >> 13) | (_randSeed1 << 19); + return _randSeed1 % (max + 1); +} + +uint Scumm::getRandomNumberRng(uint min, uint max) +{ + return getRandomNumber(max - min) + min; +} + + +Scumm::Scumm (GameDetector *detector, OSystem *syst) + : Engine(detector, syst) +{ + OSystem::Property prop; + + // Use g_scumm from error() ONLY + g_scumm = this; + + _debugMode = detector->_debugMode; + _bootParam = detector->_bootParam; + _exe_name = detector->_exe_name; + _gameId = detector->_gameId; + _gameText = detector->_gameText; + _features = detector->_features; + _soundCardType = detector->_soundCardType; + _noSubtitles = detector->_noSubtitles; + _cdrom = detector->_cdrom; + _defaultTalkDelay = detector->_talkSpeed; + _use_adlib = detector->_use_adlib; + + if (_gameId == GID_ZAK256) { // FmTowns is 320x240 + _realWidth = 320; + _realHeight = 240; + } else { + _realWidth = 320; + _realHeight = 200; + } + + _gui = new Gui(); + _gui->init(this); + + _newgui = new NewGui(this); + _bundle = new Bundle(this); + _timer = new Timer(this); + _sound = new Sound(this); + + _sound->_sound_volume_master = 0; + _sound->_sound_volume_sfx = detector->_sfx_volume; + _sound->_sound_volume_music = detector->_music_volume; + + /* Initialize backend */ + syst->init_size(_realWidth, _realHeight); + prop.cd_num = detector->_cdrom; + syst->property(OSystem::PROP_OPEN_CD, &prop); + + /* Bind the mixer to the system => mixer will be invoked + * automatically when samples need to be generated */ + if (!_mixer->bind_to_system(syst)) { + warning("Sound initialization failed"); + if (detector->_use_adlib) { + _use_adlib = false; + detector->_use_adlib = false; + detector->_midi_driver = MD_NULL; + warning("Adlib music was selected, switching to midi null driver"); + } + } + _mixer->set_volume(kDefaultSFXVolume); + _mixer->set_music_volume(kDefaultMusicVolume); + + + // Init iMuse + if (detector->_use_adlib) { + _imuse = IMuse::create_adlib(syst, _mixer); + } else { + _imuse = IMuse::create_midi(syst, detector->createMidi()); + } + if (detector->_gameTempo != 0) + _imuse->property(IMuse::PROP_TEMPO_BASE, detector->_gameTempo); + _imuse->set_music_volume(_sound->_sound_volume_music); + + + // Load game from specified slot, if any + if (detector->_save_slot != -1) { + _saveLoadSlot = detector->_save_slot; + _saveLoadFlag = 2; + _saveLoadCompatible = false; + } +} + +Scumm::~Scumm () +{ + delete [] _actors; + delete _gui; + delete _newgui; + delete _bundle; + delete _timer; + delete _sound; +} + +void Scumm::scummInit() +{ + int i; + Actor *a; + + tempMusic = 0; + debug(9, "scummInit"); + + if (_features & GF_SMALL_HEADER) + _resourceHeaderSize = 6; + else + _resourceHeaderSize = 8; + + if (!(_features & GF_SMALL_NAMES)) + loadCharset(1); + + initScreens(0, 16, 320, 144); + + setShake(0); + setupCursor(); + + _timer->init(); + + /* Allocate and initilise actors */ + _actors = new Actor[MAX_ACTORS]; + for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { + a->number = i; + a->initActorClass(this); + a->initActor(1); + } + + _vars[VAR_CHARINC] = 4; + + _numNestedScripts = 0; + vm.cutSceneStackPointer = 0; + + memset(vm.cutScenePtr, 0, sizeof(vm.cutScenePtr)); + memset(vm.cutSceneData, 0, sizeof(vm.cutSceneData)); + + for (i = 0; i < _maxVerbs; i++) { + _verbs[i].verbid = 0; + _verbs[i].right = 319; + _verbs[i].oldleft = -1; + _verbs[i].type = 0; + _verbs[i].color = 2; + _verbs[i].hicolor = 0; + _verbs[i].charset_nr = 1; + _verbs[i].curmode = 0; + _verbs[i].saveid = 0; + _verbs[i].center = 0; + _verbs[i].key = 0; + } + + if (!(_features & GF_AFTER_V7)) { + camera._leftTrigger = 10; + camera._rightTrigger = 30; + camera._mode = 0; + } + camera._follows = 0; + + virtscr[0].xstart = 0; + + if (!(_features & GF_AFTER_V7)) { + _vars[VAR_V5_DRAWFLAGS] = 11; + _vars[VAR_59] = 3; + + _vars[VAR_CURRENT_LIGHTS] = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen; + } + + mouse.x = 104; + mouse.y = 56; + + _ENCD_offs = 0; + _EXCD_offs = 0; + + _currentScript = 0xFF; + _sentenceNum = 0; + + _currentRoom = 0; + _numObjectsInRoom = 0; + _actorToPrintStrFor = 0; + + charset._bufPos = 0; + _haveMsg = 0; + + _varwatch = -1; + _screenStartStrip = 0; + + _vars[VAR_TALK_ACTOR] = 0; + + _talkDelay = 0; + _keepText = false; + + _cursorState = 0; + _userPut = 0; + + _newEffect = 129; + _fullRedraw = true; + + clearDrawObjectQueue(); + + for (i = 0; i < 6; i++) { + if (_features & GF_OLD256) { + string[i].t_xpos = 0; + string[i].t_ypos = 0; + } else { + string[i].t_xpos = 2; + string[i].t_ypos = 5; + } + string[i].t_right = 319; + string[i].t_color = 0xF; + string[i].t_center = 0; + string[i].t_charset = 0; + } + + _numInMsgStack = 0; + + createResource(rtTemp, 6, 500); + + initScummVars(); + + if (!(_features & GF_AFTER_V6)) + _vars[VAR_V5_TALK_STRING_Y] = -0x50; + + getGraphicsPerformance(); + +#ifdef COMPRESSED_SOUND_FILE + _sound->_current_cache = 0; +#endif + + _timer->installProcedure(&autosave, 5 * 60 * 1000); +} + + +void Scumm::initScummVars() +{ + if (!(_features & GF_AFTER_V7)) { + _vars[VAR_CURRENTDRIVE] = _currentDrive; + _vars[VAR_FIXEDDISK] = checkFixedDisk(); + _vars[VAR_SOUNDCARD] = _soundCardType; + _vars[VAR_VIDEOMODE] = 0x13; + _vars[VAR_HEAPSPACE] = 630; + _vars[VAR_MOUSEPRESENT] = _mousePresent; + _vars[VAR_SOUNDPARAM] = _soundParam; + _vars[VAR_SOUNDPARAM2] = _soundParam2; + _vars[VAR_SOUNDPARAM3] = _soundParam3; + if (_features & GF_AFTER_V6) + _vars[VAR_V6_EMSSPACE] = 10000; + } +} + +void Scumm::checkRange(int max, int min, int no, const char *str) +{ + if (no < min || no > max) { + error("Value %d is out of bounds (%d,%d) int script(%d) msg %s", no, min, + max, vm.slot[_curExecScript].number, str); + } +} + +int Scumm::scummLoop(int delta) +{ + static int counter = 0; + +#ifndef _WIN32_WCE + if (_debugger) + _debugger->on_frame(); +#endif + + // Randomize the PRNG by calling it at regular intervals. This ensures + // that it will be in a different state each time you run the program. + getRandomNumber(2); + + _vars[VAR_TMR_1] += delta; + _vars[VAR_TMR_2] += delta; + _vars[VAR_TMR_3] += delta; + _vars[VAR_TMR_4] += delta; + + if (delta > 15) + delta = 15; + + decreaseScriptDelay(delta); + + _talkDelay -= delta; + if (_talkDelay < 0) + _talkDelay = 0; + + processKbd(); + + if (_features & GF_AFTER_V7) { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + _vars[VAR_CAMERA_POS_Y] = camera._cur.y; + } else { + _vars[VAR_CAMERA_POS_X] = camera._cur.x; + } + _vars[VAR_HAVE_MSG] = (_haveMsg == 0xFE) ? 0xFF : _haveMsg; + _vars[VAR_VIRT_MOUSE_X] = _virtual_mouse_x; + _vars[VAR_VIRT_MOUSE_Y] = _virtual_mouse_y; + _vars[VAR_MOUSE_X] = mouse.x; + _vars[VAR_MOUSE_Y] = mouse.y; + _vars[VAR_DEBUGMODE] = _debugMode; + + if (_features & GF_AUDIOTRACKS) { + if (delta) { + if (++counter != 2) + _vars[VAR_MI1_TIMER] += 5; + else { + counter = 0; + _vars[VAR_MI1_TIMER] += 6; + } + } + } else if (_features & GF_OLD256) { + + if(tempMusic == 3) { + tempMusic = 0; + _vars[VAR_MUSIC_FLAG]++; + } else { + tempMusic ++; + } + } + + + if (_saveLoadFlag) { + if (_saveLoadFlag == 1) { + saveState(_saveLoadSlot, _saveLoadCompatible); + // Ender: Disabled for small_header games, as + // can overwrite game variables (eg, Zak256 cashcards) + if (_saveLoadCompatible && !(_features & GF_SMALL_HEADER)) + _vars[VAR_GAME_LOADED] = 201; + } else { + loadState(_saveLoadSlot, _saveLoadCompatible); + // Ender: Disabled for small_header games, as + // can overwrite game variables (eg, Zak256 cashcards) + if (_saveLoadCompatible && !(_features & GF_SMALL_HEADER)) + _vars[VAR_GAME_LOADED] = 203; + } + _saveLoadFlag = 0; + } + + if (_doAutosave) { + _saveLoadSlot = 0; + sprintf(_saveLoadName, "Autosave %d", _saveLoadSlot); + _saveLoadFlag = 1; + _saveLoadCompatible = false; + _doAutosave = false; + } + + if (_completeScreenRedraw) { + _completeScreenRedraw = false; + gdi.clearUpperMask(); + charset._hasMask = false; + redrawVerbs(); + _fullRedraw = true; + } + + runAllScripts(); + checkExecVerbs(); + checkAndRunVar33(); + + if (_currentRoom == 0) { + gdi._cursorActive = 0; + CHARSET_1(); + drawDirtyScreenParts(); + _sound->processSoundQues(); + camera._last = camera._cur; + } else { + walkActors(); + moveCamera(); + fixObjectFlags(); + CHARSET_1(); + + if (camera._cur.x != camera._last.x || _BgNeedsRedraw || _fullRedraw + || (_features & GF_AFTER_V7 && camera._cur.y != camera._last.y)) { + redrawBGAreas(); + } + + processDrawQue(); + setActorRedrawFlags(); + resetActorBgs(); + + if (!(_vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_screen) && + _vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_flashlight) { + drawFlashlight(); + setActorRedrawFlags(); + } + + processActors(); + clear_fullRedraw(); + cyclePalette(); + palManipulate(); + + if (_doEffect) { + _doEffect = false; + fadeIn(_newEffect); + clearClickedStatus(); + } + + if (_cursorState > 0) { + verbMouseOver(checkMouseOver(mouse.x, mouse.y)); + } + + drawBlastObjects(); + drawDirtyScreenParts(); + removeBlastObjects(); + + if (!(_features & GF_AFTER_V6)) + playActorSounds(); + + _sound->processSoundQues(); + camera._last = camera._cur; + } + + if (!(++_expire_counter)) { + increaseResourceCounter(); + } + + animateCursor(); + + /* show or hide mouse */ + _system->show_mouse(_cursorState > 0); + + _vars[VAR_TIMER] = 0; + return _vars[VAR_TIMER_NEXT]; + +} + +void Scumm::startScene(int room, Actor * a, int objectNr) +{ + int i, where; + Actor *at; + + CHECK_HEAP debug(1, "Loading room %d", room); + + clearMsgQueue(); + + fadeOut(_switchRoomEffect2); + _newEffect = _switchRoomEffect; + + if (_currentScript != 0xFF) { + if (vm.slot[_currentScript].where == WIO_ROOM || + vm.slot[_currentScript].where == WIO_FLOBJECT) { + if (vm.slot[_currentScript].cutsceneOverride != 0) + error("Object %d stopped with active cutscene/override in exit", + vm.slot[_currentScript].number); + _currentScript = 0xFF; + } else if (vm.slot[_currentScript].where == WIO_LOCAL) { + if (vm.slot[_currentScript].cutsceneOverride != 0) + error("Script %d stopped with active cutscene/override in exit", + vm.slot[_currentScript].number); + _currentScript = 0xFF; + } + } + + if (!(_features & GF_SMALL_HEADER)) // Disable for SH games. Overwrites + _vars[VAR_NEW_ROOM] = room; // gamevars, eg Zak cashcards + + runExitScript(); + killScriptsAndResources(); + clearEnqueue(); + stopCycle(0); + + for (i = 1, at = getFirstActor(); ++at, i < NUM_ACTORS; i++) { + at->hideActor(); + } + + if (!(_features & GF_AFTER_V7)) { + for (i = 0; i < 0x100; i++) + _shadowPalette[i] = i; + } + + clearDrawObjectQueue(); + + _vars[VAR_ROOM] = room; + _fullRedraw = true; + + increaseResourceCounter(); + + _currentRoom = room; + _vars[VAR_ROOM] = room; + + if (room >= 0x80) + _roomResource = _resourceMapper[room & 0x7F]; + else + _roomResource = room; + + _vars[VAR_ROOM_RESOURCE] = _roomResource; + + if (room != 0) + ensureResourceLoaded(1, room); + + if (_currentRoom == 0) { + _ENCD_offs = _EXCD_offs = 0; + _numObjectsInRoom = 0; + return; + } + + initRoomSubBlocks(); + if (_features & GF_SMALL_HEADER) + loadRoomObjectsSmall(); + else + loadRoomObjects(); + + if (!(_features & GF_AFTER_V7)) { + camera._mode = CM_NORMAL; + camera._cur.x = camera._dest.x = 160; + camera._cur.y = camera._dest.y = 100; + } + + if (_features & GF_AFTER_V6) { + _vars[VAR_V6_SCREEN_WIDTH] = _scrWidth; + _vars[VAR_V6_SCREEN_HEIGHT] = _scrHeight; + } + + if (_features & GF_AFTER_V7) { + _vars[VAR_CAMERA_MIN_X] = 160; + _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160; + _vars[VAR_CAMERA_MIN_Y] = 100; + _vars[VAR_CAMERA_MAX_Y] = _scrHeight - 100; + setCameraAt(160, 100); + } else { + _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160; + _vars[VAR_CAMERA_MIN_X] = 160; + } + + if (_roomResource == 0) + return; + + + memset(gfxUsageBits, 0, sizeof(gfxUsageBits)); + + if (a) { + where = whereIsObject(objectNr); + if (where != WIO_ROOM && where != WIO_FLOBJECT) + error("startScene: Object %d is not in room %d", objectNr, + _currentRoom); + int x, y, dir; + getObjectXYPos(objectNr, x, y, dir); + a->putActor(x, y, _currentRoom); + a->setDirection(dir + 180); + a->moving = 0; + } + + showActors(); + + _egoPositioned = false; + runEntryScript(); + + if (!(_features & GF_AFTER_V7)) { + if (a && !_egoPositioned) { + int x, y; + getObjectXYPos(objectNr, x, y); + a->putActor(x, y, _currentRoom); + a->moving = 0; + } + } else { + if (camera._follows) { + Actor *a = derefActorSafe(camera._follows, "startScene: follows"); + setCameraAt(a->x, a->y); + } + } + + _doEffect = true; + + CHECK_HEAP; +} + +void Scumm::initRoomSubBlocks() +{ + int i, offs; + byte *ptr; + byte *roomptr, *searchptr; + RoomHeader *rmhd; + + _ENCD_offs = 0; + _EXCD_offs = 0; + _CLUT_offs = 0; + _PALS_offs = 0; + + nukeResource(rtMatrix, 1); + nukeResource(rtMatrix, 2); + + for (i = 1; i < _maxScaleTable; i++) + nukeResource(rtScaleTable, i); + + roomptr = getResourceAddress(rtRoom, _roomResource); + + rmhd = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr); + + if (_features & GF_AFTER_V7) { + _scrWidth = READ_LE_UINT16(&(rmhd->v7.width)); + _scrHeight = READ_LE_UINT16(&(rmhd->v7.height)); + } else { + _scrWidth = READ_LE_UINT16(&(rmhd->old.width)); + _scrHeight = READ_LE_UINT16(&(rmhd->old.height)); + } + + + if (_features & GF_SMALL_HEADER) + _IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr; + else + _IM00_offs = + findResource(MKID('IM00'), + findResource(MKID('RMIM'), roomptr)) - roomptr; + + ptr = findResourceData(MKID('EXCD'), roomptr); + if (ptr) { + _EXCD_offs = ptr - roomptr; +#ifdef DUMP_SCRIPTS + dumpResource("exit-", _roomResource, ptr - 8); +#endif + } + + ptr = findResourceData(MKID('ENCD'), roomptr); + if (ptr) { + _ENCD_offs = ptr - roomptr; +#ifdef DUMP_SCRIPTS + dumpResource("entry-", _roomResource, ptr - 8); +#endif + } + + if (_features & GF_SMALL_HEADER) { + ptr = findResourceData(MKID('BOXD'), roomptr); + if (ptr) { + byte numOfBoxes = *(ptr); + int size; + if (_features & GF_OLD256) + size = numOfBoxes * (SIZEOF_BOX - 2) + 1; + else + size = numOfBoxes * SIZEOF_BOX + 1; + + + createResource(rtMatrix, 2, size); + memcpy(getResourceAddress(rtMatrix, 2), ptr, size); + ptr += size; + size = getResourceDataSize(ptr - size - 6) - size; + + if (size >= 0) { // do this :) + createResource(rtMatrix, 1, size); + memcpy(getResourceAddress(rtMatrix, 1), ptr, size); + } + + } + } else { + ptr = findResourceData(MKID('BOXD'), roomptr); + if (ptr) { + int size = getResourceDataSize(ptr); + createResource(rtMatrix, 2, size); + roomptr = getResourceAddress(rtRoom, _roomResource); + ptr = findResourceData(MKID('BOXD'), roomptr); + memcpy(getResourceAddress(rtMatrix, 2), ptr, size); + } + + ptr = findResourceData(MKID('BOXM'), roomptr); + if (ptr) { + int size = getResourceDataSize(ptr); + createResource(rtMatrix, 1, size); + roomptr = getResourceAddress(rtRoom, _roomResource); + ptr = findResourceData(MKID('BOXM'), roomptr); + memcpy(getResourceAddress(rtMatrix, 1), ptr, size); + } + } + + ptr = findResourceData(MKID('SCAL'), roomptr); + if (ptr) { + offs = ptr - roomptr; + for (i = 1; i < _maxScaleTable; i++, offs += 8) { + int a = READ_LE_UINT16(roomptr + offs); + int b = READ_LE_UINT16(roomptr + offs + 2); + int c = READ_LE_UINT16(roomptr + offs + 4); + int d = READ_LE_UINT16(roomptr + offs + 6); + if (a || b || c || d) { + setScaleItem(i, b, a, d, c); + roomptr = getResourceAddress(rtRoom, _roomResource); + } + } + } + memset(_localScriptList, 0, sizeof(_localScriptList)); + + searchptr = roomptr = getResourceAddress(rtRoom, _roomResource); + if (_features & GF_SMALL_HEADER) { + while ((ptr = findResourceSmall(MKID('LSCR'), searchptr)) != NULL) { + int id = 0; + ptr += _resourceHeaderSize; /* skip tag & size */ + id = ptr[0]; +#ifdef DUMP_SCRIPTS + do { + char buf[32]; + sprintf(buf, "room-%d-", _roomResource); + dumpResource(buf, id, ptr - 6); + } while (0); +#endif + _localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr; + searchptr = NULL; + } + } else { + while ((ptr = findResource(MKID('LSCR'), searchptr)) != NULL) { + int id = 0; + + ptr += _resourceHeaderSize; /* skip tag & size */ + + if (_features & GF_AFTER_V7) { + id = READ_LE_UINT16(ptr); + checkRange(2050, 2000, id, "Invalid local script %d"); + _localScriptList[id - _numGlobalScripts] = ptr + 2 - roomptr; + } else { + id = ptr[0]; + _localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr; + } +#ifdef DUMP_SCRIPTS + do { + char buf[32]; + sprintf(buf, "room-%d-", _roomResource); + dumpResource(buf, id, ptr - 8); + } while (0); +#endif + searchptr = NULL; + } + } + + if (_features & GF_SMALL_HEADER) + ptr = findResourceSmall(MKID('EPAL'), roomptr); + else + ptr = findResource(MKID('EPAL'), roomptr); + + if (ptr) + _EPAL_offs = ptr - roomptr; + + if (_features & GF_SMALL_HEADER) + ptr = findResourceSmall(MKID('CLUT'), roomptr); + else + ptr = findResourceData(MKID('CLUT'), roomptr); + + if (ptr) { + _CLUT_offs = ptr - roomptr; + setPaletteFromRes(); + } + + if (_features & GF_AFTER_V6) { + ptr = findResource(MKID('PALS'), roomptr); + if (ptr) { + _PALS_offs = ptr - roomptr; + setPalette(0); + } + } + + if (_features & GF_SMALL_HEADER) + ptr = findResourceData(MKID('CYCL'), roomptr); + else + ptr = findResourceData(MKID('CYCL'), roomptr); + + if (ptr) + initCycl(findResourceData(MKID('CYCL'), roomptr)); + + ptr = findResourceData(MKID('TRNS'), roomptr); + if (ptr) + gdi._transparency = ptr[0]; + else + gdi._transparency = 255; + + initBGBuffers(_scrHeight); + + memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags)); +} + +void Scumm::setScaleItem(int slot, int a, int b, int c, int d) +{ + byte *ptr; + int cur, amounttoadd, i, tmp; + + ptr = createResource(rtScaleTable, slot, 200); + + if (a == c) + return; + + cur = (b - d) * a; + amounttoadd = d - b; + + for (i = 200; i > 0; i--) { + tmp = cur / (c - a) + b; + if (tmp < 1) + tmp = 1; + if (tmp > 255) + tmp = 255; + *ptr++ = tmp; + cur += amounttoadd; + } +} + +void Scumm::dumpResource(char *tag, int idx, byte *ptr) +{ + char buf[256]; + FILE *out; + + uint32 size; + if (_features & GF_SMALL_HEADER) + size = READ_LE_UINT32(ptr); + else + size = READ_BE_UINT32_UNALIGNED(ptr + 4); + +#if defined(MACOS_CARBON) + sprintf(buf, ":dumps:%s%d.dmp", tag, idx); +#else + sprintf(buf, "dumps/%s%d.dmp", tag, idx); +#endif + + out = fopen(buf, "rb"); + if (!out) { + out = fopen(buf, "wb"); + if (!out) + return; + fwrite(ptr, size, 1, out); + } + fclose(out); +} + + +void Scumm::clear_fullRedraw() +{ + _fullRedraw = 0; +} + +void Scumm::clearClickedStatus() +{ + checkKeyHit(); + _mouseButStat = 0; + _leftBtnPressed = 0; + _rightBtnPressed = 0; +} + +int Scumm::checkKeyHit() +{ + int a = _keyPressed; + _keyPressed = 0; + return a; +} + +void Scumm::unkRoomFunc3(int unk1, int unk2, int rfact, int gfact, int bfact) +{ + byte *pal = _currentPalette; + byte *table = _shadowPalette; + int i; + + warning("unkRoomFunc3(%d,%d,%d,%d,%d): not fully implemented", unk1, unk2, rfact, gfact, bfact); + + // TODO - correctly implement this function (see also patch #588501) + // + // Some "typical" examples of how this function is being invoked in real life: + // + // unkRoomFunc3(16, 255, 200, 200, 200) + // + // FOA: Sets up the colors for the boat and submarine shadows in the + // diving scene. Are the shadows too light? Maybe unk1 is used to + // darken the colors? + // + // unkRoomFunc3(0, 255, 700, 700, 700) + // + // FOA: Sets up the colors for the subway car headlight when it first + // goes on. This seems to work ok. + // + // unkRoomFunc3(160, 191, 300, 300, 300) + // unkRoomFunc3(160, 191, 289, 289, 289) + // ... + // unkRoomFunc3(160, 191, 14, 14, 14) + // unkRoomFunc3(160, 191, 3, 3, 3) + // + // FOA: Sets up the colors for the subway car headlight for the later + // half of the trip, where it fades out. This currently doesn't work + // at all. The colors are too dark to be brightened. At first I thought + // unk1 and unk2 were used to tell which color interval to manipulate, + // but as far as I can tell the colors 160-191 aren't used at all to + // draw the light, that can't be it. Apparently unk1 and/or unk2 are + // used to brighten the colors. + + for (i = 0; i <= 255; i++) { + int r = (int) (*pal++ * rfact) >> 8; + int g = (int) (*pal++ * gfact) >> 8; + int b = (int) (*pal++ * bfact) >> 8; + + *table++ = remapPaletteColor(r, g, b, (uint) -1); + } +} + + +void Scumm::palManipulate(int start, int end, int d, int time, int e) +{ + // TODO - correctly implement this function (see also bug #558245) + // + // The only place I know of where this function is being called is in the + // FOA extro, to change the color to match the sinking sun. The following + // three calls (with some pauses between them) are issued: + // + // palManipulate(16, 190, 32, 180, 1) + // palManipulate(16, 190, 32, 1, 1) + // palManipulate(16, 190, 32, 800, 1) + // + // The first two parameters seem to specify a palette range (as the colors + // from 16 to 190 are the ones that make up water & sky). + // + // Maybe the change has to be done over a period of time, possibly specified + // by the second last parameter - between call 1 and 2, about 17-18 seconds + // seem to pass (well using get_msecs, I measured 17155 ms, 17613 ms, 17815 ms). + // + // No clue about the third and fifth parameter right now, they just always + // are 32 and 1 - possibly finding another example of this function being + // used would help a lot. Also, I can't currently compare it with the original, + // doing that (and possibly, taking screenshots of it for analysis!) would + // help a lot. + + static int sys_time = 0; + int new_sys_time = _system->get_msecs(); + + warning("palManipulate(%d, %d, %d, %d, %d): not implemented", start, end, d, time, e); + if (sys_time != 0) + printf("Time since last call: %d\n", new_sys_time-sys_time); + sys_time = new_sys_time; + + { + int redScale = 0xFF; + int greenScale = 0xFF - d; + int blueScale = 0xFF - d; + byte *cptr; + byte *cur; + int num; + int color; + + cptr = _currentPalette + start * 3; + cur = _currentPalette + start * 3; + num = end - start + 1; + + do { + color = *cptr++; + if (redScale != 0xFF) + color = color * redScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + + color = *cptr++; + if (greenScale != 0xFF) + color = color * greenScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + + color = *cptr++; + if (blueScale != 0xFF) + color = color * blueScale / 0xFF; + if (color > 255) + color = 255; + *cur++ = color; + } while (--num); + setDirtyColors(start, end); + } +} + +void Scumm::pauseGame(bool user) +{ + //_gui->pause(); + _newgui->pauseDialog(); +} + +void Scumm::setOptions() +{ + _gui->options(); + //_newgui->optionsDialog(); +} + +void Scumm::shutDown(int i) +{ + /* TODO: implement this */ + warning("shutDown: not implemented"); +} + +void Scumm::processKbd() +{ + int saveloadkey; + getKeyInput(0); + + if (_features & GF_OLD256) /* FIXME: Support ingame screen */ + saveloadkey = 319; + else + saveloadkey = _vars[VAR_SAVELOADDIALOG_KEY]; + + _virtual_mouse_x = mouse.x + virtscr[0].xstart; + + + + if(_features & GF_AFTER_V7) + _virtual_mouse_y = mouse.y + camera._cur.y-100; + else + _virtual_mouse_y = mouse.y; + + if (!(_features & GF_OLD256)) + _virtual_mouse_y += virtscr[0].topline; + else + _virtual_mouse_y -= 16; + + if (_virtual_mouse_y < 0) + _virtual_mouse_y = -1; + + if (_features & GF_OLD256) { + if (_virtual_mouse_y >= virtscr[0].height + virtscr[0].topline) + _virtual_mouse_y = -1; + } else { + if (_virtual_mouse_y >= virtscr[0].height) + _virtual_mouse_y = -1; + } + + if (!_lastKeyHit) + return; + + if (_lastKeyHit == KEY_SET_OPTIONS) { + setOptions(); + return; + } + + if (_lastKeyHit == _vars[VAR_RESTART_KEY]) { + warning("Restart not implemented"); +// pauseGame(true); + return; + } + + if (_lastKeyHit == _vars[VAR_PAUSE_KEY]) { + pauseGame(true); + /* pause */ + return; + } + + if (_lastKeyHit == _vars[VAR_CUTSCENEEXIT_KEY]) { + if (_insaneState) { + videoFinished = 1; + } else + exitCutscene(); + } else if (_lastKeyHit == saveloadkey + && _currentRoom != 0) { + if (_features & GF_AFTER_V7) + runScript(_vars[VAR_UNK_SCRIPT], 0, 0, 0); + _gui->saveLoadDialog(); + if (_features & GF_AFTER_V7) + runScript(_vars[VAR_UNK_SCRIPT_2], 0, 0, 0); + } else if (_lastKeyHit == _vars[VAR_TALKSTOP_KEY]) { + _talkDelay = 0; + if (_sound->_sfxMode == 2) + stopTalk(); + return; + } else if (_lastKeyHit == '[') { // [, eg volume down + _sound->_sound_volume_master-=5; + if (_sound->_sound_volume_master < 0) + _sound->_sound_volume_master = 0; + _imuse->set_master_volume(_sound->_sound_volume_master); + } else if (_lastKeyHit == ']') { // ], eg volume down + _sound->_sound_volume_master+=5; + if (_sound->_sound_volume_master > 128) + _sound->_sound_volume_master = 128; + _imuse->set_master_volume(_sound->_sound_volume_master); + } else if (_lastKeyHit == '-') { // -, eg text speed down + _defaultTalkDelay+=5; + if (_defaultTalkDelay > 90) + _defaultTalkDelay = 90; + + _vars[VAR_CHARINC] = _defaultTalkDelay / 20; + } else if (_lastKeyHit == '+') { // +, eg text speed up + _defaultTalkDelay-=5; + if (_defaultTalkDelay < 5) + _defaultTalkDelay = 5; + + _vars[VAR_CHARINC] = _defaultTalkDelay / 20; + } else if (_lastKeyHit == 321) { // F7, display new GUI + _newgui->saveloadDialog(); + } + + _mouseButStat = _lastKeyHit; +} + +int Scumm::getKeyInput(int a) +{ + _mouseButStat = 0; + + _lastKeyHit = checkKeyHit(); + if (a == 0) + convertKeysToClicks(); + + if (mouse.x < 0) + mouse.x = 0; + if (mouse.x > _realWidth-1) + mouse.x = _realWidth-1; + if (mouse.y < 0) + mouse.y = 0; + if (mouse.y > _realHeight-1) + mouse.y = _realHeight-1; + + if (_leftBtnPressed & msClicked && _rightBtnPressed & msClicked) { + _mouseButStat = 0; + _lastKeyHit = _vars[VAR_CUTSCENEEXIT_KEY]; + } else if (_leftBtnPressed & msClicked) { + _mouseButStat = MBS_LEFT_CLICK; + } else if (_rightBtnPressed & msClicked) { + _mouseButStat = MBS_RIGHT_CLICK; + } + + if (_features & GF_AFTER_V7) { +// _vars[VAR_LEFTBTN_DOWN] = (_leftBtnPressed&msClicked) != 0; + _vars[VAR_LEFTBTN_HOLD] = (_leftBtnPressed & msDown) != 0; +// _vars[VAR_RIGHTBTN_DOWN] = (_rightBtnPressed&msClicked) != 0; + _vars[VAR_RIGHTBTN_HOLD] = (_rightBtnPressed & msDown) != 0; + } + + _leftBtnPressed &= ~msClicked; + _rightBtnPressed &= ~msClicked; + + return _lastKeyHit; +} + +void Scumm::convertKeysToClicks() +{ + if (_lastKeyHit && _cursorState > 0) { + if (_lastKeyHit == 9) { + _mouseButStat = MBS_RIGHT_CLICK; + } else if (_lastKeyHit == 13) { + _mouseButStat = MBS_LEFT_CLICK; + } else + return; + _lastKeyHit = 0; + } +} + +Actor *Scumm::derefActor(int id) +{ + return &_actors[id]; +} + +Actor *Scumm::derefActorSafe(int id, const char *errmsg) +{ + if (id < 1 || id >= NUM_ACTORS) { + if (_debugMode) + warning + ("Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.", + id, errmsg, vm.slot[_curExecScript].number, _opcode); + return NULL; + } + return derefActor(id); +} + +void Scumm::makeCursorColorTransparent(int a) +{ + int i, size; + + size = _cursorWidth * _cursorHeight; + + for (i = 0; i < size; i++) + if (_grabbedCursor[i] == (byte)a) + _grabbedCursor[i] = 0xFF; + + updateCursor(); +} + +void Scumm::setStringVars(int slot) +{ + StringTab *st = &string[slot]; + st->xpos = st->t_xpos; + st->ypos = st->t_ypos; + st->center = st->t_center; + st->overhead = st->t_overhead; + st->no_talk_anim = st->t_no_talk_anim; + st->right = st->t_right; + st->color = st->t_color; + st->charset = st->t_charset; +} + +void Scumm::unkMiscOp9() +{ + warning("stub unkMiscOp9()"); +} + +void Scumm::startManiac() +{ + warning("stub startManiac()"); +} + +void Scumm::destroy() +{ + freeResources(); + + free(_objectStateTable); + free(_objectRoomTable); + free(_objectOwnerTable); + free(_inventory); + free(_arrays); + free(_verbs); + free(_objs); + free(_vars); + free(_bitVars); + free(_newNames); + free(_classData); +} + +const int new_dir_table[4] = { + 270, + 90, + 180, + 0, +}; + +const int16 many_direction_tab[16] = {71, 109, 251, 289, -1, -1, -1, -1, 22, 72, 107, 157, 202, 252, 287, 337}; + +int newDirToOldDir(int dir) +{ + if (dir >= 71 && dir <= 109) + return 1; + if (dir >= 109 && dir <= 251) + return 2; + if (dir >= 251 && dir <= 289) + return 0; + return 3; +} + +int oldDirToNewDir(int dir) +{ + return new_dir_table[dir]; +} + + +int numSimpleDirDirections(int dirType) +{ + return dirType ? 8 : 4; +} + + +/* Convert an angle to a simple direction */ +int toSimpleDir(int dirType, int dir) +{ + int num = dirType ? 8 : 4; + const int16 *dirtab = &many_direction_tab[dirType * 8]; + for (int i = 1; i < num; i++, dirtab++) { + if (dir >= dirtab[0] && dir <= dirtab[1]) + return i; + } + return 0; + +} + +/* Convert a simple direction to an angle */ +int fromSimpleDir(int dirType, int dir) +{ + if (!dirType) + return dir * 90; + else + return dir * 45; +} + + +int normalizeAngle(int angle) +{ + int temp; + + temp = (angle + 360) % 360; + + return toSimpleDir(1, temp) * 45; +} + +void NORETURN CDECL error(const char *s, ...) +{ + char buf[1024]; +#if defined( USE_WINDBG ) || defined ( _WIN32_WCE ) + char buf2[1024]; +#if defined( _WIN32_WCE ) + TCHAR buf2w[2048]; +#endif +#endif + + va_list va; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + + if (g_scumm && g_scumm->_currentScript != 0xFF) { + ScriptSlot *ss = &g_scumm->vm.slot[g_scumm->_currentScript]; + fprintf(stderr, "Error(%d:%d:0x%X): %s!\n", + g_scumm->_roomResource, + ss->number, + g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, buf); +#if defined( USE_WINDBG ) || defined( _WIN32_WCE ) + sprintf(buf2, "Error(%d:%d:0x%X): %s!\n", + g_scumm->_roomResource, + ss->number, + g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, + buf); +#if defined ( _WIN32_WCE ) + MultiByteToWideChar(CP_ACP, 0, buf2, strlen(buf2) + 1, buf2w, sizeof(buf2w)); + GraphicsOff(); + MessageBox(NULL, buf2w, TEXT("ScummVM error"), MB_OK); +#else + OutputDebugString(buf2); +#endif +#endif + + } else { + fprintf(stderr, "Error: %s!\n", buf); +#if defined( USE_WINDBG ) || defined( _WIN32_WCE ) + sprintf(&buf[strlen(buf)], "\n"); +#if defined ( _WIN32_WCE ) + MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf2w, sizeof(buf2w)); + GraphicsOff(); + MessageBox(NULL, buf2w, TEXT("ScummVM error"), MB_OK); +#else + OutputDebugString(buf); +#endif +#endif + } + // Doesn't wait for any keypress!! Is it intended to? + exit(1); +} + +void CDECL warning(const char *s, ...) +{ + char buf[1024]; + va_list va; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + + fprintf(stderr, "WARNING: %s!\n", buf); +#if defined( USE_WINDBG ) + sprintf(&buf[strlen(buf)], "\n"); + OutputDebugString(buf); +#endif +} + +uint16 _debugLevel = 1; + +void CDECL debug(int level, const char *s, ...) +{ + char buf[1024]; + va_list va; + + if (level > _debugLevel) + return; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + printf("%s\n", buf); + +#if defined( USE_WINDBG ) + sprintf(&buf[strlen(buf)], "\n"); + OutputDebugString(buf); +#endif + + fflush(stdout); +} + +void checkHeap() +{ +#if defined(WIN32) + if (_heapchk() != _HEAPOK) { + error("Heap is invalid!"); + } +#endif +} + +ScummDebugger g_debugger; + +void Scumm::waitForTimer(int msec_delay) { + OSystem::Event event; + uint32 start_time; + + if (_fastMode&2) + msec_delay = 0; + else if (_fastMode&1) + msec_delay = 10; + + start_time = _system->get_msecs(); + + for(;;) { + while (_system->poll_event(&event)) { + + // if newgui is running, copy event to EventList, and let the GUI handle it itself + // we might consider this approach for ScummLoop as well, and clean up the current mess + if (_newgui->isActive()) { + if (event.event_code == OSystem::EVENT_MOUSEMOVE) { + mouse.x = event.mouse.x; + mouse.y = event.mouse.y; + _system->set_mouse_pos(event.mouse.x, event.mouse.y); + _system->update_screen(); + } + _newgui->handleEvent(event); + continue; + } + + switch(event.event_code) { + case OSystem::EVENT_KEYDOWN: + if (event.kbd.keycode >= '0' && event.kbd.keycode<='9' + && (event.kbd.flags == OSystem::KBD_SHIFT || + event.kbd.flags == OSystem::KBD_CTRL)) { + _saveLoadSlot = event.kbd.keycode - '0'; + sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); + _saveLoadFlag = (event.kbd.flags == OSystem::KBD_SHIFT) ? 1 : 2; + _saveLoadCompatible = false; + } else if (event.kbd.flags==OSystem::KBD_CTRL) { + if (event.kbd.keycode=='f') + _fastMode ^= 1; + else if (event.kbd.keycode=='g') + _fastMode ^= 2; + else if ((event.kbd.keycode=='d') && (!_system->property(OSystem::PROP_GET_FULLSCREEN, 0))) + g_debugger.attach(this); + else if (event.kbd.keycode=='s') + resourceStats(); + } else + _keyPressed = event.kbd.ascii; // Normal key press, pass on to the game. + break; + + case OSystem::EVENT_MOUSEMOVE: + mouse.x = event.mouse.x; + mouse.y = event.mouse.y; + _system->set_mouse_pos(event.mouse.x, event.mouse.y); + _system->update_screen(); + break; + + case OSystem::EVENT_LBUTTONDOWN: + _leftBtnPressed |= msClicked|msDown; +#ifdef _WIN32_WCE + mouse.x = event.mouse.x; + mouse.y = event.mouse.y; +#endif + break; + + case OSystem::EVENT_RBUTTONDOWN: + _rightBtnPressed |= msClicked|msDown; +#ifdef _WIN32_WCE + mouse.x = event.mouse.x; + mouse.y = event.mouse.y; +#endif + break; + + case OSystem::EVENT_LBUTTONUP: + _leftBtnPressed &= ~msDown; + break; + + case OSystem::EVENT_RBUTTONUP: + _rightBtnPressed &= ~msDown; + break; + } + } +#ifdef COMPRESSED_SOUND_FILE + if (_sound->updateMP3CD() == -1) +#endif + _system->update_cdrom(); /* Loop CD Audio if needed */ + if (_system->get_msecs() >= start_time + msec_delay) + break; + _system->delay_msecs(10); + } +} + + +void Scumm::updatePalette() { + if (_palDirtyMax == -1) + return; + + int first = _palDirtyMin; + int num = _palDirtyMax - first + 1; + int i; + + byte palette_colors[1024],*p = palette_colors; + + // Sam & Max film noir mode + if (_gameId == GID_SAMNMAX && readVar(0x8000)) + desaturatePalette(); + + for (i = _palDirtyMin; i <= _palDirtyMax; i++) { + byte *data; + + if (_features & GF_SMALL_HEADER) + data = _currentPalette + _shadowPalette[i] * 3; + else + data = _currentPalette + i * 3; + + *p++ = data[0]; + *p++ = data[1]; + *p++ = data[2]; + *p++ = 0; + + } + + _system->set_palette(palette_colors, first, num); + + _palDirtyMax = -1; + _palDirtyMin = 256; +} + +void Scumm::mainRun() +{ + int delta = 0; + int last_time = _system->get_msecs(); + int new_time; + + for(;;) { + + updatePalette(); + + _system->update_screen(); + new_time = _system->get_msecs(); + waitForTimer(delta * 15 + last_time - new_time); + last_time = _system->get_msecs(); + if (_gui->isActive()) { + _gui->loop(); + delta = 5; + } else if (_newgui->isActive()) { + _newgui->loop(); + delta = 5; + } else { + delta = scummLoop(delta); + if (delta < 1) // Ensure we don't get into a loop + delta = 1; // by not decreasing sleepers. + } + } +} + +void Scumm::launch() +{ + charset._vm = this; + gdi._vm = this; + _fileHandle = NULL; + + _maxHeapThreshold = 450000; + _minHeapThreshold = 400000; + + /* Create a primary virtual screen */ + _videoBuffer = (byte *)calloc(328*200, 1); + + allocResTypeData(rtBuffer, MKID('NONE'), 10, "buffer", 0); + initVirtScreen(0, 0, 0, 320, 200, false, false); + + if (_features & GF_AFTER_V7) + setupScummVarsNew(); + else + setupScummVarsOld(); + + if ((_features & GF_AFTER_V7) || (_gameId == GID_SAMNMAX)) + NUM_ACTORS = 30; + else + NUM_ACTORS = 13; + + if (_features & GF_AFTER_V7) + OF_OWNER_ROOM = 0xFF; + else + OF_OWNER_ROOM = 0x0F; + + // if (_gameId==GID_MONKEY2 && _bootParam == 0) + // _bootParam = 10001; + + if (_gameId == GID_INDY4 && _bootParam == 0) { + _bootParam = -7873; + } + + readIndexFile(); + + initRandSeeds(); + + if (_features & GF_NEW_OPCODES) + setupOpcodes2(); + else + setupOpcodes(); + + scummInit(); + + if (!(_features & GF_AFTER_V7)) + _vars[VAR_VERSION] = 21; + + _vars[VAR_DEBUGMODE] = _debugMode; + + if (_gameId == GID_MONKEY) + _vars[74] = 1225; + + _sound->setupSound(); + + runScript(1, 0, 0, &_bootParam); + +// _scummTimer = 0; +} + +void Scumm::go() { + launch(); + setupGUIColors(); + mainRun(); +} + + +byte Scumm::getDefaultGUIColor(int color) +{ + /* FIXME: strange IF line? */ + if ((_features & GF_AFTER_V7) || (_features & GF_SMALL_HEADER)) + return 0; + if (_features & GF_AFTER_V6) { + if (color == 8) + color = 1; + return readArray(110, 0, color); + } else { + return getStringAddress(21)[color]; + } +} + +void Scumm::setupGUIColors() { + + /* FIXME: strange IF line? */ + if (_gameId && !(_features & GF_SMALL_HEADER) && !(_features & GF_AFTER_V7)) { + _gui->_bgcolor = getDefaultGUIColor(0); + _gui->_color = getDefaultGUIColor(1); + _gui->_textcolor = getDefaultGUIColor(2); + _gui->_textcolorhi = getDefaultGUIColor(6); + _gui->_shadowcolor = getDefaultGUIColor(8); + + _newgui->_bgcolor = _gui->_bgcolor; + _newgui->_color = _gui->_color; + _newgui->_textcolor = _gui->_textcolor; + _newgui->_textcolorhi = _gui->_textcolorhi; + _newgui->_shadowcolor = _gui->_shadowcolor; + } +} diff --git a/scumm/smush.h b/scumm/smush.h new file mode 100644 index 0000000000..1389a51b14 --- /dev/null +++ b/scumm/smush.h @@ -0,0 +1,144 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#define SP_MAX_FONTS 5 +#define MAX_STREAMER 10 + +class SmushPlayer { + +private: + +struct PersistentCodecData37 { + byte *deltaBuf; + byte *deltaBufs[2]; + uint32 deltaSize; + int32 width, height; + int32 curtable; + int32 unk2, unk3; + uint32 flags; + int16 *table1; + int32 table_last_pitch; + byte table_last_flags; +}; + +struct CodecData { + byte * out, * src; + int32 x, y; + int32 outwidth, outheight; + int32 w, h, pitch; + uint32 flags; +}; + + FILE * _in; + int32 fileSize; + byte * _block; + uint32 _blockTag; + uint32 _blockSize; + + byte * _cur; + byte * _renderBitmap; + uint32 _frameSize; + uint32 _frmeTag, _frmeSize; + bool _frameChanged; + + // Palette + uint16 _fluPalMul129[768]; + uint16 _fluPalWords[768]; + bool _paletteChanged; + byte _fluPalette[768]; + + // TRES + byte * _fonts[SP_MAX_FONTS]; + byte * _bufferTres; + + int32 _mixerNum; + + // PSAD: Full Throttle audio + uint32 _saudSize[MAX_STREAMER], _saudSubSize[MAX_STREAMER]; + uint32 _psadTrk[MAX_STREAMER], _strkRate[MAX_STREAMER]; + uint32 _saudSubTag[MAX_STREAMER]; + uint32 _strkFinalSize[MAX_STREAMER]; + bool _strkNewMixer[MAX_STREAMER]; + byte * _strkBuf[MAX_STREAMER]; + + // IACT: The Dig audio + uint32 _imusSize[MAX_STREAMER], _imusSubSize[MAX_STREAMER]; + uint32 _imusTrk[MAX_STREAMER], _imusRate[MAX_STREAMER], _imusChan[MAX_STREAMER]; + uint32 _imusSubTag[MAX_STREAMER]; + byte _imusData[MAX_STREAMER][3]; + uint32 _imusPos[MAX_STREAMER], _imusCodec[MAX_STREAMER]; + uint32 _imusFinalSize[MAX_STREAMER]; + byte _imusFlags[MAX_STREAMER]; + byte * _imusBuf[MAX_STREAMER]; + bool _imusNewMixer[MAX_STREAMER]; + + // Codec37 + PersistentCodecData37 pcd37; + byte * _deltaBuf; + int32 _deltaBufSize; + + bool _lock; + Scumm * _scumm; + + // TRES + byte * loadTres(); + void loadFonts(); + uint32 getCharWidth(uint8 c_font, byte txt); + uint32 getFontHeight(uint8 c_font); + byte * getStringTRES(int32 number); + void drawStringTRES(uint32 x, uint32 y, byte * txt); + void drawCharTRES(uint32 * x, uint32 y, uint32 c_line, uint8 c_font, uint8 color, uint8 txt); + + void openFile(byte* fileName); + + void setPalette(); + void codec44Depack(byte *dst, byte *src, uint32 len); + void codec1(CodecData * cd); + void codec37Maketable(PersistentCodecData37 * pcd, int32 pitch, byte idx); + bool codec37(int32 game, CodecData * cd, PersistentCodecData37 * pcd); + void codec37Init(PersistentCodecData37 * pcd, int32 width, int32 height); + void codec37Proc5(int32 game, byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table); + void codec37BompDepack(byte *dst, byte *src, int32 len); + void codec37Proc4(byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table); + uint32 nextBE32(); + void nextBlock(); + + bool parseTag(); + void parseAHDR(); + void parseFRME(); + void parseNPAL(); + void parseFOBJ(); + void parsePSAD(); + void parseTRES(); + void parseXPAL(); + void parseIACT(); + + void init(); + void deinit(); + void go(); + +public: + SmushPlayer(Scumm * parent); + ~SmushPlayer(); + void startVideo(short int arg, byte* videofile); + void update(); +}; diff --git a/scumm/sound.h b/scumm/sound.h new file mode 100644 index 0000000000..4d2a554d6c --- /dev/null +++ b/scumm/sound.h @@ -0,0 +1,136 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef SOUND_H +#define SOUND_H + +#include "scummsys.h" +#include "sound/mixer.h" + +class Scumm; + +class Sound { + +private: + +enum { + SOUND_HEADER_SIZE = 26, + SOUND_HEADER_BIG_SIZE = 26 + 8, + +}; + + int16 _soundQuePos, _soundQue[0x100]; + byte _soundQue2Pos, _soundQue2[10]; + bool _soundsPaused2; + bool _soundVolumePreset; + + int32 _numberBundleMusic; + int32 _currentSampleBundleMusic; + int32 _numberSamplesBundleMusic; + int32 _offsetSampleBundleMusic; + int32 _offsetBufBundleMusic; + byte * _musicBundleBufFinal; + byte * _musicBundleBufOutput; + bool _pauseBundleMusic; + + + int _talkChannel; /* Mixer channel actor is talking on */ + void *_sfxFile; + uint32 _talk_sound_a, _talk_sound_b; + byte _talk_sound_mode; + bool _mouthSyncMode; + bool _endOfMouthSync; + uint16 _mouthSyncTimes[52]; + uint _curSoundPos; + + MP3OffsetTable *offset_table; // SO3 MP3 compressed audio + int num_sound_effects; // SO3 MP3 compressed audio +#ifdef COMPRESSED_SOUND_FILE + + #define CACHE_TRACKS 10 + + /* used for mp3 CD music */ + + int _cached_tracks[CACHE_TRACKS]; + struct mad_header _mad_header[CACHE_TRACKS]; + long _mp3_size[CACHE_TRACKS]; + FILE *_mp3_tracks[CACHE_TRACKS]; + int _mp3_index; + bool _mp3_cd_playing; +#endif + + Scumm * _scumm; + +public: + +#ifdef COMPRESSED_SOUND_FILE + + int _current_cache; + +#endif + + bool _soundsPaused; + int16 _sound_volume_master, _sound_volume_music, _sound_volume_sfx; + byte _sfxMode; + + Sound(Scumm *parent); + ~Sound(); + void addSoundToQueue(int sound); + void addSoundToQueue2(int sound); + void processSoundQues(); + void playSound(int sound); + void processSfxQueues(); + int startTalkSound(uint32 offset, uint32 b, int mode); + void stopTalkSound(); + bool isMouthSyncOff(uint pos); + int isSoundRunning(int sound); + bool isSoundInQueue(int sound); + void stopSound(int a); + void stopAllSounds(); + void clearSoundQue(); + void soundKludge(int16 * list); + void talkSound(uint32 a, uint32 b, int mode); + void setupSound(); + void pauseSounds(bool pause); + int startSfxSound(void *file, int file_size); + void * openSfxFile(); + void stopSfxSound(); + bool isSfxFinished(); + uint32 decode12BitsSample(byte * src, byte ** dst, uint32 size); + void playBundleMusic(int32 song); + void pauseBundleMusic(bool state); + void bundleMusicHandler(Scumm * scumm); + void stopBundleMusic(); + void playBundleSound(char *sound); + int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned); + int playSfxSound_MP3(void *sound, uint32 size); + +#ifdef COMPRESSED_SOUND_FILE + int getCachedTrack(int track); + int playMP3CDTrack(int track, int num_loops, int start, int delay); + int stopMP3CD(); + int pollMP3CD(); + int updateMP3CD(); +#endif + +}; + +#endif + diff --git a/scumm/string.cpp b/scumm/string.cpp new file mode 100644 index 0000000000..00f1cdd04d --- /dev/null +++ b/scumm/string.cpp @@ -0,0 +1,1056 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "actor.h" + +int CharsetRenderer::getStringWidth(int arg, byte *text, int pos) +{ + byte *ptr; + int width, offs, w; + byte chr; + + width = 1; + ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; + if (_vm->_features & GF_SMALL_HEADER) + ptr -= 12; + + while ((chr = text[pos++]) != 0) { + if (chr == 0xD) + break; + if (chr == '@') + continue; + if (chr == 254) + chr = 255; + if (chr == 255) { + chr = text[pos++]; + if (chr == 3) + break; + if (chr == 8) { + if (arg == 1) + break; + while (text[pos] == ' ') + text[pos++] = '@'; + continue; + } + if (chr == 10 || chr == 21 || chr == 12 || chr == 13) { + pos += 2; + continue; + } + if (chr == 9 || chr == 1 || chr == 2) + break; + if (chr == 14) { + int set = text[pos] | (text[pos + 1] << 8); + pos += 2; + ptr = _vm->getResourceAddress(rtCharset, set) + 29; + if (_vm->_features & GF_SMALL_HEADER) + ptr -= 12; + continue; + } + } + if (_vm->_features & GF_OLD256) { + width += 8; + } else { + offs = READ_LE_UINT32(ptr + chr * 4 + 4); + if (offs) { + if (ptr[offs + 2] >= 0x80) { + w = ptr[offs + 2] - 0x100; + } else { + w = ptr[offs + 2]; + } + width += ptr[offs] + w; + } + } + } + return width; +} + +void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) +{ + int lastspace = -1; + int curw = 1; + int offs, w; + byte *ptr; + byte chr; + + ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; + if (_vm->_features & GF_SMALL_HEADER) + ptr -= 12; + + while ((chr = str[pos++]) != 0) { + if (chr == '@') + continue; + if (chr == 254) + chr = 255; + if (chr == 255) { + chr = str[pos++]; + if (chr == 3) + break; + if (chr == 8) { + if (a == 1) { + curw = 1; + } else { + while (str[pos] == ' ') + str[pos++] = '@'; + } + continue; + } + if (chr == 10 || chr == 21 || chr == 12 || chr == 13) { + pos += 2; + continue; + } + if (chr == 1) { + curw = 1; + continue; + } + if (chr == 2) + break; + if (chr == 14) { + int set = str[pos] | (str[pos + 1] << 8); + pos += 2; + ptr = _vm->getResourceAddress(rtCharset, set) + 29; + if (_vm->_features & GF_SMALL_HEADER) + ptr -= 12; + continue; + } + } + + if (chr == ' ') + lastspace = pos - 1; + if (_vm->_features & GF_OLD256) { + curw += getSpacing(chr); + } else { + offs = READ_LE_UINT32(ptr + chr * 4 + 4); + if (offs) { + if (ptr[offs + 2] >= 0x80) { + w = ptr[offs + 2] - 0x100; + } else { + w = ptr[offs + 2]; + } + curw += w + ptr[offs]; + } + } + if (lastspace == -1) + continue; + if (curw > maxwidth) { + str[lastspace] = 0xD; + curw = 1; + pos = lastspace + 1; + lastspace = -1; + } + } +} + +void Scumm::unkMessage1() +{ + byte buffer[100]; + _msgPtrToAdd = buffer; + _messagePtr = addMessageToStack(_messagePtr); + + if (buffer[0] == 0xFF && buffer[1] == 10) { + uint32 a, b; + + a = buffer[2] | (buffer[3] << 8) | (buffer[6] << 16) | (buffer[7] << 24); + b = buffer[10] | (buffer[11] << 8) | (buffer[14] << 16) | (buffer[15] << 24); +// if (_saveSound != 1) + _sound->talkSound(a, b, 1); + } +// warning("unkMessage1(\"%s\")", buffer); +} + +void Scumm::unkMessage2() +{ + byte buf[100], *tmp; + + _msgPtrToAdd = buf; + tmp = _messagePtr = addMessageToStack(_messagePtr); + + if (string[3].color == 0) + string[3].color = 4; + + warning("unkMessage2(\"%s\")", buf); + _messagePtr = tmp; +} + + +void Scumm::CHARSET_1() +{ + int s, i, t, c; + int frme; + Actor *a; + byte *buffer; + + if (!_haveMsg) + return; + + // FIXME: This Zak check fixes several hangs (Yak hang, and opening + // 'secret room while walking' hang. It doesn't do the camera check + // when the talk target isn't an actor. The question is, can we make + // this a more general case? Does it really need to be Zak specific? + if (!(_features & GF_AFTER_V7) && !(_gameId==GID_ZAK256 && _vars[VAR_TALK_ACTOR] == 0xFF)) { + if ((camera._dest.x >> 3) != (camera._cur.x >> 3) || camera._cur.x != camera._last.x) + return; + } + + a = NULL; + if (_vars[VAR_TALK_ACTOR] != 0xFF) + a = derefActorSafe(_vars[VAR_TALK_ACTOR], "CHARSET_1"); + + if (a && string[0].overhead != 0) { + if (!(_features & GF_AFTER_V6)) { + string[0].xpos = a->x - camera._cur.x + 160; + + if (_vars[VAR_V5_TALK_STRING_Y] < 0) { + s = (a->scaley * (int)_vars[VAR_V5_TALK_STRING_Y]) / 0xFF; + string[0].ypos = ((_vars[VAR_V5_TALK_STRING_Y] - s) >> 1) + s - a->elevation + a->y; + } else { + string[0].ypos = _vars[VAR_V5_TALK_STRING_Y]; + } + if (string[0].ypos < 1) + string[0].ypos = 1; + + if (string[0].xpos < 80) + string[0].xpos = 80; + if (string[0].xpos > 240) + string[0].xpos = 240; + } else { + s = a->scaley * a->new_1 / 0xFF; + string[0].ypos = ((a->new_1 - s) >> 1) + s - a->elevation + a->y; + if (string[0].ypos < 1) + string[0].ypos = 1; + + if (string[0].ypos < camera._cur.y - 100) + + string[0].ypos = camera._cur.y - 100; + + s = a->scalex * a->new_2 / 0xFF; + string[0].xpos = ((a->new_2 - s) >> 1) + s + a->x - camera._cur.x + 160; + if (string[0].xpos < 80) + string[0].xpos = 80; + if (string[0].xpos > 240) + string[0].xpos = 240; + } + } + + charset._top = string[0].ypos; + charset._left = string[0].xpos; + charset._left2 = string[0].xpos; + charset._curId = string[0].charset; + + if (a && a->charset) + charset._curId = a->charset; + + charset._center = string[0].center; + charset._right = string[0].right; + charset._color = _charsetColor; + _bkColor = 0; + + if (!(_features & GF_OLD256)) // FIXME + for (i = 0; i < 4; i++) + if (_features & GF_SMALL_HEADER) + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + else + charset._colorMap[i] = _charsetData[charset._curId][i]; + + if (_keepText) { + charset._strLeft = gdi._mask_left; + charset._strRight = gdi._mask_right; + charset._strTop = gdi._mask_top; + charset._strBottom = gdi._mask_bottom; + } + + if (_talkDelay) + return; + + if (_haveMsg != 0xFF && _haveMsg != 0xFE) { + if (_sound->_sfxMode == 0) + stopTalk(); + return; + } + + if (a && !string[0].no_talk_anim) { + a->startAnimActor(a->talkFrame1); + _useTalkAnims = true; + } + + _talkDelay = _defaultTalkDelay; + + if (!_keepText) { + if (_features & GF_OLD256) { + gdi._mask_left = string[0].xpos; + gdi._mask_top = string[0].ypos; + gdi._mask_bottom = string[0].ypos + 8; + gdi._mask_right = 320; + if (string[0].ypos <= 16) // If we are cleaning the text line, clean 2 lines. + gdi._mask_bottom = 16; + } + restoreCharsetBg(); + charset._xpos2 = string[0].xpos; + charset._ypos2 = string[0].ypos; + } + + t = charset._right - string[0].xpos - 1; + if (charset._center) { + if (t > charset._xpos2) + t = charset._xpos2; + t <<= 1; + } + + buffer = charset._buffer + charset._bufPos; + charset.addLinebreaks(0, buffer, 0, t); + + _lastXstart = virtscr[0].xstart; + if (charset._center) { + charset._xpos2 -= charset.getStringWidth(0, buffer, 0) >> 1; + if (charset._xpos2 < 0) + charset._xpos2 = 0; + } + + charset._disableOffsX = charset._unk12 = !_keepText; + + do { + c = *buffer++; + if (c == 0) { + // End of text reached, set _haveMsg to 1 so that the text will be + // removed next time CHARSET_1 is called. + _haveMsg = 1; + _keepText = false; + break; + } + if (c == 13) { + newLine:; + if (_features & GF_OLD256) { + charset._ypos2 = 8; + charset._xpos2 = 0; + continue; + } else { + charset._xpos2 = string[0].xpos; + if (charset._center) { + charset._xpos2 -= charset.getStringWidth(0, buffer, 0) >> 1; + } + if (_features & GF_SMALL_HEADER) + charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[18]; + else + charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30]; + charset._disableOffsX = 1; + continue; + } + } + + if (c == 0xFE) + c = 0xFF; + + if (c != 0xFF) { + charset._left = charset._xpos2; + charset._top = charset._ypos2; + if (_features & GF_OLD256) + charset.printCharOld(c); + else if (!(_features & GF_AFTER_V6)) { +// if (!_vars[VAR_V5_CHARFLAG]) { /* FIXME */ + if (!(_haveMsg == 0xFE && _noSubtitles)) + charset.printChar(c); +// } + } else { + if (!(_haveMsg == 0xFE && _noSubtitles)) + charset.printChar(c); + } + + charset._xpos2 = charset._left; + charset._ypos2 = charset._top; + _talkDelay += _vars[VAR_CHARINC]; + continue; + } + + c = *buffer++; + if (c == 3) { + if (_haveMsg != 0xFE) + _haveMsg = 0xFF; + _keepText = false; + break; + } else if (c == 1) { + goto newLine; + } else if (c == 2) { + _haveMsg = 0; + _keepText = true; + break; + } else if (c == 9) { + frme = *buffer++; + frme |= *buffer++ << 8; + if (a) + a->startAnimActor(frme); + } else if (c == 10) { + uint32 tmpA, tmpB; + + tmpA = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24); + tmpB = buffer[8] | (buffer[9] << 8) | (buffer[12] << 16) | (buffer[13] << 24); + _sound->talkSound(tmpA, tmpB, 2); + buffer += 14; + + // Set flag that speech variant exist of this msg + if (_haveMsg == 0xFF) + _haveMsg = 0xFE; + } else if (c == 14) { + int oldy = getResourceAddress(rtCharset, charset._curId)[30]; + + charset._curId = *buffer++; + buffer += 2; + for (i = 0; i < 4; i++) + if (_features & GF_SMALL_HEADER) + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + else + charset._colorMap[i] = _charsetData[charset._curId][i]; + charset._ypos2 -= getResourceAddress(rtCharset, charset._curId)[30] - oldy; + } else if (c == 12) { + int color; + color = *buffer++; + color |= *buffer++ << 8; + if (color == 0xFF) + charset._color = _charsetColor; + else + charset._color = color; + } else if (c == 13) { + buffer += 2; + } else { + warning("CHARSET_1: invalid code %d", c); + } + } while (1); + + charset._bufPos = buffer - charset._buffer; + + gdi._mask_left = charset._strLeft; + gdi._mask_right = charset._strRight; + gdi._mask_top = charset._strTop; + gdi._mask_bottom = charset._strBottom; +} + +void Scumm::description() +{ + int c; + byte *buffer; + + buffer = charset._buffer + charset._bufPos; + string[0].ypos = camera._cur.y + 88; + string[0].xpos = 160 - (charset.getStringWidth(0, buffer, 0) >> 1); + if (string[0].xpos < 0) + string[0].xpos = 0; + + charset._top = string[0].ypos; + charset._left = string[0].xpos; + charset._left2 = string[0].xpos; + charset._right = 319; + charset._xpos2 = string[0].xpos; + charset._ypos2 = string[0].ypos; + charset._disableOffsX = charset._unk12 = 1; + charset._curId = 3; + charset._center = false; + charset._color = 15; + _bkColor = 0; + _talkDelay = 1; + + restoreCharsetBg(); + + _lastXstart = virtscr[0].xstart; + + do { + c = *buffer++; + if (c == 0) { + _haveMsg = 1; + break; + } + if (c != 0xFF) { + charset._left = charset._xpos2; + charset._top = charset._ypos2; + charset.printChar(c); + charset._xpos2 = charset._left; + charset._ypos2 = charset._top; + continue; + } + + } while (1); + + gdi._mask_left = charset._strLeft; + gdi._mask_right = charset._strRight; + gdi._mask_top = charset._strTop; + gdi._mask_bottom = charset._strBottom; +} + +void Scumm::drawString(int a) +{ + byte buf[256]; + byte *charsetptr, *space; + int i; + byte byte1 = 0, chr; + uint color; + + _msgPtrToAdd = buf; + _messagePtr = addMessageToStack(_messagePtr); + + charset._left2 = charset._left = string[a].xpos; + charset._top = string[a].ypos; + charset._curId = string[a].charset; + charset._center = string[a].center; + charset._right = string[a].right; + charset._color = string[a].color; + _bkColor = 0; + charset._unk12 = 1; + charset._disableOffsX = 1; + + if (!(_features & GF_OLD256)) { + charsetptr = getResourceAddress(rtCharset, charset._curId); + assert(charsetptr); + charsetptr += 29; + if (_features & GF_SMALL_HEADER) + charsetptr -= 12; + + for (i = 0; i < 4; i++) + if (_features & GF_SMALL_HEADER) + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + else + charset._colorMap[i] = _charsetData[charset._curId][i]; + + byte1 = charsetptr[1]; + } + + _msgPtrToAdd = buf; + + /* trim from the right */ + space = NULL; + while (*_msgPtrToAdd) { + if (*_msgPtrToAdd == ' ') { + if (!space) + space = _msgPtrToAdd; + } else { + space = NULL; + } + _msgPtrToAdd++; + } + if (space) + *space = '\0'; + if (charset._center) { + charset._left -= charset.getStringWidth(a, buf, 0) >> 1; + } + + charset._ignoreCharsetMask = 1; + + if (!buf[0]) { + buf[0] = ' '; + buf[1] = 0; + } + + for (i = 0; (chr = buf[i++]) != 0;) { + if (chr == 254) + chr = 255; + if (chr == 255) { + chr = buf[i++]; + switch (chr) { + case 9: + case 10: + case 13: + case 14: + i += 2; + break; + case 1: + case 8: + if (charset._center) { + charset._left = charset._left2 - charset.getStringWidth(a, buf, i); + } else { + charset._left = charset._left2; + } + charset._top += byte1; + break; + case 12: + color = buf[i] + (buf[i + 1] << 8); + i += 2; + if (color == 0xFF) + charset._color = string[a].color; + else + charset._color = color; + break; + } + } else { + if (a == 1 && (_features & GF_AFTER_V6)) + + if (string[a].no_talk_anim == 0) + charset._blitAlso = true; + if (_features & GF_OLD256) + charset.printCharOld(chr); + else + charset.printChar(chr); + charset._blitAlso = false; + } + } + + charset._ignoreCharsetMask = 0; + + if (a == 0) { + charset._xpos2 = charset._left; + charset._ypos2 = charset._top; + } +} + +byte *Scumm::addMessageToStack(byte *msg) +{ + int num, numorg; + byte *ptr, chr; + + numorg = num = _numInMsgStack; + ptr = getResourceAddress(rtTemp, 6); + + if (ptr == NULL) + error("Message stack not allocated"); + + if (msg == NULL) { + warning("Bad message in addMessageToStack, ignoring"); + return NULL; + } + + while ((chr = *msg++) != 0) { + if (num > 500) + error("Message stack overflow"); + + ptr[num++] = chr; + + if (chr == 255) { + ptr[num++] = chr = *msg++; + + if (chr != 1 && chr != 2 && chr != 3 && chr != 8) { + ptr[num++] = chr = *msg++; + ptr[num++] = chr = *msg++; + } + } + } + ptr[num++] = 0; + + _numInMsgStack = num; + num = numorg; + + while (1) { + ptr = getResourceAddress(rtTemp, 6); + chr = ptr[num++]; + if (chr == 0) + break; + if (chr == 0xFF) { + chr = ptr[num++]; + switch (chr) { + case 4: + unkAddMsgToStack2(READ_LE_UINT16(ptr + num)); + num += 2; + break; + case 5: + unkAddMsgToStack3(READ_LE_UINT16(ptr + num)); + num += 2; + break; + case 6: + unkAddMsgToStack4(READ_LE_UINT16(ptr + num)); + num += 2; + break; + case 7: + unkAddMsgToStack5(READ_LE_UINT16(ptr + num)); + num += 2; + break; + case 9: +//#if defined(DOTT) + case 10: + case 12: + case 13: + case 14: +//#endif + *_msgPtrToAdd++ = 0xFF; + *_msgPtrToAdd++ = chr; + *_msgPtrToAdd++ = ptr[num++]; + *_msgPtrToAdd++ = ptr[num++]; + break; + default: + *_msgPtrToAdd++ = 0xFF; + *_msgPtrToAdd++ = chr; + } + } else { + if (chr != '@') { + *_msgPtrToAdd++ = chr; + } + } + } + *_msgPtrToAdd = 0; + _numInMsgStack = numorg; + + return msg; +} + +void Scumm::unkAddMsgToStack2(int var) +{ + int num, max; + byte flag; + + num = readVar(var); + if (num < 0) { + *_msgPtrToAdd++ = '-'; + num = -num; + } + + flag = 0; + max = 10000; + do { + if (num >= max || flag) { + *_msgPtrToAdd++ = num / max + '0'; + num -= (num / max) * max; + flag = 1; + } + max /= 10; + if (max == 1) + flag = 1; + } while (max); +} + +void Scumm::unkAddMsgToStack3(int var) +{ + int num, i; + + num = readVar(var); + if (num) { + for (i = 1; i < _maxVerbs; i++) { + if (num == _verbs[i].verbid && !_verbs[i].type && !_verbs[i].saveid) { + addMessageToStack(getResourceAddress(rtVerb, i)); + break; + } + } + } else { + addMessageToStack((byte *)""); + } +} + +void Scumm::unkAddMsgToStack4(int var) +{ + int num; + + num = readVar(var); + if (num) { + addMessageToStack(getObjOrActorName(num)); + } else { + addMessageToStack((byte *)""); + } +} + +void Scumm::unkAddMsgToStack5(int var) +{ + byte *ptr; + + if (_features & GF_AFTER_V6 || _gameId == GID_INDY3_256) + var = readVar(var); + + if (var) { + ptr = getStringAddress(var); + if (ptr) { + addMessageToStack(ptr); + return; + } + } + addMessageToStack((byte *)""); +} + +void Scumm::initCharset(int charsetno) +{ + int i; + + if (_features & GF_OLD256) + charsetno = !charsetno; + + if (_features & GF_SMALL_HEADER) + loadCharset(charsetno); + else if (!getResourceAddress(rtCharset, charsetno)) + loadCharset(charsetno); + + string[0].t_charset = charsetno; + string[1].t_charset = charsetno; + + for (i = 0; i < 0x10; i++) + if (_features & GF_SMALL_HEADER) + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + else + charset._colorMap[i] = _charsetData[charset._curId][i]; +} + +void CharsetRenderer::printCharOld(int chr) +{ // Loom3 / Zak256 + VirtScreen *vs; + byte *char_ptr, *dest_ptr; + unsigned int buffer = 0, mask = 0, x = 0, y = 0; + unsigned char color; + + _vm->checkRange(_vm->_maxCharsets - 1, 0, _curId, "Printing with bad charset %d"); + + if ((vs = _vm->findVirtScreen(_top)) == NULL) + return; + + if (chr == '@') + return; + + if (_unk12) { + _strLeft = _left; + _strTop = _top; + _strRight = _left; + _strBottom = _top; + _unk12 = 0; + } + char_ptr = _vm->getResourceAddress(rtCharset, _curId) + 224 + (chr + 1) * 8; + dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * 320 + _left; + _vm->updateDirtyRect(vs->number, _left, _left + 8, _top - vs->topline, _top - vs->topline + 8, 0); + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + if ((mask >>= 1) == 0) { + buffer = *char_ptr++; + mask = 0x80; + } + color = ((buffer & mask) != 0); + if (color) + *(dest_ptr + y * 320 + x) = _color; + } + } + + _left += getSpacing(chr); + + if (_left > _strRight) + _strRight = _left; + + if (_top + 8 > _strBottom) + _strBottom = _top + 8; + +} + + +void CharsetRenderer::printChar(int chr) +{ + int d, right; + VirtScreen *vs; + + _vm->checkRange(_vm->_maxCharsets - 1, 1, _curId, "Printing with bad charset %d"); + if ((vs = _vm->findVirtScreen(_top)) == NULL) + return; + + if (chr == '@') + return; + + _ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; + if (_vm->_features & GF_SMALL_HEADER) + _ptr -= 12; + + _bpp = _unk2 = *_ptr; + _invNumBits = 8 - _bpp; + _bitMask = 0xFF << _invNumBits; + _colorMap[1] = _color; + + _charOffs = READ_LE_UINT32(_ptr + chr * 4 + 4); + + if (!_charOffs) + return; + + assert(_charOffs < 0x10000); + + _charPtr = _ptr + _charOffs; + + _width = _charPtr[0]; + _height = _charPtr[1]; + if (_unk12) { + _strLeft = 0; + _strTop = 0; + _strRight = 0; + _strBottom = 0; + } + + if (_disableOffsX) { + _offsX = 0; + } else { + d = _charPtr[2]; + if (d >= 0x80) + d -= 0x100; + _offsX = d; + } + + d = _charPtr[3]; + if (d >= 0x80) + d -= 0x100; + _offsY = d; + + _top += _offsY; + _left += _offsX; + + right = _left + _width; + + if (right > _right + 1 || _left < 0) { + _left = right; + _top -= _offsY; + return; + } + + _disableOffsX = 0; + + if (_unk12) { + _strLeft = _left; + _strTop = _top; + _strRight = _left; + _strBottom = _top; + _unk12 = 0; + } + + if (_left < _strLeft) + _strLeft = _left; + + if (_top < _strTop) + _strTop = _top; + + _drawTop = _top - vs->topline; + if (_drawTop < 0) + _drawTop = 0; + + _bottom = _drawTop + _height + _offsY; + + _vm->updateDirtyRect(vs->number, _left, right, _drawTop, _bottom, 0); + +#if defined(OLD) + if (vs->number == 0) + _hasMask = true; +#else + if (vs->number != 0) + _blitAlso = false; + if (vs->number == 0 && _blitAlso == 0) + _hasMask = true; +#endif + + _dest_ptr = _backbuff_ptr = vs->screenPtr + vs->xstart + _drawTop * 320 + _left; + +#if !defined(OLD) + if (_blitAlso) { +#else + if (1) { +#endif + _dest_ptr = _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number + 5) + + vs->xstart + _drawTop * 320 + _left; + } + + _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + + _drawTop * 40 + _left / 8 + _vm->_screenStartStrip; + + _revBitMask = revBitMask[_left & 7]; + + _virtScreenHeight = vs->height; + _charPtr += 4; + + drawBits(); + +#if !defined(OLD) + if (_blitAlso) + blit(_backbuff_ptr, _bgbak_ptr, _width, _height); +#endif + + _left += _width; + if (_left > _strRight) + _strRight = _left; + + if (_top + _height > _strBottom) + _strBottom = _top + _height; + + _top -= _offsY; +} + +void CharsetRenderer::drawBits() +{ + bool usemask; + byte *dst, *mask, maskmask; + int y, x; + int maskpos; + int color; + byte numbits, bits; + + usemask = (_vm->_curVirtScreen->number == 0 && _ignoreCharsetMask == 0); + + bits = *_charPtr++; + numbits = 8; + + dst = _dest_ptr; + mask = _mask_ptr; + y = 0; + + for (y = 0; y < _height && y + _drawTop < _virtScreenHeight;) { + maskmask = _revBitMask; + maskpos = 0; + + for (x = 0; x < _width; x++) { + color = (bits & _bitMask) >> _invNumBits; + if (color) { + if (usemask) { + mask[maskpos] |= maskmask; + } + *dst = _colorMap[color]; + } + dst++; + bits <<= _bpp; + if ((numbits -= _bpp) == 0) { + bits = *_charPtr++; + numbits = 8; + } + if ((maskmask >>= 1) == 0) { + maskmask = 0x80; + maskpos++; + } + } + dst = (_dest_ptr += 320); + mask += 40; + y++; + } +} + +int CharsetRenderer::getSpacing(char chr) +{ + int space; + + if (_curId == 1) { // do spacing for variable width old-style font + switch (chr) { + case '.': + space = 1; + break; + case 'i': + case '\'': + case 'I': + case '!': + space = 2; + break; + case 'l': + space = 3; + break; + case ' ': + space = 4; + break; + case 'W': + case 'w': + case 'N': + case 'M': + case 'm': + space = 8; + break; + default: + space = 6; + } + } else + space = 7; + return space; +} diff --git a/scumm/sys.cpp b/scumm/sys.cpp new file mode 100644 index 0000000000..ce797ffd26 --- /dev/null +++ b/scumm/sys.cpp @@ -0,0 +1,195 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" + +void *Scumm::fileOpen(const char *filename, int mode) +{ + clearFileReadFailed(_fileHandle); + + if (mode == 1) + return fopen(filename, "rb"); + + error("This should not happen!"); + return NULL; +} + +void Scumm::fileClose(void *file) +{ + if (file) + fclose((FILE *)file); +} + +bool Scumm::fileReadFailed(void *file) +{ + return _fileReadFailed != 0; +} + +void Scumm::clearFileReadFailed(void *file) +{ + _fileReadFailed = false; +} + +bool Scumm::fileEof(void *file) +{ + return feof((FILE *)file) != 0; +} + +uint32 Scumm::filePos(void *handle) +{ + return ftell((FILE *)handle); +} + +void Scumm::fileSeek(void *file, long offs, int whence) +{ + if (fseek((FILE *)file, offs, whence) != 0) + clearerr((FILE *)file); +} + +void Scumm::fileRead(void *file, void *ptr, uint32 size) +{ + byte *ptr2 = (byte *)ptr, *src; + + if (size == 0) + return; + + if ((uint32)fread(ptr2, size, 1, (FILE *)file) != 1) { + clearerr((FILE *)file); + _fileReadFailed = true; + } + + do { + *ptr2++ ^= _encbyte; + } while (--size); +} + +int Scumm::fileReadByte() +{ + byte b; + byte *src; + + if (fread(&b, 1, 1, (FILE *)_fileHandle) != 1) { + clearerr((FILE *)_fileHandle); + _fileReadFailed = true; + } + return b ^ _encbyte; +} + +uint Scumm::fileReadWordLE() +{ + uint a = fileReadByte(); + uint b = fileReadByte(); + return a | (b << 8); +} + +uint32 Scumm::fileReadDwordLE() +{ + uint a = fileReadWordLE(); + uint b = fileReadWordLE(); + return (b << 16) | a; +} + +uint Scumm::fileReadWordBE() +{ + uint b = fileReadByte(); + uint a = fileReadByte(); + return a | (b << 8); +} + +uint32 Scumm::fileReadDwordBE() +{ + uint b = fileReadWordBE(); + uint a = fileReadWordBE(); + return (b << 16) | a; +} + +/* Overloaded versions */ +int Scumm::fileReadByte(void *handle) +{ + byte b; + + if (fread(&b, 1, 1, (FILE *)handle) != 1) { + clearerr((FILE *)handle); + _fileReadFailed = true; + } + return b ^ _encbyte; +} + +uint Scumm::fileReadWordLE(void *handle) +{ + uint a = fileReadByte(handle); + uint b = fileReadByte(handle); + return a | (b << 8); +} + +uint32 Scumm::fileReadDwordLE(void *handle) +{ + uint a = fileReadWordLE(handle); + uint b = fileReadWordLE(handle); + return (b << 16) | a; +} + +uint Scumm::fileReadWordBE(void *handle) +{ + uint b = fileReadByte(handle); + uint a = fileReadByte(handle); + return a | (b << 8); +} + +uint32 Scumm::fileReadDwordBE(void *handle) +{ + uint b = fileReadWordBE(handle); + uint a = fileReadWordBE(handle); + return (b << 16) | a; +} + +bool Scumm::checkFixedDisk() +{ + return true; +} + + +#ifdef NEED_STRDUP +char *strdup(const char *s) +{ + if (s) { + int len = strlen(s) + 1; + char *d = (char *)malloc(len); + if (d) + memcpy(d, s, len); + return d; + } + return NULL; +} +#endif /* NEED_STRDUP */ + + +void *operator new(size_t size) +{ + return calloc(size, 1); +} + +void operator delete(void *ptr) +{ + free(ptr); +} diff --git a/scumm/vars.cpp b/scumm/vars.cpp new file mode 100644 index 0000000000..18c6076e83 --- /dev/null +++ b/scumm/vars.cpp @@ -0,0 +1,207 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + +#include "stdafx.h" +#include "scumm.h" + +void Scumm::setupScummVarsOld() +{ + + VAR_EGO = 1; + VAR_CAMERA_POS_X = 2; + VAR_HAVE_MSG = 3; + VAR_ROOM = 4; + VAR_OVERRIDE = 5; + VAR_MACHINE_SPEED = 6; + VAR_ME = 7; + VAR_NUM_ACTOR = 8; + VAR_CURRENT_LIGHTS = 9; + VAR_CURRENTDRIVE = 10; + VAR_TMR_1 = 11; + VAR_TMR_2 = 12; + VAR_TMR_3 = 13; + VAR_MUSIC_FLAG = 14; + VAR_ACTOR_RANGE_MIN = 15; + VAR_ACTOR_RANGE_MAX = 16; + VAR_CAMERA_MIN_X = 17; + VAR_CAMERA_MAX_X = 18; + VAR_TIMER_NEXT = 19; + VAR_VIRT_MOUSE_X = 20; + VAR_VIRT_MOUSE_Y = 21; + VAR_ROOM_RESOURCE = 22; + VAR_LAST_SOUND = 23; + VAR_CUTSCENEEXIT_KEY = 24; + VAR_TALK_ACTOR = 25; + VAR_CAMERA_FAST_X = 26; + VAR_SCROLL_SCRIPT = 27; + VAR_ENTRY_SCRIPT = 28; + VAR_ENTRY_SCRIPT2 = 29; + VAR_EXIT_SCRIPT = 30; + VAR_EXIT_SCRIPT2 = 31; + VAR_VERB_SCRIPT = 32; + VAR_SENTENCE_SCRIPT = 33; + VAR_HOOK_SCRIPT = 34; + VAR_CUTSCENE_START_SCRIPT = 35; + VAR_CUTSCENE_END_SCRIPT = 36; + VAR_CHARINC = 37; + VAR_WALKTO_OBJ = 38; + VAR_DEBUGMODE = 39; + VAR_HEAPSPACE = 40; + VAR_RESTART_KEY = 42; + VAR_PAUSE_KEY = 43; + VAR_MOUSE_X = 44; + VAR_MOUSE_Y = 45; + VAR_TIMER = 46; + VAR_TMR_4 = 47; + VAR_SOUNDCARD = 48; + VAR_VIDEOMODE = 49; + VAR_SAVELOADDIALOG_KEY = 50; + VAR_FIXEDDISK = 51; + VAR_CURSORSTATE = 52; + VAR_USERPUT = 53; + VAR_SOUNDRESULT = 56; + VAR_TALKSTOP_KEY = 57; + VAR_59 = 59; + + VAR_SOUNDPARAM = 64; + VAR_SOUNDPARAM2 = 65; + VAR_SOUNDPARAM3 = 66; + VAR_MOUSEPRESENT = 67; + VAR_PERFORMANCE_1 = 68; + VAR_PERFORMANCE_2 = 69; // Zak256 Note: Cashcard for Zak + VAR_ROOM_FLAG = 70; // Zak256 Note: Cashcard for Annie + VAR_GAME_LOADED = 71; // Zak256 Note: Cashcard for Melissa + VAR_NEW_ROOM = 72; // Zak256 Note: Cashcard for Leslie + VAR_VERSION = 75; + + VAR_V5_DRAWFLAGS = 9; + VAR_MI1_TIMER = 14; + + VAR_V5_OBJECT_LO = 15; + VAR_V5_OBJECT_HI = 16; + + VAR_V5_TALK_STRING_Y = 54; + VAR_V5_CHARFLAG = 60; + + VAR_V6_SCREEN_WIDTH = 41; + VAR_V6_SCREEN_HEIGHT = 54; + VAR_V6_EMSSPACE = 76; + VAR_V6_RANDOM_NR = 118; +} + + +void Scumm::setupScummVarsNew() +{ + + VAR_MOUSE_X = 1; + VAR_MOUSE_Y = 2; + VAR_VIRT_MOUSE_X = 3; + VAR_VIRT_MOUSE_Y = 4; + VAR_V6_SCREEN_WIDTH = 5; + VAR_V6_SCREEN_HEIGHT = 6; + VAR_CAMERA_POS_X = 7; + VAR_CAMERA_POS_Y = 8; + VAR_OVERRIDE = 9; + VAR_ROOM = 10; + VAR_ROOM_RESOURCE = 11; + VAR_TALK_ACTOR = 12; + VAR_HAVE_MSG = 13; + VAR_TIMER = 14; + VAR_TMR_4 = 15; + VAR_LEFTBTN_DOWN = 22; + VAR_RIGHTBTN_DOWN = 23; + VAR_LEFTBTN_HOLD = 24; + VAR_RIGHTBTN_HOLD = 25; + + VAR_PERFORMANCE_1 = 26; + VAR_PERFORMANCE_2 = 27; + VAR_GAME_LOADED = 29; + VAR_V6_RANDOM_NR = 34; + VAR_NEW_ROOM = 35; + VAR_WALKTO_OBJ = 36; + + + VAR_CAMERA_DEST_X = 38; + + VAR_CAMERA_DEST_Y = 39; + + VAR_CAMERA_FOLLOWED_ACTOR = 40; + + + VAR_SCROLL_SCRIPT = 50; + VAR_ENTRY_SCRIPT = 51; + VAR_ENTRY_SCRIPT2 = 52; + VAR_EXIT_SCRIPT = 53; + VAR_EXIT_SCRIPT2 = 54; + VAR_VERB_SCRIPT = 55; + VAR_SENTENCE_SCRIPT = 56; + VAR_HOOK_SCRIPT = 57; + VAR_CUTSCENE_START_SCRIPT = 58; + VAR_CUTSCENE_END_SCRIPT = 59; + VAR_UNK_SCRIPT = 60; + VAR_UNK_SCRIPT_2 = 61; + + VAR_PAUSE_KEY = 64; + VAR_RESTART_KEY = 63; /* ?? */ + VAR_TALKSTOP_KEY = 66; /* ?? */ + VAR_SAVELOADDIALOG_KEY = 65; /* ?? */ + VAR_CUTSCENEEXIT_KEY = 62; + + VAR_TIMER_NEXT = 97; + VAR_TMR_1 = 98; + VAR_TMR_2 = 99; + VAR_TMR_3 = 100; + + VAR_CAMERA_MIN_X = 101; + VAR_CAMERA_MAX_X = 102; + VAR_CAMERA_MIN_Y = 103; + VAR_CAMERA_MAX_Y = 104; + VAR_CAMERA_THRESHOLD_X = 105; + VAR_CAMERA_THRESHOLD_Y = 106; + VAR_CAMERA_SPEED_X = 107; + VAR_CAMERA_SPEED_Y = 108; + VAR_CAMERA_ACCEL_X = 109; + VAR_CAMERA_ACCEL_Y = 110; + + VAR_EGO = 111; + + VAR_CURSORSTATE = 112; + VAR_USERPUT = 113; + VAR_DEFAULT_TALK_DELAY = 114; + VAR_CHARINC = 115; + VAR_DEBUGMODE = 116; + + VAR_CHARSET_MASK = 119; + VAR_VIDEONAME = 0xF6/2; + VAR_CUSTOMSCALETABLE = 131; + + //VAR_V5_DRAWFLAGS = 9; + VAR_MI1_TIMER = 14; + VAR_V5_OBJECT_LO = 15; + VAR_V5_OBJECT_HI = 16; + VAR_V5_TALK_STRING_Y = 54; + VAR_V5_CHARFLAG = 60; + + VAR_V6_EMSSPACE = 76; + VAR_STRING2DRAW = 130; +} diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp new file mode 100644 index 0000000000..131bde0312 --- /dev/null +++ b/scumm/verbs.cpp @@ -0,0 +1,317 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm.h" +#include "object.h" +#include "resource.h" + +void Scumm::redrawVerbs() +{ + int i; + for (i = 0; i < _maxVerbs; i++) + drawVerb(i, 0); + verbMouseOver(0); +} + +void Scumm::checkExecVerbs() +{ + int i, over; + VerbSlot *vs; + + if (_userPut <= 0 || _mouseButStat == 0) + return; + + if (_mouseButStat < MBS_MAX_KEY) { + /* Check keypresses */ + vs = &_verbs[1]; + for (i = 1; i < _maxVerbs; i++, vs++) { + if (vs->verbid && vs->saveid == 0 && vs->curmode == 1) { + if (_mouseButStat == vs->key) { + runInputScript(1, vs->verbid, 1); + return; + } + } + } + runInputScript(4, _mouseButStat, 1); + } else if (_mouseButStat & MBS_MOUSE_MASK) { + byte code = _mouseButStat & MBS_LEFT_CLICK ? 1 : 2; + if (mouse.y >= virtscr[0].topline && mouse.y < virtscr[0].topline + virtscr[0].height) { + over = checkMouseOver(mouse.x, mouse.y); + if (over != 0) { + runInputScript(1, _verbs[over].verbid, code); + return; + } + runInputScript(2, 0, code); + } else { + over = checkMouseOver(mouse.x, mouse.y); + + // FIXME For the future: Indy3 and under inv scrolling + /* + if (over >= 31 && over <= 36) + over += _inventoryOffset; + */ + runInputScript(1, over != 0 ? _verbs[over].verbid : 0, code); + } + } +} + +void Scumm::verbMouseOver(int verb) +{ + if (_verbMouseOver == verb) + return; + + if (_verbs[_verbMouseOver].type != 1) { + drawVerb(_verbMouseOver, 0); + _verbMouseOver = verb; + } + + if (_verbs[verb].type != 1 && _verbs[verb].hicolor) { + drawVerb(verb, 1); + _verbMouseOver = verb; + } +} + +int Scumm::checkMouseOver(int x, int y) +{ + VerbSlot *vs; + int i = _maxVerbs - 1; + + vs = &_verbs[i]; + do { + if (vs->curmode != 1 || !vs->verbid || vs->saveid || y < vs->y || y >= vs->bottom) + continue; + if (vs->center) { + if (x < -(vs->right - vs->x - vs->x) || x >= vs->right) + continue; + } else { + if (x < vs->x || x >= vs->right) + continue; + } + + return i; + } while (--vs, --i); + return 0; +} + +void Scumm::drawVerb(int vrb, int mode) +{ + VerbSlot *vs; + byte tmp; + + if (!vrb) + return; + + vs = &_verbs[vrb]; + + if (!vs->saveid && vs->curmode && vs->verbid) { + if (vs->type == 1) { + drawVerbBitmap(vrb, vs->x, vs->y); + return; + } + restoreVerbBG(vrb); + + string[4].charset = vs->charset_nr; + string[4].xpos = vs->x; + string[4].ypos = vs->y; + string[4].right = 319; + string[4].center = vs->center; + + if (vs->curmode == 2) + string[4].color = vs->dimcolor; + else if (mode && vs->hicolor) + string[4].color = vs->hicolor; + else + string[4].color = vs->color; + + // FIXME For the future: Indy3 and under inv scrolling + /* + if (vrb >= 31 && vrb <= 36) + vrb += _inventoryOffset; + */ + + _messagePtr = getResourceAddress(rtVerb, vrb); + if (!_messagePtr) + return; + assert(_messagePtr); + + tmp = charset._center; + charset._center = 0; + drawString(4); + charset._center = tmp; + + vs->right = charset._strRight; + vs->bottom = charset._strBottom; + vs->oldleft = charset._strLeft; + vs->oldright = charset._strRight; + vs->oldtop = charset._strTop; + vs->oldbottom = charset._strBottom; + charset._strLeft = charset._strRight; + } else { + restoreVerbBG(vrb); + } +} + +void Scumm::restoreVerbBG(int verb) +{ + VerbSlot *vs; + + vs = &_verbs[verb]; + + if (vs->oldleft != -1) { + _bkColor = vs->bkcolor; + restoreBG(vs->oldleft, vs->oldtop, vs->oldright, vs->oldbottom); + vs->oldleft = -1; + } +} + +void Scumm::drawVerbBitmap(int vrb, int x, int y) +{ + VirtScreen *vs; + VerbSlot *vst; + byte twobufs, *imptr; + int ydiff, xstrip; + int imgw, imgh; + int i, tmp; + byte *obim; + ImageHeader *imhd; + uint32 size; + + if ((vs = findVirtScreen(y)) == NULL) + return; + + _lastXstart = virtscr[0].xstart; + + gdi.disableZBuffer(); + + twobufs = vs->alloctwobuffers; + vs->alloctwobuffers = 0; + + xstrip = x >> 3; + ydiff = y - vs->topline; + + obim = getResourceAddress(rtVerb, vrb); + if (_features & GF_SMALL_HEADER) { + int obj; + obj = READ_LE_UINT16(obim + 6); + size = READ_LE_UINT32(obim); + + imgw = (*(obim + size + 11)); + imgh = (*(obim + size + 17)) >> 3; + imptr = (obim + 8); + } else { + imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obim); + if (_features & GF_AFTER_V7) { + imgw = READ_LE_UINT16(&imhd->v7.width) >> 3; + imgh = READ_LE_UINT16(&imhd->v7.height) >> 3; + } else { + imgw = READ_LE_UINT16(&imhd->old.width) >> 3; + imgh = READ_LE_UINT16(&imhd->old.height) >> 3; + } + + imptr = findResource(MKID('IM01'), obim); + if (!imptr) + error("No image for verb %d", vrb); + } + for (i = 0; i < imgw; i++) { + tmp = xstrip + i; + if ((uint) tmp < 40) + gdi.drawBitmap(imptr, vs, tmp, ydiff, imgh << 3, i, 1, true); + } + + vst = &_verbs[vrb]; + vst->right = vst->x + imgw * 8 - 1; + vst->bottom = vst->y + imgh * 8 - 1; + vst->oldleft = vst->x; + vst->oldright = vst->right; + vst->oldtop = vst->y; + vst->oldbottom = vst->bottom; + + gdi.enableZBuffer(); + + vs->alloctwobuffers = twobufs; +} + +int Scumm::getVerbSlot(int id, int mode) +{ + int i; + for (i = 1; i < _maxVerbs; i++) { + if (_verbs[i].verbid == id && _verbs[i].saveid == mode) { + return i; + } + } + return 0; +} + +void Scumm::killVerb(int slot) +{ + VerbSlot *vs; + + if (slot == 0) + return; + + vs = &_verbs[slot]; + vs->verbid = 0; + vs->curmode = 0; + + nukeResource(rtVerb, slot); + + if (vs->saveid == 0) { + drawVerb(slot, 0); + verbMouseOver(0); + } + vs->saveid = 0; +} + +void Scumm::setVerbObject(uint room, uint object, uint verb) +{ + byte *obimptr; + byte *obcdptr; + uint32 size, size2; + FindObjectInRoom foir; + int i; + + if (whereIsObject(object) == WIO_FLOBJECT) + error("Can't grab verb image from flobject"); + + if (_features & GF_SMALL_HEADER) { + for (i = _numObjectsInRoom; i > 0; i--) { + if (_objs[i].obj_nr == object) { + findObjectInRoom(&foir, foImageHeader, object, room); + size = READ_LE_UINT32(foir.obim); + obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); + size2 = READ_LE_UINT32(obcdptr); + createResource(rtVerb, verb, size + size2); + obimptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obim; + obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); + memcpy(getResourceAddress(rtVerb, verb), obimptr, size); + memcpy(getResourceAddress(rtVerb, verb) + size, obcdptr, size2); + } + } + } else { + findObjectInRoom(&foir, foImageHeader, object, room); + size = READ_BE_UINT32_UNALIGNED(foir.obim + 4); + createResource(rtVerb, verb, size); + obimptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obim; + memcpy(getResourceAddress(rtVerb, verb), obimptr, size); + } +} diff --git a/scummsys.h b/scummsys.h deleted file mode 100644 index 74fcfbcb84..0000000000 --- a/scummsys.h +++ /dev/null @@ -1,366 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ -#ifndef __SCUMMSYS_H_ -#define __SCUMMSYS_H_ - -#include - -#if defined(HAVE_NO_BOOL) -typedef int bool; -const bool true(1), false(0); -#endif /* HAVE_NO_BOOL */ - -#if defined(_MSC_VER) - -//#pragma warning (disable: 4244) -//#pragma warning (disable: 4101) - -#define scumm_stricmp stricmp - -#if defined(CHECK_HEAP) -#undef CHECK_HEAP -#define CHECK_HEAP checkHeap(); -#else -#define CHECK_HEAP -#endif - -#define SCUMM_LITTLE_ENDIAN - -#define FORCEINLINE __forceinline -#define NORETURN _declspec(noreturn) - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; -typedef signed long int32; - -#define START_PACK_STRUCTS pack (push,1) -#define END_PACK_STRUCTS pack(pop) -#define GCC_PACK - -#elif defined(__MINGW32__) - -#define scumm_stricmp stricmp -#define CHECK_HEAP -#define SCUMM_LITTLE_ENDIAN - -#define FORCEINLINE inline -#define NORETURN __attribute__((__noreturn__)) -#define GCC_PACK __attribute__((packed)) -#define _HEAPOK 0 - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; -typedef signed long int32; - -#define START_PACK_STRUCTS pack (push,1) -#define END_PACK_STRUCTS pack(pop) - -#elif defined(UNIX) || defined(__APPLE__) - -#define scumm_stricmp strcasecmp - -#define CHECK_HEAP - -#ifdef X11_BACKEND - -/* You need to set those manually */ -#define SCUMM_LITTLE_ENDIAN -/* #define SCUMM_NEED_ALIGNMENT */ - -#else -/* need this for the SDL_BYTEORDER define */ -#include - -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SCUMM_LITTLE_ENDIAN -#elif SDL_BYTEORDER == SDL_BIG_ENDIAN -#define SCUMM_BIG_ENDIAN -#define SCUMM_NEED_ALIGNMENT -#else -#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set. -#endif -#endif - -#define FORCEINLINE inline -#define CDECL - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; - -# if defined(__DECCXX) // Assume alpha architecture - -# define INVERSE_MKID -# define SCUMM_NEED_ALIGNMENT - -typedef unsigned int uint32; -typedef signed int int32; - -# else - -typedef unsigned long uint32; -typedef signed long int32; - -# endif - - -#if defined(__GNUC__) -#define START_PACK_STRUCTS -#define END_PACK_STRUCTS -#define GCC_PACK __attribute__((packed)) -#define NORETURN __attribute__((__noreturn__)) -#else -#define START_PACK_STRUCTS pack (1) -#define END_PACK_STRUCTS pack () -#define GCC_PACK -#define NORETURN -#endif - -#elif defined(macintosh) -#include - -#include "macos.h" - -#define scumm_stricmp strcmp -inline char* strdup(char *buf) {return (char*)buf;}; - -#define CHECK_HEAP -#define SCUMM_BIG_ENDIAN - -#define FORCEINLINE inline -#define CDECL - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; -typedef signed long int32; - -#define START_PACK_STRUCTS pack (1) -#define END_PACK_STRUCTS pack () -#define GCC_PACK -#define NORETURN -#define USE_QTMUSIC -#define NEED_STRDUP - -#elif defined(__MORPHOS__) -#define scumm_stricmp stricmp -#define CHECK_HEAP - -#define SCUMM_BIG_ENDIAN -#define SCUMM_NEED_ALIGNMENT - -#define FORCEINLINE inline -#define CDECL - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; -typedef signed long int32; - -#if defined(__GNUC__) - #define START_PACK_STRUCTS - #define END_PACK_STRUCTS - #define GCC_PACK __attribute__((packed)) - #define NORETURN __attribute__((__noreturn__)) -#else - #define START_PACK_STRUCTS pack (1) - #define END_PACK_STRUCTS pack () - #define GCC_PACK - #define NORETURN -#endif -#define main morphos_main -#elif defined(__DC__) - -#define scumm_stricmp strcasecmp -#define CHECK_HEAP -#define SCUMM_LITTLE_ENDIAN -#define SCUMM_NEED_ALIGNMENT - -#define FORCEINLINE inline -#define NORETURN __attribute__((__noreturn__)) -#define GCC_PACK __attribute__((packed)) -#define CDECL - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; -typedef signed long int32; - -#define START_PACK_STRUCTS pack (push,1) -#define END_PACK_STRUCTS pack(pop) - -#else -#error No system type defined -#endif - - -#if defined(SCUMM_LITTLE_ENDIAN) - -//#if defined(SCUMM_NEED_ALIGNMENT) -//#error Little endian processors that need alignment is not implemented -//#endif - - -#define PROTO_MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) -#define PROTO_MKID_BE(a) (a & 0xffffffff) - -#if defined(INVERSE_MKID) -# define MKID(a) PROTO_MKID_BE(a) -# define MKID_BE(a) PROTO_MKID(a) -#else -# define MKID(a) PROTO_MKID(a) -# define MKID_BE(a) PROTO_MKID_BE(a) -#endif - - -#if defined(SCUMM_NEED_ALIGNMENT) - FORCEINLINE uint READ_LE_UINT16(void *ptr) { - return (((byte*)ptr)[1]<<8)|((byte*)ptr)[0]; - } -#else - FORCEINLINE uint READ_LE_UINT16(void *ptr) { - return *(uint16*)(ptr); - } -#endif - -FORCEINLINE uint READ_BE_UINT16(void *ptr) { - return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; -} - -#if defined(SCUMM_NEED_ALIGNMENT) - FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); - } -#else - FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { - return *(uint32*)(ptr); - } -#endif - -FORCEINLINE uint32 READ_BE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); -} - -#define READ_BE_UINT32_UNALIGNED READ_BE_UINT32 -#define READ_BE_UINT16_UNALIGNED READ_BE_UINT16 - -#define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a) - -#define FROM_LE_32(__a__) __a__ -#define FROM_LE_16(__a__) __a__ - -#define TO_LE_32(__a__) __a__ -#define TO_LE_16(__a__) __a__ - -#define TO_BE_32(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) - -uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } - -#elif defined(SCUMM_BIG_ENDIAN) - -#define MKID(a) (a) -#define MKID_BE(a) (a) -//#define MKID_BE(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) - -uint32 FORCEINLINE FROM_LE_32(uint32 a) { - return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000); -} - -uint16 FORCEINLINE FROM_LE_16(uint16 a) { - return ((a>>8)&0xFF) + ((a<<8)&0xFF00); -} - -#define TO_LE_32 FROM_LE_32 -#define TO_LE_16 FROM_LE_16 - -uint32 FORCEINLINE READ_LE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); -} - -uint32 FORCEINLINE READ_BE_UINT32(void *ptr) { - return *(uint32*)(ptr); -} - -uint FORCEINLINE READ_LE_UINT16(void *ptr) { - byte *b = (byte*)ptr; - return (b[1]<<8) + b[0]; -} - -uint FORCEINLINE READ_BE_UINT16(void *ptr) { - return *(uint16*)(ptr); -} - -uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) { - return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; -} - -uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) { - byte *b = (byte*)ptr; - return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); -} - -#define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED - -#define TO_BE_32(a) (a) -#define TO_BE_16(a) (a) -#else - -#error No endianness defined - -#endif - - -#ifdef NEED_STRDUP -char *strdup(const char *s); -#endif - -/* Initialized operator new */ -void * operator new(size_t size); - -#endif diff --git a/scummvm.cpp b/scummvm.cpp deleted file mode 100644 index 2471d268aa..0000000000 --- a/scummvm.cpp +++ /dev/null @@ -1,1677 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "sound/mixer.h" -#include "sound/mididrv.h" -#include "sound/imuse.h" -#include "actor.h" -#include "debug.h" -#include "gameDetector.h" -#include "gui.h" -#include "newgui.h" -#include "object.h" -#include "resource.h" -#include "string.h" - -#ifdef _WIN32_WCE -extern void GraphicsOff(void); -#endif - -// Use g_scumm from error() ONLY -Scumm *g_scumm = 0; - - -void autosave(Scumm * scumm) -{ - scumm->_doAutosave = true; -} - -void Scumm::initRandSeeds() -{ - _randSeed1 = 0xA943DE33; - _randSeed2 = 0x37A9ED29; -} - -uint Scumm::getRandomNumber(uint max) -{ - /* TODO: my own random number generator */ - _randSeed1 = 0xDEADBF03 * (_randSeed1 + 1); - _randSeed1 = (_randSeed1 >> 13) | (_randSeed1 << 19); - return _randSeed1 % (max + 1); -} - -uint Scumm::getRandomNumberRng(uint min, uint max) -{ - return getRandomNumber(max - min) + min; -} - - -Scumm::Scumm (GameDetector *detector, OSystem *syst) - : Engine(detector, syst) -{ - OSystem::Property prop; - - // Use g_scumm from error() ONLY - g_scumm = this; - - _debugMode = detector->_debugMode; - _bootParam = detector->_bootParam; - _exe_name = detector->_exe_name; - _gameId = detector->_gameId; - _gameText = detector->_gameText; - _features = detector->_features; - _soundCardType = detector->_soundCardType; - _noSubtitles = detector->_noSubtitles; - _cdrom = detector->_cdrom; - _defaultTalkDelay = detector->_talkSpeed; - _use_adlib = detector->_use_adlib; - - if (_gameId == GID_ZAK256) { // FmTowns is 320x240 - _realWidth = 320; - _realHeight = 240; - } else { - _realWidth = 320; - _realHeight = 200; - } - - _gui = new Gui(); - _gui->init(this); - - _newgui = new NewGui(this); - _bundle = new Bundle(this); - _timer = new Timer(this); - _sound = new Sound(this); - - _sound->_sound_volume_master = 0; - _sound->_sound_volume_sfx = detector->_sfx_volume; - _sound->_sound_volume_music = detector->_music_volume; - - /* Initialize backend */ - syst->init_size(_realWidth, _realHeight); - prop.cd_num = detector->_cdrom; - syst->property(OSystem::PROP_OPEN_CD, &prop); - - /* Bind the mixer to the system => mixer will be invoked - * automatically when samples need to be generated */ - if (!_mixer->bind_to_system(syst)) { - warning("Sound initialization failed"); - if (detector->_use_adlib) { - _use_adlib = false; - detector->_use_adlib = false; - detector->_midi_driver = MD_NULL; - warning("Adlib music was selected, switching to midi null driver"); - } - } - _mixer->set_volume(kDefaultSFXVolume); - _mixer->set_music_volume(kDefaultMusicVolume); - - - // Init iMuse - if (detector->_use_adlib) { - _imuse = IMuse::create_adlib(syst, _mixer); - } else { - _imuse = IMuse::create_midi(syst, detector->createMidi()); - } - if (detector->_gameTempo != 0) - _imuse->property(IMuse::PROP_TEMPO_BASE, detector->_gameTempo); - _imuse->set_music_volume(_sound->_sound_volume_music); - - - // Load game from specified slot, if any - if (detector->_save_slot != -1) { - _saveLoadSlot = detector->_save_slot; - _saveLoadFlag = 2; - _saveLoadCompatible = false; - } -} - -Scumm::~Scumm () -{ - delete [] _actors; - delete _gui; - delete _newgui; - delete _bundle; - delete _timer; - delete _sound; -} - -void Scumm::scummInit() -{ - int i; - Actor *a; - - tempMusic = 0; - debug(9, "scummInit"); - - if (_features & GF_SMALL_HEADER) - _resourceHeaderSize = 6; - else - _resourceHeaderSize = 8; - - if (!(_features & GF_SMALL_NAMES)) - loadCharset(1); - - initScreens(0, 16, 320, 144); - - setShake(0); - setupCursor(); - - _timer->init(); - - /* Allocate and initilise actors */ - _actors = new Actor[MAX_ACTORS]; - for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) { - a->number = i; - a->initActorClass(this); - a->initActor(1); - } - - _vars[VAR_CHARINC] = 4; - - _numNestedScripts = 0; - vm.cutSceneStackPointer = 0; - - memset(vm.cutScenePtr, 0, sizeof(vm.cutScenePtr)); - memset(vm.cutSceneData, 0, sizeof(vm.cutSceneData)); - - for (i = 0; i < _maxVerbs; i++) { - _verbs[i].verbid = 0; - _verbs[i].right = 319; - _verbs[i].oldleft = -1; - _verbs[i].type = 0; - _verbs[i].color = 2; - _verbs[i].hicolor = 0; - _verbs[i].charset_nr = 1; - _verbs[i].curmode = 0; - _verbs[i].saveid = 0; - _verbs[i].center = 0; - _verbs[i].key = 0; - } - - if (!(_features & GF_AFTER_V7)) { - camera._leftTrigger = 10; - camera._rightTrigger = 30; - camera._mode = 0; - } - camera._follows = 0; - - virtscr[0].xstart = 0; - - if (!(_features & GF_AFTER_V7)) { - _vars[VAR_V5_DRAWFLAGS] = 11; - _vars[VAR_59] = 3; - - _vars[VAR_CURRENT_LIGHTS] = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen; - } - - mouse.x = 104; - mouse.y = 56; - - _ENCD_offs = 0; - _EXCD_offs = 0; - - _currentScript = 0xFF; - _sentenceNum = 0; - - _currentRoom = 0; - _numObjectsInRoom = 0; - _actorToPrintStrFor = 0; - - charset._bufPos = 0; - _haveMsg = 0; - - _varwatch = -1; - _screenStartStrip = 0; - - _vars[VAR_TALK_ACTOR] = 0; - - _talkDelay = 0; - _keepText = false; - - _cursorState = 0; - _userPut = 0; - - _newEffect = 129; - _fullRedraw = true; - - clearDrawObjectQueue(); - - for (i = 0; i < 6; i++) { - if (_features & GF_OLD256) { - string[i].t_xpos = 0; - string[i].t_ypos = 0; - } else { - string[i].t_xpos = 2; - string[i].t_ypos = 5; - } - string[i].t_right = 319; - string[i].t_color = 0xF; - string[i].t_center = 0; - string[i].t_charset = 0; - } - - _numInMsgStack = 0; - - createResource(rtTemp, 6, 500); - - initScummVars(); - - if (!(_features & GF_AFTER_V6)) - _vars[VAR_V5_TALK_STRING_Y] = -0x50; - - getGraphicsPerformance(); - -#ifdef COMPRESSED_SOUND_FILE - _sound->_current_cache = 0; -#endif - - _timer->installProcedure(&autosave, 5 * 60 * 1000); -} - - -void Scumm::initScummVars() -{ - if (!(_features & GF_AFTER_V7)) { - _vars[VAR_CURRENTDRIVE] = _currentDrive; - _vars[VAR_FIXEDDISK] = checkFixedDisk(); - _vars[VAR_SOUNDCARD] = _soundCardType; - _vars[VAR_VIDEOMODE] = 0x13; - _vars[VAR_HEAPSPACE] = 630; - _vars[VAR_MOUSEPRESENT] = _mousePresent; - _vars[VAR_SOUNDPARAM] = _soundParam; - _vars[VAR_SOUNDPARAM2] = _soundParam2; - _vars[VAR_SOUNDPARAM3] = _soundParam3; - if (_features & GF_AFTER_V6) - _vars[VAR_V6_EMSSPACE] = 10000; - } -} - -void Scumm::checkRange(int max, int min, int no, const char *str) -{ - if (no < min || no > max) { - error("Value %d is out of bounds (%d,%d) int script(%d) msg %s", no, min, - max, vm.slot[_curExecScript].number, str); - } -} - -int Scumm::scummLoop(int delta) -{ - static int counter = 0; - -#ifndef _WIN32_WCE - if (_debugger) - _debugger->on_frame(); -#endif - - // Randomize the PRNG by calling it at regular intervals. This ensures - // that it will be in a different state each time you run the program. - getRandomNumber(2); - - _vars[VAR_TMR_1] += delta; - _vars[VAR_TMR_2] += delta; - _vars[VAR_TMR_3] += delta; - _vars[VAR_TMR_4] += delta; - - if (delta > 15) - delta = 15; - - decreaseScriptDelay(delta); - - _talkDelay -= delta; - if (_talkDelay < 0) - _talkDelay = 0; - - processKbd(); - - if (_features & GF_AFTER_V7) { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - _vars[VAR_CAMERA_POS_Y] = camera._cur.y; - } else { - _vars[VAR_CAMERA_POS_X] = camera._cur.x; - } - _vars[VAR_HAVE_MSG] = (_haveMsg == 0xFE) ? 0xFF : _haveMsg; - _vars[VAR_VIRT_MOUSE_X] = _virtual_mouse_x; - _vars[VAR_VIRT_MOUSE_Y] = _virtual_mouse_y; - _vars[VAR_MOUSE_X] = mouse.x; - _vars[VAR_MOUSE_Y] = mouse.y; - _vars[VAR_DEBUGMODE] = _debugMode; - - if (_features & GF_AUDIOTRACKS) { - if (delta) { - if (++counter != 2) - _vars[VAR_MI1_TIMER] += 5; - else { - counter = 0; - _vars[VAR_MI1_TIMER] += 6; - } - } - } else if (_features & GF_OLD256) { - - if(tempMusic == 3) { - tempMusic = 0; - _vars[VAR_MUSIC_FLAG]++; - } else { - tempMusic ++; - } - } - - - if (_saveLoadFlag) { - if (_saveLoadFlag == 1) { - saveState(_saveLoadSlot, _saveLoadCompatible); - // Ender: Disabled for small_header games, as - // can overwrite game variables (eg, Zak256 cashcards) - if (_saveLoadCompatible && !(_features & GF_SMALL_HEADER)) - _vars[VAR_GAME_LOADED] = 201; - } else { - loadState(_saveLoadSlot, _saveLoadCompatible); - // Ender: Disabled for small_header games, as - // can overwrite game variables (eg, Zak256 cashcards) - if (_saveLoadCompatible && !(_features & GF_SMALL_HEADER)) - _vars[VAR_GAME_LOADED] = 203; - } - _saveLoadFlag = 0; - } - - if (_doAutosave) { - _saveLoadSlot = 0; - sprintf(_saveLoadName, "Autosave %d", _saveLoadSlot); - _saveLoadFlag = 1; - _saveLoadCompatible = false; - _doAutosave = false; - } - - if (_completeScreenRedraw) { - _completeScreenRedraw = false; - gdi.clearUpperMask(); - charset._hasMask = false; - redrawVerbs(); - _fullRedraw = true; - } - - runAllScripts(); - checkExecVerbs(); - checkAndRunVar33(); - - if (_currentRoom == 0) { - gdi._cursorActive = 0; - CHARSET_1(); - drawDirtyScreenParts(); - _sound->processSoundQues(); - camera._last = camera._cur; - } else { - walkActors(); - moveCamera(); - fixObjectFlags(); - CHARSET_1(); - - if (camera._cur.x != camera._last.x || _BgNeedsRedraw || _fullRedraw - || (_features & GF_AFTER_V7 && camera._cur.y != camera._last.y)) { - redrawBGAreas(); - } - - processDrawQue(); - setActorRedrawFlags(); - resetActorBgs(); - - if (!(_vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_screen) && - _vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_flashlight) { - drawFlashlight(); - setActorRedrawFlags(); - } - - processActors(); - clear_fullRedraw(); - cyclePalette(); - palManipulate(); - - if (_doEffect) { - _doEffect = false; - fadeIn(_newEffect); - clearClickedStatus(); - } - - if (_cursorState > 0) { - verbMouseOver(checkMouseOver(mouse.x, mouse.y)); - } - - drawBlastObjects(); - drawDirtyScreenParts(); - removeBlastObjects(); - - if (!(_features & GF_AFTER_V6)) - playActorSounds(); - - _sound->processSoundQues(); - camera._last = camera._cur; - } - - if (!(++_expire_counter)) { - increaseResourceCounter(); - } - - animateCursor(); - - /* show or hide mouse */ - _system->show_mouse(_cursorState > 0); - - _vars[VAR_TIMER] = 0; - return _vars[VAR_TIMER_NEXT]; - -} - -void Scumm::startScene(int room, Actor * a, int objectNr) -{ - int i, where; - Actor *at; - - CHECK_HEAP debug(1, "Loading room %d", room); - - clearMsgQueue(); - - fadeOut(_switchRoomEffect2); - _newEffect = _switchRoomEffect; - - if (_currentScript != 0xFF) { - if (vm.slot[_currentScript].where == WIO_ROOM || - vm.slot[_currentScript].where == WIO_FLOBJECT) { - if (vm.slot[_currentScript].cutsceneOverride != 0) - error("Object %d stopped with active cutscene/override in exit", - vm.slot[_currentScript].number); - _currentScript = 0xFF; - } else if (vm.slot[_currentScript].where == WIO_LOCAL) { - if (vm.slot[_currentScript].cutsceneOverride != 0) - error("Script %d stopped with active cutscene/override in exit", - vm.slot[_currentScript].number); - _currentScript = 0xFF; - } - } - - if (!(_features & GF_SMALL_HEADER)) // Disable for SH games. Overwrites - _vars[VAR_NEW_ROOM] = room; // gamevars, eg Zak cashcards - - runExitScript(); - killScriptsAndResources(); - clearEnqueue(); - stopCycle(0); - - for (i = 1, at = getFirstActor(); ++at, i < NUM_ACTORS; i++) { - at->hideActor(); - } - - if (!(_features & GF_AFTER_V7)) { - for (i = 0; i < 0x100; i++) - _shadowPalette[i] = i; - } - - clearDrawObjectQueue(); - - _vars[VAR_ROOM] = room; - _fullRedraw = true; - - increaseResourceCounter(); - - _currentRoom = room; - _vars[VAR_ROOM] = room; - - if (room >= 0x80) - _roomResource = _resourceMapper[room & 0x7F]; - else - _roomResource = room; - - _vars[VAR_ROOM_RESOURCE] = _roomResource; - - if (room != 0) - ensureResourceLoaded(1, room); - - if (_currentRoom == 0) { - _ENCD_offs = _EXCD_offs = 0; - _numObjectsInRoom = 0; - return; - } - - initRoomSubBlocks(); - if (_features & GF_SMALL_HEADER) - loadRoomObjectsSmall(); - else - loadRoomObjects(); - - if (!(_features & GF_AFTER_V7)) { - camera._mode = CM_NORMAL; - camera._cur.x = camera._dest.x = 160; - camera._cur.y = camera._dest.y = 100; - } - - if (_features & GF_AFTER_V6) { - _vars[VAR_V6_SCREEN_WIDTH] = _scrWidth; - _vars[VAR_V6_SCREEN_HEIGHT] = _scrHeight; - } - - if (_features & GF_AFTER_V7) { - _vars[VAR_CAMERA_MIN_X] = 160; - _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160; - _vars[VAR_CAMERA_MIN_Y] = 100; - _vars[VAR_CAMERA_MAX_Y] = _scrHeight - 100; - setCameraAt(160, 100); - } else { - _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160; - _vars[VAR_CAMERA_MIN_X] = 160; - } - - if (_roomResource == 0) - return; - - - memset(gfxUsageBits, 0, sizeof(gfxUsageBits)); - - if (a) { - where = whereIsObject(objectNr); - if (where != WIO_ROOM && where != WIO_FLOBJECT) - error("startScene: Object %d is not in room %d", objectNr, - _currentRoom); - int x, y, dir; - getObjectXYPos(objectNr, x, y, dir); - a->putActor(x, y, _currentRoom); - a->setDirection(dir + 180); - a->moving = 0; - } - - showActors(); - - _egoPositioned = false; - runEntryScript(); - - if (!(_features & GF_AFTER_V7)) { - if (a && !_egoPositioned) { - int x, y; - getObjectXYPos(objectNr, x, y); - a->putActor(x, y, _currentRoom); - a->moving = 0; - } - } else { - if (camera._follows) { - Actor *a = derefActorSafe(camera._follows, "startScene: follows"); - setCameraAt(a->x, a->y); - } - } - - _doEffect = true; - - CHECK_HEAP; -} - -void Scumm::initRoomSubBlocks() -{ - int i, offs; - byte *ptr; - byte *roomptr, *searchptr; - RoomHeader *rmhd; - - _ENCD_offs = 0; - _EXCD_offs = 0; - _CLUT_offs = 0; - _PALS_offs = 0; - - nukeResource(rtMatrix, 1); - nukeResource(rtMatrix, 2); - - for (i = 1; i < _maxScaleTable; i++) - nukeResource(rtScaleTable, i); - - roomptr = getResourceAddress(rtRoom, _roomResource); - - rmhd = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr); - - if (_features & GF_AFTER_V7) { - _scrWidth = READ_LE_UINT16(&(rmhd->v7.width)); - _scrHeight = READ_LE_UINT16(&(rmhd->v7.height)); - } else { - _scrWidth = READ_LE_UINT16(&(rmhd->old.width)); - _scrHeight = READ_LE_UINT16(&(rmhd->old.height)); - } - - - if (_features & GF_SMALL_HEADER) - _IM00_offs = findResourceData(MKID('IM00'), roomptr) - roomptr; - else - _IM00_offs = - findResource(MKID('IM00'), - findResource(MKID('RMIM'), roomptr)) - roomptr; - - ptr = findResourceData(MKID('EXCD'), roomptr); - if (ptr) { - _EXCD_offs = ptr - roomptr; -#ifdef DUMP_SCRIPTS - dumpResource("exit-", _roomResource, ptr - 8); -#endif - } - - ptr = findResourceData(MKID('ENCD'), roomptr); - if (ptr) { - _ENCD_offs = ptr - roomptr; -#ifdef DUMP_SCRIPTS - dumpResource("entry-", _roomResource, ptr - 8); -#endif - } - - if (_features & GF_SMALL_HEADER) { - ptr = findResourceData(MKID('BOXD'), roomptr); - if (ptr) { - byte numOfBoxes = *(ptr); - int size; - if (_features & GF_OLD256) - size = numOfBoxes * (SIZEOF_BOX - 2) + 1; - else - size = numOfBoxes * SIZEOF_BOX + 1; - - - createResource(rtMatrix, 2, size); - memcpy(getResourceAddress(rtMatrix, 2), ptr, size); - ptr += size; - size = getResourceDataSize(ptr - size - 6) - size; - - if (size >= 0) { // do this :) - createResource(rtMatrix, 1, size); - memcpy(getResourceAddress(rtMatrix, 1), ptr, size); - } - - } - } else { - ptr = findResourceData(MKID('BOXD'), roomptr); - if (ptr) { - int size = getResourceDataSize(ptr); - createResource(rtMatrix, 2, size); - roomptr = getResourceAddress(rtRoom, _roomResource); - ptr = findResourceData(MKID('BOXD'), roomptr); - memcpy(getResourceAddress(rtMatrix, 2), ptr, size); - } - - ptr = findResourceData(MKID('BOXM'), roomptr); - if (ptr) { - int size = getResourceDataSize(ptr); - createResource(rtMatrix, 1, size); - roomptr = getResourceAddress(rtRoom, _roomResource); - ptr = findResourceData(MKID('BOXM'), roomptr); - memcpy(getResourceAddress(rtMatrix, 1), ptr, size); - } - } - - ptr = findResourceData(MKID('SCAL'), roomptr); - if (ptr) { - offs = ptr - roomptr; - for (i = 1; i < _maxScaleTable; i++, offs += 8) { - int a = READ_LE_UINT16(roomptr + offs); - int b = READ_LE_UINT16(roomptr + offs + 2); - int c = READ_LE_UINT16(roomptr + offs + 4); - int d = READ_LE_UINT16(roomptr + offs + 6); - if (a || b || c || d) { - setScaleItem(i, b, a, d, c); - roomptr = getResourceAddress(rtRoom, _roomResource); - } - } - } - memset(_localScriptList, 0, sizeof(_localScriptList)); - - searchptr = roomptr = getResourceAddress(rtRoom, _roomResource); - if (_features & GF_SMALL_HEADER) { - while ((ptr = findResourceSmall(MKID('LSCR'), searchptr)) != NULL) { - int id = 0; - ptr += _resourceHeaderSize; /* skip tag & size */ - id = ptr[0]; -#ifdef DUMP_SCRIPTS - do { - char buf[32]; - sprintf(buf, "room-%d-", _roomResource); - dumpResource(buf, id, ptr - 6); - } while (0); -#endif - _localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr; - searchptr = NULL; - } - } else { - while ((ptr = findResource(MKID('LSCR'), searchptr)) != NULL) { - int id = 0; - - ptr += _resourceHeaderSize; /* skip tag & size */ - - if (_features & GF_AFTER_V7) { - id = READ_LE_UINT16(ptr); - checkRange(2050, 2000, id, "Invalid local script %d"); - _localScriptList[id - _numGlobalScripts] = ptr + 2 - roomptr; - } else { - id = ptr[0]; - _localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr; - } -#ifdef DUMP_SCRIPTS - do { - char buf[32]; - sprintf(buf, "room-%d-", _roomResource); - dumpResource(buf, id, ptr - 8); - } while (0); -#endif - searchptr = NULL; - } - } - - if (_features & GF_SMALL_HEADER) - ptr = findResourceSmall(MKID('EPAL'), roomptr); - else - ptr = findResource(MKID('EPAL'), roomptr); - - if (ptr) - _EPAL_offs = ptr - roomptr; - - if (_features & GF_SMALL_HEADER) - ptr = findResourceSmall(MKID('CLUT'), roomptr); - else - ptr = findResourceData(MKID('CLUT'), roomptr); - - if (ptr) { - _CLUT_offs = ptr - roomptr; - setPaletteFromRes(); - } - - if (_features & GF_AFTER_V6) { - ptr = findResource(MKID('PALS'), roomptr); - if (ptr) { - _PALS_offs = ptr - roomptr; - setPalette(0); - } - } - - if (_features & GF_SMALL_HEADER) - ptr = findResourceData(MKID('CYCL'), roomptr); - else - ptr = findResourceData(MKID('CYCL'), roomptr); - - if (ptr) - initCycl(findResourceData(MKID('CYCL'), roomptr)); - - ptr = findResourceData(MKID('TRNS'), roomptr); - if (ptr) - gdi._transparency = ptr[0]; - else - gdi._transparency = 255; - - initBGBuffers(_scrHeight); - - memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags)); -} - -void Scumm::setScaleItem(int slot, int a, int b, int c, int d) -{ - byte *ptr; - int cur, amounttoadd, i, tmp; - - ptr = createResource(rtScaleTable, slot, 200); - - if (a == c) - return; - - cur = (b - d) * a; - amounttoadd = d - b; - - for (i = 200; i > 0; i--) { - tmp = cur / (c - a) + b; - if (tmp < 1) - tmp = 1; - if (tmp > 255) - tmp = 255; - *ptr++ = tmp; - cur += amounttoadd; - } -} - -void Scumm::dumpResource(char *tag, int idx, byte *ptr) -{ - char buf[256]; - FILE *out; - - uint32 size; - if (_features & GF_SMALL_HEADER) - size = READ_LE_UINT32(ptr); - else - size = READ_BE_UINT32_UNALIGNED(ptr + 4); - -#if defined(MACOS_CARBON) - sprintf(buf, ":dumps:%s%d.dmp", tag, idx); -#else - sprintf(buf, "dumps/%s%d.dmp", tag, idx); -#endif - - out = fopen(buf, "rb"); - if (!out) { - out = fopen(buf, "wb"); - if (!out) - return; - fwrite(ptr, size, 1, out); - } - fclose(out); -} - - -void Scumm::clear_fullRedraw() -{ - _fullRedraw = 0; -} - -void Scumm::clearClickedStatus() -{ - checkKeyHit(); - _mouseButStat = 0; - _leftBtnPressed = 0; - _rightBtnPressed = 0; -} - -int Scumm::checkKeyHit() -{ - int a = _keyPressed; - _keyPressed = 0; - return a; -} - -void Scumm::unkRoomFunc3(int unk1, int unk2, int rfact, int gfact, int bfact) -{ - byte *pal = _currentPalette; - byte *table = _shadowPalette; - int i; - - warning("unkRoomFunc3(%d,%d,%d,%d,%d): not fully implemented", unk1, unk2, rfact, gfact, bfact); - - // TODO - correctly implement this function (see also patch #588501) - // - // Some "typical" examples of how this function is being invoked in real life: - // - // unkRoomFunc3(16, 255, 200, 200, 200) - // - // FOA: Sets up the colors for the boat and submarine shadows in the - // diving scene. Are the shadows too light? Maybe unk1 is used to - // darken the colors? - // - // unkRoomFunc3(0, 255, 700, 700, 700) - // - // FOA: Sets up the colors for the subway car headlight when it first - // goes on. This seems to work ok. - // - // unkRoomFunc3(160, 191, 300, 300, 300) - // unkRoomFunc3(160, 191, 289, 289, 289) - // ... - // unkRoomFunc3(160, 191, 14, 14, 14) - // unkRoomFunc3(160, 191, 3, 3, 3) - // - // FOA: Sets up the colors for the subway car headlight for the later - // half of the trip, where it fades out. This currently doesn't work - // at all. The colors are too dark to be brightened. At first I thought - // unk1 and unk2 were used to tell which color interval to manipulate, - // but as far as I can tell the colors 160-191 aren't used at all to - // draw the light, that can't be it. Apparently unk1 and/or unk2 are - // used to brighten the colors. - - for (i = 0; i <= 255; i++) { - int r = (int) (*pal++ * rfact) >> 8; - int g = (int) (*pal++ * gfact) >> 8; - int b = (int) (*pal++ * bfact) >> 8; - - *table++ = remapPaletteColor(r, g, b, (uint) -1); - } -} - - -void Scumm::palManipulate(int start, int end, int d, int time, int e) -{ - // TODO - correctly implement this function (see also bug #558245) - // - // The only place I know of where this function is being called is in the - // FOA extro, to change the color to match the sinking sun. The following - // three calls (with some pauses between them) are issued: - // - // palManipulate(16, 190, 32, 180, 1) - // palManipulate(16, 190, 32, 1, 1) - // palManipulate(16, 190, 32, 800, 1) - // - // The first two parameters seem to specify a palette range (as the colors - // from 16 to 190 are the ones that make up water & sky). - // - // Maybe the change has to be done over a period of time, possibly specified - // by the second last parameter - between call 1 and 2, about 17-18 seconds - // seem to pass (well using get_msecs, I measured 17155 ms, 17613 ms, 17815 ms). - // - // No clue about the third and fifth parameter right now, they just always - // are 32 and 1 - possibly finding another example of this function being - // used would help a lot. Also, I can't currently compare it with the original, - // doing that (and possibly, taking screenshots of it for analysis!) would - // help a lot. - - static int sys_time = 0; - int new_sys_time = _system->get_msecs(); - - warning("palManipulate(%d, %d, %d, %d, %d): not implemented", start, end, d, time, e); - if (sys_time != 0) - printf("Time since last call: %d\n", new_sys_time-sys_time); - sys_time = new_sys_time; - - { - int redScale = 0xFF; - int greenScale = 0xFF - d; - int blueScale = 0xFF - d; - byte *cptr; - byte *cur; - int num; - int color; - - cptr = _currentPalette + start * 3; - cur = _currentPalette + start * 3; - num = end - start + 1; - - do { - color = *cptr++; - if (redScale != 0xFF) - color = color * redScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - - color = *cptr++; - if (greenScale != 0xFF) - color = color * greenScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - - color = *cptr++; - if (blueScale != 0xFF) - color = color * blueScale / 0xFF; - if (color > 255) - color = 255; - *cur++ = color; - } while (--num); - setDirtyColors(start, end); - } -} - -void Scumm::pauseGame(bool user) -{ - //_gui->pause(); - _newgui->pauseDialog(); -} - -void Scumm::setOptions() -{ - _gui->options(); - //_newgui->optionsDialog(); -} - -void Scumm::shutDown(int i) -{ - /* TODO: implement this */ - warning("shutDown: not implemented"); -} - -void Scumm::processKbd() -{ - int saveloadkey; - getKeyInput(0); - - if (_features & GF_OLD256) /* FIXME: Support ingame screen */ - saveloadkey = 319; - else - saveloadkey = _vars[VAR_SAVELOADDIALOG_KEY]; - - _virtual_mouse_x = mouse.x + virtscr[0].xstart; - - - - if(_features & GF_AFTER_V7) - _virtual_mouse_y = mouse.y + camera._cur.y-100; - else - _virtual_mouse_y = mouse.y; - - if (!(_features & GF_OLD256)) - _virtual_mouse_y += virtscr[0].topline; - else - _virtual_mouse_y -= 16; - - if (_virtual_mouse_y < 0) - _virtual_mouse_y = -1; - - if (_features & GF_OLD256) { - if (_virtual_mouse_y >= virtscr[0].height + virtscr[0].topline) - _virtual_mouse_y = -1; - } else { - if (_virtual_mouse_y >= virtscr[0].height) - _virtual_mouse_y = -1; - } - - if (!_lastKeyHit) - return; - - if (_lastKeyHit == KEY_SET_OPTIONS) { - setOptions(); - return; - } - - if (_lastKeyHit == _vars[VAR_RESTART_KEY]) { - warning("Restart not implemented"); -// pauseGame(true); - return; - } - - if (_lastKeyHit == _vars[VAR_PAUSE_KEY]) { - pauseGame(true); - /* pause */ - return; - } - - if (_lastKeyHit == _vars[VAR_CUTSCENEEXIT_KEY]) { - if (_insaneState) { - videoFinished = 1; - } else - exitCutscene(); - } else if (_lastKeyHit == saveloadkey - && _currentRoom != 0) { - if (_features & GF_AFTER_V7) - runScript(_vars[VAR_UNK_SCRIPT], 0, 0, 0); - _gui->saveLoadDialog(); - if (_features & GF_AFTER_V7) - runScript(_vars[VAR_UNK_SCRIPT_2], 0, 0, 0); - } else if (_lastKeyHit == _vars[VAR_TALKSTOP_KEY]) { - _talkDelay = 0; - if (_sound->_sfxMode == 2) - stopTalk(); - return; - } else if (_lastKeyHit == '[') { // [, eg volume down - _sound->_sound_volume_master-=5; - if (_sound->_sound_volume_master < 0) - _sound->_sound_volume_master = 0; - _imuse->set_master_volume(_sound->_sound_volume_master); - } else if (_lastKeyHit == ']') { // ], eg volume down - _sound->_sound_volume_master+=5; - if (_sound->_sound_volume_master > 128) - _sound->_sound_volume_master = 128; - _imuse->set_master_volume(_sound->_sound_volume_master); - } else if (_lastKeyHit == '-') { // -, eg text speed down - _defaultTalkDelay+=5; - if (_defaultTalkDelay > 90) - _defaultTalkDelay = 90; - - _vars[VAR_CHARINC] = _defaultTalkDelay / 20; - } else if (_lastKeyHit == '+') { // +, eg text speed up - _defaultTalkDelay-=5; - if (_defaultTalkDelay < 5) - _defaultTalkDelay = 5; - - _vars[VAR_CHARINC] = _defaultTalkDelay / 20; - } else if (_lastKeyHit == 321) { // F7, display new GUI - _newgui->saveloadDialog(); - } - - _mouseButStat = _lastKeyHit; -} - -int Scumm::getKeyInput(int a) -{ - _mouseButStat = 0; - - _lastKeyHit = checkKeyHit(); - if (a == 0) - convertKeysToClicks(); - - if (mouse.x < 0) - mouse.x = 0; - if (mouse.x > _realWidth-1) - mouse.x = _realWidth-1; - if (mouse.y < 0) - mouse.y = 0; - if (mouse.y > _realHeight-1) - mouse.y = _realHeight-1; - - if (_leftBtnPressed & msClicked && _rightBtnPressed & msClicked) { - _mouseButStat = 0; - _lastKeyHit = _vars[VAR_CUTSCENEEXIT_KEY]; - } else if (_leftBtnPressed & msClicked) { - _mouseButStat = MBS_LEFT_CLICK; - } else if (_rightBtnPressed & msClicked) { - _mouseButStat = MBS_RIGHT_CLICK; - } - - if (_features & GF_AFTER_V7) { -// _vars[VAR_LEFTBTN_DOWN] = (_leftBtnPressed&msClicked) != 0; - _vars[VAR_LEFTBTN_HOLD] = (_leftBtnPressed & msDown) != 0; -// _vars[VAR_RIGHTBTN_DOWN] = (_rightBtnPressed&msClicked) != 0; - _vars[VAR_RIGHTBTN_HOLD] = (_rightBtnPressed & msDown) != 0; - } - - _leftBtnPressed &= ~msClicked; - _rightBtnPressed &= ~msClicked; - - return _lastKeyHit; -} - -void Scumm::convertKeysToClicks() -{ - if (_lastKeyHit && _cursorState > 0) { - if (_lastKeyHit == 9) { - _mouseButStat = MBS_RIGHT_CLICK; - } else if (_lastKeyHit == 13) { - _mouseButStat = MBS_LEFT_CLICK; - } else - return; - _lastKeyHit = 0; - } -} - -Actor *Scumm::derefActor(int id) -{ - return &_actors[id]; -} - -Actor *Scumm::derefActorSafe(int id, const char *errmsg) -{ - if (id < 1 || id >= NUM_ACTORS) { - if (_debugMode) - warning - ("Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.", - id, errmsg, vm.slot[_curExecScript].number, _opcode); - return NULL; - } - return derefActor(id); -} - -void Scumm::makeCursorColorTransparent(int a) -{ - int i, size; - - size = _cursorWidth * _cursorHeight; - - for (i = 0; i < size; i++) - if (_grabbedCursor[i] == (byte)a) - _grabbedCursor[i] = 0xFF; - - updateCursor(); -} - -void Scumm::setStringVars(int slot) -{ - StringTab *st = &string[slot]; - st->xpos = st->t_xpos; - st->ypos = st->t_ypos; - st->center = st->t_center; - st->overhead = st->t_overhead; - st->no_talk_anim = st->t_no_talk_anim; - st->right = st->t_right; - st->color = st->t_color; - st->charset = st->t_charset; -} - -void Scumm::unkMiscOp9() -{ - warning("stub unkMiscOp9()"); -} - -void Scumm::startManiac() -{ - warning("stub startManiac()"); -} - -void Scumm::destroy() -{ - freeResources(); - - free(_objectStateTable); - free(_objectRoomTable); - free(_objectOwnerTable); - free(_inventory); - free(_arrays); - free(_verbs); - free(_objs); - free(_vars); - free(_bitVars); - free(_newNames); - free(_classData); -} - -const int new_dir_table[4] = { - 270, - 90, - 180, - 0, -}; - -const int16 many_direction_tab[16] = {71, 109, 251, 289, -1, -1, -1, -1, 22, 72, 107, 157, 202, 252, 287, 337}; - -int newDirToOldDir(int dir) -{ - if (dir >= 71 && dir <= 109) - return 1; - if (dir >= 109 && dir <= 251) - return 2; - if (dir >= 251 && dir <= 289) - return 0; - return 3; -} - -int oldDirToNewDir(int dir) -{ - return new_dir_table[dir]; -} - - -int numSimpleDirDirections(int dirType) -{ - return dirType ? 8 : 4; -} - - -/* Convert an angle to a simple direction */ -int toSimpleDir(int dirType, int dir) -{ - int num = dirType ? 8 : 4; - const int16 *dirtab = &many_direction_tab[dirType * 8]; - for (int i = 1; i < num; i++, dirtab++) { - if (dir >= dirtab[0] && dir <= dirtab[1]) - return i; - } - return 0; - -} - -/* Convert a simple direction to an angle */ -int fromSimpleDir(int dirType, int dir) -{ - if (!dirType) - return dir * 90; - else - return dir * 45; -} - - -int normalizeAngle(int angle) -{ - int temp; - - temp = (angle + 360) % 360; - - return toSimpleDir(1, temp) * 45; -} - -void NORETURN CDECL error(const char *s, ...) -{ - char buf[1024]; -#if defined( USE_WINDBG ) || defined ( _WIN32_WCE ) - char buf2[1024]; -#if defined( _WIN32_WCE ) - TCHAR buf2w[2048]; -#endif -#endif - - va_list va; - - va_start(va, s); - vsprintf(buf, s, va); - va_end(va); - - if (g_scumm && g_scumm->_currentScript != 0xFF) { - ScriptSlot *ss = &g_scumm->vm.slot[g_scumm->_currentScript]; - fprintf(stderr, "Error(%d:%d:0x%X): %s!\n", - g_scumm->_roomResource, - ss->number, - g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, buf); -#if defined( USE_WINDBG ) || defined( _WIN32_WCE ) - sprintf(buf2, "Error(%d:%d:0x%X): %s!\n", - g_scumm->_roomResource, - ss->number, - g_scumm->_scriptPointer - g_scumm->_scriptOrgPointer, - buf); -#if defined ( _WIN32_WCE ) - MultiByteToWideChar(CP_ACP, 0, buf2, strlen(buf2) + 1, buf2w, sizeof(buf2w)); - GraphicsOff(); - MessageBox(NULL, buf2w, TEXT("ScummVM error"), MB_OK); -#else - OutputDebugString(buf2); -#endif -#endif - - } else { - fprintf(stderr, "Error: %s!\n", buf); -#if defined( USE_WINDBG ) || defined( _WIN32_WCE ) - sprintf(&buf[strlen(buf)], "\n"); -#if defined ( _WIN32_WCE ) - MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf2w, sizeof(buf2w)); - GraphicsOff(); - MessageBox(NULL, buf2w, TEXT("ScummVM error"), MB_OK); -#else - OutputDebugString(buf); -#endif -#endif - } - // Doesn't wait for any keypress!! Is it intended to? - exit(1); -} - -void CDECL warning(const char *s, ...) -{ - char buf[1024]; - va_list va; - - va_start(va, s); - vsprintf(buf, s, va); - va_end(va); - - fprintf(stderr, "WARNING: %s!\n", buf); -#if defined( USE_WINDBG ) - sprintf(&buf[strlen(buf)], "\n"); - OutputDebugString(buf); -#endif -} - -uint16 _debugLevel = 1; - -void CDECL debug(int level, const char *s, ...) -{ - char buf[1024]; - va_list va; - - if (level > _debugLevel) - return; - - va_start(va, s); - vsprintf(buf, s, va); - va_end(va); - printf("%s\n", buf); - -#if defined( USE_WINDBG ) - sprintf(&buf[strlen(buf)], "\n"); - OutputDebugString(buf); -#endif - - fflush(stdout); -} - -void checkHeap() -{ -#if defined(WIN32) - if (_heapchk() != _HEAPOK) { - error("Heap is invalid!"); - } -#endif -} - -ScummDebugger g_debugger; - -void Scumm::waitForTimer(int msec_delay) { - OSystem::Event event; - uint32 start_time; - - if (_fastMode&2) - msec_delay = 0; - else if (_fastMode&1) - msec_delay = 10; - - start_time = _system->get_msecs(); - - for(;;) { - while (_system->poll_event(&event)) { - - // if newgui is running, copy event to EventList, and let the GUI handle it itself - // we might consider this approach for ScummLoop as well, and clean up the current mess - if (_newgui->isActive()) { - if (event.event_code == OSystem::EVENT_MOUSEMOVE) { - mouse.x = event.mouse.x; - mouse.y = event.mouse.y; - _system->set_mouse_pos(event.mouse.x, event.mouse.y); - _system->update_screen(); - } - _newgui->handleEvent(event); - continue; - } - - switch(event.event_code) { - case OSystem::EVENT_KEYDOWN: - if (event.kbd.keycode >= '0' && event.kbd.keycode<='9' - && (event.kbd.flags == OSystem::KBD_SHIFT || - event.kbd.flags == OSystem::KBD_CTRL)) { - _saveLoadSlot = event.kbd.keycode - '0'; - sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); - _saveLoadFlag = (event.kbd.flags == OSystem::KBD_SHIFT) ? 1 : 2; - _saveLoadCompatible = false; - } else if (event.kbd.flags==OSystem::KBD_CTRL) { - if (event.kbd.keycode=='f') - _fastMode ^= 1; - else if (event.kbd.keycode=='g') - _fastMode ^= 2; - else if ((event.kbd.keycode=='d') && (!_system->property(OSystem::PROP_GET_FULLSCREEN, 0))) - g_debugger.attach(this); - else if (event.kbd.keycode=='s') - resourceStats(); - } else - _keyPressed = event.kbd.ascii; // Normal key press, pass on to the game. - break; - - case OSystem::EVENT_MOUSEMOVE: - mouse.x = event.mouse.x; - mouse.y = event.mouse.y; - _system->set_mouse_pos(event.mouse.x, event.mouse.y); - _system->update_screen(); - break; - - case OSystem::EVENT_LBUTTONDOWN: - _leftBtnPressed |= msClicked|msDown; -#ifdef _WIN32_WCE - mouse.x = event.mouse.x; - mouse.y = event.mouse.y; -#endif - break; - - case OSystem::EVENT_RBUTTONDOWN: - _rightBtnPressed |= msClicked|msDown; -#ifdef _WIN32_WCE - mouse.x = event.mouse.x; - mouse.y = event.mouse.y; -#endif - break; - - case OSystem::EVENT_LBUTTONUP: - _leftBtnPressed &= ~msDown; - break; - - case OSystem::EVENT_RBUTTONUP: - _rightBtnPressed &= ~msDown; - break; - } - } -#ifdef COMPRESSED_SOUND_FILE - if (_sound->updateMP3CD() == -1) -#endif - _system->update_cdrom(); /* Loop CD Audio if needed */ - if (_system->get_msecs() >= start_time + msec_delay) - break; - _system->delay_msecs(10); - } -} - - -void Scumm::updatePalette() { - if (_palDirtyMax == -1) - return; - - int first = _palDirtyMin; - int num = _palDirtyMax - first + 1; - int i; - - byte palette_colors[1024],*p = palette_colors; - - // Sam & Max film noir mode - if (_gameId == GID_SAMNMAX && readVar(0x8000)) - desaturatePalette(); - - for (i = _palDirtyMin; i <= _palDirtyMax; i++) { - byte *data; - - if (_features & GF_SMALL_HEADER) - data = _currentPalette + _shadowPalette[i] * 3; - else - data = _currentPalette + i * 3; - - *p++ = data[0]; - *p++ = data[1]; - *p++ = data[2]; - *p++ = 0; - - } - - _system->set_palette(palette_colors, first, num); - - _palDirtyMax = -1; - _palDirtyMin = 256; -} - -void Scumm::mainRun() -{ - int delta = 0; - int last_time = _system->get_msecs(); - int new_time; - - for(;;) { - - updatePalette(); - - _system->update_screen(); - new_time = _system->get_msecs(); - waitForTimer(delta * 15 + last_time - new_time); - last_time = _system->get_msecs(); - if (_gui->isActive()) { - _gui->loop(); - delta = 5; - } else if (_newgui->isActive()) { - _newgui->loop(); - delta = 5; - } else { - delta = scummLoop(delta); - if (delta < 1) // Ensure we don't get into a loop - delta = 1; // by not decreasing sleepers. - } - } -} - -void Scumm::launch() -{ - charset._vm = this; - gdi._vm = this; - _fileHandle = NULL; - - _maxHeapThreshold = 450000; - _minHeapThreshold = 400000; - - /* Create a primary virtual screen */ - _videoBuffer = (byte *)calloc(328*200, 1); - - allocResTypeData(rtBuffer, MKID('NONE'), 10, "buffer", 0); - initVirtScreen(0, 0, 0, 320, 200, false, false); - - if (_features & GF_AFTER_V7) - setupScummVarsNew(); - else - setupScummVarsOld(); - - if ((_features & GF_AFTER_V7) || (_gameId == GID_SAMNMAX)) - NUM_ACTORS = 30; - else - NUM_ACTORS = 13; - - if (_features & GF_AFTER_V7) - OF_OWNER_ROOM = 0xFF; - else - OF_OWNER_ROOM = 0x0F; - - // if (_gameId==GID_MONKEY2 && _bootParam == 0) - // _bootParam = 10001; - - if (_gameId == GID_INDY4 && _bootParam == 0) { - _bootParam = -7873; - } - - readIndexFile(); - - initRandSeeds(); - - if (_features & GF_NEW_OPCODES) - setupOpcodes2(); - else - setupOpcodes(); - - scummInit(); - - if (!(_features & GF_AFTER_V7)) - _vars[VAR_VERSION] = 21; - - _vars[VAR_DEBUGMODE] = _debugMode; - - if (_gameId == GID_MONKEY) - _vars[74] = 1225; - - _sound->setupSound(); - - runScript(1, 0, 0, &_bootParam); - -// _scummTimer = 0; -} - -void Scumm::go() { - launch(); - setupGUIColors(); - mainRun(); -} - - -byte Scumm::getDefaultGUIColor(int color) -{ - /* FIXME: strange IF line? */ - if ((_features & GF_AFTER_V7) || (_features & GF_SMALL_HEADER)) - return 0; - if (_features & GF_AFTER_V6) { - if (color == 8) - color = 1; - return readArray(110, 0, color); - } else { - return getStringAddress(21)[color]; - } -} - -void Scumm::setupGUIColors() { - - /* FIXME: strange IF line? */ - if (_gameId && !(_features & GF_SMALL_HEADER) && !(_features & GF_AFTER_V7)) { - _gui->_bgcolor = getDefaultGUIColor(0); - _gui->_color = getDefaultGUIColor(1); - _gui->_textcolor = getDefaultGUIColor(2); - _gui->_textcolorhi = getDefaultGUIColor(6); - _gui->_shadowcolor = getDefaultGUIColor(8); - - _newgui->_bgcolor = _gui->_bgcolor; - _newgui->_color = _gui->_color; - _newgui->_textcolor = _gui->_textcolor; - _newgui->_textcolorhi = _gui->_textcolorhi; - _newgui->_shadowcolor = _gui->_shadowcolor; - } -} diff --git a/sdl.cpp b/sdl.cpp deleted file mode 100644 index 204d1323dd..0000000000 --- a/sdl.cpp +++ /dev/null @@ -1,1409 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scummsys.h" -#include "system.h" -#include "sound/mididrv.h" -#include "gameDetector.h" -#include "scaler.h" -#include "scumm.h" // Only #included for error() and warning() - -#include "scummvm.xpm" - -#include -#include - - -class OSystem_SDL : public OSystem { -public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - // Add a callback timer - void set_timer(int timer, int (*callback)(int)); - - // Mutex handling - void *create_mutex(void); - void lock_mutex(void *mutex); - void unlock_mutex(void *mutex); - void delete_mutex(void *mutex); - - static OSystem *create(int gfx_mode, bool full_screen); - -private: - typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height); - - SDL_Surface *sdl_screen; // unseen game screen - SDL_Surface *sdl_hwscreen; // hardware screen - SDL_Surface *sdl_tmpscreen; // temporary screen (for 2xsai) - SDL_CD *cdrom; - - enum { - DF_WANT_RECT_OPTIM = 1 << 0, - DF_REAL_8BIT = 1 << 1, - DF_SEPARATE_TEMPSCREEN = 1 << 2, - DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 - }; - - int _mode; - bool _full_screen; - bool _mouse_visible; - bool _mouse_drawn; - uint32 _mode_flags; - - bool force_full; //Force full redraw on next update_screen - bool cksum_valid; - - enum { - NUM_DIRTY_RECT = 100, - - MAX_MOUSE_W = 40, - MAX_MOUSE_H = 40, - MAX_SCALING = 3 - }; - - int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; - SDL_Rect *dirty_rect_list; - int num_dirty_rects; - uint32 *dirty_checksums; - - int scaling; - - /* CD Audio */ - int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; - Uint32 cd_end_time, cd_stop_time, cd_next_second; - - /* Keyboard mouse emulation */ - struct KbdMouse { - int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count; - uint32 last_time, delay_time, x_down_time, y_down_time; - } km; - - struct MousePos { - int16 x, y, w, h; - }; - - byte *_mouse_data; - byte *_mouse_backup; - MousePos _mouse_cur_state; - MousePos _mouse_old_state; - int16 _mouse_hotspot_x; - int16 _mouse_hotspot_y; - int _current_shake_pos; - int _new_shake_pos; - TwoXSaiProc *_sai_func; - SDL_Color *_cur_pal; - - uint _palette_changed_first, _palette_changed_last; - - OSystem_SDL() : _current_shake_pos(0), _new_shake_pos(0) {} - - void add_dirty_rgn_auto(const byte *buf); - void mk_checksums(const byte *buf); - - static void fill_sound(void *userdata, Uint8 * stream, int len); - - void add_dirty_rect(int x, int y, int w, int h); - - void draw_mouse(); - void undraw_mouse(); - - void load_gfx_mode(); - void unload_gfx_mode(); - - void hotswap_gfx_mode(); - - void get_320x200_image(byte *buf); - - void setup_icon(); - void kbd_mouse(); -}; - -void atexit_proc() { - SDL_ShowCursor(SDL_ENABLE); - - SDL_QuitSubSystem(SDL_INIT_VIDEO); - SDL_QuitSubSystem(SDL_INIT_TIMER); - SDL_QuitSubSystem(SDL_INIT_CDROM); -#ifndef WIN32 // FIXME: SDL bug - closing audio freezes w/ waveout - SDL_QuitSubSystem(SDL_INIT_AUDIO); -#endif -} - -OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) { - OSystem_SDL *syst = new OSystem_SDL(); - syst->_mode = gfx_mode; - syst->_full_screen = full_screen; - - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) ==-1) { - error("Could not initialize SDL: %s.\n", SDL_GetError()); - } - -#ifdef WIN32 /* Use waveout on win32, not */ - SDL_AudioInit("waveout"); /* dsound - unfortunatly dsound */ -#endif /* doesn't do COOPERATIVE mode*/ - - SDL_ShowCursor(SDL_DISABLE); - - /* Setup the icon */ - syst->setup_icon(); - - /* Clean up on exit */ - atexit(atexit_proc); - - return syst; -} - -void OSystem_SDL::set_timer(int timer, int (*callback)(int)) { - SDL_SetTimer(timer, (SDL_TimerCallback) callback); -} -OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) { - return OSystem_SDL::create(gfx_mode, full_screen); -} - -void OSystem_SDL::set_palette(const byte *colors, uint start, uint num) { - const byte *b = colors; - uint i; - SDL_Color *base = _cur_pal + start; - for(i=0;i!=num;i++) { - base[i].r = b[0]; - base[i].g = b[1]; - base[i].b = b[2]; - b += 4; - } - - if (start < _palette_changed_first) - _palette_changed_first = start; - - if (start + num > _palette_changed_last) - _palette_changed_last = start + num; -} - -void OSystem_SDL::load_gfx_mode() { - force_full = true; - scaling = 1; - _mode_flags = 0; - - _sai_func = NULL; - sdl_tmpscreen = NULL; - - switch(_mode) { - case GFX_2XSAI: - scaling = 2; - _sai_func = _2xSaI; - break; - case GFX_SUPER2XSAI: - scaling = 2; - _sai_func = Super2xSaI; - break; - case GFX_SUPEREAGLE: - scaling = 2; - _sai_func = SuperEagle; - break; - case GFX_ADVMAME2X: - scaling = 2; - _sai_func = AdvMame2x; - break; - - case GFX_DOUBLESIZE: - scaling = 2; - break; - - case GFX_TRIPLESIZE: - if (_full_screen) { - warning("full screen in useless in triplesize mode, reverting to normal mode"); - goto normal_mode; - } - scaling = 3; - break; - - case GFX_NORMAL: -normal_mode:; - scaling = 1; - break; - } - - sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 8, 0, 0, 0, 0); - if (sdl_screen == NULL) - error("sdl_screen failed failed"); - - if (_sai_func) { - uint16 *tmp_screen = (uint16*)calloc((SCREEN_WIDTH+3)*(SCREEN_HEIGHT+3),sizeof(uint16)); - _mode_flags = DF_WANT_RECT_OPTIM | DF_SEPARATE_TEMPSCREEN | DF_UPDATE_EXPAND_1_PIXEL; - - sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 16, - _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE - ); - if (sdl_hwscreen == NULL) - error("sdl_hwscreen failed"); - - /* Need some extra bytes around when using 2XSAI */ - if (sdl_hwscreen->format->Rmask == 0x7C00) // HACK HACK HACK - Init_2xSaI(555); - else - Init_2xSaI(565); - sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen, - SCREEN_WIDTH + 3, SCREEN_HEIGHT + 3, 16, (SCREEN_WIDTH + 3)*2, - sdl_hwscreen->format->Rmask, - sdl_hwscreen->format->Gmask, - sdl_hwscreen->format->Bmask, - sdl_hwscreen->format->Amask); - - if (sdl_tmpscreen == NULL) - error("sdl_tmpscreen failed"); - - } else { - switch(scaling) { - case 3: - _sai_func = Normal3x; - break; - case 2: - _sai_func = Normal2x; - break; - case 1: - _sai_func = Normal1x; - break; - } - - _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; - - sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 8, - _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE - ); - if (sdl_hwscreen == NULL) - error("sdl_hwscreen failed"); - - sdl_tmpscreen = sdl_screen; - } - - // keyboard cursor control, some other better place for it? - km.x_max = SCREEN_WIDTH * scaling - 1; - km.y_max = SCREEN_HEIGHT * scaling - 1; - km.delay_time = 25; - km.last_time = 0; - -} - -void OSystem_SDL::unload_gfx_mode() { - SDL_FreeSurface(sdl_screen); - sdl_screen = NULL; - - SDL_FreeSurface(sdl_hwscreen); - sdl_hwscreen = NULL; - - if (_mode_flags & DF_SEPARATE_TEMPSCREEN) { - free((uint16*)sdl_tmpscreen->pixels); - SDL_FreeSurface(sdl_tmpscreen); - } - sdl_tmpscreen = NULL; -} - -void OSystem_SDL::init_size(uint w, uint h) { - //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) - // error("320x200 is the only game resolution supported"); - - SCREEN_WIDTH = w; - SCREEN_HEIGHT = h; - CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)); - /* allocate palette, it needs to be persistent across - * driver changes, so i'll alloc it here */ - _cur_pal = (SDL_Color*)calloc(sizeof(SDL_Color), 256); - - dirty_rect_list = (SDL_Rect*)calloc(NUM_DIRTY_RECT, sizeof(SDL_Rect)); - _mouse_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); - dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); - - load_gfx_mode(); -} - -void OSystem_SDL::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { - if (sdl_screen == NULL) - return; - - if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { - /* Special, optimized case for full screen updates. - * It tries to determine what areas were actually changed, - * and just updates those, on the actual display. */ - add_dirty_rgn_auto(buf); - } else { - /* Clip the coordinates */ - if (x < 0) { w+=x; buf-=x; x = 0; } - if (y < 0) { h+=y; buf-=y*pitch; y = 0; } - if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } - if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } - - if (w <= 0 || h <= 0) - return; - - cksum_valid = false; - add_dirty_rect(x, y, w, h); - } - - /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ - if (_mouse_drawn) - undraw_mouse(); - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - byte *dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; - do { - memcpy(dst, buf, w); - dst += SCREEN_WIDTH; - buf += pitch; - } while (--h); - - SDL_UnlockSurface(sdl_screen); -} - - -void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) { - if (force_full) - return; - - if (num_dirty_rects == NUM_DIRTY_RECT) - force_full = true; - else { - SDL_Rect *r = &dirty_rect_list[num_dirty_rects++]; - - /* Update the dirty region by 1 pixel for graphics drivers - * that "smear" the screen */ - if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { - x--; - y--; - w+=2; - h+=2; - } - - /* clip */ - if (x < 0) { w+=x; x=0; } - if (y < 0) { h+=y; y=0; } - if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } - if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } - - r->x = x; - r->y = y; - r->w = w; - r->h = h; - } -} - -#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) -#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] -void OSystem_SDL::mk_checksums(const byte *buf) { - uint32 *sums = dirty_checksums; - uint x,y; - const uint last_x = (uint)SCREEN_WIDTH/8; - const uint last_y = (uint)SCREEN_HEIGHT/8; - - /* the 8x8 blocks in buf are enumerated starting in the top left corner and - * reading each line at a time from left to right */ - for(y=0; y != last_y; y++, buf+=SCREEN_WIDTH*(8-1)) - for(x=0; x != last_x; x++, buf+=8) { - uint32 a = x; - uint32 b = y; - - DOLINE(0); ROL(a,13); ROL(b,11); - DOLINE(2); ROL(a,13); ROL(b,11); - DOLINE(4); ROL(a,13); ROL(b,11); - DOLINE(6); ROL(a,13); ROL(b,11); - - a*=0xDEADBEEF; - b*=0xBAADF00D; - - DOLINE(1); ROL(a,13); ROL(b,11); - DOLINE(3); ROL(a,13); ROL(b,11); - DOLINE(5); ROL(a,13); ROL(b,11); - DOLINE(7); ROL(a,13); ROL(b,11); - - /* output the checksum for this block */ - *sums++=a+b; - } -} -#undef DOLINE -#undef ROL - - -void OSystem_SDL::add_dirty_rgn_auto(const byte *buf) { - assert( ((uint32)buf & 3) == 0); - - /* generate a table of the checksums */ - mk_checksums(buf); - - if (!cksum_valid) { - force_full = true; - cksum_valid = true; - } - - /* go through the checksum list, compare it with the previous checksums, - and add all dirty rectangles to a list. try to combine small rectangles - into bigger ones in a simple way */ - if (!force_full) { - int x,y,w; - uint32 *ck = dirty_checksums; - - for(y=0; y!=SCREEN_HEIGHT/8; y++) { - for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { - if (ck[0] != ck[CKSUM_NUM]) { - /* found a dirty 8x8 block, now go as far to the right as possible, - and at the same time, unmark the dirty status by setting old to new. */ - w=0; - do { - ck[w+CKSUM_NUM] = ck[w]; - w++; - } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); - - add_dirty_rect(x*8, y*8, w*8, 8); - - if (force_full) - goto get_out; - } - } - } - } else { - get_out:; - /* Copy old checksums to new */ - memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); - } -} - -void OSystem_SDL::update_screen() { - - if (sdl_hwscreen == NULL) - return; // Can this really happen? - - /* First make sure the mouse is drawn, if it should be drawn. */ - draw_mouse(); - - /* Palette update in case we are NOT in "real" 8 bit color mode. - * Must take place before updating the screen, since the palette must - * be set up for conversion from 8bit to 16bit. - */ - if (((_mode_flags & DF_REAL_8BIT) == 0) && _palette_changed_last != 0) { - SDL_SetColors(sdl_screen, _cur_pal + _palette_changed_first, - _palette_changed_first, - _palette_changed_last - _palette_changed_first); - - _palette_changed_last = 0; - - force_full = true; - } - - - /* If the shake position changed, fill the dirty area with blackness */ - if (_current_shake_pos != _new_shake_pos) { - SDL_Rect blackrect = {0, 0, SCREEN_WIDTH*scaling, _new_shake_pos*scaling}; - SDL_FillRect(sdl_hwscreen, &blackrect, 0); - - _current_shake_pos = _new_shake_pos; - - force_full = true; - } - - /* force a full redraw if requested */ - if (force_full) { - num_dirty_rects = 1; - - dirty_rect_list[0].x = 0; - dirty_rect_list[0].y = 0; - dirty_rect_list[0].w = SCREEN_WIDTH; - dirty_rect_list[0].h = SCREEN_HEIGHT; - } - - /* Only draw anything if necessary */ - if (num_dirty_rects > 0) { - - SDL_Rect *r; - uint32 srcPitch, dstPitch; - SDL_Rect *last_rect = dirty_rect_list + num_dirty_rects; - - /* Convert appropriate parts of the image into 16bpp */ - if ((_mode_flags & DF_REAL_8BIT) == 0) { - SDL_Rect dst; - for(r=dirty_rect_list; r!=last_rect; ++r) { - dst = *r; - dst.x++; - dst.y++; - if (SDL_BlitSurface(sdl_screen, r, sdl_tmpscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - } - } - - SDL_LockSurface(sdl_tmpscreen); - SDL_LockSurface(sdl_hwscreen); - - srcPitch = sdl_tmpscreen->pitch; - dstPitch = sdl_hwscreen->pitch; - - if ((_mode_flags & DF_REAL_8BIT) == 0) { - for(r=dirty_rect_list; r!=last_rect; ++r) { - register int dst_y = r->y + _current_shake_pos; - register int dst_h = 0; - if (dst_y < SCREEN_HEIGHT) { - dst_h = r->h; - if (dst_h > SCREEN_HEIGHT - dst_y) - dst_h = SCREEN_HEIGHT - dst_y; - - r->x <<= 1; - dst_y <<= 1; - - _sai_func((byte*)sdl_tmpscreen->pixels + (r->x+2) + (r->y+1)*srcPitch, srcPitch, NULL, - (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); - } - - r->y = dst_y; - r->w <<= 1; - r->h = dst_h << 1; - } - } else { - for(r=dirty_rect_list; r!=last_rect; ++r) { - register int dst_y = r->y + _current_shake_pos; - register int dst_h = 0; - if (dst_y < SCREEN_HEIGHT) { - dst_h = r->h; - if (dst_h > SCREEN_HEIGHT - dst_y) - dst_h = SCREEN_HEIGHT - dst_y; - - dst_y *= scaling; - - _sai_func((byte*)sdl_tmpscreen->pixels + r->x + r->y*srcPitch, srcPitch, NULL, - (byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h); - } - - r->x *= scaling; - r->y = dst_y; - r->w *= scaling; - r->h = dst_h * scaling; - } - } - - if (force_full) { - dirty_rect_list[0].y = 0; - dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; - } - - SDL_UnlockSurface(sdl_tmpscreen); - SDL_UnlockSurface(sdl_hwscreen); - } - - /* Palette update in case we are in "real" 8 bit color mode. - * Must take place after the screen data was updated, since with - * "real" 8bit mode, palatte changes may be visible immediatly, - * and we want to avoid any ugly effects. - */ - if (_mode_flags & DF_REAL_8BIT && _palette_changed_last != 0) { - SDL_SetColors(sdl_hwscreen, _cur_pal + _palette_changed_first, - _palette_changed_first, - _palette_changed_last - _palette_changed_first); - - _palette_changed_last = 0; - } - - if (num_dirty_rects > 0) { - /* Finally, blit all our changes to the screen */ - SDL_UpdateRects(sdl_hwscreen, num_dirty_rects, dirty_rect_list); - } - - num_dirty_rects = 0; - force_full = false; -} - -void OSystem_SDL::kbd_mouse() { - uint32 time = get_msecs(); - if (time >= km.last_time + km.delay_time) { - km.last_time = time; - if (km.x_down_count == 1) { - km.x_down_time = time; - km.x_down_count = 2; - } - if (km.y_down_count == 1) { - km.y_down_time = time; - km.y_down_count = 2; - } - - if (km.x_vel || km.y_vel) { - if (km.x_down_count) { - if (time > km.x_down_time + km.delay_time*12) { - if (km.x_vel > 0) - km.x_vel++; - else - km.x_vel--; - } else if (time > km.x_down_time + km.delay_time*8) { - if (km.x_vel > 0) - km.x_vel = 5; - else - km.x_vel = -5; - } - } - if (km.y_down_count) { - if (time > km.y_down_time + km.delay_time*12) { - if (km.y_vel > 0) - km.y_vel++; - else - km.y_vel--; - } else if (time > km.y_down_time + km.delay_time*8) { - if (km.y_vel > 0) - km.y_vel = 5; - else - km.y_vel = -5; - } - } - - km.x += km.x_vel; - km.y += km.y_vel; - - if (km.x < 0) { - km.x = 0; - km.x_vel = -1; - km.x_down_count = 1; - } else if (km.x > km.x_max) { - km.x = km.x_max; - km.x_vel = 1; - km.x_down_count = 1; - } - - if (km.y < 0) { - km.y = 0; - km.y_vel = -1; - km.y_down_count = 1; - } else if (km.y > km.y_max) { - km.y = km.y_max; - km.y_vel = 1; - km.y_down_count = 1; - } - - SDL_WarpMouse(km.x, km.y); - } - } -} - -bool OSystem_SDL::show_mouse(bool visible) { - if (_mouse_visible == visible) - return visible; - - bool last = _mouse_visible; - _mouse_visible = visible; - - if (visible) - draw_mouse(); - else - undraw_mouse(); - - return last; -} - -void OSystem_SDL::set_mouse_pos(int x, int y) { - if (x != _mouse_cur_state.x || y != _mouse_cur_state.y) { - _mouse_cur_state.x = x; - _mouse_cur_state.y = y; - undraw_mouse(); - } -} - -void OSystem_SDL::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { - _mouse_cur_state.w = w; - _mouse_cur_state.h = h; - - _mouse_hotspot_x = hotspot_x; - _mouse_hotspot_y = hotspot_y; - - _mouse_data = (byte*)buf; - - undraw_mouse(); -} - -void OSystem_SDL::set_shake_pos(int shake_pos) { - _new_shake_pos = shake_pos; -} - -uint32 OSystem_SDL::get_msecs() { - return SDL_GetTicks(); -} - -void OSystem_SDL::delay_msecs(uint msecs) { - SDL_Delay(msecs); -} - -void *OSystem_SDL::create_thread(ThreadProc *proc, void *param) { - return SDL_CreateThread(proc, param); -} - -int mapKey(int key, byte mod) -{ - if (key >= SDLK_F1 && key <= SDLK_F9) { - return key - SDLK_F1 + 315; - } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { - key &= ~0x20; - } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) - return 0; - return key; -} - -bool OSystem_SDL::poll_event(Event *event) { - SDL_Event ev; - kbd_mouse(); - - for(;;) { - if (!SDL_PollEvent(&ev)) - return false; - - switch(ev.type) { - case SDL_KEYDOWN: { - byte b = 0; - if (ev.key.keysym.mod & KMOD_SHIFT) b |= KBD_SHIFT; - if (ev.key.keysym.mod & KMOD_CTRL) b |= KBD_CTRL; - if (ev.key.keysym.mod & KMOD_ALT) b |= KBD_ALT; - event->kbd.flags = b; - - /* internal keypress? */ - if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { - property(PROP_TOGGLE_FULLSCREEN, NULL); - break; - } - - if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) { - quit(); - break; - } - if (b == (KBD_CTRL|KBD_ALT) && - (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { - Property prop; - prop.gfx_mode = ev.key.keysym.sym - '1'; - property(PROP_SET_GFX_MODE, &prop); - break; - } - #ifdef QTOPIA - // quit on fn+backspace on zaurus - if (ev.key.keysym.sym==127) { - quit(); - break; - } - // map menu key (f11) to f5 (scumm menu) - if (ev.key.keysym.sym==292) { - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 286; - event->kbd.ascii = mapKey(286, ev.key.keysym.mod); - } - // map center (space) to tab (default action ) - // i wanted to map the calendar button but the calendar comes up - // - else if (ev.key.keysym.sym==32) { - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 9; - event->kbd.ascii = mapKey(9, ev.key.keysym.mod); - } - // since we stole space (pause) above we'll rebind it to the tab key on the keyboard - else if (ev.key.keysym.sym==9) { - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = 32; - event->kbd.ascii = mapKey(32, ev.key.keysym.mod); - } - else { - // let the events fall through if we didn't change them, this may not be the best way to - // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though. - // and yes i have an huge terminal size so i dont wrap soon enough. - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = ev.key.keysym.sym; - event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); - } - #endif - #ifndef QTOPIA - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = ev.key.keysym.sym; - event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); - #endif - - switch(ev.key.keysym.sym) { - case SDLK_LEFT: - km.x_vel = -1; - km.x_down_count = 1; - break; - case SDLK_RIGHT: - km.x_vel = 1; - km.x_down_count = 1; - break; - case SDLK_UP: - km.y_vel = -1; - km.y_down_count = 1; - break; - case SDLK_DOWN: - km.y_vel = 1; - km.y_down_count = 1; - break; - default: - break; - } - - return true; - } - - case SDL_KEYUP: { - event->event_code = EVENT_KEYUP; - event->kbd.keycode = ev.key.keysym.sym; - event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); - - switch(ev.key.keysym.sym){ - case SDLK_LEFT: - if (km.x_vel < 0) { - km.x_vel = 0; - km.x_down_count = 0; - } - break; - case SDLK_RIGHT: - if (km.x_vel > 0) { - km.x_vel = 0; - km.x_down_count = 0; - } - break; - case SDLK_UP: - if (km.y_vel < 0) { - km.y_vel = 0; - km.y_down_count = 0; - } - break; - case SDLK_DOWN: - if (km.y_vel > 0) { - km.y_vel = 0; - km.y_down_count = 0; - } - break; - default: - break; - } - return true; - } - - case SDL_MOUSEMOTION: - event->event_code = EVENT_MOUSEMOVE; - km.x = event->mouse.x = ev.motion.x; - km.y = event->mouse.y = ev.motion.y; - - event->mouse.x /= scaling; - event->mouse.y /= scaling; - - return true; - - case SDL_MOUSEBUTTONDOWN: - if (ev.button.button == SDL_BUTTON_LEFT) - event->event_code = EVENT_LBUTTONDOWN; - else if (ev.button.button == SDL_BUTTON_RIGHT) - event->event_code = EVENT_RBUTTONDOWN; - else - break; - km.x = event->mouse.x = ev.motion.x; - km.y = event->mouse.y = ev.motion.y; - event->mouse.x /= scaling; - event->mouse.y /= scaling; - - return true; - - case SDL_MOUSEBUTTONUP: - if (ev.button.button == SDL_BUTTON_LEFT) - event->event_code = EVENT_LBUTTONUP; - else if (ev.button.button == SDL_BUTTON_RIGHT) - event->event_code = EVENT_RBUTTONUP; - else - break; - event->mouse.x = ev.button.x; - event->mouse.y = ev.button.y; - event->mouse.x /= scaling; - event->mouse.y /= scaling; - return true; - - case SDL_QUIT: - quit(); - } - } -} - -bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { - SDL_AudioSpec desired; - - /* only one format supported at the moment */ - - desired.freq = SAMPLES_PER_SEC; - desired.format = AUDIO_S16SYS; - desired.channels = 2; - desired.samples = 2048; - desired.callback = proc; - desired.userdata = param; - if (SDL_OpenAudio(&desired, NULL) != 0) { - return false; - } - SDL_PauseAudio(0); - return true; -} - - -/* retrieve the 320x200 bitmap currently being displayed */ -void OSystem_SDL::get_320x200_image(byte *buf) { - /* make sure the mouse is gone */ - undraw_mouse(); - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - memcpy(buf, sdl_screen->pixels, SCREEN_WIDTH*SCREEN_HEIGHT); - - SDL_UnlockSurface(sdl_screen); -} - -void OSystem_SDL::hotswap_gfx_mode() { - /* hmm, need to allocate a 320x200 bitmap - * which will contain the "backup" of the screen during the change. - * then draw that to the new screen right after it's setup. - */ - - byte *bak_mem = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT); - - get_320x200_image(bak_mem); - - unload_gfx_mode(); - load_gfx_mode(); - - force_full = true; - - /* reset palette */ - if (_mode_flags & DF_REAL_8BIT) - SDL_SetColors(sdl_hwscreen, _cur_pal, 0, 256); - else - SDL_SetColors(sdl_screen, _cur_pal, 0, 256); - - /* blit image */ - OSystem_SDL::copy_rect(bak_mem, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - free(bak_mem); - - OSystem_SDL::update_screen(); -} - -uint32 OSystem_SDL::property(int param, Property *value) { - switch(param) { - - case PROP_TOGGLE_FULLSCREEN: - _full_screen ^= true; - - if (!SDL_WM_ToggleFullScreen(sdl_hwscreen)) { - /* if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode */ - hotswap_gfx_mode(); - } - return 1; - - case PROP_GET_FULLSCREEN: - return _full_screen; - - case PROP_SET_WINDOW_CAPTION: - SDL_WM_SetCaption(value->caption, value->caption); - return 1; - - case PROP_OPEN_CD: - if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) - cdrom = NULL; - else { - cdrom = SDL_CDOpen(value->cd_num); - /* Did if open? Check if cdrom is NULL */ - if (!cdrom) { - warning("Couldn't open drive: %s\n", SDL_GetError()); - } - } - break; - - case PROP_SET_GFX_MODE: - if (value->gfx_mode >= 7) - return 0; - - _mode = value->gfx_mode; - hotswap_gfx_mode(); - - return 1; - - case PROP_SHOW_DEFAULT_CURSOR: - SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); - break; - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - } - - return 0; -} - -void OSystem_SDL::quit() { - if(cdrom) { - SDL_CDStop(cdrom); - SDL_CDClose(cdrom); - } - unload_gfx_mode(); - exit(1); -} - -void OSystem_SDL::draw_mouse() { - if (_mouse_drawn || !_mouse_visible) - return; - - int x = _mouse_cur_state.x - _mouse_hotspot_x; - int y = _mouse_cur_state.y - _mouse_hotspot_y; - int w = _mouse_cur_state.w; - int h = _mouse_cur_state.h; - byte color; - byte *src = _mouse_data; // Image representing the mouse - byte *bak = _mouse_backup; // Surface used to backup the area obscured by the mouse - byte *dst; // Surface we are drawing into - - // clip the mouse rect, and addjust the src pointer accordingly - if (x < 0) { - w += x; - src -= x; - x = 0; - } - if (y < 0) { - h += y; - src -= y * _mouse_cur_state.w; - y = 0; - } - if (w > SCREEN_WIDTH - x) - w = SCREEN_WIDTH - x; - if (h > SCREEN_HEIGHT - y) - h = SCREEN_HEIGHT - y; - - // Store the bounding box so that undraw mouse can restore the area the - // mouse currently covers to its original content. - _mouse_old_state.x = x; - _mouse_old_state.y = y; - _mouse_old_state.w = w; - _mouse_old_state.h = h; - - // Quick check to see if anything has to be drawn at all - if (w <= 0 || h <= 0) - return; - - // Draw the mouse cursor; backup the covered area in "bak" - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - add_dirty_rect(x, y, w, h); - - dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; - while (h > 0) { - int width = w; - while (width > 0) { - *bak++ = *dst; - color = *src++; - if (color != 0xFF) // 0xFF = transparent, don't draw - *dst = color; - dst++; - width--; - } - src += _mouse_cur_state.w - w; - bak += MAX_MOUSE_W - w; - dst += SCREEN_WIDTH - w; - h--; - } - - SDL_UnlockSurface(sdl_screen); - - // Finally, set the flag to indicate the mouse has been drawn - _mouse_drawn = true; -} - -void OSystem_SDL::undraw_mouse() { - if (!_mouse_drawn) - return; - _mouse_drawn = false; - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - byte *dst, *bak = _mouse_backup; - const int old_mouse_x = _mouse_old_state.x; - const int old_mouse_y = _mouse_old_state.y; - const int old_mouse_w = _mouse_old_state.w; - const int old_mouse_h = _mouse_old_state.h; - int x,y; - - // No need to do clipping here, since draw_mouse() did that already - - dst = (byte *)sdl_screen->pixels + old_mouse_y * SCREEN_WIDTH + old_mouse_x; - for (y = 0; y < old_mouse_h; ++y, bak += MAX_MOUSE_W, dst += SCREEN_WIDTH) { - for (x = 0; x < old_mouse_w; ++x) { - dst[x] = bak[x]; - } - } - - add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); - - SDL_UnlockSurface(sdl_screen); -} - -void OSystem_SDL::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */ - cd_stop_time = SDL_GetTicks() + 100; - cd_num_loops = 0; - -} - -void OSystem_SDL::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { - if (!num_loops && !start_frame) - return; - - if (!cdrom) - return; - - if (end_frame > 0) - end_frame+=5; - - cd_track = track; - cd_num_loops = num_loops; - cd_start_frame = start_frame; - - SDL_CDStatus(cdrom); - SDL_CDPlayTracks(cdrom, track, start_frame, 0, end_frame); - cd_end_frame = end_frame; - cd_stop_time = 0; - cd_end_time = SDL_GetTicks() + cdrom->track[track].length * 1000 / CD_FPS; -} - -bool OSystem_SDL::poll_cdrom() { - if (!cdrom) - return false; - - return (cd_num_loops != 0 && (SDL_GetTicks() < cd_end_time || SDL_CDStatus(cdrom) != CD_STOPPED)); -} - -void OSystem_SDL::update_cdrom() { - if (!cdrom) - return; - - if (cd_stop_time != 0 && SDL_GetTicks() >= cd_stop_time) { - SDL_CDStop(cdrom); - cd_num_loops = 0; - cd_stop_time = 0; - return; - } - - if (cd_num_loops == 0 || SDL_GetTicks() < cd_end_time) - return; - - if (cd_num_loops != 1 && SDL_CDStatus(cdrom) != CD_STOPPED) { - // Wait another second for it to be done - cd_end_time += 1000; - return; - } - - if (cd_num_loops > 0) - cd_num_loops--; - - if (cd_num_loops != 0) { - SDL_CDPlayTracks(cdrom, cd_track, cd_start_frame, 0, cd_end_frame); - cd_end_time = SDL_GetTicks() + cdrom->track[cd_track].length * 1000 / CD_FPS; - } -} - -void OSystem_SDL::setup_icon() { - int w, h, ncols, nbytes, i; - unsigned int rgba[256], icon[32 * 32]; - unsigned char mask[32][4]; - - sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); - if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { - warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); - return; - } - for (i = 0; i < ncols; i++) { - unsigned char code; - char color[32]; - unsigned int col; - sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); - if (!strcmp(color, "None")) - col = 0x00000000; - else if (!strcmp(color, "black")) - col = 0xFF000000; - else if (color[0] == '#') { - sscanf(color + 1, "%06x", &col); - col |= 0xFF000000; - } else { - warning("Could not load the icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); - return; - } - - rgba[code] = col; - } - memset(mask, 0, sizeof(mask)); - for (h = 0; h < 32; h++) { - char *line = scummvm_icon[1 + ncols + h]; - for (w = 0; w < 32; w++) { - icon[w + 32 * h] = rgba[line[w]]; - if (rgba[line[w]] & 0xFF000000) { - mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); - } - } - } - - SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); - SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); -} - -void *OSystem_SDL::create_mutex(void) { - return (void *) SDL_CreateMutex(); -} - -void OSystem_SDL::lock_mutex(void *mutex) { - SDL_mutexP((SDL_mutex *) mutex); -} - -void OSystem_SDL::unlock_mutex(void *mutex) { - SDL_mutexV((SDL_mutex *) mutex); -} - -void OSystem_SDL::delete_mutex(void *mutex) { - SDL_DestroyMutex((SDL_mutex *) mutex); -} - - -#ifdef USE_NULL_DRIVER - -/* NULL video driver */ -class OSystem_NULL : public OSystem { -public: - void set_palette(const byte *colors, uint start, uint num) {} - void init_size(uint w, uint h); - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {} - void update_screen() {} - bool show_mouse(bool visible) { return false; } - void set_mouse_pos(int x, int y) {} - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {} - void set_shake_pos(int shake_pos) {} - uint32 get_msecs(); - void delay_msecs(uint msecs); - void *create_thread(ThreadProc *proc, void *param) { return NULL; } - bool poll_event(Event *event) { return false; } - bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} - void quit() { exit(1); } - uint32 property(int param, Property *value) { return 0; } - static OSystem *create(int gfx_mode, bool full_screen); -private: - - uint msec_start; - - uint32 get_ticks(); -}; - -void OSystem_NULL::init_size(uint w, uint h, byte sound) { - msec_start = get_ticks(); -} - -uint32 OSystem_NULL::get_ticks() { - uint a = 0; -#ifdef WIN32 - a = GetTickCount(); -#endif -#ifdef UNIX - struct timeval tv; - gettimeofday(&tv, NULL); - a = tv.tv_sec * 1000 + tv.tv_usec/1000; -#endif - - return a; -} - -void OSystem_NULL::delay_msecs(uint msecs) { -#ifdef WIN32 - Sleep(msecs); -#endif -#ifdef UNIX - usleep(msecs*1000); -#endif -} - -uint32 OSystem_NULL::get_msecs() { - return get_ticks() - msec_start; -} - -OSystem *OSystem_NULL_create() { - return new OSystem_NULL(); -} -#else /* USE_NULL_DRIVER */ - -OSystem *OSystem_NULL_create() { - return NULL; -} - -#endif diff --git a/sdl_gl.cpp b/sdl_gl.cpp deleted file mode 100644 index adec2a1f6b..0000000000 --- a/sdl_gl.cpp +++ /dev/null @@ -1,1068 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scummsys.h" -#include "system.h" -#include "sound/mididrv.h" -#include "gameDetector.h" -#include "scaler.h" -#include "scumm.h" // Only #included for error() and warning() - -#include "scummvm.xpm" - -#include -#include - -#ifdef WIN32 -int glColorTable(int, int, int, int, int, void *) { return 0; } -int glGetColorTable(int, int, int, void *) { return 0; } -/* Use OpenGL 1.1 */ -bool OGL_1_1 = true; -#else -bool OGL_1_1 = false; -#endif - -#include "fb2opengl.h" -FB2GL fb2gl; - -class OSystem_SDL : public OSystem { -public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - // Add a callback timer - void set_timer(int timer, int (*callback)(int)); - - // Mutex handling - void *create_mutex(void); - void lock_mutex(void *mutex); - void unlock_mutex(void *mutex); - void delete_mutex(void *mutex); - - static OSystem *create(int gfx_mode, bool full_screen); - -private: - typedef void TwoXSaiProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, - uint8 *dstPtr, uint32 dstPitch, int width, int height); - - SDL_Surface *sdl_screen; - SDL_Surface *sdl_tmpscreen; - SDL_CD *cdrom; - - enum { - DF_WANT_RECT_OPTIM = 1 << 0, - DF_REAL_8BIT = 1 << 1, - DF_SEPARATE_TEMPSCREEN = 1 << 2, - DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 - }; - - int _mode; - bool _full_screen; - bool _mouse_visible; - bool _mouse_drawn; - uint32 _mode_flags; - - bool force_full; //Force full redraw on next update_screen - bool cksum_valid; - - enum { - NUM_DIRTY_RECT = 100, - - MAX_MOUSE_W = 40, - MAX_MOUSE_H = 40, - MAX_SCALING = 3 - }; - - int SCREEN_WIDTH, SCREEN_HEIGHT, CKSUM_NUM; - SDL_Rect *dirty_rect_list; - int num_dirty_rects; - uint32 *dirty_checksums; - - int scaling; - - /* CD Audio */ - int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; - Uint32 cd_end_time, cd_stop_time, cd_next_second; - - struct MousePos { - int16 x, y, w, h; - }; - - byte *_mouse_data; - byte *_mouse_backup; - MousePos _mouse_cur_state; - MousePos _mouse_old_state; - int16 _mouse_hotspot_x; - int16 _mouse_hotspot_y; - int _current_shake_pos; - int _new_shake_pos; - TwoXSaiProc *_sai_func; - SDL_Color *_cur_pal; - - uint _palette_changed_first, _palette_changed_last; - - OSystem_SDL() : _current_shake_pos(0), _new_shake_pos(0) {} - - void add_dirty_rgn_auto(const byte *buf); - void mk_checksums(const byte *buf); - - static void fill_sound(void *userdata, Uint8 * stream, int len); - - void add_dirty_rect(int x, int y, int w, int h); - - void draw_mouse(); - void undraw_mouse(); - - void load_gfx_mode(); - void unload_gfx_mode(); - - void hotswap_gfx_mode(); - - void get_320x200_image(byte *buf); - - void setup_icon(); -}; - -bool atexit_proc_instaled = false; -void atexit_proc() { - SDL_ShowCursor(SDL_ENABLE); - SDL_Quit(); -} - -OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) { - OSystem_SDL *syst = new OSystem_SDL(); - syst->_mode = gfx_mode; - syst->_full_screen = full_screen; - - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) ==-1) { - error("Could not initialize SDL: %s.\n", SDL_GetError()); - } - -#ifdef WIN32 /* Use waveout on win32, not */ - SDL_AudioInit("waveout"); /* dsound - unfortunatly dsound */ -#endif /* doesn't do COOPERATIVE mode*/ - - SDL_ShowCursor(SDL_DISABLE); - - /* Setup the icon */ - syst->setup_icon(); - -#ifndef MACOSX // Work around a bug in OS X - /* Clean up on exit */ - atexit_proc_instaled = true; - atexit(atexit_proc); -#endif - - return syst; -} - -void OSystem_SDL::set_timer(int timer, int (*callback)(int)) { - SDL_SetTimer(timer, (SDL_TimerCallback) callback); -} -OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) { - return OSystem_SDL::create(gfx_mode, full_screen); -} - -void OSystem_SDL::set_palette(const byte *colors, uint start, uint num) { - const byte *b = colors; - uint i; - - for(i=0;i!=num;i++) { - fb2gl.palette(i+start,b[0],b[1],b[2]); - b += 4; - } - - if (start < _palette_changed_first) - _palette_changed_first = start; - - if (start + num > _palette_changed_last) - _palette_changed_last = start + num; -} - -void OSystem_SDL::load_gfx_mode() { - int gl_flags = FB2GL_320 | FB2GL_PITCH; - force_full = true; - scaling = 1; - _mode_flags = 0; - - _sai_func = NULL; - sdl_tmpscreen = NULL; - - /* It's easier to work with 8 bit (256 colors) */ - _mode_flags |= DF_REAL_8BIT; - - sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 8, 0, 0, 0, 0); - if (sdl_screen == NULL) - error("sdl_screen failed failed"); - - _sai_func = Normal1x; - - _mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT; - - if (_full_screen) gl_flags |= (FB2GL_FS); - - if (OGL_1_1) { // OpenGL 1.1 - gl_flags |= (FB2GL_RGBA | FB2GL_EXPAND); - fb2gl.init(640,480,0,70,gl_flags ); - } - else { // OpenGL 1.2 - if (!fb2gl.init(640,480,0,70,gl_flags)) { // Try to use 8bpp textures - gl_flags |= (FB2GL_RGBA | FB2GL_EXPAND); // using RGBA textures - fb2gl.init(640,480,0,70,gl_flags); - } - } - -#ifdef MACOSX // Work around a bug in OS X - if (!atexit_proc_instaled) { - atexit_proc_instaled = true; - atexit(atexit_proc); - } -#endif - - SDL_SetGamma(1.25,1.25,1.25); - - sdl_tmpscreen = sdl_screen; -} - -void OSystem_SDL::unload_gfx_mode() { - SDL_FreeSurface(sdl_screen); - sdl_screen = NULL; - - if (_mode_flags & DF_SEPARATE_TEMPSCREEN) { - free((uint16*)sdl_tmpscreen->pixels); - SDL_FreeSurface(sdl_tmpscreen); - } - sdl_tmpscreen = NULL; -} - -void OSystem_SDL::init_size(uint w, uint h) { - //if (w != SCREEN_WIDTH && h != SCREEN_HEIGHT) - // error("320x200 is the only game resolution supported"); - - SCREEN_WIDTH = w; - SCREEN_HEIGHT = h; - CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)); - /* allocate palette, it needs to be persistent across - * driver changes, so i'll alloc it here */ - _cur_pal = (SDL_Color*)calloc(sizeof(SDL_Color), 256); - - dirty_rect_list = (SDL_Rect*)calloc(NUM_DIRTY_RECT, sizeof(SDL_Rect)); - _mouse_backup = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H * MAX_SCALING); - dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32)); - - load_gfx_mode(); -} - -void OSystem_SDL::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { - if (sdl_screen == NULL) - return; - - if (pitch == SCREEN_WIDTH && x==0 && y==0 && w==SCREEN_WIDTH && h==SCREEN_HEIGHT && _mode_flags&DF_WANT_RECT_OPTIM) { - /* Special, optimized case for full screen updates. - * It tries to determine what areas were actually changed, - * and just updates those, on the actual display. */ - add_dirty_rgn_auto(buf); - } else { - /* Clip the coordinates */ - if (x < 0) { w+=x; buf-=x; x = 0; } - if (y < 0) { h+=y; buf-=y*pitch; y = 0; } - if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } - if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } - - if (w <= 0 || h <= 0) - return; - - cksum_valid = false; - add_dirty_rect(x, y, w, h); - } - - /* FIXME: undraw mouse only if the draw rect intersects with the mouse rect */ - if (_mouse_drawn) - undraw_mouse(); - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - byte *dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; - do { - memcpy(dst, buf, w); - dst += SCREEN_WIDTH; - buf += pitch; - } while (--h); - - SDL_UnlockSurface(sdl_screen); -} - - -void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) { - if (force_full) - return; - - if (num_dirty_rects == NUM_DIRTY_RECT) - force_full = true; - else { - SDL_Rect *r = &dirty_rect_list[num_dirty_rects++]; - - /* Update the dirty region by 1 pixel for graphics drivers - * that "smear" the screen */ - if (_mode_flags & DF_UPDATE_EXPAND_1_PIXEL) { - x--; - y--; - w+=2; - h+=2; - } - - /* clip */ - if (x < 0) { w+=x; x=0; } - if (y < 0) { h+=y; y=0; } - if (w > SCREEN_WIDTH-x) { w = SCREEN_WIDTH - x; } - if (h > SCREEN_HEIGHT-y) { h = SCREEN_HEIGHT - y; } - - r->x = x; - r->y = y; - r->w = w; - r->h = h; - } -} - -#define ROL(a,n) a = (a<<(n)) | (a>>(32-(n))) -#define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] -void OSystem_SDL::mk_checksums(const byte *buf) { - uint32 *sums = dirty_checksums; - uint x,y; - const uint last_x = (uint)SCREEN_WIDTH/8; - const uint last_y = (uint)SCREEN_HEIGHT/8; - - /* the 8x8 blocks in buf are enumerated starting in the top left corner and - * reading each line at a time from left to right */ - for(y=0; y != last_y; y++, buf+=SCREEN_WIDTH*(8-1)) - for(x=0; x != last_x; x++, buf+=8) { - uint32 a = x; - uint32 b = y; - - DOLINE(0); ROL(a,13); ROL(b,11); - DOLINE(2); ROL(a,13); ROL(b,11); - DOLINE(4); ROL(a,13); ROL(b,11); - DOLINE(6); ROL(a,13); ROL(b,11); - - a*=0xDEADBEEF; - b*=0xBAADF00D; - - DOLINE(1); ROL(a,13); ROL(b,11); - DOLINE(3); ROL(a,13); ROL(b,11); - DOLINE(5); ROL(a,13); ROL(b,11); - DOLINE(7); ROL(a,13); ROL(b,11); - - /* output the checksum for this block */ - *sums++=a+b; - } -} -#undef DOLINE -#undef ROL - - -void OSystem_SDL::add_dirty_rgn_auto(const byte *buf) { - assert( ((uint32)buf & 3) == 0); - - /* generate a table of the checksums */ - mk_checksums(buf); - - if (!cksum_valid) { - force_full = true; - cksum_valid = true; - } - - /* go through the checksum list, compare it with the previous checksums, - and add all dirty rectangles to a list. try to combine small rectangles - into bigger ones in a simple way */ - if (!force_full) { - int x,y,w; - uint32 *ck = dirty_checksums; - - for(y=0; y!=SCREEN_HEIGHT/8; y++) { - for(x=0; x!=SCREEN_WIDTH/8; x++,ck++) { - if (ck[0] != ck[CKSUM_NUM]) { - /* found a dirty 8x8 block, now go as far to the right as possible, - and at the same time, unmark the dirty status by setting old to new. */ - w=0; - do { - ck[w+CKSUM_NUM] = ck[w]; - w++; - } while (x+w != SCREEN_WIDTH/8 && ck[w] != ck[w+CKSUM_NUM]); - - add_dirty_rect(x*8, y*8, w*8, 8); - - if (force_full) - goto get_out; - } - } - } - } else { - get_out:; - /* Copy old checksums to new */ - memcpy(dirty_checksums + CKSUM_NUM, dirty_checksums, CKSUM_NUM * sizeof(uint32)); - } -} - -void OSystem_SDL::update_screen() { - - /* First make sure the mouse is drawn, if it should be drawn. */ - draw_mouse(); - - /* If the shake position changed, fill the dirty area with blackness */ - if (_current_shake_pos != _new_shake_pos) { - - _current_shake_pos = _new_shake_pos; - - } - - /* Palette update in case we are in "real" 8 bit color mode. - * Must take place after the screen data was updated, since with - * "real" 8bit mode, palatte changes may be visible immediatly, - * and we want to avoid any ugly effects. - */ - if (_palette_changed_last != 0) { - fb2gl.setPalette(_palette_changed_first, - _palette_changed_last - _palette_changed_first); - - _palette_changed_last = 0; - } - - fb2gl.update(sdl_tmpscreen->pixels,320,200,320,0,_current_shake_pos); - -} - -bool OSystem_SDL::show_mouse(bool visible) { - if (_mouse_visible == visible) - return visible; - - bool last = _mouse_visible; - _mouse_visible = visible; - - if (visible) - draw_mouse(); - else - undraw_mouse(); - - return last; -} - -void OSystem_SDL::set_mouse_pos(int x, int y) { - if (x != _mouse_cur_state.x || y != _mouse_cur_state.y) { - _mouse_cur_state.x = x; - _mouse_cur_state.y = y; - undraw_mouse(); - } -} - -void OSystem_SDL::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { - _mouse_cur_state.w = w; - _mouse_cur_state.h = h; - - _mouse_hotspot_x = hotspot_x; - _mouse_hotspot_y = hotspot_y; - - _mouse_data = (byte*)buf; - - undraw_mouse(); -} - -void OSystem_SDL::set_shake_pos(int shake_pos) { - _new_shake_pos = shake_pos; -} - -uint32 OSystem_SDL::get_msecs() { - return SDL_GetTicks(); -} - -void OSystem_SDL::delay_msecs(uint msecs) { - SDL_Delay(msecs); -} - -void *OSystem_SDL::create_thread(ThreadProc *proc, void *param) { - return SDL_CreateThread(proc, param); -} - -int mapKey(int key, byte mod) -{ - if (key >= SDLK_F1 && key <= SDLK_F9) { - return key - SDLK_F1 + 315; - } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { - key &= ~0x20; - } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) - return 0; - return key; -} - -bool OSystem_SDL::poll_event(Event *event) { - SDL_Event ev; - - for(;;) { - if (!SDL_PollEvent(&ev)) - return false; - - switch(ev.type) { - case SDL_KEYDOWN: { - byte b = 0; - if (ev.key.keysym.mod & KMOD_SHIFT) b |= KBD_SHIFT; - if (ev.key.keysym.mod & KMOD_CTRL) b |= KBD_CTRL; - if (ev.key.keysym.mod & KMOD_ALT) b |= KBD_ALT; - event->kbd.flags = b; - - /* internal keypress? */ - if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { - property(PROP_TOGGLE_FULLSCREEN, NULL); - break; - } - - if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) { - quit(); - break; - } - - if (b == (KBD_CTRL|KBD_ALT) && - (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { - Property prop; - prop.gfx_mode = ev.key.keysym.sym - '1'; - property(PROP_SET_GFX_MODE, &prop); - break; - } - - - event->event_code = EVENT_KEYDOWN; - event->kbd.keycode = ev.key.keysym.sym; - event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); - return true; - } - - case SDL_KEYUP: - event->event_code = EVENT_KEYUP; - event->kbd.keycode = ev.key.keysym.sym; - event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); - - return true; - - case SDL_MOUSEMOTION: - event->event_code = EVENT_MOUSEMOVE; - event->mouse.x = ev.motion.x; - event->mouse.y = ev.motion.y; - - event->mouse.x /= scaling; - event->mouse.y /= scaling; - - return true; - - case SDL_MOUSEBUTTONDOWN: - if (ev.button.button == SDL_BUTTON_LEFT) - event->event_code = EVENT_LBUTTONDOWN; - else if (ev.button.button == SDL_BUTTON_RIGHT) - event->event_code = EVENT_RBUTTONDOWN; - else - break; - event->mouse.x = ev.button.x; - event->mouse.y = ev.button.y; - event->mouse.x /= scaling; - event->mouse.y /= scaling; - - return true; - - case SDL_MOUSEBUTTONUP: - if (ev.button.button == SDL_BUTTON_LEFT) - event->event_code = EVENT_LBUTTONUP; - else if (ev.button.button == SDL_BUTTON_RIGHT) - event->event_code = EVENT_RBUTTONUP; - else - break; - event->mouse.x = ev.button.x; - event->mouse.y = ev.button.y; - event->mouse.x /= scaling; - event->mouse.y /= scaling; - return true; - - case SDL_QUIT: - quit(); - } - } -} - -bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { - SDL_AudioSpec desired; - - /* only one format supported at the moment */ - - desired.freq = SAMPLES_PER_SEC; - desired.format = AUDIO_S16SYS; - desired.channels = 2; - desired.samples = 2048; - desired.callback = proc; - desired.userdata = param; - if (SDL_OpenAudio(&desired, NULL) != 0) { - return false; - } - SDL_PauseAudio(0); - return true; -} - - -/* retrieve the 320x200 bitmap currently being displayed */ -void OSystem_SDL::get_320x200_image(byte *buf) { - /* make sure the mouse is gone */ - undraw_mouse(); - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - memcpy(buf, sdl_screen->pixels, SCREEN_WIDTH*SCREEN_HEIGHT); - - SDL_UnlockSurface(sdl_screen); -} - -void OSystem_SDL::hotswap_gfx_mode() { - /* hmm, need to allocate a 320x200 bitmap - * which will contain the "backup" of the screen during the change. - * then draw that to the new screen right after it's setup. - */ - - byte *bak_mem = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT); - - get_320x200_image(bak_mem); - - unload_gfx_mode(); - load_gfx_mode(); - - fb2gl.setPalette(0,256); - fb2gl.update(sdl_tmpscreen->pixels,320,200,320,0,_current_shake_pos); - - /* blit image */ - OSystem_SDL::copy_rect(bak_mem, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - free(bak_mem); - - OSystem_SDL::update_screen(); -} - -uint32 OSystem_SDL::property(int param, Property *value) { - switch(param) { - - case PROP_TOGGLE_FULLSCREEN: - _full_screen ^= true; - SDL_WM_ToggleFullScreen(fb2gl.screen); - return 1; - - case PROP_GET_FULLSCREEN: - return _full_screen; - - case PROP_SET_WINDOW_CAPTION: - SDL_WM_SetCaption(value->caption, value->caption); - return 1; - - case PROP_OPEN_CD: - if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) - cdrom = NULL; - else { - cdrom = SDL_CDOpen(value->cd_num); - /* Did if open? Check if cdrom is NULL */ - if (!cdrom) { - warning("Couldn't open drive: %s\n", SDL_GetError()); - } - } - break; - - case PROP_SET_GFX_MODE: - if (value->gfx_mode >= 7) - return 0; - - _mode = value->gfx_mode; - hotswap_gfx_mode(); - - return 1; - - case PROP_SHOW_DEFAULT_CURSOR: - SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); - break; - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - } - - return 0; -} - -void OSystem_SDL::quit() { - if(cdrom) { - SDL_CDStop(cdrom); - SDL_CDClose(cdrom); - } - unload_gfx_mode(); - exit(1); -} - -void OSystem_SDL::draw_mouse() { - if (_mouse_drawn || !_mouse_visible) - return; - - int x = _mouse_cur_state.x - _mouse_hotspot_x; - int y = _mouse_cur_state.y - _mouse_hotspot_y; - int w = _mouse_cur_state.w; - int h = _mouse_cur_state.h; - byte color; - byte *src = _mouse_data; // Image representing the mouse - byte *bak = _mouse_backup; // Surface used to backup the area obscured by the mouse - byte *dst; // Surface we are drawing into - - // clip the mouse rect, and addjust the src pointer accordingly - if (x < 0) { - w += x; - src -= x; - x = 0; - } - if (y < 0) { - h += y; - src -= y * _mouse_cur_state.w; - y = 0; - } - if (w > SCREEN_WIDTH - x) - w = SCREEN_WIDTH - x; - if (h > SCREEN_HEIGHT - y) - h = SCREEN_HEIGHT - y; - - // Store the bounding box so that undraw mouse can restore the area the - // mouse currently covers to its original content. - _mouse_old_state.x = x; - _mouse_old_state.y = y; - _mouse_old_state.w = w; - _mouse_old_state.h = h; - - // Quick check to see if anything has to be drawn at all - if (w <= 0 || h <= 0) - return; - - // Draw the mouse cursor; backup the covered area in "bak" - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - add_dirty_rect(x, y, w, h); - - dst = (byte *)sdl_screen->pixels + y * SCREEN_WIDTH + x; - while (h > 0) { - int width = w; - while (width > 0) { - *bak++ = *dst; - color = *src++; - if (color != 0xFF) // 0xFF = transparent, don't draw - *dst = color; - dst++; - width--; - } - src += _mouse_cur_state.w - w; - bak += MAX_MOUSE_W - w; - dst += SCREEN_WIDTH - w; - h--; - } - - SDL_UnlockSurface(sdl_screen); - - // Finally, set the flag to indicate the mouse has been drawn - _mouse_drawn = true; -} - -void OSystem_SDL::undraw_mouse() { - if (!_mouse_drawn) - return; - _mouse_drawn = false; - - if (SDL_LockSurface(sdl_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - byte *dst, *bak = _mouse_backup; - const int old_mouse_x = _mouse_old_state.x; - const int old_mouse_y = _mouse_old_state.y; - const int old_mouse_w = _mouse_old_state.w; - const int old_mouse_h = _mouse_old_state.h; - int x,y; - - // No need to do clipping here, since draw_mouse() did that already - - dst = (byte *)sdl_screen->pixels + old_mouse_y * SCREEN_WIDTH + old_mouse_x; - for (y = 0; y < old_mouse_h; ++y, bak += MAX_MOUSE_W, dst += SCREEN_WIDTH) { - for (x = 0; x < old_mouse_w; ++x) { - dst[x] = bak[x]; - } - } - - add_dirty_rect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); - - SDL_UnlockSurface(sdl_screen); -} - -void OSystem_SDL::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */ - cd_stop_time = SDL_GetTicks() + 100; - cd_num_loops = 0; - -} - -void OSystem_SDL::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { - if (!num_loops && !start_frame) - return; - - if (!cdrom) - return; - - if (end_frame > 0) - end_frame+=5; - - cd_track = track; - cd_num_loops = num_loops; - cd_start_frame = start_frame; - - SDL_CDStatus(cdrom); - SDL_CDPlayTracks(cdrom, track, start_frame, 0, end_frame); - cd_end_frame = end_frame; - cd_stop_time = 0; - cd_end_time = SDL_GetTicks() + cdrom->track[track].length * 1000 / CD_FPS; -} - -bool OSystem_SDL::poll_cdrom() { - if (!cdrom) - return false; - - return (cd_num_loops != 0 && (SDL_GetTicks() < cd_end_time || SDL_CDStatus(cdrom) != CD_STOPPED)); -} - -void OSystem_SDL::update_cdrom() { - if (!cdrom) - return; - - if (cd_stop_time != 0 && SDL_GetTicks() >= cd_stop_time) { - SDL_CDStop(cdrom); - cd_num_loops = 0; - cd_stop_time = 0; - return; - } - - if (cd_num_loops == 0 || SDL_GetTicks() < cd_end_time) - return; - - if (cd_num_loops != 1 && SDL_CDStatus(cdrom) != CD_STOPPED) { - // Wait another second for it to be done - cd_end_time += 1000; - return; - } - - if (cd_num_loops > 0) - cd_num_loops--; - - if (cd_num_loops != 0) { - SDL_CDPlayTracks(cdrom, cd_track, cd_start_frame, 0, cd_end_frame); - cd_end_time = SDL_GetTicks() + cdrom->track[cd_track].length * 1000 / CD_FPS; - } -} - -void OSystem_SDL::setup_icon() { - int w, h, ncols, nbytes, i; - unsigned int rgba[256], icon[32 * 32]; - unsigned char mask[32][4]; - - sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); - if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { - warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); - return; - } - for (i = 0; i < ncols; i++) { - unsigned char code; - char color[32]; - unsigned int col; - sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); - if (!strcmp(color, "None")) - col = 0x00000000; - else if (!strcmp(color, "black")) - col = 0xFF000000; - else if (color[0] == '#') { - sscanf(color + 1, "%06x", &col); - col |= 0xFF000000; - } else { - warning("Could not load the icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); - return; - } - - rgba[code] = col; - } - memset(mask, 0, sizeof(mask)); - for (h = 0; h < 32; h++) { - char *line = scummvm_icon[1 + ncols + h]; - for (w = 0; w < 32; w++) { - icon[w + 32 * h] = rgba[line[w]]; - if (rgba[line[w]] & 0xFF000000) { - mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); - } - } - } - - SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); - SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); -} - -void *OSystem_SDL::create_mutex(void) { - return (void *) SDL_CreateMutex(); -} - -void OSystem_SDL::lock_mutex(void *mutex) { - SDL_mutexP((SDL_mutex *) mutex); -} - -void OSystem_SDL::unlock_mutex(void *mutex) { - SDL_mutexV((SDL_mutex *) mutex); -} - -void OSystem_SDL::delete_mutex(void *mutex) { - SDL_DestroyMutex((SDL_mutex *) mutex); -} - - -#ifdef USE_NULL_DRIVER - -/* NULL video driver */ -class OSystem_NULL : public OSystem { -public: - void set_palette(const byte *colors, uint start, uint num) {} - void init_size(uint w, uint h); - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {} - void update_screen() {} - bool show_mouse(bool visible) { return false; } - void set_mouse_pos(int x, int y) {} - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {} - void set_shake_pos(int shake_pos) {} - uint32 get_msecs(); - void delay_msecs(uint msecs); - void *create_thread(ThreadProc *proc, void *param) { return NULL; } - bool poll_event(Event *event) { return false; } - bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} - void quit() { exit(1); } - uint32 property(int param, Property *value) { return 0; } - static OSystem *create(int gfx_mode, bool full_screen); -private: - - uint msec_start; - - uint32 get_ticks(); -}; - -void OSystem_NULL::init_size(uint w, uint h, byte sound) { - msec_start = get_ticks(); -} - -uint32 OSystem_NULL::get_ticks() { - uint a = 0; -#ifdef WIN32 - a = GetTickCount(); -#endif -#ifdef UNIX - struct timeval tv; - gettimeofday(&tv, NULL); - a = tv.tv_sec * 1000 + tv.tv_usec/1000; -#endif - - return a; -} - -void OSystem_NULL::delay_msecs(uint msecs) { -#ifdef WIN32 - Sleep(msecs); -#endif -#ifdef UNIX - usleep(msecs*1000); -#endif -} - -uint32 OSystem_NULL::get_msecs() { - return get_ticks() - msec_start; -} - -OSystem *OSystem_NULL_create() { - return new OSystem_NULL(); -} -#else /* USE_NULL_DRIVER */ - -OSystem *OSystem_NULL_create() { - return NULL; -} - -#endif diff --git a/simon/debug.cpp b/simon/debug.cpp new file mode 100644 index 0000000000..6b1902c6b7 --- /dev/null +++ b/simon/debug.cpp @@ -0,0 +1,769 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +// Simon debug functions +#include "stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" + +#ifdef SIMONDEBUG +#define SIMON2 +#define SIMON2WIN + +static const char *const opcode_name_table[256] = { + /* 0 */ + "|INV_COND", + "IJ|PTRA_PARENT_IS", + "IJ|PTRA_PARENT_ISNOT", + NULL, + /* 4 */ + NULL, + "IJ|PARENT_IS_1", + "IJ|PARENT_ISNOT_1", + "IIJ|PARENT_IS", + /* 8 */ + NULL, + NULL, + NULL, + "VJ|IS_ZERO", + /* 12 */ + "VJ|ISNOT_ZERO", + "VWJ|IS_EQ", + "VWJ|IS_NEQ", + "VWJ|IS_LE", + /* 16 */ + "VWJ|IS_GE", + "VVJ|IS_EQF", + "VVJ|IS_NEQF", + "VVJ|IS_LEF", + /* 20 */ + "VVJ|IS_GEF", + NULL, + NULL, + "WJ|UNK23", + /* 24 */ + NULL, + "IJ|HAS_CHILD_1", + "IJ|HAS_CHILD_2", + "IWJ|ITEM_UNK3_IS", + /* 28 */ + "IBJ|CHILD_HAS_FLAG", + NULL, + NULL, + "I|SET_NO_PARENT", + /* 32 */ + NULL, + "II|SET_PARENT", + NULL, + NULL, + /* 36 */ + "VV|MOVE", + NULL, + NULL, + NULL, + /* 40 */ + NULL, + "V|ZERO", + "VW|SET", + "VW|ADD", + /* 44 */ + "VW|SUB", + "VV|ADDF", + "VV|SUBF", + "VW|MUL", + /* 48 */ + "VW|DIV", + "VV|MULF", + "VV|DIVF", + "VW|MOD", + /* 52 */ + "VV|MODF", + "VW|RANDOM", + NULL, + "I|SET_A_PARENT", + /* 56 */ + "IB|SET_CHILD2_BIT", + "IB|CLEAR_CHILD2_BIT", + "II|MAKE_SIBLING", + "I|INC_UNK3", + /* 60 */ + "I|DEC_UNK3", + "IW|SET_UNK3", + "V|SHOW_INT", + "T|SHOW_STRING_NL", + /* 64 */ + "T|SHOW_STRING", + "WWWWWB|ADD_HITAREA", + "BT|SET_ITEM_NAME", +#if defined SIMON1WIN || defined SIMON2 + "BTw|SET_ITEM_DESC", +#endif +#ifdef SIMON1DOS + "BT|SET_ITEM_DESC", +#endif + /* 68 */ + "x|HALT", + "x|RET1", + "V|SHOW_STRING_AR3", + "W|START_SUB", + /* 72 */ + NULL, + NULL, + NULL, + NULL, + /* 76 */ + "WW|ADD_TIMEOUT", + "J|IS_M1_EMPTY", + "J|IS_M3_EMPTY", + "ITJ|CHILD_FR2_IS", + /* 80 */ + "IIJ|IS_ITEM_EQ", + NULL, + "B|UNK82", + "|RETM10", + /* 84 */ + NULL, + NULL, + NULL, + "W|UNK87", + /* 88 */ + "|OR_SCRIPT_WORD_10", + "|AND_SCRIPT_WORD_10", + "IB|SET_M_TO_PARENT", + "IB|SET_M_TO_SIBLING", + /* 92 */ + "IB|SET_M_TO_CHILD", + NULL, + NULL, + NULL, + /* 96 */ + "WB|UNK96", + "W|LOAD_VGA", +#ifdef SIMON2 + "WWBWWW|START_VGA", +#else + "WBWWW|START_VGA", +#endif +#ifdef SIMON2 + "WW|KILL_THREAD", +#else + "W|KILL_THREAD", +#endif + /* 100 */ + "|VGA_RESET", + "BWWWWWW|UNK101", + "B|UNK102", + "|UNK103", + /* 104 */ + "B|UNK104", + NULL, + NULL, + "WWWWWIW|ADD_ITEM_HITAREA", + /* 108 */ + "W|DEL_HITAREA", + "W|CLEAR_HITAREA_0x40", + "W|SET_HITAREA_0x40", + "WWW|SET_HITAREA_XY", + /* 112 */ + NULL, + NULL, + "IB|UNK114", + "IBJ|HAS_FLAG", + /* 116 */ + "IB|SET_FLAG", + "IB|CLEAR_FLAG", + NULL, + "W|WAIT_VGA", + /* 120 */ + "W|UNK120", + "BI|SET_VGA_ITEM", + NULL, + NULL, + /* 124 */ + NULL, + "IJ|IS_SIBLING_WITH_A", + "IBB|UNK126", + "WW|UNK127", + /* 128 */ + "W|GET_DUMMY_WORD", + "W|GET_WORD_COND_TRUE", + "Bww|UNK131", + NULL, /* opcode 131 doesn't exist */ + /* 132 */ + "|SAVE_GAME", + "|LOAD_GAME", + "|DUMMYPROC_134", + "|QUIT_IF_USER_PRESSES_Y", + /* 136 */ + "IV|GET_ITEM_UNK3", + "B|UNK137", + "|VGA_POINTER_OP_4", + "II|SET_PARENT_SPECIAL", + /* 140 */ + "|DEL_TE_AND_ADD_ONE", + "BI|SET_M1_OR_M3", + "WJ|IS_HITAREA_0x40_CLEAR", + "I|START_ITEM_SUB", + /* 144 */ + NULL, + NULL, + NULL, + NULL, + /* 148 */ + NULL, + NULL, + NULL, + "BI|SET_ARRAY6_TO", + /* 152 */ + "BB|SET_M1_M3_TO_ARRAY6", + "B|SET_BIT", + "B|CLEAR_BIT", + "BJ|IS_BIT_CLEAR", + /* 156 */ + "BJ|IS_BIT_SET", + "IBB|GET_ITEM_PROP", + "IBW|SET_ITEM_PROP", + NULL, + /* 160 */ + "B|UNK160", + "BWBW|SETUP_TEXT", +#if defined SIMON1WIN || defined SIMON2 + "BBTW|PRINT_STR", +#endif +#ifdef SIMON1DOS + "BBT|PRINT_STR", +#endif + "W|SOUND_1", + /* 164 */ + "|UNK164", + "IWWJ|ITEM_UNK1_UNK2_IS", + "B|SET_BIT2", + "B|CLEAR_BIT2", + /* 168 */ + "BJ|IS_BIT2_CLEAR", + "BJ|IS_BIT2_SET", + NULL, + NULL, + /* 172 */ + NULL, + NULL, + NULL, + "|VGA_POINTER_OP_1", + /* 176 */ + "|VGA_POINTER_OP_2", + "BBI|UNK177", + "WWBB|PATHFIND", + "BBB|UNK179", + /* 180 */ + "|FORCE_UNLOCK", + "|FORCE_LOCK", + "|READ_VGARES_328", + "|READ_VGARES_23", + /* 184 */ + "W|CLEAR_VGAPOINTER_ENTRY", + "W|DUMMY_185", + "|VGA_POINTER_OP_3", + "|FADE_TO_BLACK", +#ifdef SIMON2 + /* 188 */ + "BSJ|STRING2_IS", + "|UNK189", + "B|UNK190", +#endif +}; + +byte *SimonState::dumpOpcode(byte *p) +{ + byte opcode; + const char *s, *st; + + opcode = *p++; + if (opcode == 255) + return NULL; + st = s = opcode_name_table[opcode]; + if (s == NULL) { + error("INVALID OPCODE %d\n", opcode); + return NULL; + } + while (*st != '|') + st++; + fprintf(_dump_file, "%s ", st + 1); + + for (;;) { + switch (*s++) { + case 'x': + fprintf(_dump_file, "\n"); + return NULL; + case '|': + fprintf(_dump_file, "\n"); + return p; + case 'B':{ + byte b = *p++; + if (b == 255) + fprintf(_dump_file, "[%d] ", *p++); + else + fprintf(_dump_file, "%d ", b); + break; + } + case 'V':{ + byte b = *p++; + if (b == 255) + fprintf(_dump_file, "[[%d]] ", *p++); + else + fprintf(_dump_file, "[%d] ", b); + break; + } + + case 'W':{ + int n = (int16)((p[0] << 8) | p[1]); + p += 2; + if (n >= 30000 && n < 30512) + fprintf(_dump_file, "[%d] ", n - 30000); + else + fprintf(_dump_file, "%d ", n); + break; + } + + case 'w':{ + int n = (int16)((p[0] << 8) | p[1]); + p += 2; + fprintf(_dump_file, "%d ", n); + break; + } + + case 'I':{ + int n = (int16)((p[0] << 8) | p[1]);; + p += 2; + if (n == -1) + fprintf(_dump_file, "ITEM_M1 "); + else if (n == -3) + fprintf(_dump_file, "ITEM_M3 "); + else if (n == -5) + fprintf(_dump_file, "ITEM_1 "); + else if (n == -7) + fprintf(_dump_file, "ITEM_0 "); + else if (n == -9) + fprintf(_dump_file, "ITEM_A_PARENT "); + else + fprintf(_dump_file, "<%d> ", n); + break; + } + case 'J':{ + fprintf(_dump_file, "-> "); + } + break; + + + case 'T':{ + uint n = ((p[0] << 8) | p[1]); + p += 2; + if (n != 0xFFFF) + fprintf(_dump_file, "\"%s\"(%d) ", getStringPtrByID(n), n); + else + fprintf(_dump_file, "NULL_STRING "); + } + break; + } + } +} + +void SimonState::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) +{ + byte *p; + + + printf("; ****\n"); + + p = (byte *)sl + SUBROUTINE_LINE_SMALL_SIZE; + if (sub->id == 0) { + fprintf(_dump_file, "; cond_a=%d, cond_b=%d, cond_c=%d\n", sl->cond_a, sl->cond_b, sl->cond_c); + p = (byte *)sl + SUBROUTINE_LINE_BIG_SIZE; + } + + for (;;) { + p = dumpOpcode(p); + if (p == NULL) + break; + } +} + +void SimonState::dumpSubroutine(Subroutine *sub) +{ + SubroutineLine *sl; + + fprintf(_dump_file, + "\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, + sub->id); + sl = (SubroutineLine *)((byte *)sub + sub->first); + for (; (byte *)sl != (byte *)sub; sl = (SubroutineLine *)((byte *)sub + sl->next)) { + dumpSubroutineLine(sl, sub); + } + fprintf(_dump_file, "\nEND ******************************************\n"); + fflush(_dump_file); +} + +void SimonState::dumpSubroutines() +{ + Subroutine *sub = _subroutine_list; + for (; sub; sub = sub->next) { + dumpSubroutine(sub); + } +} + +const char *const video_opcode_name_table[] = { + /* 0 */ + "x|RET", + "ddd|DUMMY", + "d|CALL", + "ddddd|NEW_THREAD", + /* 4 */ + "ddd|DUMMY_2", + "vd|SKIP_IF_NEQ", + "d|SKIP_IFN_SIB_WITH_A", + "d|SKIP_IF_SIB_WITH_A", + /* 8 */ + "dd|SKIP_IF_PARENT_IS", + "dd|SKIP_IF_UNK3_IS", +#ifdef SIMON2 + "ddddb|DRAW", +#else + "ddddd|DRAW", +#endif + "|CLEAR_PATHFIND_ARRAY", + /* 12 */ +#ifdef SIMON2 + "b|DELAY", +#else + "d|DELAY", +#endif + "d|OFFSET_X", + "d|OFFSET_Y", + "d|IDENT_WAKEUP", + /* 16 */ + "d|IDENT_SLEEP", + "dq|SET_PATHFIND_ITEM", + "i|JUMP_REL", + "|CHAIN_TO", + /* 20 */ + "dd|SET_CODE_WORD", + "i|JUMP_IF_CODE_WORD", + "dd|SET_PAL", + "d|SET_PRI", + /* 24 */ + "diid|SET_IMG_XY", + "x|HALT_THREAD", + "ddddd|SET_WINDOW", + "|RESET", + /* 28 */ + "dddd|DUMMY_3", + "|STOP_ALL_SOUNDS", + "d|SET_BASE_DELAY", + "d|SET_PALETTE_MODE", + /* 32 */ + "vv|COPY_VAR", + "|FORCE_UNLOCK", + "|FORCE_LOCK", + "dd|DUMMY_4", + /* 36 */ + "dd|SAVELOAD_THING", + "v|OFFSET_Y_F", + "v|SKIP_IF_VAR_ZERO", + "vd|SET_VAR", + /* 40 */ + "vd|ADD_VAR", + "vd|SUB_VAR", + "vd|SLEEP_UNTIL_SET", + "d|SKIP_IF_BIT_CLEAR", + /* 44 */ + "d|SKIP_IF_BIT_SET", + "v|SET_X_F", + "v|SET_Y_F", + "vv|ADD_VAR_F", + /* 48 */ + "|VC_48", + "d|SET_BIT", + "d|CLEAR_BIT", + "d|CLEAR_HITAREA_BIT_0x40", + /* 52 */ + "d|VC_52", + "dd|DUMMY_5", + "ddd|DUMMY_6", + "ddd|OFFSET_HIT_AREA", + /* 56 */ +#ifdef SIMON2 + "i|SLEEP_EX", +#else + "|DUMMY_7", +#endif + "|DUMMY_8", + "|DUMMY_9", +#ifdef SIMON2 + "ddd|KILL_MULTI_THREAD", +#else + "|SKIP_IF_SOUND??", +#endif + /* 60 */ +#ifdef SIMON2 + "dd|KILL_THREAD", +#else + "d|KILL_THREAD", +#endif + "ddd|INIT_SPRITE", + "|PALETTE_THING", + "|PALETTE_THING_2", +#ifdef SIMON2 + /* 64 */ + "|UNK64", + "|UNK65", + "|UNK66", + "|UNK67", + /* 68 */ + "|UNK68", + "dd|UNK69", + "dd|UNK70", + "|UNK71", + /* 72 */ + "dd|UNK72", + "bb|UNK73", + "bb|UNK74", +#endif +}; + +void SimonState::dump_video_script(byte *src, bool one_opcode_only) +{ + uint opcode; + const char *str, *strn; + + do { + if (!(_game & GAME_SIMON2)) { + opcode = READ_BE_UINT16_UNALIGNED(src); + src += 2; + } else { + opcode = *src++; + } + + if (opcode >= gss->NUM_VIDEO_OP_CODES) { + error("Invalid opcode %x\n", opcode); + return; + } + + strn = str = video_opcode_name_table[opcode]; + while (*strn != '|') + strn++; + fprintf(_dump_file, "%.2d: %s ", opcode, strn + 1); + + for (; *str != '|'; str++) { + switch (*str) { + case 'x': + fprintf(_dump_file, "\n"); + return; + case 'b': + fprintf(_dump_file, "%d ", *src++); + break; + case 'd': + fprintf(_dump_file, "%d ", READ_BE_UINT16_UNALIGNED(src)); + src += 2; + break; + case 'v': + fprintf(_dump_file, "[%d] ", READ_BE_UINT16_UNALIGNED(src)); + src += 2; + break; + case 'i': + fprintf(_dump_file, "%d ", (int16)READ_BE_UINT16_UNALIGNED(src)); + src += 2; + break; + case 'q': + while (READ_BE_UINT16_UNALIGNED(src) != 999) { + fprintf(_dump_file, "(%d,%d) ", READ_BE_UINT16_UNALIGNED(src), + READ_BE_UINT16_UNALIGNED(src + 2)); + src += 4; + } + src++; + break; + default: + error("Invalid fmt string '%c' in decompile VGA", *str); + } + } + + fprintf(_dump_file, "\n"); + } while (!one_opcode_only); +} + +void SimonState::dump_vga_file(byte *vga) +{ + { + byte *pp; + byte *p; + int count; + + pp = vga; + p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) pp)->hdr2_start); + count = READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_count); + p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_table); + while (--count >= 0) { + int id = READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->id); + + dump_vga_script_always(vga + + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->script_offs), + id / 100, id); + p += sizeof(VgaFile1Struct0x6); + } + } + + { + byte *bb, *b; + int c; + + bb = vga; + b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) bb)->hdr2_start); + c = READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk1); + b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk2_offs); + + while (--c >= 0) { + int id = READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->id); + + dump_vga_script_always(vga + + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->script_offs), + id / 100, id); + b += sizeof(VgaFile1Struct0x8); + } + } +} + + + +const byte bmp_hdr[] = { + 0x42, 0x4D, + 0x9E, 0x14, 0x00, 0x00, /* offset 2, file size */ + 0x00, 0x00, 0x00, 0x00, + 0x36, 0x04, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, + + 0x3C, 0x00, 0x00, 0x00, /* image width */ + 0x46, 0x00, 0x00, 0x00, /* image height */ + 0x01, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +void dump_bmp(const char *filename, int w, int h, const byte *bytes, const uint32 *palette) +{ + FILE *out = fopen(filename, "wb"); + byte my_hdr[sizeof(bmp_hdr)]; + int i; + + if (out == NULL) { + printf("DUMP ERROR\n"); + return; + } + + memcpy(my_hdr, bmp_hdr, sizeof(bmp_hdr)); + + *(uint32 *)(my_hdr + 2) = w * h + 1024 + sizeof(bmp_hdr); + *(uint32 *)(my_hdr + 18) = w; + *(uint32 *)(my_hdr + 22) = h; + + + fwrite(my_hdr, 1, sizeof(my_hdr), out); + + for (i = 0; i != 256; i++, palette++) { + byte color[4]; + color[0] = (byte)(*palette >> 16); + color[1] = (byte)(*palette >> 8); + color[2] = (byte)(*palette); + color[3] = 0; + fwrite(color, 1, 4, out); + } + + while (--h >= 0) { + fwrite(bytes + h * ((w + 3) & ~3), ((w + 3) & ~3), 1, out); + } + + fclose(out); +} + +void dump_bitmap(const char *filename, byte *offs, int w, int h, int flags, const byte *palette, + byte base) +{ + /* allocate */ + byte *b = (byte *)malloc(w * h); + int i, j; + + VC10_state state; + + state.depack_cont = -0x80; + state.depack_src = offs; + state.dh = h; + state.y_skip = 0; + + for (i = 0; i != w; i += 2) { + byte *c = vc_10_depack_column(&state); + for (j = 0; j != h; j++) { + byte pix = c[j]; + b[j * w + i] = (pix >> 4) | base; + b[j * w + i + 1] = (pix & 0xF) | base; + + } + } + + dump_bmp(filename, w, h, b, (uint32 *)palette); + free(b); +} + +void SimonState::dump_single_bitmap(int file, int image, byte *offs, int w, int h, byte base) +{ +/* Only supported for win32 atm. mkdir doesn't work otherwise. */ +#if defined (WIN32) && !defined(_WIN32_WCE) + char buf[255], buf2[255]; + struct stat statbuf; + + sprintf(buf, "bmp_%d\\%d.bmp", file, image); + + if (stat(buf, &statbuf) == 0) + return; + + sprintf(buf2, "bmp_%d", file); + mkdir(buf2); + + dump_bitmap(buf, offs, w, h, 0, _palette, base); +#endif +} + +void SimonState::dump_vga_script_always(byte *ptr, uint res, uint sprite_id) +{ + fprintf(_dump_file, "; address=%x, vgafile=%d vgasprite=%d\n", + ptr - _vga_buffer_pointers[res].vgaFile1, res, sprite_id); + dump_video_script(ptr, false); + fprintf(_dump_file, "; end\n"); +} + +void SimonState::dump_vga_script(byte *ptr, uint res, uint sprite_id) +{ + dump_Vga_script_always(ptr, res, sprite_id); +} + + +#endif diff --git a/simon/intern.h b/simon/intern.h new file mode 100644 index 0000000000..2536534844 --- /dev/null +++ b/simon/intern.h @@ -0,0 +1,171 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef SIMON_INTERN_H +#define SIMON_INTERN_H + +struct Child { + Child *next; + uint16 type; +}; + +struct Child1 : Child { + uint16 subroutine_id; + uint16 fr2; + uint16 array[1]; +}; + +struct Child2 : Child { + uint16 string_id; + uint32 avail_props; + int16 array[1]; +}; + +struct Child3 : Child { +}; + +struct Child9 : Child { + uint16 array[4]; +}; + +enum { + CHILD1_SIZE = sizeof(Child1) - sizeof(uint16), + CHILD2_SIZE = sizeof(Child2) - sizeof(int16) +}; + + +struct Item { + uint16 parent; + uint16 child; + uint16 sibling; + int16 unk1; + int16 unk2; + int16 unk3; /* signed int */ + uint16 unk4; + uint16 xxx_1; /* unused? */ + Child *children; +}; + +struct Subroutine { + uint16 id; /* subroutine ID */ + uint16 first; /* offset from subroutine start to first subroutine line */ + Subroutine *next; /* next subroutine in linked list */ +}; + +struct FillOrCopyDataEntry { + Item *item; + uint16 hit_area; + uint16 xxx_1; +}; + +struct FillOrCopyData { + int16 unk1; + Item *item_ptr; + FillOrCopyDataEntry e[64]; + int16 unk3, unk4; + uint16 unk2; +}; + +struct FillOrCopyStruct { + byte mode; + byte flags; + uint16 x, y; + uint16 width, height; + uint16 textColumn, textRow; + uint8 textColumnOffset, textLength, textMaxLength; + uint8 fill_color, text_color, unk5; + FillOrCopyData *fcs_data; +}; +// note on text offset: +// the actual x-coordinate is: textColumn * 8 + textColumnOffset +// the actual y-coordinate is: textRow * 8 + + +enum { + SUBROUTINE_LINE_SMALL_SIZE = 2, + SUBROUTINE_LINE_BIG_SIZE = 8, +}; + +struct SubroutineLine { + uint16 next; + int16 cond_a; + int16 cond_b; + int16 cond_c; +}; + +struct TimeEvent { + uint32 time; + uint16 subroutine_id; + TimeEvent *next; +}; + +struct VgaFile1Header { + uint16 x_1, x_2; + uint16 hdr2_start; + uint16 x_3, x_4; +}; + +struct VgaFile1Header2 { + uint16 x_1; + uint16 unk1; + uint16 x_2; + uint16 id_count; + uint16 x_3; + uint16 unk2_offs; + uint16 x_4; + uint16 id_table; + uint16 x_5; +}; + +struct VgaFile1Struct0x8 { + uint16 id; + uint16 x_1; + uint16 x_2; + uint16 script_offs; +}; + +struct VgaFile1Struct0x6 { + uint16 id; + uint16 x_2; + uint16 script_offs; +}; + + +struct GameSpecificSettings { + uint VGA_DELAY_BASE; + uint TABLE_INDEX_BASE; + uint TEXT_INDEX_BASE; + uint NUM_GAME_OFFSETS; + uint NUM_VIDEO_OP_CODES; + uint VGA_MEM_SIZE; + uint TABLES_MEM_SIZE; + uint NUM_VOICE_RESOURCES; + uint NUM_EFFECTS_RESOURCES; + uint MUSIC_INDEX_BASE; + uint SOUND_INDEX_BASE; + const char *gme_filename; + const char *wav_filename; + const char *wav_filename2; + const char *effects_filename; + const char *gamepc_filename; +}; + +#endif diff --git a/simon/items.cpp b/simon/items.cpp new file mode 100644 index 0000000000..4baeae0ec8 --- /dev/null +++ b/simon/items.cpp @@ -0,0 +1,1628 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +// Item script opcodes for Simon1/Simon2 +#include "stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" + +#ifdef _WIN32_WCE + +extern bool toolbar_drawn; +extern bool draw_keyboard; + +#endif + +int SimonState::runScript() +{ + byte opcode; + bool flag, condition; + + do { +#ifdef DUMP_CONTINOUS_MAINSCRIPT + dumpOpcode(_code_ptr); +#endif + + opcode = getByte(); + if (opcode == 0xFF) + return 0; + + if (_run_script_return_1) + return 1; + + /* Invert condition? */ + flag = false; + if (opcode == 0) { + flag = true; + opcode = getByte(); + if (opcode == 0xFF) + return 0; + } + + condition = true; + + switch (opcode) { + case 1:{ /* ptrA parent is */ + condition = (getItem1Ptr()->parent == getNextItemID()); + } + break; + + case 2:{ /* ptrA parent is not */ + condition = (getItem1Ptr()->parent != getNextItemID()); + } + break; + + case 5:{ /* parent is 1 */ + condition = (getNextItemPtr()->parent == getItem1ID()); + } + break; + + case 6:{ /* parent isnot 1 */ + condition = (getNextItemPtr()->parent != getItem1ID()); + } + break; + + case 7:{ /* parent is */ + Item *item = getNextItemPtr(); + condition = (item->parent == getNextItemID()); + } + break; + + case 11:{ /* is zero */ + condition = (getNextVarContents() == 0); + } + break; + + case 12:{ /* isnot zero */ + condition = (getNextVarContents() != 0); + } + break; + + case 13:{ /* equal */ + uint tmp = getNextVarContents(); + condition = (tmp == getVarOrWord()); + } + break; + + case 14:{ /* not equal */ + uint tmp = getNextVarContents(); + condition = (tmp != getVarOrWord()); + } + break; + + case 15:{ /* is greater */ + uint tmp = getNextVarContents(); + condition = (tmp > getVarOrWord()); + } + break; + + case 16:{ /* is less */ + uint tmp = getNextVarContents(); + condition = (tmp < getVarOrWord()); + } + break; + + case 17:{ /* is eq f */ + uint tmp = getNextVarContents(); + condition = (tmp == getNextVarContents()); + } + break; + + case 18:{ /* is not equal f */ + uint tmp = getNextVarContents(); + condition = (tmp != getNextVarContents()); + } + break; + + case 19:{ /* is greater f */ + uint tmp = getNextVarContents(); + condition = (tmp < getNextVarContents()); + } + break; + + case 20:{ /* is less f */ + uint tmp = getNextVarContents(); + condition = (tmp > getNextVarContents()); + } + break; + + case 23:{ + condition = o_unk_23(getVarOrWord()); + } + break; + + case 25:{ /* has child of type 1 */ + condition = hasChildOfType1(getNextItemPtr()); + } + break; + + case 26:{ /* has child of type 2 */ + condition = hasChildOfType2(getNextItemPtr()); + } + break; + + case 27:{ /* item unk3 is */ + Item *item = getNextItemPtr(); + condition = ((uint) item->unk3 == getVarOrWord()); + } + break; + + case 28:{ /* item has prop */ + Child2 *child = findChildOfType2(getNextItemPtr()); + byte num = getVarOrByte(); + condition = child != NULL && (child->avail_props & (1 << num)) != 0; + } break; + + case 31:{ /* set no parent */ + setItemParent(getNextItemPtr(), NULL); + } + break; + + case 33:{ /* set item parent */ + Item *item = getNextItemPtr(); + setItemParent(item, getNextItemPtr()); + } + break; + + case 36:{ /* copy var */ + uint value = getNextVarContents(); + writeNextVarContents(value); + } + break; + + case 41:{ /* zero var */ + writeNextVarContents(0); + } + break; + + case 42:{ /* set var */ + uint var = getVarOrByte(); + writeVariable(var, getVarOrWord()); + } + break; + + case 43:{ /* add */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) + getVarOrWord()); + } + break; + + case 44:{ /* sub */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) - getVarOrWord()); + } + break; + + case 45:{ /* add f */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) + getNextVarContents()); + } + break; + + case 46:{ /* sub f */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) - getNextVarContents()); + } + break; + + case 47:{ /* mul */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) * getVarOrWord()); + } + break; + + case 48:{ /* div */ + uint var = getVarOrByte(); + int value = getVarOrWord(); + if (value == 0) + error("Division by zero in div"); + writeVariable(var, readVariable(var) / value); + } + break; + + case 49:{ /* mul f */ + uint var = getVarOrByte(); + writeVariable(var, readVariable(var) * getNextVarContents()); + } + break; + + case 50:{ /* div f */ + uint var = getVarOrByte(); + int value = getNextVarContents(); + if (value == 0) + error("Division by zero in div f"); + writeVariable(var, readVariable(var) / value); + } + break; + + case 51:{ /* mod */ + uint var = getVarOrByte(); + int value = getVarOrWord(); + if (value == 0) + error("Division by zero in mod"); + writeVariable(var, readVariable(var) % value); + } + break; + + case 52:{ /* mod f */ + uint var = getVarOrByte(); + int value = getNextVarContents(); + if (value == 0) + error("Division by zero in mod f"); + writeVariable(var, readVariable(var) % value); + } + break; + + case 53:{ /* random */ + uint var = getVarOrByte(); + uint value = (uint16)getVarOrWord(); + uint rand_value; + + for (;;) { + uint value_2 = value; + rand_value = rand() & 0x7FFF; + + if (value == 0) + error("Invalid random range"); + + value = 0x8000 / value; + + if (value == 0) + error("Invalid random range"); + + if (rand_value / value != value_2) + break; + + value = value_2; + } + + writeVariable(var, rand_value / value); + } + break; + + case 55:{ /* set itemA parent */ + setItemParent(getItem1Ptr(), getNextItemPtr()); + } + break; + + case 56:{ /* set child2 fr bit */ + Child2 *child = findChildOfType2(getNextItemPtr()); + int value = getVarOrByte(); + if (child != NULL && value >= 0x10) + child->avail_props |= 1 << value; + } + break; + + case 57:{ /* clear child2 fr bit */ + Child2 *child = findChildOfType2(getNextItemPtr()); + int value = getVarOrByte(); + if (child != NULL && value >= 0x10) + child->avail_props &= ~(1 << value); + } + break; + + case 58:{ /* make siblings */ + Item *item = getNextItemPtr(); + setItemParent(item, derefItem(getNextItemPtr()->parent)); + } + break; + + case 59:{ /* item inc unk3 */ + Item *item = getNextItemPtr(); + if (item->unk3 <= 30000) + setItemUnk3(item, item->unk3 + 1); + } + break; + + case 60:{ /* item dec unk3 */ + Item *item = getNextItemPtr(); + if (item->unk3 >= 0) + setItemUnk3(item, item->unk3 - 1); + } + break; + + case 61:{ /* item set unk3 */ + Item *item = getNextItemPtr(); + int value = getVarOrWord(); + if (value < 0) + value = 0; + if (value > 30000) + value = 30000; + setItemUnk3(item, value); + } + break; + + case 62:{ /* show int */ + showMessageFormat("%d", getNextVarContents()); + } + break; + + case 63:{ /* show string nl */ + showMessageFormat("%s\n", getStringPtrByID(getNextStringID())); + } + break; + + case 64:{ /* show string */ + showMessageFormat("%s", getStringPtrByID(getNextStringID())); + } + break; + + case 65:{ /* add hit area */ + int id = getVarOrWord(); + int x = getVarOrWord(); + int y = getVarOrWord(); + int w = getVarOrWord(); + int h = getVarOrWord(); + int number = getVarOrByte(); + if (number < 20) + addNewHitArea(id, x, y, w, h, (number << 8) + 129, 0xD0, _dummy_item_2); + } + break; + + case 66:{ /* set array 2 */ + uint var = getVarOrByte(); + uint string_id = getNextStringID(); + if (var < 20) + _stringid_array_2[var] = string_id; + } + break; + + case 67:{ /* set array 3 and 4 */ + if (_game == GAME_SIMON1WIN || _game & GAME_SIMON2) { + uint var = getVarOrByte(); + uint string_id = getNextStringID(); + uint value = getNextWord(); + if (var < 20) { + _stringid_array_3[var] = string_id; + _array_4[var] = value; + } + } else { + uint var = getVarOrByte(); + uint string_id = getNextStringID(); + if (var < 20) { + _stringid_array_3[var] = string_id; + } + } + } + break; + + case 68:{ /* exit interpreter */ + error("Exit interpreter opcode"); + } + break; + + case 69:{ /* return 1 */ + return 1; + } + + case 70:{ /* show string from array */ + const char *str = (const char *)getStringPtrByID(_stringid_array_3[getVarOrByte()]); + + if (_game & GAME_SIMON2) { + writeVariable(51, strlen(str) / 53 * 8 + 8); + } + + showMessageFormat("%s\n", str); + } + break; + + case 71:{ /* start subroutine */ + Subroutine *sub = getSubroutineByID(getVarOrWord()); + if (sub != NULL) + startSubroutine(sub); + } + break; + + case 76:{ /* add event */ + uint timeout = getVarOrWord(); + addTimeEvent(timeout, getVarOrWord()); + } + break; + + case 77:{ /* has item minus 1 */ + condition = _subject_item != NULL; + } + break; + + case 78:{ /* has item minus 3 */ + condition = _object_item != NULL; + } + break; + + case 79:{ /* childstruct fr2 is */ + Child2 *child = findChildOfType2(getNextItemPtr()); + uint string_id = getNextStringID(); + condition = (child != NULL) && child->string_id == string_id; + } + break; + + case 80:{ /* item equal */ + condition = getNextItemPtr() == getNextItemPtr(); + } + break; + + case 82:{ /* dummy opcode? */ + getVarOrByte(); + } + break; + + case 83:{ /* restart subroutine */ + return -10; + } + + case 87:{ /* dummy opcode? */ + getNextStringID(); + } + break; + + case 88:{ /* or_lock_word */ + _lock_word |= 0x10; + } + break; + + case 89:{ /* and lock word */ + _lock_word &= ~0x10; + } + break; + + case 90:{ /* set minusitem to parent */ + Item *item = derefItem(getNextItemPtr()->parent); + switch (getVarOrByte()) { + case 0: + _object_item = item; + break; + case 1: + _subject_item = item; + break; + default: + error("set minusitem to parent, invalid subcode"); + } + } + break; + + case 91:{ /* set minusitem to sibling */ + Item *item = derefItem(getNextItemPtr()->sibling); + switch (getVarOrByte()) { + case 0: + _object_item = item; + break; + case 1: + _subject_item = item; + break; + default: + error("set minusitem to sibling, invalid subcode"); + } + } + break; + + case 92:{ /* set minusitem to child */ + Item *item = derefItem(getNextItemPtr()->child); + switch (getVarOrByte()) { + case 0: + _object_item = item; + break; + case 1: + _subject_item = item; + break; + default: + error("set minusitem to child, invalid subcode"); + } + } + break; + + case 96:{ + uint val = getVarOrWord(); + o_set_video_mode(getVarOrByte(), val); + } + break; + + case 97:{ /* load vga */ + ensureVgaResLoadedC(getVarOrWord()); + } + break; + + case 98:{ + if (!(_game & GAME_SIMON2)) { + uint a = getVarOrWord(); + uint b = getVarOrByte(); + uint c = getVarOrWord(); + uint d = getVarOrWord(); + uint f = getVarOrWord(); + start_vga_code(b, a / 100, a, c, d, f); + } else { + uint a = getVarOrWord(); + uint b = getVarOrWord(); + uint c = getVarOrByte(); + uint d = getVarOrWord(); + uint e = getVarOrWord(); + uint f = getVarOrWord(); + start_vga_code(c, a, b, d, e, f); + } + } + break; + + case 99:{ + if (!(_game & GAME_SIMON2)) { + o_unk_99_simon1(getVarOrWord()); + } else { + uint a = getVarOrWord(); + uint b = getVarOrWord(); + o_unk_99_simon2(a, b); + } + } + break; + + case 100:{ + o_vga_reset(); + } + break; + + case 101:{ + uint a = getVarOrByte(); + uint b = getVarOrWord(); + uint c = getVarOrWord(); + uint d = getVarOrWord(); + uint e = getVarOrWord(); + uint f = getVarOrWord(); + uint g = getVarOrWord(); + o_unk26_helper(a, b, c, d, e, f, g, 0); + } + break; + + case 102:{ + fcs_unk_2(getVarOrByte() & 7); + } + break; + + case 103:{ + o_unk_103(); + } + break; + + case 104:{ + fcs_delete(getVarOrByte() & 7); + } + break; + + case 107:{ /* ADD_ITEM_HITAREA(id,x,y,w,h,item,unk3) */ + uint flags = 0; + uint id = getVarOrWord(); + uint params = id / 1000; + uint x, y, w, h, unk3; + Item *item; + + id = id % 1000; + + if (params & 1) + flags |= 8; + if (params & 2) + flags |= 4; + if (params & 4) + flags |= 0x80; + if (params & 8) + flags |= 1; + if (params & 16) + flags |= 0x10; + + x = getVarOrWord(); + y = getVarOrWord(); + w = getVarOrWord(); + h = getVarOrWord(); + item = getNextItemPtrStrange(); + unk3 = getVarOrWord(); + if (x >= 1000) { + unk3 += 0x4000; + x -= 1000; + } + addNewHitArea(id, x, y, w, h, flags, unk3, item); + } + break; + + case 108:{ /* delete hitarea */ + delete_hitarea(getVarOrWord()); + } + break; + + case 109:{ /* clear hitarea bit 0x40 */ + clear_hitarea_bit_0x40(getVarOrWord()); + } + break; + + case 110:{ /* set hitarea bit 0x40 */ + set_hitarea_bit_0x40(getVarOrWord()); + } + break; + + case 111:{ /* set hitarea xy */ + uint hitarea_id = getVarOrWord(); + uint x = getVarOrWord(); + uint y = getVarOrWord(); + set_hitarea_x_y(hitarea_id, x, y); + } + break; + + case 114:{ + Item *item = getNextItemPtr(); + uint fcs_index = getVarOrByte(); + lock(); + fcs_unk_proc_1(fcs_index, item, 0, 0); + unlock(); + } + break; + + case 115:{ /* item has flag */ + Item *item = getNextItemPtr(); + condition = (item->unk4 & (1 << getVarOrByte())) != 0; + } + break; + + case 116:{ /* item set flag */ + Item *item = getNextItemPtr(); + item->unk4 |= (1 << getVarOrByte()); + } + break; + + case 117:{ /* item clear flag */ + Item *item = getNextItemPtr(); + item->unk4 &= ~(1 << getVarOrByte()); + } + break; + + case 119:{ /* WAIT_VGA */ + uint var = getVarOrWord(); + _scriptvar_2 = (var == 200); + + if (var != 200 || !_skip_vga_wait) + o_wait_for_vga(var); + _skip_vga_wait = false; + } + break; + + case 120:{ + o_unk_120(getVarOrWord()); + } + break; + + case 121:{ /* SET_VGA_ITEM */ + uint slot = getVarOrByte(); + _vc_item_array[slot] = getNextItemPtr(); + } + break; + + case 125:{ /* item is sibling with item 1 */ + Item *item = getNextItemPtr(); + condition = (getItem1Ptr()->parent == item->parent); + } + break; + + case 126:{ + Item *item = getNextItemPtr(); + uint fcs_index = getVarOrByte(); + uint a = 1 << getVarOrByte(); + lock(); + fcs_unk_proc_1(fcs_index, item, 1, a); + unlock(); + } + break; + + case 127:{ /* deals with music */ + o_unk_127(); + } + break; + + case 128:{ /* dummy instruction? */ + getVarOrWord(); + } + break; + + case 129:{ /* dummy instruction? */ + getVarOrWord(); + condition = true; + } + break; + + case 130:{ /* set script cond */ + uint a = getVarOrByte(); + if (a == 1) { + getNextWord(); + _script_cond_b = getNextWord(); + } else { + getNextWord(); + _script_cond_c = getNextWord(); + } + } + break; + + case 132:{ +#ifdef _WIN32_WCE + + if (!draw_keyboard) { + draw_keyboard = true; + toolbar_drawn = false; + } +#endif + o_save_game(); + } + break; + + case 133:{ + o_load_game(); + } + break; + + case 134:{ + warning("stopMidiMusic: not implemented"); + /* dummy proc */ + } + break; + + case 135:{ + error("Quit if user presses Y unimplemented"); + } + break; + + case 136:{ /* set var to item unk3 */ + Item *item = getNextItemPtr(); + writeNextVarContents(item->unk3); + } + break; + + case 137:{ + o_unk_137(getVarOrByte()); + } + break; + + case 138:{ + o_unk_138(); + } + break; + + case 139:{ /* SET_PARENT_SPECIAL */ + Item *item = getNextItemPtr(); + _no_parent_notify = true; + setItemParent(item, getNextItemPtr()); + _no_parent_notify = false; + } + break; + + case 140:{ + killAllTimers(); + addTimeEvent(3, 0xA0); + } + break; + + case 141:{ + uint which = getVarOrByte(); + Item *item = getNextItemPtr(); + if (which == 1) { + _subject_item = item; + } else { + _object_item = item; + } + } + break; + + case 142:{ + condition = is_hitarea_0x40_clear(getVarOrWord()); + } + break; + + case 143:{ /* start item sub */ + Child1 *child = findChildOfType1(getNextItemPtr()); + if (child != NULL) { + Subroutine *sub = getSubroutineByID(child->subroutine_id); + if (sub) + startSubroutine(sub); + } + } + break; + + case 151:{ /* set array6 to item */ + uint var = getVarOrByte(); + Item *item = getNextItemPtr(); + _item_array_6[var] = item; + } + break; + + case 152:{ /* set m1 or m3 to array6 */ + Item *item = _item_array_6[getVarOrByte()]; + uint var = getVarOrByte(); + if (var == 1) { + _subject_item = item; + } else { + _object_item = item; + } + } + break; + + case 153:{ /* set bit */ + uint bit = getVarOrByte(); + _bit_array[bit >> 4] |= 1 << (bit & 15); + break; + } + + case 154:{ /* clear bit */ + uint bit = getVarOrByte(); + _bit_array[bit >> 4] &= ~(1 << (bit & 15)); + break; + } + + case 155:{ /* is bit clear? */ + uint bit = getVarOrByte(); + condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) == 0; + } + break; + + case 156:{ /* is bit set? */ + uint bit = getVarOrByte(); + condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) != 0; + } + break; + + case 157:{ /* get item int prop */ + Item *item = getNextItemPtr(); + Child2 *child = findChildOfType2(item); + uint prop = getVarOrByte(); + + if (child != NULL && child->avail_props & (1 << prop) && prop < 16) { + uint offs = getOffsetOfChild2Param(child, 1 << prop); + writeNextVarContents(child->array[offs]); + } else { + writeNextVarContents(0); + } + } + break; + + case 158:{ /* set item prop */ + Item *item = getNextItemPtr(); + Child2 *child = findChildOfType2(item); + uint prop = getVarOrByte(); + int value = getVarOrWord(); + + if (child != NULL && child->avail_props & (1 << prop) && prop < 16) { + uint offs = getOffsetOfChild2Param(child, 1 << prop); + child->array[offs] = value; + } + } + break; + + case 160:{ + o_unk_160(getVarOrByte()); + } + break; + + case 161:{ /* setup text */ + uint value = getVarOrByte(); + ThreeValues *tv; + + switch (value) { + case 1: + tv = &_threevalues_1; + break; + case 2: + tv = &_threevalues_2; + break; + case 101: + tv = &_threevalues_3; + break; + case 102: + tv = &_threevalues_4; + break; + default: + error("setup text, invalid value %d", value); + } + + tv->a = getVarOrWord(); + tv->b = getVarOrByte(); + tv->c = getVarOrWord(); + } + break; + + case 162:{ + o_print_str(); + } + break; + + case 163:{ + o_unk_163(getVarOrWord()); + } + break; + + case 164:{ + _show_preposition = true; + o_setup_cond_c(); + _show_preposition = false; + } + break; + + case 165:{ + Item *item = getNextItemPtr(); + int16 a = getNextWord(), b = getNextWord(); + condition = (item->unk2 == a && item->unk1 == b); + } break; + + case 166:{ /* set bit2 */ + uint bit = getVarOrByte(); + _bit_array[(bit >> 4) + 16] |= 1 << (bit & 15); + } + break; + + case 167:{ /* clear bit2 */ + uint bit = getVarOrByte(); + _bit_array[(bit >> 4) + 16] &= ~(1 << (bit & 15)); + } + break; + + case 168:{ /* is bit clear? */ + uint bit = getVarOrByte(); + condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) == 0; + } + break; + + case 169:{ /* is bit set? */ + uint bit = getVarOrByte(); + condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) != 0; + } + break; + + case 175:{ + o_unk_175(); + } + break; + + case 176:{ + o_unk_176(); + } + break; + + case 177:{ + o_177(); + } + break; + + case 178:{ /* path find */ + uint a = getVarOrWord(); + uint b = getVarOrWord(); + uint c = getVarOrByte(); + uint d = getVarOrByte(); + o_pathfind(a, b, c, d); + } + break; + + case 179:{ + if (_game == GAME_SIMON1WIN) { + uint b = getVarOrByte(); + /*uint c = */ getVarOrByte(); + uint a = getVarOrByte(); + uint d = _array_4[a]; + if (d != 0) + talk_with_speech(d, b); + } else if (_game == GAME_SIMON1DOS) { + uint b = getVarOrByte(); + uint c = getVarOrByte(); + uint a = getVarOrByte(); + const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]); + ThreeValues *tv; + + switch (b) { + case 1: + tv = &_threevalues_1; + break; + case 2: + tv = &_threevalues_2; + break; + case 101: + tv = &_threevalues_3; + break; + case 102: + tv = &_threevalues_4; + break; + default: + error("setup text, invalid value %d", b); + } + + talk_with_text(b, c, s, tv->a, tv->b, tv->c); + } else if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { + uint b = getVarOrByte(); + uint c = getVarOrByte(); + uint a = getVarOrByte(); + uint d; + const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]); + ThreeValues *tv; + + switch (b) { + case 1: + tv = &_threevalues_1; + break; + case 2: + tv = &_threevalues_2; + break; + case 101: + tv = &_threevalues_3; + break; + case 102: + tv = &_threevalues_4; + break; + default: + error("setup text, invalid value %d", b); + } + + d = _array_4[a]; + if (d != 0 && !_vk_t_toggle) + talk_with_speech(d, b); + + if (s != NULL && _vk_t_toggle) + talk_with_text(b, c, s, tv->a, tv->b, tv->c); + } + } + break; + + case 180:{ + o_force_unlock(); + } + break; + + case 181:{ + o_force_lock(); + if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { + fcs_unk_2(1); + showMessageFormat("\xC"); + } + } + break; + + case 182:{ + if (_game & GAME_SIMON2) + goto invalid_opcode; + o_read_vgares_328(); + } + break; + + case 183:{ + if (_game & GAME_SIMON2) + goto invalid_opcode; + o_read_vgares_23(); + } + break; + + case 184:{ + o_clear_vgapointer_entry(getVarOrWord()); + } + break; + + case 185:{ + if (_game & GAME_SIMON2) + goto invalid_opcode; + getVarOrWord(); + } + break; + + case 186:{ + o_unk_186(); + } + break; + + case 187:{ + if (_game & GAME_SIMON2) + goto invalid_opcode; + o_fade_to_black(); + } + break; + + case 188: + if (!(_game & GAME_SIMON2)) + goto invalid_opcode; + { + uint i = getVarOrByte(); + uint str = getNextStringID(); + condition = (str < 20 && _stringid_array_2[i] == str); + } + break; + + case 189:{ + if (!(_game & GAME_SIMON2)) + goto invalid_opcode; + _op_189_flags = 0; + } + break; + + case 190:{ + uint i; + if (!(_game & GAME_SIMON2)) + goto invalid_opcode; + i = getVarOrByte(); + if (!(_op_189_flags & (1 << i))) + o_190_helper(i); + } + break; + + default: + invalid_opcode:; + error("Invalid opcode '%d'", opcode); + } + + } while (condition != flag); + + return 0; +} + +int SimonState::startSubroutine(Subroutine *sub) +{ + int result = -1; + SubroutineLine *sl; + byte *old_code_ptr; + +#ifdef DUMP_START_MAINSCRIPT + dumpSubroutine(sub); +#endif + + old_code_ptr = _code_ptr; + + if (++_recursion_depth > 40) + error("Recursion error"); + + sl = (SubroutineLine *)((byte *)sub + sub->first); + + while ((byte *)sl != (byte *)sub) { + if (checkIfToRunSubroutineLine(sl, sub)) { + result = 0; + _code_ptr = (byte *)sl; + if (sub->id) + _code_ptr += 2; + else + _code_ptr += 8; + +#ifdef DUMP_CONTINOUS_MAINSCRIPT + fprintf(_dump_file, "; %d\n", sub->id); +#endif + result = runScript(); + if (result != 0) { + /* result -10 means restart subroutine */ + if (result == -10) { + delay(0); /* maybe leave control to the VGA */ + sl = (SubroutineLine *)((byte *)sub + sub->first); + continue; + } + break; + } + } + sl = (SubroutineLine *)((byte *)sub + sl->next); + } + + _code_ptr = old_code_ptr; + + _recursion_depth--; + return result; +} + +int SimonState::startSubroutineEx(Subroutine *sub) +{ + _item_1_ptr = _item_1; + return startSubroutine(sub); +} + +bool SimonState::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub) +{ + if (sub->id) + return true; + + if (sl->cond_a != -1 && sl->cond_a != _script_cond_a && + (sl->cond_a != -2 || _script_cond_a != -1)) + return false; + + if (sl->cond_b != -1 && sl->cond_b != _script_cond_b && + (sl->cond_b != -2 || _script_cond_b != -1)) + return false; + + if (sl->cond_c != -1 && sl->cond_c != _script_cond_c && + (sl->cond_c != -2 || _script_cond_c != -1)) + return false; + + return true; +} + +void SimonState::o_190_helper(uint i) +{ + warning("o_190_helper not implemented"); +} + + +bool SimonState::o_unk_23(uint a) +{ + if (a == 0) + return 0; + + if (a == 100) + return 1; + + a += _script_unk_1; + if (a <= 0) { + _script_unk_1 = 0; + return 0; + } + + if (((uint) (rand() >> 5)) % 100 < a) { + if (_script_unk_1 <= 0) + _script_unk_1 -= 5; + else + _script_unk_1 = 0; + return 1; + } + + if (_script_unk_1 >= 0) + _script_unk_1 += 5; + else + _script_unk_1 = 0; + + return 0; +} + +void SimonState::o_177() +{ + if (_game == GAME_SIMON1WIN) { + uint a = getVarOrByte(); + /*uint b = */ getVarOrByte(); + uint offs; + Child2 *child = findChildOfType2(getNextItemPtr()); + if (child != NULL && child->avail_props & 0x200) { + offs = getOffsetOfChild2Param(child, 0x200); + talk_with_speech(child->array[offs], a); + } else if (child != NULL && child->avail_props & 0x100) { + offs = getOffsetOfChild2Param(child, 0x100); + talk_with_speech(child->array[offs] + 3550, a); + } + } else if (_game == GAME_SIMON1DOS) { + uint a = getVarOrByte(); + uint b = getVarOrByte(); + Child2 *child = findChildOfType2(getNextItemPtr()); + if (child != NULL && child->avail_props & 1) { + const char *s = (const char *)getStringPtrByID(child->array[0]); + ThreeValues *tv; + char buf[256]; + switch (a) { + case 1: + tv = &_threevalues_1; + break; + case 2: + tv = &_threevalues_2; + break; + case 101: + tv = &_threevalues_3; + break; + case 102: + tv = &_threevalues_4; + break; + default: + error("setup text, invalid value %d", a); + } + + if (child->avail_props & 0x100) { + uint x = getOffsetOfChild2Param(child, 0x100); + sprintf(buf, "%d%s", child->array[x], s); + s = buf; + } + + talk_with_text(a, b, s, tv->a, tv->b, tv->c); + } + } else if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { + uint a = getVarOrByte(); + uint b = getVarOrByte(); + Child2 *child = findChildOfType2(getNextItemPtr()); + const char *s = NULL; + ThreeValues *tv = NULL; + char buf[256]; + + if (child != NULL && child->avail_props & 1) { + s = (const char *)getStringPtrByID(child->array[0]); + switch (a) { + case 1: + tv = &_threevalues_1; + break; + case 2: + tv = &_threevalues_2; + break; + case 101: + tv = &_threevalues_3; + break; + case 102: + tv = &_threevalues_4; + break; + default: + error("setup text, invalid value %d", a); + } + } + + if (child != NULL && child->avail_props & 0x200) { + uint var200 = child->array[getOffsetOfChild2Param(child, 0x200)]; + + if (child->avail_props & 0x100) { + uint var100 = child->array[getOffsetOfChild2Param(child, 0x100)]; + + if (var200 == 116) + var200 = var100 + 115; + if (var200 == 92) + var200 = var100 + 98; + if (var200 == 99) + var200 = 9; + if (var200 == 97) { + switch (var100) { + case 12: + var200 = 109; + break; + case 14: + var200 = 108; + break; + case 18: + var200 = 107; + break; + case 20: + var200 = 106; + break; + case 22: + var200 = 105; + break; + case 28: + var200 = 104; + break; + case 90: + var200 = 103; + break; + case 92: + var200 = 102; + break; + case 100: + var200 = 51; + break; + default: + error("o_177: invalid case %d", var100); + } + } + } + + if (!_vk_t_toggle) + talk_with_speech(var200, a); + } + + if (!_vk_t_toggle) + return; + + if (child == NULL || !(child->avail_props & 1)) + return; + + if (child->avail_props & 0x100) { + sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], s); + s = buf; + } + + talk_with_text(a, b, s, tv->a, tv->b, tv->c); + } +} + + +void SimonState::o_unk_137(uint fcs_index) +{ + FillOrCopyStruct *fcs; + + fcs = _fcs_ptr_array_3[fcs_index & 7]; + if (fcs->fcs_data == NULL) + return; + fcs_unk_proc_1(fcs_index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); +} + +void SimonState::o_unk_138() +{ + _vga_buf_start = _vga_buf_free_start; + _vga_file_buf_org = _vga_buf_free_start; +} + +void SimonState::o_unk_186() +{ + _vga_buf_free_start = _vga_file_buf_org_2; + _vga_buf_start = _vga_file_buf_org_2; + _vga_file_buf_org = _vga_file_buf_org_2; +} + +void SimonState::o_unk_175() +{ + _vga_buf_start = _vga_buf_free_start; +} + +void SimonState::o_unk_176() +{ + _vga_buf_free_start = _vga_file_buf_org; + _vga_buf_start = _vga_file_buf_org; +} + +int SimonState::o_unk_132_helper(bool *b, char *buf) +{ + HitArea *ha; + + *b = true; + + + if (!_saveload_flag) { + strange_jump:; + _saveload_flag = false; + savegame_dialog(buf); + } + +start_over:; + _key_pressed = 0; + +start_over_2:; + _last_hitarea = _last_hitarea_3 = 0; + + do { + if (_key_pressed != 0) { + if (_saveload_flag) { + *b = false; + return _key_pressed; + } + goto start_over; + } + delay(100); + } while (_last_hitarea_3 == 0); + + ha = _last_hitarea; + + if (ha == NULL || ha->id < 205) + goto start_over_2; + + if (ha->id == 205) + return ha->id; + + if (ha->id == 206) { + if (_saveload_row_curpos == 1) + goto start_over_2; + if (_saveload_row_curpos < 7) + _saveload_row_curpos = 1; + else + _saveload_row_curpos -= 6; + + goto strange_jump; + } + + if (ha->id == 207) { + if (!_savedialog_flag) + goto start_over_2; + _saveload_row_curpos += 6; +// if (_saveload_row_curpos >= _num_savegame_rows) +// _saveload_row_curpos = _num_savegame_rows; + goto strange_jump; + } + + if (ha->id >= 214) + goto start_over_2; + return ha->id - 208; +} + +void SimonState::o_unk_132_helper_3() +{ + for (int i = 208; i != 208 + 6; i++) + set_hitarea_bit_0x40(i); +} + +void SimonState::o_unk_132_helper_2(FillOrCopyStruct *fcs, int x) +{ + byte old_text; + + video_putchar(fcs, x); + old_text = fcs->text_color; + fcs->text_color = fcs->fill_color; + + x += 120; + if (x != 128) + x = 129; + video_putchar(fcs, x); + + fcs->text_color = old_text; + video_putchar(fcs, 8); +} + +void SimonState::o_unk_127() +{ + if (_game & GAME_SIMON2) { + uint a = getVarOrWord(); + uint b = getVarOrWord(); + uint c = getVarOrByte(); + + warning("o_unk_127(%d,%d,%d) not implemented properly", a, b, c); + + if (a != _last_music_played) { + _last_music_played = a; + playMusic(a); + } + } else { + uint a = getVarOrWord(); + /*uint b = */ getVarOrWord(); + + if (a != _last_music_played) { + _last_music_played = a; + playMusic(a); + } + } +} + +void SimonState::o_unk_120(uint a) +{ + uint16 id = TO_BE_16(a); + _lock_word |= 0x4000; + _vc_ptr = (byte *)&id; + vc_15_start_funkystruct_by_id(); + _lock_word &= ~0x4000; +} + +void SimonState::o_unk_163(uint a) +{ + playSound(a); +} + +void SimonState::o_unk_160(uint a) +{ + fcs_setTextColor(_fcs_ptr_array_3[_fcs_unk_1], a); +} + +void SimonState::o_unk_103() +{ + lock(); + fcs_unk1(_fcs_unk_1); + showMessageFormat("\x0C"); + unlock(); +} + +void SimonState::o_unk_99_simon1(uint a) +{ + uint16 b = TO_BE_16(a); + _lock_word |= 0x4000; + _vc_ptr = (byte *)&b; + vc_60(); + _lock_word &= ~0x4000; +} + +void SimonState::o_unk_99_simon2(uint a, uint b) +{ + uint16 items[2]; + + items[0] = TO_BE_16(a); + items[1] = TO_BE_16(b); + + _lock_word |= 0x4000; + _vc_ptr = (byte *)&items; + vc_60(); + _lock_word &= ~0x4000; +} + +/* OK */ +void SimonState::o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) +{ + a &= 7; + + if (_fcs_ptr_array_3[a]) + fcs_delete(a); + + _fcs_ptr_array_3[a] = fcs_alloc(b, c, d, e, f, g, h); + + if (a == _fcs_unk_1) { + _fcs_ptr_1 = _fcs_ptr_array_3[a]; + showmessage_helper_3(_fcs_ptr_1->textLength, + _fcs_ptr_1->textMaxLength); + } +} diff --git a/simon/midi.cpp b/simon/midi.cpp index b9cf3ac867..a55ab0f3ec 100644 --- a/simon/midi.cpp +++ b/simon/midi.cpp @@ -22,10 +22,10 @@ #include "stdafx.h" #include "scummsys.h" -#include "system.h" -#include "../sound/mididrv.h" -#include "../sound/mixer.h" -#include "simon.h" +#include "common/system.h" +#include "sound/mididrv.h" +#include "sound/mixer.h" +#include "simon/simon.h" void MidiPlayer::read_from_file(void *dst, uint size) { diff --git a/simon/res.cpp b/simon/res.cpp new file mode 100644 index 0000000000..8a059486bd --- /dev/null +++ b/simon/res.cpp @@ -0,0 +1,400 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +// Resource file routines for Simon1/Simon2 +#include "stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" + +// Script opcodes to load into memory +static const char *const opcode_arg_table_simon1win[256] = { + " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", + "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", + "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BTS ", "T ", " ", "B ", + "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", + "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NBNNN ", "N ", + " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", + "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", + "NN ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", "N ", + "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", "B ", + "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBTS ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", "T ", + "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", " ", + " ", +}; + +static const char *const opcode_arg_table_simon1dos[256] = { + " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", + "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", + "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BT ", "T ", " ", "B ", + "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", + "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NBNNN ", "N ", + " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", + "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", + "NN ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", "N ", + "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", "B ", + "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBT ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", "T ", + "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", " ", + " ", +}; + +static const char *const opcode_arg_table_simon2win[256] = { + " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", + "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", + "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BTS ", "T ", " ", "B ", + "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", + "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NNBNNN ", "NN ", + " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", + "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", + "NNB ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", + "N ", "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", + "B ", "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBTS ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", + "T ", "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", + " ", " ", "BT ", " ", "B " +}; + +static const char *const opcode_arg_table_simon2dos[256] = { + " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", + "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", + "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", + "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BT ", "T ", " ", "B ", + "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", + "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NNBNNN ", "NN ", + " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", + "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", + "NNB ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", + "N ", "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", + "B ", "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBT ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", + "T ", "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", + " ", " ", "BT ", " ", "B " +}; + +FILE *SimonState::fopen_maybe_lowercase(const char *filename) +{ + FILE *in; + char buf[256], dotbuf[256], *e; + const char *s = _gameDataPath; + + if (filename == NULL || *filename == '\0') + return NULL; + + strcpy(buf, s); + strcat(buf, filename); + strcpy(dotbuf, buf); + strcat(dotbuf, "."); // '.' appended version + // for dumb vfat drivers + + /* original filename */ + in = fopen(buf, "rb"); + if (in) + return in; + + /* lowercase original filename */ + e = buf + strlen(s); + do + *e = tolower(*e); + while (*e++); + in = fopen(buf, "rb"); + if (in) + return in; + + if (strchr(buf, '.')) + return NULL; + + /* dot appended original filename */ + in = fopen(dotbuf, "rb"); + if (in) + return in; + + /* lowercase dot appended */ + e = dotbuf + strlen(s); + do + *e = tolower(*e); + while (*e++); + in = fopen(dotbuf, "rb"); + + return in; +} + +bool SimonState::loadGamePcFile(const char *filename) +{ + FILE *in; + int num_inited_objects; + int i, file_size; + + /* read main gamepc file */ + in = fopen_maybe_lowercase(filename); + if (in == NULL) + return false; + + num_inited_objects = allocGamePcVars(in); + + allocItem1(); + loginPlayer(); + readGamePcText(in); + + for (i = 2; i < num_inited_objects; i++) { + readItemFromGamePc(in, _itemarray_ptr[i]); + } + + readSubroutineBlock(in); + + fclose(in); + + /* Read list of TABLE resources */ + in = fopen_maybe_lowercase("TBLLIST"); + if (in == NULL) + return false; + + fseek(in, 0, SEEK_END); + file_size = ftell(in); + + _tbl_list = (byte *)malloc(file_size); + if (_tbl_list == NULL) + error("Out of memory for strip table list"); + fseek(in, 0, SEEK_SET); + fread(_tbl_list, file_size, 1, in); + fclose(in); + + /* Remember the current state */ + _subroutine_list_org = _subroutine_list; + _tablesheap_ptr_org = _tablesheap_ptr; + _tablesheap_curpos_org = _tablesheap_curpos; + + /* Read list of TEXT resources */ + in = fopen_maybe_lowercase("STRIPPED.TXT"); + if (in == NULL) + return false; + + fseek(in, 0, SEEK_END); + file_size = ftell(in); + _stripped_txt_mem = (byte *)malloc(file_size); + if (_stripped_txt_mem == NULL) + error("Out of memory for strip text list"); + fseek(in, 0, SEEK_SET); + fread(_stripped_txt_mem, file_size, 1, in); + fclose(in); + + return true; +} + +void SimonState::readGamePcText(FILE *in) +{ + uint text_size; + byte *text_mem; + + _text_size = text_size = fileReadBE32(in); + text_mem = (byte *)malloc(text_size); + if (text_mem == NULL) + error("Out of text memory"); + + fread(text_mem, text_size, 1, in); + + setupStringTable(text_mem, _stringtab_num); +} + +void SimonState::readItemFromGamePc(FILE *in, Item *item) +{ + uint32 type; + + item->unk2 = fileReadBE16(in); + item->unk1 = fileReadBE16(in); + item->unk3 = fileReadBE16(in); + item->sibling = (uint16)fileReadItemID(in); + item->child = (uint16)fileReadItemID(in); + item->parent = (uint16)fileReadItemID(in); + fileReadBE16(in); + item->unk4 = fileReadBE16(in); + item->children = NULL; + + type = fileReadBE32(in); + while (type) { + type = fileReadBE16(in); + if (type != 0) + readItemChildren(in, item, type); + } +} + +void SimonState::readItemChildren(FILE *in, Item *item, uint type) +{ + if (type == 1) { + uint fr1 = fileReadBE16(in); + uint fr2 = fileReadBE16(in); + uint i, size; + uint j, k; + Child1 *child; + + size = CHILD1_SIZE; + for (i = 0, j = fr2; i != 6; i++, j >>= 2) + if (j & 3) + size += sizeof(child->array[0]); + + child = (Child1 *)allocateChildBlock(item, 1, size); + child->subroutine_id = fr1; + child->fr2 = fr2; + + for (i = k = 0, j = fr2; i != 6; i++, j >>= 2) + if (j & 3) + child->array[k++] = (uint16)fileReadItemID(in); + } else if (type == 2) { + uint32 fr = fileReadBE32(in); + uint i, k, size; + Child2 *child; + + size = CHILD2_SIZE; + for (i = 0; i != 16; i++) + if (fr & (1 << i)) + size += sizeof(child->array[0]); + + child = (Child2 *)allocateChildBlock(item, 2, size); + child->avail_props = fr; + + k = 0; + if (fr & 1) { + child->array[k++] = (uint16)fileReadBE32(in); + } + for (i = 1; i != 16; i++) + if (fr & (1 << i)) + child->array[k++] = fileReadBE16(in); + + child->string_id = (uint16)fileReadBE32(in); + } else { + error("readItemChildren: invalid mode"); + } +} + +uint fileReadItemID(FILE *in) +{ + uint32 val = fileReadBE32(in); + if (val == 0xFFFFFFFF) + return 0; + return val + 2; +} + +byte *SimonState::readSingleOpcode(FILE *in, byte *ptr) +{ + int i, l; + const char *string_ptr; + uint val; + + const char *const *table; + + switch (_game) { + case GAME_SIMON1WIN: + table = opcode_arg_table_simon1win; + break; + case GAME_SIMON2DOS: + table = opcode_arg_table_simon2win; + printf("right opcode table\n"); + break; + case GAME_SIMON2WIN: + table = opcode_arg_table_simon2win; + break; + case GAME_SIMON1DOS: + table = opcode_arg_table_simon1dos; + break; + default: + error("Invalid game specified"); + } + + i = 0; + + string_ptr = table[*ptr++]; + if (!string_ptr) + error("Unable to locate opcode table. Perhaps you are using the wrong game target?"); + + for (;;) { + if (string_ptr[i] == ' ') + return ptr; + + l = string_ptr[i++]; + switch (l) { + case 'N': + case 'S': + case 'a': + case 'n': + case 'p': + case 'v': + val = fileReadBE16(in); + *ptr++ = val >> 8; + *ptr++ = val & 255; + break; + + case 'B': + *ptr++ = fileReadByte(in); + if (ptr[-1] == 0xFF) { + *ptr++ = fileReadByte(in); + } + break; + + case 'I': + val = fileReadBE16(in); + switch (val) { + case 1: + val = 0xFFFF; + break; + case 3: + val = 0xFFFD; + break; + case 5: + val = 0xFFFB; + break; + case 7: + val = 0xFFF9; + break; + case 9: + val = 0xFFF7; + break; + default: + val = fileReadItemID(in);; + } + *ptr++ = val >> 8; + *ptr++ = val & 255; + break; + + case 'T': + val = fileReadBE16(in); + switch (val) { + case 0: + val = 0xFFFF; + break; + case 3: + val = 0xFFFD; + break; + default: + val = (uint16)fileReadBE32(in); + break; + } + *ptr++ = val >> 8; + *ptr++ = val & 255; + break; + + default: + error("Bad cmd table entry %c", l); + } + } +} diff --git a/simon/simon.cpp b/simon/simon.cpp index a60234d7a2..d3b8a8391f 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -20,9 +20,9 @@ */ #include "stdafx.h" -#include "simon.h" -#include "simonintern.h" -#include "gameDetector.h" +#include "simon/simon.h" +#include "simon/intern.h" +#include "common/gameDetector.h" #include #include diff --git a/simon/simondebug.cpp b/simon/simondebug.cpp deleted file mode 100644 index ed7febe739..0000000000 --- a/simon/simondebug.cpp +++ /dev/null @@ -1,769 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -// Simon debug functions -#include "stdafx.h" -#include "simon.h" -#include "simonintern.h" - -#ifdef SIMONDEBUG -#define SIMON2 -#define SIMON2WIN - -static const char *const opcode_name_table[256] = { - /* 0 */ - "|INV_COND", - "IJ|PTRA_PARENT_IS", - "IJ|PTRA_PARENT_ISNOT", - NULL, - /* 4 */ - NULL, - "IJ|PARENT_IS_1", - "IJ|PARENT_ISNOT_1", - "IIJ|PARENT_IS", - /* 8 */ - NULL, - NULL, - NULL, - "VJ|IS_ZERO", - /* 12 */ - "VJ|ISNOT_ZERO", - "VWJ|IS_EQ", - "VWJ|IS_NEQ", - "VWJ|IS_LE", - /* 16 */ - "VWJ|IS_GE", - "VVJ|IS_EQF", - "VVJ|IS_NEQF", - "VVJ|IS_LEF", - /* 20 */ - "VVJ|IS_GEF", - NULL, - NULL, - "WJ|UNK23", - /* 24 */ - NULL, - "IJ|HAS_CHILD_1", - "IJ|HAS_CHILD_2", - "IWJ|ITEM_UNK3_IS", - /* 28 */ - "IBJ|CHILD_HAS_FLAG", - NULL, - NULL, - "I|SET_NO_PARENT", - /* 32 */ - NULL, - "II|SET_PARENT", - NULL, - NULL, - /* 36 */ - "VV|MOVE", - NULL, - NULL, - NULL, - /* 40 */ - NULL, - "V|ZERO", - "VW|SET", - "VW|ADD", - /* 44 */ - "VW|SUB", - "VV|ADDF", - "VV|SUBF", - "VW|MUL", - /* 48 */ - "VW|DIV", - "VV|MULF", - "VV|DIVF", - "VW|MOD", - /* 52 */ - "VV|MODF", - "VW|RANDOM", - NULL, - "I|SET_A_PARENT", - /* 56 */ - "IB|SET_CHILD2_BIT", - "IB|CLEAR_CHILD2_BIT", - "II|MAKE_SIBLING", - "I|INC_UNK3", - /* 60 */ - "I|DEC_UNK3", - "IW|SET_UNK3", - "V|SHOW_INT", - "T|SHOW_STRING_NL", - /* 64 */ - "T|SHOW_STRING", - "WWWWWB|ADD_HITAREA", - "BT|SET_ITEM_NAME", -#if defined SIMON1WIN || defined SIMON2 - "BTw|SET_ITEM_DESC", -#endif -#ifdef SIMON1DOS - "BT|SET_ITEM_DESC", -#endif - /* 68 */ - "x|HALT", - "x|RET1", - "V|SHOW_STRING_AR3", - "W|START_SUB", - /* 72 */ - NULL, - NULL, - NULL, - NULL, - /* 76 */ - "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", - "ITJ|CHILD_FR2_IS", - /* 80 */ - "IIJ|IS_ITEM_EQ", - NULL, - "B|UNK82", - "|RETM10", - /* 84 */ - NULL, - NULL, - NULL, - "W|UNK87", - /* 88 */ - "|OR_SCRIPT_WORD_10", - "|AND_SCRIPT_WORD_10", - "IB|SET_M_TO_PARENT", - "IB|SET_M_TO_SIBLING", - /* 92 */ - "IB|SET_M_TO_CHILD", - NULL, - NULL, - NULL, - /* 96 */ - "WB|UNK96", - "W|LOAD_VGA", -#ifdef SIMON2 - "WWBWWW|START_VGA", -#else - "WBWWW|START_VGA", -#endif -#ifdef SIMON2 - "WW|KILL_THREAD", -#else - "W|KILL_THREAD", -#endif - /* 100 */ - "|VGA_RESET", - "BWWWWWW|UNK101", - "B|UNK102", - "|UNK103", - /* 104 */ - "B|UNK104", - NULL, - NULL, - "WWWWWIW|ADD_ITEM_HITAREA", - /* 108 */ - "W|DEL_HITAREA", - "W|CLEAR_HITAREA_0x40", - "W|SET_HITAREA_0x40", - "WWW|SET_HITAREA_XY", - /* 112 */ - NULL, - NULL, - "IB|UNK114", - "IBJ|HAS_FLAG", - /* 116 */ - "IB|SET_FLAG", - "IB|CLEAR_FLAG", - NULL, - "W|WAIT_VGA", - /* 120 */ - "W|UNK120", - "BI|SET_VGA_ITEM", - NULL, - NULL, - /* 124 */ - NULL, - "IJ|IS_SIBLING_WITH_A", - "IBB|UNK126", - "WW|UNK127", - /* 128 */ - "W|GET_DUMMY_WORD", - "W|GET_WORD_COND_TRUE", - "Bww|UNK131", - NULL, /* opcode 131 doesn't exist */ - /* 132 */ - "|SAVE_GAME", - "|LOAD_GAME", - "|DUMMYPROC_134", - "|QUIT_IF_USER_PRESSES_Y", - /* 136 */ - "IV|GET_ITEM_UNK3", - "B|UNK137", - "|VGA_POINTER_OP_4", - "II|SET_PARENT_SPECIAL", - /* 140 */ - "|DEL_TE_AND_ADD_ONE", - "BI|SET_M1_OR_M3", - "WJ|IS_HITAREA_0x40_CLEAR", - "I|START_ITEM_SUB", - /* 144 */ - NULL, - NULL, - NULL, - NULL, - /* 148 */ - NULL, - NULL, - NULL, - "BI|SET_ARRAY6_TO", - /* 152 */ - "BB|SET_M1_M3_TO_ARRAY6", - "B|SET_BIT", - "B|CLEAR_BIT", - "BJ|IS_BIT_CLEAR", - /* 156 */ - "BJ|IS_BIT_SET", - "IBB|GET_ITEM_PROP", - "IBW|SET_ITEM_PROP", - NULL, - /* 160 */ - "B|UNK160", - "BWBW|SETUP_TEXT", -#if defined SIMON1WIN || defined SIMON2 - "BBTW|PRINT_STR", -#endif -#ifdef SIMON1DOS - "BBT|PRINT_STR", -#endif - "W|SOUND_1", - /* 164 */ - "|UNK164", - "IWWJ|ITEM_UNK1_UNK2_IS", - "B|SET_BIT2", - "B|CLEAR_BIT2", - /* 168 */ - "BJ|IS_BIT2_CLEAR", - "BJ|IS_BIT2_SET", - NULL, - NULL, - /* 172 */ - NULL, - NULL, - NULL, - "|VGA_POINTER_OP_1", - /* 176 */ - "|VGA_POINTER_OP_2", - "BBI|UNK177", - "WWBB|PATHFIND", - "BBB|UNK179", - /* 180 */ - "|FORCE_UNLOCK", - "|FORCE_LOCK", - "|READ_VGARES_328", - "|READ_VGARES_23", - /* 184 */ - "W|CLEAR_VGAPOINTER_ENTRY", - "W|DUMMY_185", - "|VGA_POINTER_OP_3", - "|FADE_TO_BLACK", -#ifdef SIMON2 - /* 188 */ - "BSJ|STRING2_IS", - "|UNK189", - "B|UNK190", -#endif -}; - -byte *SimonState::dumpOpcode(byte *p) -{ - byte opcode; - const char *s, *st; - - opcode = *p++; - if (opcode == 255) - return NULL; - st = s = opcode_name_table[opcode]; - if (s == NULL) { - error("INVALID OPCODE %d\n", opcode); - return NULL; - } - while (*st != '|') - st++; - fprintf(_dump_file, "%s ", st + 1); - - for (;;) { - switch (*s++) { - case 'x': - fprintf(_dump_file, "\n"); - return NULL; - case '|': - fprintf(_dump_file, "\n"); - return p; - case 'B':{ - byte b = *p++; - if (b == 255) - fprintf(_dump_file, "[%d] ", *p++); - else - fprintf(_dump_file, "%d ", b); - break; - } - case 'V':{ - byte b = *p++; - if (b == 255) - fprintf(_dump_file, "[[%d]] ", *p++); - else - fprintf(_dump_file, "[%d] ", b); - break; - } - - case 'W':{ - int n = (int16)((p[0] << 8) | p[1]); - p += 2; - if (n >= 30000 && n < 30512) - fprintf(_dump_file, "[%d] ", n - 30000); - else - fprintf(_dump_file, "%d ", n); - break; - } - - case 'w':{ - int n = (int16)((p[0] << 8) | p[1]); - p += 2; - fprintf(_dump_file, "%d ", n); - break; - } - - case 'I':{ - int n = (int16)((p[0] << 8) | p[1]);; - p += 2; - if (n == -1) - fprintf(_dump_file, "ITEM_M1 "); - else if (n == -3) - fprintf(_dump_file, "ITEM_M3 "); - else if (n == -5) - fprintf(_dump_file, "ITEM_1 "); - else if (n == -7) - fprintf(_dump_file, "ITEM_0 "); - else if (n == -9) - fprintf(_dump_file, "ITEM_A_PARENT "); - else - fprintf(_dump_file, "<%d> ", n); - break; - } - case 'J':{ - fprintf(_dump_file, "-> "); - } - break; - - - case 'T':{ - uint n = ((p[0] << 8) | p[1]); - p += 2; - if (n != 0xFFFF) - fprintf(_dump_file, "\"%s\"(%d) ", getStringPtrByID(n), n); - else - fprintf(_dump_file, "NULL_STRING "); - } - break; - } - } -} - -void SimonState::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) -{ - byte *p; - - - printf("; ****\n"); - - p = (byte *)sl + SUBROUTINE_LINE_SMALL_SIZE; - if (sub->id == 0) { - fprintf(_dump_file, "; cond_a=%d, cond_b=%d, cond_c=%d\n", sl->cond_a, sl->cond_b, sl->cond_c); - p = (byte *)sl + SUBROUTINE_LINE_BIG_SIZE; - } - - for (;;) { - p = dumpOpcode(p); - if (p == NULL) - break; - } -} - -void SimonState::dumpSubroutine(Subroutine *sub) -{ - SubroutineLine *sl; - - fprintf(_dump_file, - "\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, - sub->id); - sl = (SubroutineLine *)((byte *)sub + sub->first); - for (; (byte *)sl != (byte *)sub; sl = (SubroutineLine *)((byte *)sub + sl->next)) { - dumpSubroutineLine(sl, sub); - } - fprintf(_dump_file, "\nEND ******************************************\n"); - fflush(_dump_file); -} - -void SimonState::dumpSubroutines() -{ - Subroutine *sub = _subroutine_list; - for (; sub; sub = sub->next) { - dumpSubroutine(sub); - } -} - -const char *const video_opcode_name_table[] = { - /* 0 */ - "x|RET", - "ddd|DUMMY", - "d|CALL", - "ddddd|NEW_THREAD", - /* 4 */ - "ddd|DUMMY_2", - "vd|SKIP_IF_NEQ", - "d|SKIP_IFN_SIB_WITH_A", - "d|SKIP_IF_SIB_WITH_A", - /* 8 */ - "dd|SKIP_IF_PARENT_IS", - "dd|SKIP_IF_UNK3_IS", -#ifdef SIMON2 - "ddddb|DRAW", -#else - "ddddd|DRAW", -#endif - "|CLEAR_PATHFIND_ARRAY", - /* 12 */ -#ifdef SIMON2 - "b|DELAY", -#else - "d|DELAY", -#endif - "d|OFFSET_X", - "d|OFFSET_Y", - "d|IDENT_WAKEUP", - /* 16 */ - "d|IDENT_SLEEP", - "dq|SET_PATHFIND_ITEM", - "i|JUMP_REL", - "|CHAIN_TO", - /* 20 */ - "dd|SET_CODE_WORD", - "i|JUMP_IF_CODE_WORD", - "dd|SET_PAL", - "d|SET_PRI", - /* 24 */ - "diid|SET_IMG_XY", - "x|HALT_THREAD", - "ddddd|SET_WINDOW", - "|RESET", - /* 28 */ - "dddd|DUMMY_3", - "|STOP_ALL_SOUNDS", - "d|SET_BASE_DELAY", - "d|SET_PALETTE_MODE", - /* 32 */ - "vv|COPY_VAR", - "|FORCE_UNLOCK", - "|FORCE_LOCK", - "dd|DUMMY_4", - /* 36 */ - "dd|SAVELOAD_THING", - "v|OFFSET_Y_F", - "v|SKIP_IF_VAR_ZERO", - "vd|SET_VAR", - /* 40 */ - "vd|ADD_VAR", - "vd|SUB_VAR", - "vd|SLEEP_UNTIL_SET", - "d|SKIP_IF_BIT_CLEAR", - /* 44 */ - "d|SKIP_IF_BIT_SET", - "v|SET_X_F", - "v|SET_Y_F", - "vv|ADD_VAR_F", - /* 48 */ - "|VC_48", - "d|SET_BIT", - "d|CLEAR_BIT", - "d|CLEAR_HITAREA_BIT_0x40", - /* 52 */ - "d|VC_52", - "dd|DUMMY_5", - "ddd|DUMMY_6", - "ddd|OFFSET_HIT_AREA", - /* 56 */ -#ifdef SIMON2 - "i|SLEEP_EX", -#else - "|DUMMY_7", -#endif - "|DUMMY_8", - "|DUMMY_9", -#ifdef SIMON2 - "ddd|KILL_MULTI_THREAD", -#else - "|SKIP_IF_SOUND??", -#endif - /* 60 */ -#ifdef SIMON2 - "dd|KILL_THREAD", -#else - "d|KILL_THREAD", -#endif - "ddd|INIT_SPRITE", - "|PALETTE_THING", - "|PALETTE_THING_2", -#ifdef SIMON2 - /* 64 */ - "|UNK64", - "|UNK65", - "|UNK66", - "|UNK67", - /* 68 */ - "|UNK68", - "dd|UNK69", - "dd|UNK70", - "|UNK71", - /* 72 */ - "dd|UNK72", - "bb|UNK73", - "bb|UNK74", -#endif -}; - -void SimonState::dump_video_script(byte *src, bool one_opcode_only) -{ - uint opcode; - const char *str, *strn; - - do { - if (!(_game & GAME_SIMON2)) { - opcode = READ_BE_UINT16_UNALIGNED(src); - src += 2; - } else { - opcode = *src++; - } - - if (opcode >= gss->NUM_VIDEO_OP_CODES) { - error("Invalid opcode %x\n", opcode); - return; - } - - strn = str = video_opcode_name_table[opcode]; - while (*strn != '|') - strn++; - fprintf(_dump_file, "%.2d: %s ", opcode, strn + 1); - - for (; *str != '|'; str++) { - switch (*str) { - case 'x': - fprintf(_dump_file, "\n"); - return; - case 'b': - fprintf(_dump_file, "%d ", *src++); - break; - case 'd': - fprintf(_dump_file, "%d ", READ_BE_UINT16_UNALIGNED(src)); - src += 2; - break; - case 'v': - fprintf(_dump_file, "[%d] ", READ_BE_UINT16_UNALIGNED(src)); - src += 2; - break; - case 'i': - fprintf(_dump_file, "%d ", (int16)READ_BE_UINT16_UNALIGNED(src)); - src += 2; - break; - case 'q': - while (READ_BE_UINT16_UNALIGNED(src) != 999) { - fprintf(_dump_file, "(%d,%d) ", READ_BE_UINT16_UNALIGNED(src), - READ_BE_UINT16_UNALIGNED(src + 2)); - src += 4; - } - src++; - break; - default: - error("Invalid fmt string '%c' in decompile VGA", *str); - } - } - - fprintf(_dump_file, "\n"); - } while (!one_opcode_only); -} - -void SimonState::dump_vga_file(byte *vga) -{ - { - byte *pp; - byte *p; - int count; - - pp = vga; - p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) pp)->hdr2_start); - count = READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_count); - p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_table); - while (--count >= 0) { - int id = READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->id); - - dump_vga_script_always(vga + - READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->script_offs), - id / 100, id); - p += sizeof(VgaFile1Struct0x6); - } - } - - { - byte *bb, *b; - int c; - - bb = vga; - b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) bb)->hdr2_start); - c = READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk1); - b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk2_offs); - - while (--c >= 0) { - int id = READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->id); - - dump_vga_script_always(vga + - READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->script_offs), - id / 100, id); - b += sizeof(VgaFile1Struct0x8); - } - } -} - - - -const byte bmp_hdr[] = { - 0x42, 0x4D, - 0x9E, 0x14, 0x00, 0x00, /* offset 2, file size */ - 0x00, 0x00, 0x00, 0x00, - 0x36, 0x04, 0x00, 0x00, - 0x28, 0x00, 0x00, 0x00, - - 0x3C, 0x00, 0x00, 0x00, /* image width */ - 0x46, 0x00, 0x00, 0x00, /* image height */ - 0x01, 0x00, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - - 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, -}; - -void dump_bmp(const char *filename, int w, int h, const byte *bytes, const uint32 *palette) -{ - FILE *out = fopen(filename, "wb"); - byte my_hdr[sizeof(bmp_hdr)]; - int i; - - if (out == NULL) { - printf("DUMP ERROR\n"); - return; - } - - memcpy(my_hdr, bmp_hdr, sizeof(bmp_hdr)); - - *(uint32 *)(my_hdr + 2) = w * h + 1024 + sizeof(bmp_hdr); - *(uint32 *)(my_hdr + 18) = w; - *(uint32 *)(my_hdr + 22) = h; - - - fwrite(my_hdr, 1, sizeof(my_hdr), out); - - for (i = 0; i != 256; i++, palette++) { - byte color[4]; - color[0] = (byte)(*palette >> 16); - color[1] = (byte)(*palette >> 8); - color[2] = (byte)(*palette); - color[3] = 0; - fwrite(color, 1, 4, out); - } - - while (--h >= 0) { - fwrite(bytes + h * ((w + 3) & ~3), ((w + 3) & ~3), 1, out); - } - - fclose(out); -} - -void dump_bitmap(const char *filename, byte *offs, int w, int h, int flags, const byte *palette, - byte base) -{ - /* allocate */ - byte *b = (byte *)malloc(w * h); - int i, j; - - VC10_state state; - - state.depack_cont = -0x80; - state.depack_src = offs; - state.dh = h; - state.y_skip = 0; - - for (i = 0; i != w; i += 2) { - byte *c = vc_10_depack_column(&state); - for (j = 0; j != h; j++) { - byte pix = c[j]; - b[j * w + i] = (pix >> 4) | base; - b[j * w + i + 1] = (pix & 0xF) | base; - - } - } - - dump_bmp(filename, w, h, b, (uint32 *)palette); - free(b); -} - -void SimonState::dump_single_bitmap(int file, int image, byte *offs, int w, int h, byte base) -{ -/* Only supported for win32 atm. mkdir doesn't work otherwise. */ -#if defined (WIN32) && !defined(_WIN32_WCE) - char buf[255], buf2[255]; - struct stat statbuf; - - sprintf(buf, "bmp_%d\\%d.bmp", file, image); - - if (stat(buf, &statbuf) == 0) - return; - - sprintf(buf2, "bmp_%d", file); - mkdir(buf2); - - dump_bitmap(buf, offs, w, h, 0, _palette, base); -#endif -} - -void SimonState::dump_vga_script_always(byte *ptr, uint res, uint sprite_id) -{ - fprintf(_dump_file, "; address=%x, vgafile=%d vgasprite=%d\n", - ptr - _vga_buffer_pointers[res].vgaFile1, res, sprite_id); - dump_video_script(ptr, false); - fprintf(_dump_file, "; end\n"); -} - -void SimonState::dump_vga_script(byte *ptr, uint res, uint sprite_id) -{ - dump_Vga_script_always(ptr, res, sprite_id); -} - - -#endif diff --git a/simon/simonintern.h b/simon/simonintern.h deleted file mode 100644 index 2536534844..0000000000 --- a/simon/simonintern.h +++ /dev/null @@ -1,171 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef SIMON_INTERN_H -#define SIMON_INTERN_H - -struct Child { - Child *next; - uint16 type; -}; - -struct Child1 : Child { - uint16 subroutine_id; - uint16 fr2; - uint16 array[1]; -}; - -struct Child2 : Child { - uint16 string_id; - uint32 avail_props; - int16 array[1]; -}; - -struct Child3 : Child { -}; - -struct Child9 : Child { - uint16 array[4]; -}; - -enum { - CHILD1_SIZE = sizeof(Child1) - sizeof(uint16), - CHILD2_SIZE = sizeof(Child2) - sizeof(int16) -}; - - -struct Item { - uint16 parent; - uint16 child; - uint16 sibling; - int16 unk1; - int16 unk2; - int16 unk3; /* signed int */ - uint16 unk4; - uint16 xxx_1; /* unused? */ - Child *children; -}; - -struct Subroutine { - uint16 id; /* subroutine ID */ - uint16 first; /* offset from subroutine start to first subroutine line */ - Subroutine *next; /* next subroutine in linked list */ -}; - -struct FillOrCopyDataEntry { - Item *item; - uint16 hit_area; - uint16 xxx_1; -}; - -struct FillOrCopyData { - int16 unk1; - Item *item_ptr; - FillOrCopyDataEntry e[64]; - int16 unk3, unk4; - uint16 unk2; -}; - -struct FillOrCopyStruct { - byte mode; - byte flags; - uint16 x, y; - uint16 width, height; - uint16 textColumn, textRow; - uint8 textColumnOffset, textLength, textMaxLength; - uint8 fill_color, text_color, unk5; - FillOrCopyData *fcs_data; -}; -// note on text offset: -// the actual x-coordinate is: textColumn * 8 + textColumnOffset -// the actual y-coordinate is: textRow * 8 - - -enum { - SUBROUTINE_LINE_SMALL_SIZE = 2, - SUBROUTINE_LINE_BIG_SIZE = 8, -}; - -struct SubroutineLine { - uint16 next; - int16 cond_a; - int16 cond_b; - int16 cond_c; -}; - -struct TimeEvent { - uint32 time; - uint16 subroutine_id; - TimeEvent *next; -}; - -struct VgaFile1Header { - uint16 x_1, x_2; - uint16 hdr2_start; - uint16 x_3, x_4; -}; - -struct VgaFile1Header2 { - uint16 x_1; - uint16 unk1; - uint16 x_2; - uint16 id_count; - uint16 x_3; - uint16 unk2_offs; - uint16 x_4; - uint16 id_table; - uint16 x_5; -}; - -struct VgaFile1Struct0x8 { - uint16 id; - uint16 x_1; - uint16 x_2; - uint16 script_offs; -}; - -struct VgaFile1Struct0x6 { - uint16 id; - uint16 x_2; - uint16 script_offs; -}; - - -struct GameSpecificSettings { - uint VGA_DELAY_BASE; - uint TABLE_INDEX_BASE; - uint TEXT_INDEX_BASE; - uint NUM_GAME_OFFSETS; - uint NUM_VIDEO_OP_CODES; - uint VGA_MEM_SIZE; - uint TABLES_MEM_SIZE; - uint NUM_VOICE_RESOURCES; - uint NUM_EFFECTS_RESOURCES; - uint MUSIC_INDEX_BASE; - uint SOUND_INDEX_BASE; - const char *gme_filename; - const char *wav_filename; - const char *wav_filename2; - const char *effects_filename; - const char *gamepc_filename; -}; - -#endif diff --git a/simon/simonitems.cpp b/simon/simonitems.cpp deleted file mode 100644 index 39e95d3a70..0000000000 --- a/simon/simonitems.cpp +++ /dev/null @@ -1,1628 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -// Item script opcodes for Simon1/Simon2 -#include "stdafx.h" -#include "simon.h" -#include "simonintern.h" - -#ifdef _WIN32_WCE - -extern bool toolbar_drawn; -extern bool draw_keyboard; - -#endif - -int SimonState::runScript() -{ - byte opcode; - bool flag, condition; - - do { -#ifdef DUMP_CONTINOUS_MAINSCRIPT - dumpOpcode(_code_ptr); -#endif - - opcode = getByte(); - if (opcode == 0xFF) - return 0; - - if (_run_script_return_1) - return 1; - - /* Invert condition? */ - flag = false; - if (opcode == 0) { - flag = true; - opcode = getByte(); - if (opcode == 0xFF) - return 0; - } - - condition = true; - - switch (opcode) { - case 1:{ /* ptrA parent is */ - condition = (getItem1Ptr()->parent == getNextItemID()); - } - break; - - case 2:{ /* ptrA parent is not */ - condition = (getItem1Ptr()->parent != getNextItemID()); - } - break; - - case 5:{ /* parent is 1 */ - condition = (getNextItemPtr()->parent == getItem1ID()); - } - break; - - case 6:{ /* parent isnot 1 */ - condition = (getNextItemPtr()->parent != getItem1ID()); - } - break; - - case 7:{ /* parent is */ - Item *item = getNextItemPtr(); - condition = (item->parent == getNextItemID()); - } - break; - - case 11:{ /* is zero */ - condition = (getNextVarContents() == 0); - } - break; - - case 12:{ /* isnot zero */ - condition = (getNextVarContents() != 0); - } - break; - - case 13:{ /* equal */ - uint tmp = getNextVarContents(); - condition = (tmp == getVarOrWord()); - } - break; - - case 14:{ /* not equal */ - uint tmp = getNextVarContents(); - condition = (tmp != getVarOrWord()); - } - break; - - case 15:{ /* is greater */ - uint tmp = getNextVarContents(); - condition = (tmp > getVarOrWord()); - } - break; - - case 16:{ /* is less */ - uint tmp = getNextVarContents(); - condition = (tmp < getVarOrWord()); - } - break; - - case 17:{ /* is eq f */ - uint tmp = getNextVarContents(); - condition = (tmp == getNextVarContents()); - } - break; - - case 18:{ /* is not equal f */ - uint tmp = getNextVarContents(); - condition = (tmp != getNextVarContents()); - } - break; - - case 19:{ /* is greater f */ - uint tmp = getNextVarContents(); - condition = (tmp < getNextVarContents()); - } - break; - - case 20:{ /* is less f */ - uint tmp = getNextVarContents(); - condition = (tmp > getNextVarContents()); - } - break; - - case 23:{ - condition = o_unk_23(getVarOrWord()); - } - break; - - case 25:{ /* has child of type 1 */ - condition = hasChildOfType1(getNextItemPtr()); - } - break; - - case 26:{ /* has child of type 2 */ - condition = hasChildOfType2(getNextItemPtr()); - } - break; - - case 27:{ /* item unk3 is */ - Item *item = getNextItemPtr(); - condition = ((uint) item->unk3 == getVarOrWord()); - } - break; - - case 28:{ /* item has prop */ - Child2 *child = findChildOfType2(getNextItemPtr()); - byte num = getVarOrByte(); - condition = child != NULL && (child->avail_props & (1 << num)) != 0; - } break; - - case 31:{ /* set no parent */ - setItemParent(getNextItemPtr(), NULL); - } - break; - - case 33:{ /* set item parent */ - Item *item = getNextItemPtr(); - setItemParent(item, getNextItemPtr()); - } - break; - - case 36:{ /* copy var */ - uint value = getNextVarContents(); - writeNextVarContents(value); - } - break; - - case 41:{ /* zero var */ - writeNextVarContents(0); - } - break; - - case 42:{ /* set var */ - uint var = getVarOrByte(); - writeVariable(var, getVarOrWord()); - } - break; - - case 43:{ /* add */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) + getVarOrWord()); - } - break; - - case 44:{ /* sub */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) - getVarOrWord()); - } - break; - - case 45:{ /* add f */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) + getNextVarContents()); - } - break; - - case 46:{ /* sub f */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) - getNextVarContents()); - } - break; - - case 47:{ /* mul */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) * getVarOrWord()); - } - break; - - case 48:{ /* div */ - uint var = getVarOrByte(); - int value = getVarOrWord(); - if (value == 0) - error("Division by zero in div"); - writeVariable(var, readVariable(var) / value); - } - break; - - case 49:{ /* mul f */ - uint var = getVarOrByte(); - writeVariable(var, readVariable(var) * getNextVarContents()); - } - break; - - case 50:{ /* div f */ - uint var = getVarOrByte(); - int value = getNextVarContents(); - if (value == 0) - error("Division by zero in div f"); - writeVariable(var, readVariable(var) / value); - } - break; - - case 51:{ /* mod */ - uint var = getVarOrByte(); - int value = getVarOrWord(); - if (value == 0) - error("Division by zero in mod"); - writeVariable(var, readVariable(var) % value); - } - break; - - case 52:{ /* mod f */ - uint var = getVarOrByte(); - int value = getNextVarContents(); - if (value == 0) - error("Division by zero in mod f"); - writeVariable(var, readVariable(var) % value); - } - break; - - case 53:{ /* random */ - uint var = getVarOrByte(); - uint value = (uint16)getVarOrWord(); - uint rand_value; - - for (;;) { - uint value_2 = value; - rand_value = rand() & 0x7FFF; - - if (value == 0) - error("Invalid random range"); - - value = 0x8000 / value; - - if (value == 0) - error("Invalid random range"); - - if (rand_value / value != value_2) - break; - - value = value_2; - } - - writeVariable(var, rand_value / value); - } - break; - - case 55:{ /* set itemA parent */ - setItemParent(getItem1Ptr(), getNextItemPtr()); - } - break; - - case 56:{ /* set child2 fr bit */ - Child2 *child = findChildOfType2(getNextItemPtr()); - int value = getVarOrByte(); - if (child != NULL && value >= 0x10) - child->avail_props |= 1 << value; - } - break; - - case 57:{ /* clear child2 fr bit */ - Child2 *child = findChildOfType2(getNextItemPtr()); - int value = getVarOrByte(); - if (child != NULL && value >= 0x10) - child->avail_props &= ~(1 << value); - } - break; - - case 58:{ /* make siblings */ - Item *item = getNextItemPtr(); - setItemParent(item, derefItem(getNextItemPtr()->parent)); - } - break; - - case 59:{ /* item inc unk3 */ - Item *item = getNextItemPtr(); - if (item->unk3 <= 30000) - setItemUnk3(item, item->unk3 + 1); - } - break; - - case 60:{ /* item dec unk3 */ - Item *item = getNextItemPtr(); - if (item->unk3 >= 0) - setItemUnk3(item, item->unk3 - 1); - } - break; - - case 61:{ /* item set unk3 */ - Item *item = getNextItemPtr(); - int value = getVarOrWord(); - if (value < 0) - value = 0; - if (value > 30000) - value = 30000; - setItemUnk3(item, value); - } - break; - - case 62:{ /* show int */ - showMessageFormat("%d", getNextVarContents()); - } - break; - - case 63:{ /* show string nl */ - showMessageFormat("%s\n", getStringPtrByID(getNextStringID())); - } - break; - - case 64:{ /* show string */ - showMessageFormat("%s", getStringPtrByID(getNextStringID())); - } - break; - - case 65:{ /* add hit area */ - int id = getVarOrWord(); - int x = getVarOrWord(); - int y = getVarOrWord(); - int w = getVarOrWord(); - int h = getVarOrWord(); - int number = getVarOrByte(); - if (number < 20) - addNewHitArea(id, x, y, w, h, (number << 8) + 129, 0xD0, _dummy_item_2); - } - break; - - case 66:{ /* set array 2 */ - uint var = getVarOrByte(); - uint string_id = getNextStringID(); - if (var < 20) - _stringid_array_2[var] = string_id; - } - break; - - case 67:{ /* set array 3 and 4 */ - if (_game == GAME_SIMON1WIN || _game & GAME_SIMON2) { - uint var = getVarOrByte(); - uint string_id = getNextStringID(); - uint value = getNextWord(); - if (var < 20) { - _stringid_array_3[var] = string_id; - _array_4[var] = value; - } - } else { - uint var = getVarOrByte(); - uint string_id = getNextStringID(); - if (var < 20) { - _stringid_array_3[var] = string_id; - } - } - } - break; - - case 68:{ /* exit interpreter */ - error("Exit interpreter opcode"); - } - break; - - case 69:{ /* return 1 */ - return 1; - } - - case 70:{ /* show string from array */ - const char *str = (const char *)getStringPtrByID(_stringid_array_3[getVarOrByte()]); - - if (_game & GAME_SIMON2) { - writeVariable(51, strlen(str) / 53 * 8 + 8); - } - - showMessageFormat("%s\n", str); - } - break; - - case 71:{ /* start subroutine */ - Subroutine *sub = getSubroutineByID(getVarOrWord()); - if (sub != NULL) - startSubroutine(sub); - } - break; - - case 76:{ /* add event */ - uint timeout = getVarOrWord(); - addTimeEvent(timeout, getVarOrWord()); - } - break; - - case 77:{ /* has item minus 1 */ - condition = _subject_item != NULL; - } - break; - - case 78:{ /* has item minus 3 */ - condition = _object_item != NULL; - } - break; - - case 79:{ /* childstruct fr2 is */ - Child2 *child = findChildOfType2(getNextItemPtr()); - uint string_id = getNextStringID(); - condition = (child != NULL) && child->string_id == string_id; - } - break; - - case 80:{ /* item equal */ - condition = getNextItemPtr() == getNextItemPtr(); - } - break; - - case 82:{ /* dummy opcode? */ - getVarOrByte(); - } - break; - - case 83:{ /* restart subroutine */ - return -10; - } - - case 87:{ /* dummy opcode? */ - getNextStringID(); - } - break; - - case 88:{ /* or_lock_word */ - _lock_word |= 0x10; - } - break; - - case 89:{ /* and lock word */ - _lock_word &= ~0x10; - } - break; - - case 90:{ /* set minusitem to parent */ - Item *item = derefItem(getNextItemPtr()->parent); - switch (getVarOrByte()) { - case 0: - _object_item = item; - break; - case 1: - _subject_item = item; - break; - default: - error("set minusitem to parent, invalid subcode"); - } - } - break; - - case 91:{ /* set minusitem to sibling */ - Item *item = derefItem(getNextItemPtr()->sibling); - switch (getVarOrByte()) { - case 0: - _object_item = item; - break; - case 1: - _subject_item = item; - break; - default: - error("set minusitem to sibling, invalid subcode"); - } - } - break; - - case 92:{ /* set minusitem to child */ - Item *item = derefItem(getNextItemPtr()->child); - switch (getVarOrByte()) { - case 0: - _object_item = item; - break; - case 1: - _subject_item = item; - break; - default: - error("set minusitem to child, invalid subcode"); - } - } - break; - - case 96:{ - uint val = getVarOrWord(); - o_set_video_mode(getVarOrByte(), val); - } - break; - - case 97:{ /* load vga */ - ensureVgaResLoadedC(getVarOrWord()); - } - break; - - case 98:{ - if (!(_game & GAME_SIMON2)) { - uint a = getVarOrWord(); - uint b = getVarOrByte(); - uint c = getVarOrWord(); - uint d = getVarOrWord(); - uint f = getVarOrWord(); - start_vga_code(b, a / 100, a, c, d, f); - } else { - uint a = getVarOrWord(); - uint b = getVarOrWord(); - uint c = getVarOrByte(); - uint d = getVarOrWord(); - uint e = getVarOrWord(); - uint f = getVarOrWord(); - start_vga_code(c, a, b, d, e, f); - } - } - break; - - case 99:{ - if (!(_game & GAME_SIMON2)) { - o_unk_99_simon1(getVarOrWord()); - } else { - uint a = getVarOrWord(); - uint b = getVarOrWord(); - o_unk_99_simon2(a, b); - } - } - break; - - case 100:{ - o_vga_reset(); - } - break; - - case 101:{ - uint a = getVarOrByte(); - uint b = getVarOrWord(); - uint c = getVarOrWord(); - uint d = getVarOrWord(); - uint e = getVarOrWord(); - uint f = getVarOrWord(); - uint g = getVarOrWord(); - o_unk26_helper(a, b, c, d, e, f, g, 0); - } - break; - - case 102:{ - fcs_unk_2(getVarOrByte() & 7); - } - break; - - case 103:{ - o_unk_103(); - } - break; - - case 104:{ - fcs_delete(getVarOrByte() & 7); - } - break; - - case 107:{ /* ADD_ITEM_HITAREA(id,x,y,w,h,item,unk3) */ - uint flags = 0; - uint id = getVarOrWord(); - uint params = id / 1000; - uint x, y, w, h, unk3; - Item *item; - - id = id % 1000; - - if (params & 1) - flags |= 8; - if (params & 2) - flags |= 4; - if (params & 4) - flags |= 0x80; - if (params & 8) - flags |= 1; - if (params & 16) - flags |= 0x10; - - x = getVarOrWord(); - y = getVarOrWord(); - w = getVarOrWord(); - h = getVarOrWord(); - item = getNextItemPtrStrange(); - unk3 = getVarOrWord(); - if (x >= 1000) { - unk3 += 0x4000; - x -= 1000; - } - addNewHitArea(id, x, y, w, h, flags, unk3, item); - } - break; - - case 108:{ /* delete hitarea */ - delete_hitarea(getVarOrWord()); - } - break; - - case 109:{ /* clear hitarea bit 0x40 */ - clear_hitarea_bit_0x40(getVarOrWord()); - } - break; - - case 110:{ /* set hitarea bit 0x40 */ - set_hitarea_bit_0x40(getVarOrWord()); - } - break; - - case 111:{ /* set hitarea xy */ - uint hitarea_id = getVarOrWord(); - uint x = getVarOrWord(); - uint y = getVarOrWord(); - set_hitarea_x_y(hitarea_id, x, y); - } - break; - - case 114:{ - Item *item = getNextItemPtr(); - uint fcs_index = getVarOrByte(); - lock(); - fcs_unk_proc_1(fcs_index, item, 0, 0); - unlock(); - } - break; - - case 115:{ /* item has flag */ - Item *item = getNextItemPtr(); - condition = (item->unk4 & (1 << getVarOrByte())) != 0; - } - break; - - case 116:{ /* item set flag */ - Item *item = getNextItemPtr(); - item->unk4 |= (1 << getVarOrByte()); - } - break; - - case 117:{ /* item clear flag */ - Item *item = getNextItemPtr(); - item->unk4 &= ~(1 << getVarOrByte()); - } - break; - - case 119:{ /* WAIT_VGA */ - uint var = getVarOrWord(); - _scriptvar_2 = (var == 200); - - if (var != 200 || !_skip_vga_wait) - o_wait_for_vga(var); - _skip_vga_wait = false; - } - break; - - case 120:{ - o_unk_120(getVarOrWord()); - } - break; - - case 121:{ /* SET_VGA_ITEM */ - uint slot = getVarOrByte(); - _vc_item_array[slot] = getNextItemPtr(); - } - break; - - case 125:{ /* item is sibling with item 1 */ - Item *item = getNextItemPtr(); - condition = (getItem1Ptr()->parent == item->parent); - } - break; - - case 126:{ - Item *item = getNextItemPtr(); - uint fcs_index = getVarOrByte(); - uint a = 1 << getVarOrByte(); - lock(); - fcs_unk_proc_1(fcs_index, item, 1, a); - unlock(); - } - break; - - case 127:{ /* deals with music */ - o_unk_127(); - } - break; - - case 128:{ /* dummy instruction? */ - getVarOrWord(); - } - break; - - case 129:{ /* dummy instruction? */ - getVarOrWord(); - condition = true; - } - break; - - case 130:{ /* set script cond */ - uint a = getVarOrByte(); - if (a == 1) { - getNextWord(); - _script_cond_b = getNextWord(); - } else { - getNextWord(); - _script_cond_c = getNextWord(); - } - } - break; - - case 132:{ -#ifdef _WIN32_WCE - - if (!draw_keyboard) { - draw_keyboard = true; - toolbar_drawn = false; - } -#endif - o_save_game(); - } - break; - - case 133:{ - o_load_game(); - } - break; - - case 134:{ - warning("stopMidiMusic: not implemented"); - /* dummy proc */ - } - break; - - case 135:{ - error("Quit if user presses Y unimplemented"); - } - break; - - case 136:{ /* set var to item unk3 */ - Item *item = getNextItemPtr(); - writeNextVarContents(item->unk3); - } - break; - - case 137:{ - o_unk_137(getVarOrByte()); - } - break; - - case 138:{ - o_unk_138(); - } - break; - - case 139:{ /* SET_PARENT_SPECIAL */ - Item *item = getNextItemPtr(); - _no_parent_notify = true; - setItemParent(item, getNextItemPtr()); - _no_parent_notify = false; - } - break; - - case 140:{ - killAllTimers(); - addTimeEvent(3, 0xA0); - } - break; - - case 141:{ - uint which = getVarOrByte(); - Item *item = getNextItemPtr(); - if (which == 1) { - _subject_item = item; - } else { - _object_item = item; - } - } - break; - - case 142:{ - condition = is_hitarea_0x40_clear(getVarOrWord()); - } - break; - - case 143:{ /* start item sub */ - Child1 *child = findChildOfType1(getNextItemPtr()); - if (child != NULL) { - Subroutine *sub = getSubroutineByID(child->subroutine_id); - if (sub) - startSubroutine(sub); - } - } - break; - - case 151:{ /* set array6 to item */ - uint var = getVarOrByte(); - Item *item = getNextItemPtr(); - _item_array_6[var] = item; - } - break; - - case 152:{ /* set m1 or m3 to array6 */ - Item *item = _item_array_6[getVarOrByte()]; - uint var = getVarOrByte(); - if (var == 1) { - _subject_item = item; - } else { - _object_item = item; - } - } - break; - - case 153:{ /* set bit */ - uint bit = getVarOrByte(); - _bit_array[bit >> 4] |= 1 << (bit & 15); - break; - } - - case 154:{ /* clear bit */ - uint bit = getVarOrByte(); - _bit_array[bit >> 4] &= ~(1 << (bit & 15)); - break; - } - - case 155:{ /* is bit clear? */ - uint bit = getVarOrByte(); - condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) == 0; - } - break; - - case 156:{ /* is bit set? */ - uint bit = getVarOrByte(); - condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) != 0; - } - break; - - case 157:{ /* get item int prop */ - Item *item = getNextItemPtr(); - Child2 *child = findChildOfType2(item); - uint prop = getVarOrByte(); - - if (child != NULL && child->avail_props & (1 << prop) && prop < 16) { - uint offs = getOffsetOfChild2Param(child, 1 << prop); - writeNextVarContents(child->array[offs]); - } else { - writeNextVarContents(0); - } - } - break; - - case 158:{ /* set item prop */ - Item *item = getNextItemPtr(); - Child2 *child = findChildOfType2(item); - uint prop = getVarOrByte(); - int value = getVarOrWord(); - - if (child != NULL && child->avail_props & (1 << prop) && prop < 16) { - uint offs = getOffsetOfChild2Param(child, 1 << prop); - child->array[offs] = value; - } - } - break; - - case 160:{ - o_unk_160(getVarOrByte()); - } - break; - - case 161:{ /* setup text */ - uint value = getVarOrByte(); - ThreeValues *tv; - - switch (value) { - case 1: - tv = &_threevalues_1; - break; - case 2: - tv = &_threevalues_2; - break; - case 101: - tv = &_threevalues_3; - break; - case 102: - tv = &_threevalues_4; - break; - default: - error("setup text, invalid value %d", value); - } - - tv->a = getVarOrWord(); - tv->b = getVarOrByte(); - tv->c = getVarOrWord(); - } - break; - - case 162:{ - o_print_str(); - } - break; - - case 163:{ - o_unk_163(getVarOrWord()); - } - break; - - case 164:{ - _show_preposition = true; - o_setup_cond_c(); - _show_preposition = false; - } - break; - - case 165:{ - Item *item = getNextItemPtr(); - int16 a = getNextWord(), b = getNextWord(); - condition = (item->unk2 == a && item->unk1 == b); - } break; - - case 166:{ /* set bit2 */ - uint bit = getVarOrByte(); - _bit_array[(bit >> 4) + 16] |= 1 << (bit & 15); - } - break; - - case 167:{ /* clear bit2 */ - uint bit = getVarOrByte(); - _bit_array[(bit >> 4) + 16] &= ~(1 << (bit & 15)); - } - break; - - case 168:{ /* is bit clear? */ - uint bit = getVarOrByte(); - condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) == 0; - } - break; - - case 169:{ /* is bit set? */ - uint bit = getVarOrByte(); - condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) != 0; - } - break; - - case 175:{ - o_unk_175(); - } - break; - - case 176:{ - o_unk_176(); - } - break; - - case 177:{ - o_177(); - } - break; - - case 178:{ /* path find */ - uint a = getVarOrWord(); - uint b = getVarOrWord(); - uint c = getVarOrByte(); - uint d = getVarOrByte(); - o_pathfind(a, b, c, d); - } - break; - - case 179:{ - if (_game == GAME_SIMON1WIN) { - uint b = getVarOrByte(); - /*uint c = */ getVarOrByte(); - uint a = getVarOrByte(); - uint d = _array_4[a]; - if (d != 0) - talk_with_speech(d, b); - } else if (_game == GAME_SIMON1DOS) { - uint b = getVarOrByte(); - uint c = getVarOrByte(); - uint a = getVarOrByte(); - const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]); - ThreeValues *tv; - - switch (b) { - case 1: - tv = &_threevalues_1; - break; - case 2: - tv = &_threevalues_2; - break; - case 101: - tv = &_threevalues_3; - break; - case 102: - tv = &_threevalues_4; - break; - default: - error("setup text, invalid value %d", b); - } - - talk_with_text(b, c, s, tv->a, tv->b, tv->c); - } else if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { - uint b = getVarOrByte(); - uint c = getVarOrByte(); - uint a = getVarOrByte(); - uint d; - const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]); - ThreeValues *tv; - - switch (b) { - case 1: - tv = &_threevalues_1; - break; - case 2: - tv = &_threevalues_2; - break; - case 101: - tv = &_threevalues_3; - break; - case 102: - tv = &_threevalues_4; - break; - default: - error("setup text, invalid value %d", b); - } - - d = _array_4[a]; - if (d != 0 && !_vk_t_toggle) - talk_with_speech(d, b); - - if (s != NULL && _vk_t_toggle) - talk_with_text(b, c, s, tv->a, tv->b, tv->c); - } - } - break; - - case 180:{ - o_force_unlock(); - } - break; - - case 181:{ - o_force_lock(); - if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { - fcs_unk_2(1); - showMessageFormat("\xC"); - } - } - break; - - case 182:{ - if (_game & GAME_SIMON2) - goto invalid_opcode; - o_read_vgares_328(); - } - break; - - case 183:{ - if (_game & GAME_SIMON2) - goto invalid_opcode; - o_read_vgares_23(); - } - break; - - case 184:{ - o_clear_vgapointer_entry(getVarOrWord()); - } - break; - - case 185:{ - if (_game & GAME_SIMON2) - goto invalid_opcode; - getVarOrWord(); - } - break; - - case 186:{ - o_unk_186(); - } - break; - - case 187:{ - if (_game & GAME_SIMON2) - goto invalid_opcode; - o_fade_to_black(); - } - break; - - case 188: - if (!(_game & GAME_SIMON2)) - goto invalid_opcode; - { - uint i = getVarOrByte(); - uint str = getNextStringID(); - condition = (str < 20 && _stringid_array_2[i] == str); - } - break; - - case 189:{ - if (!(_game & GAME_SIMON2)) - goto invalid_opcode; - _op_189_flags = 0; - } - break; - - case 190:{ - uint i; - if (!(_game & GAME_SIMON2)) - goto invalid_opcode; - i = getVarOrByte(); - if (!(_op_189_flags & (1 << i))) - o_190_helper(i); - } - break; - - default: - invalid_opcode:; - error("Invalid opcode '%d'", opcode); - } - - } while (condition != flag); - - return 0; -} - -int SimonState::startSubroutine(Subroutine *sub) -{ - int result = -1; - SubroutineLine *sl; - byte *old_code_ptr; - -#ifdef DUMP_START_MAINSCRIPT - dumpSubroutine(sub); -#endif - - old_code_ptr = _code_ptr; - - if (++_recursion_depth > 40) - error("Recursion error"); - - sl = (SubroutineLine *)((byte *)sub + sub->first); - - while ((byte *)sl != (byte *)sub) { - if (checkIfToRunSubroutineLine(sl, sub)) { - result = 0; - _code_ptr = (byte *)sl; - if (sub->id) - _code_ptr += 2; - else - _code_ptr += 8; - -#ifdef DUMP_CONTINOUS_MAINSCRIPT - fprintf(_dump_file, "; %d\n", sub->id); -#endif - result = runScript(); - if (result != 0) { - /* result -10 means restart subroutine */ - if (result == -10) { - delay(0); /* maybe leave control to the VGA */ - sl = (SubroutineLine *)((byte *)sub + sub->first); - continue; - } - break; - } - } - sl = (SubroutineLine *)((byte *)sub + sl->next); - } - - _code_ptr = old_code_ptr; - - _recursion_depth--; - return result; -} - -int SimonState::startSubroutineEx(Subroutine *sub) -{ - _item_1_ptr = _item_1; - return startSubroutine(sub); -} - -bool SimonState::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub) -{ - if (sub->id) - return true; - - if (sl->cond_a != -1 && sl->cond_a != _script_cond_a && - (sl->cond_a != -2 || _script_cond_a != -1)) - return false; - - if (sl->cond_b != -1 && sl->cond_b != _script_cond_b && - (sl->cond_b != -2 || _script_cond_b != -1)) - return false; - - if (sl->cond_c != -1 && sl->cond_c != _script_cond_c && - (sl->cond_c != -2 || _script_cond_c != -1)) - return false; - - return true; -} - -void SimonState::o_190_helper(uint i) -{ - warning("o_190_helper not implemented"); -} - - -bool SimonState::o_unk_23(uint a) -{ - if (a == 0) - return 0; - - if (a == 100) - return 1; - - a += _script_unk_1; - if (a <= 0) { - _script_unk_1 = 0; - return 0; - } - - if (((uint) (rand() >> 5)) % 100 < a) { - if (_script_unk_1 <= 0) - _script_unk_1 -= 5; - else - _script_unk_1 = 0; - return 1; - } - - if (_script_unk_1 >= 0) - _script_unk_1 += 5; - else - _script_unk_1 = 0; - - return 0; -} - -void SimonState::o_177() -{ - if (_game == GAME_SIMON1WIN) { - uint a = getVarOrByte(); - /*uint b = */ getVarOrByte(); - uint offs; - Child2 *child = findChildOfType2(getNextItemPtr()); - if (child != NULL && child->avail_props & 0x200) { - offs = getOffsetOfChild2Param(child, 0x200); - talk_with_speech(child->array[offs], a); - } else if (child != NULL && child->avail_props & 0x100) { - offs = getOffsetOfChild2Param(child, 0x100); - talk_with_speech(child->array[offs] + 3550, a); - } - } else if (_game == GAME_SIMON1DOS) { - uint a = getVarOrByte(); - uint b = getVarOrByte(); - Child2 *child = findChildOfType2(getNextItemPtr()); - if (child != NULL && child->avail_props & 1) { - const char *s = (const char *)getStringPtrByID(child->array[0]); - ThreeValues *tv; - char buf[256]; - switch (a) { - case 1: - tv = &_threevalues_1; - break; - case 2: - tv = &_threevalues_2; - break; - case 101: - tv = &_threevalues_3; - break; - case 102: - tv = &_threevalues_4; - break; - default: - error("setup text, invalid value %d", a); - } - - if (child->avail_props & 0x100) { - uint x = getOffsetOfChild2Param(child, 0x100); - sprintf(buf, "%d%s", child->array[x], s); - s = buf; - } - - talk_with_text(a, b, s, tv->a, tv->b, tv->c); - } - } else if (_game == GAME_SIMON2WIN || _game == GAME_SIMON2DOS) { - uint a = getVarOrByte(); - uint b = getVarOrByte(); - Child2 *child = findChildOfType2(getNextItemPtr()); - const char *s = NULL; - ThreeValues *tv = NULL; - char buf[256]; - - if (child != NULL && child->avail_props & 1) { - s = (const char *)getStringPtrByID(child->array[0]); - switch (a) { - case 1: - tv = &_threevalues_1; - break; - case 2: - tv = &_threevalues_2; - break; - case 101: - tv = &_threevalues_3; - break; - case 102: - tv = &_threevalues_4; - break; - default: - error("setup text, invalid value %d", a); - } - } - - if (child != NULL && child->avail_props & 0x200) { - uint var200 = child->array[getOffsetOfChild2Param(child, 0x200)]; - - if (child->avail_props & 0x100) { - uint var100 = child->array[getOffsetOfChild2Param(child, 0x100)]; - - if (var200 == 116) - var200 = var100 + 115; - if (var200 == 92) - var200 = var100 + 98; - if (var200 == 99) - var200 = 9; - if (var200 == 97) { - switch (var100) { - case 12: - var200 = 109; - break; - case 14: - var200 = 108; - break; - case 18: - var200 = 107; - break; - case 20: - var200 = 106; - break; - case 22: - var200 = 105; - break; - case 28: - var200 = 104; - break; - case 90: - var200 = 103; - break; - case 92: - var200 = 102; - break; - case 100: - var200 = 51; - break; - default: - error("o_177: invalid case %d", var100); - } - } - } - - if (!_vk_t_toggle) - talk_with_speech(var200, a); - } - - if (!_vk_t_toggle) - return; - - if (child == NULL || !(child->avail_props & 1)) - return; - - if (child->avail_props & 0x100) { - sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], s); - s = buf; - } - - talk_with_text(a, b, s, tv->a, tv->b, tv->c); - } -} - - -void SimonState::o_unk_137(uint fcs_index) -{ - FillOrCopyStruct *fcs; - - fcs = _fcs_ptr_array_3[fcs_index & 7]; - if (fcs->fcs_data == NULL) - return; - fcs_unk_proc_1(fcs_index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); -} - -void SimonState::o_unk_138() -{ - _vga_buf_start = _vga_buf_free_start; - _vga_file_buf_org = _vga_buf_free_start; -} - -void SimonState::o_unk_186() -{ - _vga_buf_free_start = _vga_file_buf_org_2; - _vga_buf_start = _vga_file_buf_org_2; - _vga_file_buf_org = _vga_file_buf_org_2; -} - -void SimonState::o_unk_175() -{ - _vga_buf_start = _vga_buf_free_start; -} - -void SimonState::o_unk_176() -{ - _vga_buf_free_start = _vga_file_buf_org; - _vga_buf_start = _vga_file_buf_org; -} - -int SimonState::o_unk_132_helper(bool *b, char *buf) -{ - HitArea *ha; - - *b = true; - - - if (!_saveload_flag) { - strange_jump:; - _saveload_flag = false; - savegame_dialog(buf); - } - -start_over:; - _key_pressed = 0; - -start_over_2:; - _last_hitarea = _last_hitarea_3 = 0; - - do { - if (_key_pressed != 0) { - if (_saveload_flag) { - *b = false; - return _key_pressed; - } - goto start_over; - } - delay(100); - } while (_last_hitarea_3 == 0); - - ha = _last_hitarea; - - if (ha == NULL || ha->id < 205) - goto start_over_2; - - if (ha->id == 205) - return ha->id; - - if (ha->id == 206) { - if (_saveload_row_curpos == 1) - goto start_over_2; - if (_saveload_row_curpos < 7) - _saveload_row_curpos = 1; - else - _saveload_row_curpos -= 6; - - goto strange_jump; - } - - if (ha->id == 207) { - if (!_savedialog_flag) - goto start_over_2; - _saveload_row_curpos += 6; -// if (_saveload_row_curpos >= _num_savegame_rows) -// _saveload_row_curpos = _num_savegame_rows; - goto strange_jump; - } - - if (ha->id >= 214) - goto start_over_2; - return ha->id - 208; -} - -void SimonState::o_unk_132_helper_3() -{ - for (int i = 208; i != 208 + 6; i++) - set_hitarea_bit_0x40(i); -} - -void SimonState::o_unk_132_helper_2(FillOrCopyStruct *fcs, int x) -{ - byte old_text; - - video_putchar(fcs, x); - old_text = fcs->text_color; - fcs->text_color = fcs->fill_color; - - x += 120; - if (x != 128) - x = 129; - video_putchar(fcs, x); - - fcs->text_color = old_text; - video_putchar(fcs, 8); -} - -void SimonState::o_unk_127() -{ - if (_game & GAME_SIMON2) { - uint a = getVarOrWord(); - uint b = getVarOrWord(); - uint c = getVarOrByte(); - - warning("o_unk_127(%d,%d,%d) not implemented properly", a, b, c); - - if (a != _last_music_played) { - _last_music_played = a; - playMusic(a); - } - } else { - uint a = getVarOrWord(); - /*uint b = */ getVarOrWord(); - - if (a != _last_music_played) { - _last_music_played = a; - playMusic(a); - } - } -} - -void SimonState::o_unk_120(uint a) -{ - uint16 id = TO_BE_16(a); - _lock_word |= 0x4000; - _vc_ptr = (byte *)&id; - vc_15_start_funkystruct_by_id(); - _lock_word &= ~0x4000; -} - -void SimonState::o_unk_163(uint a) -{ - playSound(a); -} - -void SimonState::o_unk_160(uint a) -{ - fcs_setTextColor(_fcs_ptr_array_3[_fcs_unk_1], a); -} - -void SimonState::o_unk_103() -{ - lock(); - fcs_unk1(_fcs_unk_1); - showMessageFormat("\x0C"); - unlock(); -} - -void SimonState::o_unk_99_simon1(uint a) -{ - uint16 b = TO_BE_16(a); - _lock_word |= 0x4000; - _vc_ptr = (byte *)&b; - vc_60(); - _lock_word &= ~0x4000; -} - -void SimonState::o_unk_99_simon2(uint a, uint b) -{ - uint16 items[2]; - - items[0] = TO_BE_16(a); - items[1] = TO_BE_16(b); - - _lock_word |= 0x4000; - _vc_ptr = (byte *)&items; - vc_60(); - _lock_word &= ~0x4000; -} - -/* OK */ -void SimonState::o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) -{ - a &= 7; - - if (_fcs_ptr_array_3[a]) - fcs_delete(a); - - _fcs_ptr_array_3[a] = fcs_alloc(b, c, d, e, f, g, h); - - if (a == _fcs_unk_1) { - _fcs_ptr_1 = _fcs_ptr_array_3[a]; - showmessage_helper_3(_fcs_ptr_1->textLength, - _fcs_ptr_1->textMaxLength); - } -} diff --git a/simon/simonres.cpp b/simon/simonres.cpp deleted file mode 100644 index 7b36d1f770..0000000000 --- a/simon/simonres.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -// Resource file routines for Simon1/Simon2 -#include "stdafx.h" -#include "simon.h" -#include "simonintern.h" - -// Script opcodes to load into memory -static const char *const opcode_arg_table_simon1win[256] = { - " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", - "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", - "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BTS ", "T ", " ", "B ", - "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", - "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NBNNN ", "N ", - " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", - "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", - "NN ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", "N ", - "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", "B ", - "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBTS ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", "T ", - "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", " ", - " ", -}; - -static const char *const opcode_arg_table_simon1dos[256] = { - " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", - "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", - "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BT ", "T ", " ", "B ", - "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", - "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NBNNN ", "N ", - " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", - "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", - "NN ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", "N ", - "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", "B ", - "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBT ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", "T ", - "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", " ", - " ", -}; - -static const char *const opcode_arg_table_simon2win[256] = { - " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", - "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", - "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BTS ", "T ", " ", "B ", - "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", - "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NNBNNN ", "NN ", - " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", - "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", - "NNB ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", - "N ", "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", - "B ", "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBTS ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", - "T ", "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", - " ", " ", "BT ", " ", "B " -}; - -static const char *const opcode_arg_table_simon2dos[256] = { - " ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ", - "II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ", - "BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ", - "IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BT ", "T ", " ", "B ", - "N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ", - "IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NNBNNN ", "NN ", - " ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ", - "IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ", - "NNB ", "N ", "N ", "Ban ", "BB ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ", - "N ", "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ", - "B ", "IBB ", "IBN ", "IB ", "B ", "BNBN ", "BBT ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ", - "T ", "T ", "B ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", " ", " ", "N ", "N ", - " ", " ", "BT ", " ", "B " -}; - -FILE *SimonState::fopen_maybe_lowercase(const char *filename) -{ - FILE *in; - char buf[256], dotbuf[256], *e; - const char *s = _gameDataPath; - - if (filename == NULL || *filename == '\0') - return NULL; - - strcpy(buf, s); - strcat(buf, filename); - strcpy(dotbuf, buf); - strcat(dotbuf, "."); // '.' appended version - // for dumb vfat drivers - - /* original filename */ - in = fopen(buf, "rb"); - if (in) - return in; - - /* lowercase original filename */ - e = buf + strlen(s); - do - *e = tolower(*e); - while (*e++); - in = fopen(buf, "rb"); - if (in) - return in; - - if (strchr(buf, '.')) - return NULL; - - /* dot appended original filename */ - in = fopen(dotbuf, "rb"); - if (in) - return in; - - /* lowercase dot appended */ - e = dotbuf + strlen(s); - do - *e = tolower(*e); - while (*e++); - in = fopen(dotbuf, "rb"); - - return in; -} - -bool SimonState::loadGamePcFile(const char *filename) -{ - FILE *in; - int num_inited_objects; - int i, file_size; - - /* read main gamepc file */ - in = fopen_maybe_lowercase(filename); - if (in == NULL) - return false; - - num_inited_objects = allocGamePcVars(in); - - allocItem1(); - loginPlayer(); - readGamePcText(in); - - for (i = 2; i < num_inited_objects; i++) { - readItemFromGamePc(in, _itemarray_ptr[i]); - } - - readSubroutineBlock(in); - - fclose(in); - - /* Read list of TABLE resources */ - in = fopen_maybe_lowercase("TBLLIST"); - if (in == NULL) - return false; - - fseek(in, 0, SEEK_END); - file_size = ftell(in); - - _tbl_list = (byte *)malloc(file_size); - if (_tbl_list == NULL) - error("Out of memory for strip table list"); - fseek(in, 0, SEEK_SET); - fread(_tbl_list, file_size, 1, in); - fclose(in); - - /* Remember the current state */ - _subroutine_list_org = _subroutine_list; - _tablesheap_ptr_org = _tablesheap_ptr; - _tablesheap_curpos_org = _tablesheap_curpos; - - /* Read list of TEXT resources */ - in = fopen_maybe_lowercase("STRIPPED.TXT"); - if (in == NULL) - return false; - - fseek(in, 0, SEEK_END); - file_size = ftell(in); - _stripped_txt_mem = (byte *)malloc(file_size); - if (_stripped_txt_mem == NULL) - error("Out of memory for strip text list"); - fseek(in, 0, SEEK_SET); - fread(_stripped_txt_mem, file_size, 1, in); - fclose(in); - - return true; -} - -void SimonState::readGamePcText(FILE *in) -{ - uint text_size; - byte *text_mem; - - _text_size = text_size = fileReadBE32(in); - text_mem = (byte *)malloc(text_size); - if (text_mem == NULL) - error("Out of text memory"); - - fread(text_mem, text_size, 1, in); - - setupStringTable(text_mem, _stringtab_num); -} - -void SimonState::readItemFromGamePc(FILE *in, Item *item) -{ - uint32 type; - - item->unk2 = fileReadBE16(in); - item->unk1 = fileReadBE16(in); - item->unk3 = fileReadBE16(in); - item->sibling = (uint16)fileReadItemID(in); - item->child = (uint16)fileReadItemID(in); - item->parent = (uint16)fileReadItemID(in); - fileReadBE16(in); - item->unk4 = fileReadBE16(in); - item->children = NULL; - - type = fileReadBE32(in); - while (type) { - type = fileReadBE16(in); - if (type != 0) - readItemChildren(in, item, type); - } -} - -void SimonState::readItemChildren(FILE *in, Item *item, uint type) -{ - if (type == 1) { - uint fr1 = fileReadBE16(in); - uint fr2 = fileReadBE16(in); - uint i, size; - uint j, k; - Child1 *child; - - size = CHILD1_SIZE; - for (i = 0, j = fr2; i != 6; i++, j >>= 2) - if (j & 3) - size += sizeof(child->array[0]); - - child = (Child1 *)allocateChildBlock(item, 1, size); - child->subroutine_id = fr1; - child->fr2 = fr2; - - for (i = k = 0, j = fr2; i != 6; i++, j >>= 2) - if (j & 3) - child->array[k++] = (uint16)fileReadItemID(in); - } else if (type == 2) { - uint32 fr = fileReadBE32(in); - uint i, k, size; - Child2 *child; - - size = CHILD2_SIZE; - for (i = 0; i != 16; i++) - if (fr & (1 << i)) - size += sizeof(child->array[0]); - - child = (Child2 *)allocateChildBlock(item, 2, size); - child->avail_props = fr; - - k = 0; - if (fr & 1) { - child->array[k++] = (uint16)fileReadBE32(in); - } - for (i = 1; i != 16; i++) - if (fr & (1 << i)) - child->array[k++] = fileReadBE16(in); - - child->string_id = (uint16)fileReadBE32(in); - } else { - error("readItemChildren: invalid mode"); - } -} - -uint fileReadItemID(FILE *in) -{ - uint32 val = fileReadBE32(in); - if (val == 0xFFFFFFFF) - return 0; - return val + 2; -} - -byte *SimonState::readSingleOpcode(FILE *in, byte *ptr) -{ - int i, l; - const char *string_ptr; - uint val; - - const char *const *table; - - switch (_game) { - case GAME_SIMON1WIN: - table = opcode_arg_table_simon1win; - break; - case GAME_SIMON2DOS: - table = opcode_arg_table_simon2win; - printf("right opcode table\n"); - break; - case GAME_SIMON2WIN: - table = opcode_arg_table_simon2win; - break; - case GAME_SIMON1DOS: - table = opcode_arg_table_simon1dos; - break; - default: - error("Invalid game specified"); - } - - i = 0; - - string_ptr = table[*ptr++]; - if (!string_ptr) - error("Unable to locate opcode table. Perhaps you are using the wrong game target?"); - - for (;;) { - if (string_ptr[i] == ' ') - return ptr; - - l = string_ptr[i++]; - switch (l) { - case 'N': - case 'S': - case 'a': - case 'n': - case 'p': - case 'v': - val = fileReadBE16(in); - *ptr++ = val >> 8; - *ptr++ = val & 255; - break; - - case 'B': - *ptr++ = fileReadByte(in); - if (ptr[-1] == 0xFF) { - *ptr++ = fileReadByte(in); - } - break; - - case 'I': - val = fileReadBE16(in); - switch (val) { - case 1: - val = 0xFFFF; - break; - case 3: - val = 0xFFFD; - break; - case 5: - val = 0xFFFB; - break; - case 7: - val = 0xFFF9; - break; - case 9: - val = 0xFFF7; - break; - default: - val = fileReadItemID(in);; - } - *ptr++ = val >> 8; - *ptr++ = val & 255; - break; - - case 'T': - val = fileReadBE16(in); - switch (val) { - case 0: - val = 0xFFFF; - break; - case 3: - val = 0xFFFD; - break; - default: - val = (uint16)fileReadBE32(in); - break; - } - *ptr++ = val >> 8; - *ptr++ = val & 255; - break; - - default: - error("Bad cmd table entry %c", l); - } - } -} diff --git a/simon/simonsys.cpp b/simon/simonsys.cpp deleted file mode 100644 index 0bef256764..0000000000 --- a/simon/simonsys.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "simon.h" - -uint fileReadByte(FILE *in) -{ - byte b; - fread(&b, sizeof(b), 1, in); - return b; -} - -uint fileReadBE16(FILE *in) -{ - byte b[2]; - fread(b, sizeof(b), 1, in); - return (b[0] << 8) | b[1]; -} - -uint fileReadLE16(FILE *in) -{ - byte b[2]; - fread(b, sizeof(b), 1, in); - return (b[1] << 8) | b[0]; -} - -uint32 fileReadBE32(FILE *in) -{ - byte b[4]; - fread(b, sizeof(b), 1, in); - return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; -} - -uint32 fileReadLE32(FILE *in) -{ - byte b[4]; - fread(b, sizeof(b), 1, in); - return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; -} - - -void fileWriteBE32(FILE *in, uint32 value) -{ - value = TO_BE_32(value); - fwrite(&value, sizeof(value), 1, in); -} - -void fileWriteBE16(FILE *in, uint16 value) -{ - value = TO_BE_16(value); - fwrite(&value, sizeof(value), 1, in); -} diff --git a/simon/simonverb.cpp b/simon/simonverb.cpp deleted file mode 100644 index 662237cd68..0000000000 --- a/simon/simonverb.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -// Verb and hitarea handling -#include "stdafx.h" -#include "simon.h" -#include "simonintern.h" - -void SimonState::defocusHitarea() -{ - HitArea *last; - HitArea *ha; - - if ((_game == GAME_SIMON2WIN) || (_game == GAME_SIMON2DOS)) { - if (_bit_array[4] & 0x8000) { - o_unk_120(202); - _last_hitarea_2_ptr = NULL; - return; - } - } - - last = _hitarea_ptr_5; - - if (last == _hitarea_ptr_7) - return; - - hitareaChangedHelper(); - _hitarea_ptr_7 = last; - - if (last != NULL && _hitarea_unk_6 && - (ha = findHitAreaByID(200)) && (ha->flags & 0x40) && !(last->flags & 0x40)) - focusVerb(last->id); -} - -static const char *const verb_names[] = { - "Walk to", - "Look at", - "Open", - "Move", - - "Consume", - "Pick up", - "Close", - "Use", - - "Talk to", - "Remove", - "Wear", - "Give" -}; - -static const char *const verb_prep_names[] = { - "", "", "", "", - "", "", "", "with what ?", - "", "", "", "to whom ?" -}; - -void SimonState::focusVerb(uint hitarea_id) -{ - uint x; - const char *txt; - - hitarea_id -= 101; - - CHECK_BOUNDS(hitarea_id, verb_prep_names); - - if (_show_preposition) { - txt = verb_prep_names[hitarea_id]; - } else { - txt = verb_names[hitarea_id]; - } - x = (53 - strlen(txt)) * 3; - showActionString(x, (const byte *)txt); - -} - -void SimonState::showActionString(uint x, const byte *string) -{ - FillOrCopyStruct *fcs; - - fcs = _fcs_ptr_array_3[1]; - if (fcs == NULL || fcs->text_color == 0) - return; - - fcs->textColumn = x >> 3; - fcs->textColumnOffset = x & 7; - - for (; *string; string++) - video_putchar(fcs, *string); -} - - -void SimonState::hitareaChangedHelper() -{ - FillOrCopyStruct *fcs; - - if ((_game == GAME_SIMON2WIN) || (_game == GAME_SIMON2WIN)) { - if (_bit_array[4] & 0x8000) - return; - } - - fcs = _fcs_ptr_array_3[1]; - if (fcs != NULL && fcs->text_color != 0) - video_fill_or_copy_from_3_to_2(fcs); - - _last_hitarea_2_ptr = NULL; - _hitarea_ptr_7 = NULL; -} - -HitArea *SimonState::findHitAreaByID(uint hitarea_id) -{ - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); - - do { - if (ha->id == hitarea_id) - return ha; - } while (ha++, --count); - return NULL; -} - -HitArea *SimonState::findEmptyHitArea() -{ - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); - - do { - if (ha->flags == 0) - return ha; - } while (ha++, --count); - return NULL; -} - -void SimonState::clear_hitarea_bit_0x40(uint hitarea) -{ - HitArea *ha = findHitAreaByID(hitarea); - if (ha != NULL) - ha->flags &= ~0x40; -} - -void SimonState::set_hitarea_bit_0x40(uint hitarea) -{ - HitArea *ha = findHitAreaByID(hitarea); - if (ha != NULL) { - ha->flags |= 0x40; - ha->flags &= ~2; - if (hitarea == 102) - hitarea_proc_1(); - } -} - -void SimonState::set_hitarea_x_y(uint hitarea, int x, int y) -{ - HitArea *ha = findHitAreaByID(hitarea); - if (ha != NULL) { - ha->x = x; - ha->y = y; - } -} - -void SimonState::delete_hitarea(uint hitarea) -{ - HitArea *ha = findHitAreaByID(hitarea); - if (ha != NULL) { - ha->flags = 0; - if (ha == _last_hitarea_2_ptr) - defocusHitarea(); - _need_hitarea_recalc++; - } -} - -bool SimonState::is_hitarea_0x40_clear(uint hitarea) -{ - HitArea *ha = findHitAreaByID(hitarea); - if (ha == NULL) - return false; - return (ha->flags & 0x40) == 0; -} - -void SimonState::addNewHitArea(int id, int x, int y, int width, int height, - int flags, int unk3, Item *item_ptr) -{ - - HitArea *ha; - delete_hitarea(id); - - ha = findEmptyHitArea(); - ha->x = x; - ha->y = y; - ha->width = width; - ha->height = height; - ha->flags = flags | 0x20; - ha->id = ha->layer = id; - ha->unk3 = unk3; - ha->item_ptr = item_ptr; - - _need_hitarea_recalc++; -} - -void SimonState::hitarea_proc_1() -{ - uint id; - HitArea *ha; - - if (_game & GAME_SIMON2) { - id = 2; - if (!(_bit_array[4] & 0x8000)) - id = (_mouse_y >= 136) ? 102 : 101; - } else { - id = (_mouse_y >= 136) ? 102 : 101; - - } - - _hitarea_unk_4 = id; - - ha = findHitAreaByID(id); - if (ha == NULL) - return; - - if (ha->flags & 0x40) { - _hitarea_unk_4 = 999; - _hitarea_ptr_5 = NULL; - } else { - _verb_hitarea = ha->unk3; - handle_verb_hitarea(ha); - } -} - -void SimonState::handle_verb_hitarea(HitArea * ha) -{ - HitArea *tmp = _hitarea_ptr_5; - - if (ha == tmp) - return; - - if (!(_game & GAME_SIMON2)) { - if (tmp != NULL) { - tmp->flags |= 8; - video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA); - } - - if (ha->flags & 2) - video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5); - else - video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA); - - ha->flags &= ~(2 + 8); - - } else { - if (ha->id < 101) - return; - _mouse_cursor = ha->id - 101; - _need_hitarea_recalc++; - - } - - _hitarea_ptr_5 = ha; -} - -void SimonState::hitarea_leave(HitArea * ha) -{ - if (!(_game & GAME_SIMON2)) { - video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5); - } else { - video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1); - } -} - -void SimonState::leaveHitAreaById(uint hitarea_id) -{ - HitArea *ha = findHitAreaByID(hitarea_id); - if (ha) - hitarea_leave(ha); -} - -void SimonState::handle_unk2_hitarea(FillOrCopyStruct *fcs) -{ - uint index; - - index = get_fcs_ptr_3_index(fcs); - - if (fcs->fcs_data->unk1 == 0) - return; - - lock(); - fcs_unk_proc_1(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 - 1, fcs->fcs_data->unk2); - unlock(); -} - -void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs) -{ - uint index; - - index = get_fcs_ptr_3_index(fcs); - - lock(); - fcs_unk_proc_1(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 + 1, fcs->fcs_data->unk2); - unlock(); -} - -void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode) -{ - HitArea *best_ha; - - if (_game & GAME_SIMON2) { - if (_bit_array[4] & 0x8000 || y < 134) { - x += _x_scroll * 8; - } - } - - { - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); - uint16 layer = 0; - const uint16 x_ = x; - const uint16 y_ = y; - - best_ha = NULL; - - do { - if (ha->flags & 0x20) { - if (!(ha->flags & 0x40)) { - if (x_ >= ha->x && y_ >= ha->y && - x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) { - layer = ha->layer; - best_ha = ha; - } else { - if (ha->flags & 2) { - hitarea_leave(ha); - ha->flags &= ~2; - } - } - } else { - ha->flags &= ~2; - } - } - } while (ha++, --count); - } - - if (best_ha == NULL) { - defocusHitarea(); - return; - } - - if (mode != 0 && mode != 3) { - _last_hitarea = best_ha; - _variableArray[1] = x; - _variableArray[2] = y; - } - - if (best_ha->flags & 4) { - defocusHitarea(); - } else if (best_ha != _last_hitarea_2_ptr) { - new_current_hitarea(best_ha); - } - - if (best_ha->flags & 8 && !(best_ha->flags & 2)) { - hitarea_leave(best_ha); - best_ha->flags |= 2; - } - - return; -} - -void SimonState::new_current_hitarea(HitArea * ha) -{ - bool result; - - hitareaChangedHelper(); - if (ha->flags & 1) { - result = hitarea_proc_2(ha->flags >> 8); - } else { - result = hitarea_proc_3(ha->item_ptr); - } - - if (result) - _last_hitarea_2_ptr = ha; -} - -bool SimonState::hitarea_proc_2(uint a) -{ - uint x; - const byte *string_ptr; - - if (_game & GAME_SIMON2) { - if (_bit_array[4] & 0x8000) { - Subroutine *sub; - _variableArray[84] = a; - sub = getSubroutineByID(5003); - if (sub != NULL) - startSubroutineEx(sub); - return true; - } - } - - if (a >= 20) - return false; - - string_ptr = getStringPtrByID(_stringid_array_2[a]); - // Arisme : hack for long strings in the French version - if ((strlen((const char*)string_ptr) - 1) <= 53) - x = (53 - (strlen((const char *)string_ptr) - 1)) * 3; - else - x = 0; - showActionString(x, string_ptr); - - return true; -} - -bool SimonState::hitarea_proc_3(Item *item) -{ - Child2 *child2; - uint x; - const byte *string_ptr; - - if (item == 0 || item == _dummy_item_2 || item == _dummy_item_3) - return false; - - child2 = findChildOfType2(item); - if (child2 == NULL) - return false; - - string_ptr = getStringPtrByID(child2->string_id); - // Arisme : hack for long strings in the French version - if ((strlen((const char*)string_ptr) - 1) <= 53) - x = (53 - (strlen((const char *)string_ptr) - 1)) * 3; - else - x = 0; - showActionString(x, string_ptr); - return true; -} diff --git a/simon/simonvga.cpp b/simon/simonvga.cpp deleted file mode 100644 index 1c56d5295d..0000000000 --- a/simon/simonvga.cpp +++ /dev/null @@ -1,1966 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -// Video script opcodes for Simon1/Simon2 -#include "stdafx.h" -#include "simon.h" -#include "simonintern.h" - -typedef void (SimonState::*VgaOpcodeProc) (); -static const uint16 vc_get_out_of_code = 0; - -// Opcode tables -static const VgaOpcodeProc vga_opcode_table[] = { - NULL, - &SimonState::vc_1, - &SimonState::vc_2, - &SimonState::vc_3, - &SimonState::vc_4, - &SimonState::vc_5, - &SimonState::vc_6_maybe_skip_3_inv, - &SimonState::vc_7_maybe_skip_3, - &SimonState::vc_8_maybe_skip_2, - &SimonState::vc_9_maybe_skip, - &SimonState::vc_10, - &SimonState::vc_11_clear_pathfind_array, - &SimonState::vc_12_sleep_variable, - &SimonState::vc_13_offset_x, - &SimonState::vc_14_offset_y, - &SimonState::vc_15_start_funkystruct_by_id, - &SimonState::vc_16_setup_funkystruct, - &SimonState::vc_17_set_pathfind_item, - &SimonState::vc_18_jump_rel, - &SimonState::vc_19, - &SimonState::vc_20, - &SimonState::vc_21, - &SimonState::vc_22, - &SimonState::vc_23_set_pri, - &SimonState::vc_24_set_image_xy, - &SimonState::vc_25_del_sprite_and_get_out, - &SimonState::vc_26, - &SimonState::vc_27_reset, - &SimonState::vc_28, - &SimonState::vc_29_stop_all_sounds, - &SimonState::vc_30_set_base_delay, - &SimonState::vc_31_set_palette_mode, - &SimonState::vc_32_copy_var, - &SimonState::vc_33, - &SimonState::vc_34, - &SimonState::vc_35, - &SimonState::vc_36, - &SimonState::vc_37_sprite_unk3_add, - &SimonState::vc_38_skip_if_var_zero, - &SimonState::vc_39_set_var, - &SimonState::vc_40_var_add, - &SimonState::vc_41_var_sub, - &SimonState::vc_42_delay_if_not_eq, - &SimonState::vc_43_skip_if_bit_clear, - &SimonState::vc_44_skip_if_bit_set, - &SimonState::vc_45_set_x, - &SimonState::vc_46_set_y, - &SimonState::vc_47_add_var_f, - &SimonState::vc_48, - &SimonState::vc_49_set_bit, - &SimonState::vc_50_clear_bit, - &SimonState::vc_51_clear_hitarea_bit_0x40, - &SimonState::vc_52, - &SimonState::vc_53_no_op, - &SimonState::vc_54_no_op, - &SimonState::vc_55_offset_hit_area, - &SimonState::vc_56_no_op, - &SimonState::vc_57_no_op, - &SimonState::vc_58, - &SimonState::vc_59, - &SimonState::vc_60, - &SimonState::vc_61_sprite_change, - &SimonState::vc_62, - &SimonState::vc_63, - &SimonState::vc_64, - &SimonState::vc_65, - &SimonState::vc_66, - &SimonState::vc_67, - &SimonState::vc_68, - &SimonState::vc_69, - &SimonState::vc_70, - &SimonState::vc_71, - &SimonState::vc_72, - &SimonState::vc_73, - &SimonState::vc_74, -}; - -// Script parser -void SimonState::run_vga_script() -{ - for (;;) { - uint opcode; - -#ifdef DUMP_CONTINOUS_VGASCRIPT - if ((void *)_vc_ptr != (void *)&vc_get_out_of_code) { -// if (_vga_cur_sprite_id==62 && _vga_cur_file_id==68 || -// _vga_cur_sprite_id==1 && _vga_cur_file_id==2) { - fprintf(_dump_file, "%.5d %.5X: %5d %4d ", _vga_tick_counter, _vc_ptr - _cur_vga_file_1, - _vga_cur_sprite_id, _vga_cur_file_id); - dump_video_script(_vc_ptr, true); -// } - } -#endif - - if (!(_game & GAME_SIMON2)) { - opcode = READ_BE_UINT16_UNALIGNED(_vc_ptr); - _vc_ptr += 2; - } else { - opcode = *_vc_ptr++; - } - - if (opcode >= gss->NUM_VIDEO_OP_CODES) - error("Invalid VGA opcode '%d' encountered", opcode); - - if (opcode == 0) - return; - - (this->*vga_opcode_table[opcode]) (); - } -} - -int SimonState::vc_read_var_or_word() -{ - int16 var = vc_read_next_word(); - if (var < 0) - var = vc_read_var(-var); - return var; -} - -uint SimonState::vc_read_next_word() -{ - uint a = READ_BE_UINT16_UNALIGNED(_vc_ptr); - _vc_ptr += 2; - return a; -} - -uint SimonState::vc_read_next_byte() -{ - return *_vc_ptr++; -} - - -void SimonState::vc_skip_next_instruction() -{ - static const byte opcode_param_len_simon1[] = { - 0, 6, 2, 10, 6, 4, 2, 2, - 4, 4, 10, 0, 2, 2, 2, 2, - 2, 0, 2, 0, 4, 2, 4, 2, - 8, 0, 10, 0, 8, 0, 2, 2, - 4, 0, 0, 4, 4, 2, 2, 4, - 4, 4, 4, 2, 2, 2, 2, 4, - 0, 2, 2, 2, 2, 4, 6, 6, - 0, 0, 0, 0, 2, 6, 0, 0, - }; - - static const byte opcode_param_len_simon2[] = { - 0, 6, 2, 12, 6, 4, 2, 2, - 4, 4, 9, 0, 1, 2, 2, 2, - 2, 0, 2, 0, 4, 2, 4, 2, - 7, 0, 10, 0, 8, 0, 2, 2, - 4, 0, 0, 4, 4, 2, 2, 4, - 4, 4, 4, 2, 2, 2, 2, 4, - 0, 2, 2, 2, 2, 4, 6, 6, - 2, 0, 6, 6, 4, 6, 0, 0, - 0, 0, 4, 4, 4, 4, 4, 0, - 4, 2, 2 - }; - - if (_game & GAME_SIMON2) { - uint opcode = vc_read_next_byte(); - _vc_ptr += opcode_param_len_simon2[opcode]; - } else { - uint opcode = vc_read_next_word(); - _vc_ptr += opcode_param_len_simon1[opcode]; - } - -#ifdef DUMP_CONTINOUS_VGASCRIPT - fprintf(_dump_file, "; skipped\n"); -#endif -} - -void SimonState::o_read_vgares_23() -{ // Simon1 Only - if (_vga_res_328_loaded == true) { - _vga_res_328_loaded = false; - _lock_word |= 0x4000; - read_vga_from_datfile_1(23); - _lock_word &= ~0x4000; - } -} - -void SimonState::o_read_vgares_328() -{ // Simon1 Only - if (_vga_res_328_loaded == false) { - _vga_res_328_loaded = true; - _lock_word |= 0x4000; - read_vga_from_datfile_1(328); - _lock_word &= ~0x4000; - } -} - - -// VGA Script commands -void SimonState::vc_1() -{ - /* dummy opcode */ - _vc_ptr += 6; -} - -void SimonState::vc_2() -{ - VgaPointersEntry *vpe; - uint num; - uint res; - byte *old_file_1, *old_file_2; - byte *b, *bb, *vc_ptr_org; - - num = vc_read_var_or_word(); - - old_file_1 = _cur_vga_file_1; - old_file_2 = _cur_vga_file_2; - - for (;;) { - res = num / 100; - vpe = &_vga_buffer_pointers[res]; - - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; - if (vpe->vgaFile1 != NULL) - break; - if (_vga_cur_file_2 != res) - _video_var_7 = _vga_cur_file_2; - - ensureVgaResLoaded(res); - _video_var_7 = 0xFFFF; - } - - - bb = _cur_vga_file_1; - b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) bb)->hdr2_start); - b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk2_offs); - - while (READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->id) != num) - b += sizeof(VgaFile1Struct0x8); - - vc_ptr_org = _vc_ptr; - - _vc_ptr = _cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->script_offs); - - -// dump_vga_script(_vc_ptr, res, num); - run_vga_script(); - - _cur_vga_file_1 = old_file_1; - _cur_vga_file_2 = old_file_2; - - _vc_ptr = vc_ptr_org; -} - -void SimonState::vc_3() -{ - uint16 a, b, c, d, e, f; - uint16 res; - VgaSprite *vsp; - VgaPointersEntry *vpe; - byte *p, *pp; - - a = vc_read_next_word(); /* 0 */ - - if (_game & GAME_SIMON2) { - f = vc_read_next_word(); /* 0 */ - b = vc_read_next_word(); /* 2 */ - } else { - b = vc_read_next_word(); /* 2 */ - f = b / 100; - } - - c = vc_read_next_word(); /* 4 */ - d = vc_read_next_word(); /* 6 */ - e = vc_read_next_word(); /* 8 */ - - /* 2nd param ignored with simon1 */ - if (has_vgastruct_with_id(b, f)) - return; - - vsp = _vga_sprites; - while (vsp->id) - vsp++; - - vsp->base_color = e; - vsp->unk6 = a; - vsp->unk5 = 0; - vsp->unk4 = 0; - vsp->image = 0; - vsp->x = c; - vsp->y = d; - vsp->id = b; - vsp->unk7 = res = f; - - for (;;) { - vpe = &_vga_buffer_pointers[res]; - _cur_vga_file_1 = vpe->vgaFile1; - - if (vpe->vgaFile1 != NULL) - break; - if (res != _vga_cur_file_2) - _video_var_7 = res; - - ensureVgaResLoaded(res); - _video_var_7 = 0xFFFF; - } - - pp = _cur_vga_file_1; - p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) pp)->hdr2_start); - p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_table); - - while (READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->id) != b) - p += sizeof(VgaFile1Struct0x6); - -#ifdef DUMP_FILE_NR - { - static bool dumped = false; - if (res == DUMP_FILE_NR && !dumped) { - dumped = true; - dump_vga_file(_cur_vga_file_1); - } - } -#endif - -#ifdef DUMP_BITMAPS_FILE_NR - { - static bool dumped = false; - if (res == DUMP_BITMAPS_FILE_NR && !dumped) { - dumped = true; - dump_vga_bitmaps(_cur_vga_file_2, _cur_vga_file_1, res); - } - } -#endif - -// dump_vga_script(_cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6*)p)->script_offs), res, b); - - add_vga_timer(gss->VGA_DELAY_BASE, - _cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->script_offs), - b, res); -} - -void SimonState::vc_4() -{ - /* dummy opcode */ - _vc_ptr += 6; -} - -void SimonState::vc_5() -{ - uint var = vc_read_next_word(); - uint value = vc_read_next_word(); - if (vc_read_var(var) != value) - vc_skip_next_instruction(); -} - -void SimonState::vc_6_maybe_skip_3_inv() -{ - if (!vc_maybe_skip_proc_3(vc_read_next_word())) - vc_skip_next_instruction(); -} - -void SimonState::vc_7_maybe_skip_3() -{ - if (vc_maybe_skip_proc_3(vc_read_next_word())) - vc_skip_next_instruction(); -} - -void SimonState::vc_8_maybe_skip_2() -{ - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - if (!vc_maybe_skip_proc_2(a, b)) - vc_skip_next_instruction(); -} - -void SimonState::vc_9_maybe_skip() -{ - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - if (!vc_maybe_skip_proc_1(a, b)) - vc_skip_next_instruction(); -} - -struct VC10_state { - int image; - uint16 e; - int x, y; - - byte base_color; - - uint draw_width, draw_height; - uint x_skip, y_skip; - - byte *surf2_addr; - uint surf2_pitch; - - byte *surf_addr; - uint surf_pitch; - - byte dl, dh; - - byte *depack_src; - int8 depack_cont; - - byte depack_dest[200]; -}; - -byte *vc_10_depack_column(VC10_state * vs) -{ - int8 a = vs->depack_cont; - byte *src = vs->depack_src; - byte *dst = vs->depack_dest; - byte dh = vs->dh; - byte color; - - if (a != -0x80) - goto start_here; - - for (;;) { - a = *src++; - start_here:; - if (a >= 0) { - color = *src++; - do { - *dst++ = color; - if (!--dh) { - if (--a < 0) - a = -0x80; - else - src--; - goto get_out; - } - } while (--a >= 0); - } else { - do { - *dst++ = *src++; - if (!--dh) { - if (++a == 0) - a = -0x80; - goto get_out; - } - } while (++a != 0); - } - } - -get_out:; - vs->depack_src = src; - vs->depack_cont = a; - return vs->depack_dest + vs->y_skip; -} - -void vc_10_skip_cols(VC10_state * vs) -{ - vs->depack_cont = -0x80; - while (vs->x_skip) { - vc_10_depack_column(vs); - vs->x_skip--; - } -} - -byte *SimonState::vc_10_depack_swap(byte *src, uint w, uint h) -{ - w <<= 3; - - { - byte *dst_org = _video_buf_1 + w; - byte color; - int8 cur = -0x80; - uint w_cur = w; - - do { - byte *dst = dst_org; - uint h_cur = h; - - if (cur == -0x80) - cur = *src++; - - for (;;) { - if (cur >= 0) { - /* rle_same */ - color = *src++; - do { - *dst = color; - dst += w; - if (!--h_cur) { - if (--cur < 0) - cur = -0x80; - else - src--; - goto next_line; - } - } while (--cur >= 0); - } else { - /* rle_diff */ - do { - *dst = *src++; - dst += w; - if (!--h_cur) { - if (++cur == 0) - cur = -0x80; - goto next_line; - } - } while (++cur != 0); - } - cur = *src++; - } - next_line: - dst_org++; - } while (--w_cur); - } - - { - byte *dst_org, *src_org; - uint i; - - src_org = dst_org = _video_buf_1 + w; - - do { - byte *dst = dst_org; - for (i = 0; i != w; ++i) { - byte b = src_org[i]; - b = (b >> 4) | (b << 4); - *--dst = b; - } - - src_org += w; - dst_org += w; - } while (--h); - - } - - return _video_buf_1; - -} - -byte *vc_10_no_depack_swap(byte *src) -{ - error("vc_10_no_depack_swap unimpl"); - return NULL; -} - -/* must not be const */ -static uint16 _video_windows[128] = { - 0, 0, 20, 200, - 0, 0, 3, 136, - 17, 0, 3, 136, - 0, 0, 20, 200, - 0, 0, 20, 134 -}; - -/* simon2 specific */ -void SimonState::vc_10_helper_8(byte *dst, byte *src) -{ - const uint pitch = _dx_surface_pitch; - int8 reps = (int8)0x80; - byte color; - byte *dst_org = dst; - uint h = _vga_var5, w = 8; - - for (;;) { - reps = *src++; - if (reps >= 0) { - color = *src++; - - do { - *dst = color; - dst += pitch; - - /* reached bottom? */ - if (--h == 0) { - /* reached right edge? */ - if (--w == 0) - return; - dst = ++dst_org; - h = _vga_var5; - } - } while (--reps >= 0); - } else { - - do { - *dst = *src++; - dst += pitch; - - /* reached bottom? */ - if (--h == 0) { - /* reached right edge? */ - if (--w == 0) - return; - dst = ++dst_org; - h = _vga_var5; - } - } while (++reps != 0); - } - } -} - -void SimonState::vc_10() -{ - byte *p2; - uint width, height; - byte flags; - const uint16 *vlut; - VC10_state state; - - int cur; - - state.image = (int16)vc_read_next_word(); - if (state.image == 0) - return; - -// if (_vga_cur_sprite_id != 802) -// return; - - state.base_color = (_vc_ptr[1] << 4); - _vc_ptr += 2; - state.x = (int16)vc_read_next_word(); - if (_game & GAME_SIMON2) { - state.x -= _x_scroll; - } - state.y = (int16)vc_read_next_word(); - - if (!(_game & GAME_SIMON2)) { - state.e = vc_read_next_word(); - } else { - state.e = vc_read_next_byte(); - } - - if (state.image < 0) - state.image = vc_read_var(-state.image); - - p2 = _cur_vga_file_2 + state.image * 8; - state.depack_src = _cur_vga_file_2 + READ_BE_UINT32_UNALIGNED(&*(uint32 *)p2); - - width = READ_BE_UINT16_UNALIGNED(p2 + 6) >> 4; - height = p2[5]; - flags = p2[4]; - - if (height == 0 || width == 0) - return; - -#ifdef DUMP_DRAWN_BITMAPS - dump_single_bitmap(_vga_cur_file_id, state.image, state.depack_src, width * 16, height, - state.base_color); -#endif - - if (flags & 0x80 && !(state.e & 0x10)) { - if (state.e & 1) { - state.e &= ~1; - state.e |= 0x10; - } else { - state.e |= 0x8; - } - } - - if (_game & GAME_SIMON2 && width >= 21) { - byte *src, *dst; - uint w; - - _vga_var1 = width * 2 - 40; - _vga_var7 = state.depack_src; - _vga_var5 = height; - if (_variableArray[34] == -1) - state.x = _variableArray[502 / 2]; - - _x_scroll = state.x; - - vc_write_var(0xfb, _x_scroll); - - dst = dx_lock_attached(); - src = state.depack_src + _x_scroll * 4; - - w = 40; - do { - vc_10_helper_8(dst, src + READ_BE_UINT32_UNALIGNED(&*(uint32 *)src)); - dst += 8; - src += 4; - } while (--w); - - dx_unlock_attached(); - - - return; - } - - if (state.e & 0x10) - state.depack_src = vc_10_depack_swap(state.depack_src, width, height); - else if (state.e & 1) - state.depack_src = vc_10_no_depack_swap(state.depack_src); - - - vlut = &_video_windows[_video_palette_mode * 4]; - - state.draw_width = width << 1; /* cl */ - state.draw_height = height; /* ch */ - - state.x_skip = 0; /* colums to skip = bh */ - state.y_skip = 0; /* rows to skip = bl */ - - cur = state.x; - if (cur < 0) { - do { - if (!--state.draw_width) - return; - state.x_skip++; - } while (++cur); - } - state.x = cur; - - cur += state.draw_width - (vlut[2] << 1); - if (cur > 0) { - do { - if (!--state.draw_width) - return; - } while (--cur); - } - - cur = state.y; - if (cur < 0) { - do { - if (!--state.draw_height) - return; - state.y_skip++; - } while (++cur); - } - state.y = cur; - - cur += state.draw_height - vlut[3]; - if (cur > 0) { - do { - if (!--state.draw_height) - return; - } while (--cur); - } - - assert(state.draw_width != 0 && state.draw_height != 0); - - state.draw_width <<= 2; - - state.surf2_addr = dx_lock_2(); - state.surf2_pitch = _dx_surface_pitch; - - state.surf_addr = dx_lock_attached(); - state.surf_pitch = _dx_surface_pitch; - - { - uint offs = ((vlut[0] - _video_windows[16]) * 2 + state.x) * 8; - uint offs2 = (vlut[1] - _video_windows[17] + state.y); - - state.surf2_addr += offs + offs2 * state.surf2_pitch; - state.surf_addr += offs + offs2 * state.surf_pitch; - } - - if (state.e & 0x20) { - byte *mask, *src, *dst; - byte h; - uint w; - - state.x_skip <<= 2; - state.dl = width; - state.dh = height; - - vc_10_skip_cols(&state); - - /* XXX: implement transparency */ - - w = 0; - do { - mask = vc_10_depack_column(&state); /* esi */ - src = state.surf2_addr + w * 2; /* ebx */ - dst = state.surf_addr + w * 2; /* edi */ - - h = state.draw_height; - do { - if (mask[0] & 0xF0) - dst[0] = src[0]; - if (mask[0] & 0x0F) - dst[1] = src[1]; - mask++; - dst += state.surf_pitch; - src += state.surf2_pitch; - } while (--h); - } while (++w != state.draw_width); - - /* vc_10_helper_5 */ - } else if (_lock_word & 0x20 && state.base_color == 0 || state.base_color == 0xC0) { - byte *src, *dst; - uint h, i; - - if (!(state.e & 8)) { - src = state.depack_src + (width * state.y_skip << 4) + (state.x_skip << 3); - dst = state.surf_addr; - - state.draw_width *= 2; - - if (state.e & 2) { - /* no transparency */ - h = state.draw_height; - do { - memcpy(dst, src, state.draw_width); - dst += 320; - src += width * 16; - } while (--h); - } else { - /* transparency */ - h = state.draw_height; - do { - for (i = 0; i != state.draw_width; i++) - if (src[i]) - dst[i] = src[i]; - dst += 320; - src += width * 16; - } while (--h); - } - - } else { - byte *dst_org = state.surf_addr; - src = state.depack_src; - /* AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE - * aaaaabbb bbcccccd ddddeeee efffffgg ggghhhhh - */ - - if (state.e & 2) { - /* no transparency */ - do { - uint count = state.draw_width >> 2; - - dst = dst_org; - do { - uint32 bits = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | (src[3]); - - dst[0] = (byte)((bits >> (32 - 5)) & 31); - dst[1] = (byte)((bits >> (32 - 10)) & 31); - dst[2] = (byte)((bits >> (32 - 15)) & 31); - dst[3] = (byte)((bits >> (32 - 20)) & 31); - dst[4] = (byte)((bits >> (32 - 25)) & 31); - dst[5] = (byte)((bits >> (32 - 30)) & 31); - - bits = (bits << 8) | src[4]; - - dst[6] = (byte)((bits >> (40 - 35)) & 31); - dst[7] = (byte)((bits) & 31); - - dst += 8; - src += 5; - } while (--count); - dst_org += 320; - } while (--state.draw_height); - } else { - /* transparency */ - do { - uint count = state.draw_width >> 2; - - dst = dst_org; - do { - uint32 bits = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | (src[3]); - byte tmp; - - tmp = (byte)((bits >> (32 - 5)) & 31); - if (tmp) - dst[0] = tmp; - tmp = (byte)((bits >> (32 - 10)) & 31); - if (tmp) - dst[1] = tmp; - tmp = (byte)((bits >> (32 - 15)) & 31); - if (tmp) - dst[2] = tmp; - tmp = (byte)((bits >> (32 - 20)) & 31); - if (tmp) - dst[3] = tmp; - tmp = (byte)((bits >> (32 - 25)) & 31); - if (tmp) - dst[4] = tmp; - tmp = (byte)((bits >> (32 - 30)) & 31); - if (tmp) - dst[5] = tmp; - - bits = (bits << 8) | src[4]; - - tmp = (byte)((bits >> (40 - 35)) & 31); - if (tmp) - dst[6] = tmp; - tmp = (byte)((bits) & 31); - if (tmp) - dst[7] = tmp; - - dst += 8; - src += 5; - } while (--count); - dst_org += 320; - } while (--state.draw_height); - } - } - /* vc_10_helper_4 */ - } else { - if (_game & GAME_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) { - state.surf_addr = state.surf2_addr; - state.surf_pitch = state.surf2_pitch; - warning("vc_10: (state.e&0x4)"); - } - - if (state.e & 0x8) { - uint w, h; - byte *src, *dst, *dst_org; - - state.x_skip <<= 2; /* reached */ - state.dl = width; - state.dh = height; - - vc_10_skip_cols(&state); - - if (state.e & 2) { - dst_org = state.surf_addr; - w = 0; - do { - src = vc_10_depack_column(&state); - dst = dst_org; - - h = 0; - do { - dst[0] = (*src >> 4) | state.base_color; - dst[1] = (*src & 15) | state.base_color; - dst += 320; - src++; - } while (++h != state.draw_height); - dst_org += 2; - } while (++w != state.draw_width); - } else { - dst_org = state.surf_addr; - if (state.e & 0x40) { /* reached */ - dst_org += vc_read_var(252); - } - w = 0; - do { - byte color; - - src = vc_10_depack_column(&state); - dst = dst_org; - - h = 0; - do { - color = (*src >> 4); - if (color) - dst[0] = color | state.base_color; - color = (*src & 15); - if (color) - dst[1] = color | state.base_color; - dst += 320; - src++; - } while (++h != state.draw_height); - dst_org += 2; - } while (++w != state.draw_width); - } - /* vc_10_helper_6 */ - } else { - byte *src, *dst; - uint count; - - src = state.depack_src + (width * state.y_skip) * 8; - dst = state.surf_addr; - state.x_skip <<= 2; - if (state.e & 2) { - do { - for (count = 0; count != state.draw_width; count++) { - dst[count * 2] = (src[count + state.x_skip] >> 4) | state.base_color; - dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.base_color; - } - dst += 320; - src += width * 8; - } while (--state.draw_height); - } else { - do { - for (count = 0; count != state.draw_width; count++) { - byte color; - color = (src[count + state.x_skip] >> 4); - if (color) - dst[count * 2] = color | state.base_color; - color = (src[count + state.x_skip] & 15); - if (color) - dst[count * 2 + 1] = color | state.base_color; - } - dst += 320; - src += width * 8; - } while (--state.draw_height); - - } - - /* vc_10_helper_7 */ - } - } - - dx_unlock_2(); - dx_unlock_attached(); - -} - -void SimonState::vc_11_clear_pathfind_array() -{ - memset(&_pathfind_array, 0, sizeof(_pathfind_array)); -} - -void SimonState::vc_12_sleep_variable() -{ - uint num; - - if (!(_game & GAME_SIMON2)) { - num = vc_read_var_or_word(); - } else { - num = vc_read_next_byte() * _vga_base_delay; - } - - add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&vc_get_out_of_code; -} - -void SimonState::vc_13_offset_x() -{ - VgaSprite *vsp = find_cur_sprite(); - int16 a = vc_read_next_word(); - vsp->x += a; - _vga_sprite_changed++; -} - -void SimonState::vc_14_offset_y() -{ - VgaSprite *vsp = find_cur_sprite(); - int16 a = vc_read_next_word(); - vsp->y += a; - _vga_sprite_changed++; -} - -/* wakeup_id */ -void SimonState::vc_15_start_funkystruct_by_id() -{ - VgaSleepStruct *vfs = _vga_sleep_structs, *vfs_tmp; - uint16 id = vc_read_next_word(); - while (vfs->ident != 0) { - if (vfs->ident == id) { - add_vga_timer(gss->VGA_DELAY_BASE, vfs->code_ptr, vfs->sprite_id, vfs->cur_vga_file); - vfs_tmp = vfs; - do { - memcpy(vfs_tmp, vfs_tmp + 1, sizeof(VgaSleepStruct)); - vfs_tmp++; - } while (vfs_tmp->ident != 0); - } else { - vfs++; - } - } - - /* clear a wait event */ - if (id == _vga_wait_for) - _vga_wait_for = 0; -} - - -/* sleep_on_id */ -void SimonState::vc_16_setup_funkystruct() -{ - VgaSleepStruct *vfs = _vga_sleep_structs; - while (vfs->ident) - vfs++; - - vfs->ident = vc_read_next_word(); - vfs->code_ptr = _vc_ptr; - vfs->sprite_id = _vga_cur_sprite_id; - vfs->cur_vga_file = _vga_cur_file_id; - - _vc_ptr = (byte *)&vc_get_out_of_code; -} - -void SimonState::vc_17_set_pathfind_item() -{ - uint a = vc_read_next_word(); - _pathfind_array[a - 1] = (uint16 *)_vc_ptr; - while (READ_BE_UINT16_UNALIGNED(_vc_ptr) != 999) - _vc_ptr += 4; - _vc_ptr += 2; -} - -void SimonState::vc_18_jump_rel() -{ - int16 offs = vc_read_next_word(); - _vc_ptr += offs; -} - -/* chain to script? */ -void SimonState::vc_19() -{ - /* XXX: not implemented */ - error("vc_19: chain to script not implemented"); -} - - -/* helper routines */ - -/* write unaligned 16-bit */ -static void write_16_le(void *p, uint16 a) -{ - ((byte *)p)[0] = (byte)(a); - ((byte *)p)[1] = (byte)(a >> 8); -} - -/* read unaligned 16-bit */ -static uint16 read_16_le(void *p) -{ - return ((byte *)p)[0] | (((byte *)p)[1] << 8); -} - -/* FIXME: unaligned access */ -void SimonState::vc_20() -{ - uint16 a = vc_read_next_word(); - write_16_le(_vc_ptr, a); - _vc_ptr += 2; -} - -/* FIXME: unaligned access */ -void SimonState::vc_21() -{ - if (!(_game & GAME_SIMON2)) { - int16 a = vc_read_next_word(); - byte *tmp = _vc_ptr + a; - uint16 val = read_16_le(tmp + 4); - - if (val != 0) { - write_16_le(tmp + 4, val - 1); - _vc_ptr = tmp + 6; - } - } else { - int16 a = vc_read_next_word(); - byte *tmp = _vc_ptr + a; - uint16 val = read_16_le(tmp + 3); - - if (val != 0) { - write_16_le(tmp + 3, val - 1); - _vc_ptr = tmp + 5; - } - } -} - -void SimonState::vc_22() -{ - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - uint num = a == 0 ? 0x20 : 0x10; - byte *palptr, *src; - - palptr = &_palette[(a << 6)]; - - src = _cur_vga_file_1 + 6 + b * 96; - - do { - palptr[0] = src[0] << 2; - palptr[1] = src[1] << 2; - palptr[2] = src[2] << 2; - palptr[3] = 0; - - palptr += 4; - src += 3; - } while (--num); - - _video_var_9 = 2; - _vga_sprite_changed++; -} - -void SimonState::vc_23_set_pri() -{ - VgaSprite *vsp = find_cur_sprite(), *vus2; - uint16 pri = vc_read_next_word(); - VgaSprite bak; - - if (vsp->id == 0) { - warning("tried to set pri for unknown id %d", _vga_cur_sprite_id); - return; - } - - memcpy(&bak, vsp, sizeof(bak)); - bak.unk5 = pri; - bak.unk6 |= 0x8000; - - vus2 = vsp; - - if (vsp != _vga_sprites && pri < vsp[-1].unk5) { - do { - vsp--; - } while (vsp != _vga_sprites && pri < vsp[-1].unk5); - do { - memcpy(vus2, vus2 - 1, sizeof(VgaSprite)); - } while (--vus2 != vsp); - memcpy(vus2, &bak, sizeof(VgaSprite)); - } else if (vsp[1].id != 0 && pri >= vsp[1].unk5) { - do { - vsp++; - } while (vsp[1].id != 0 && pri >= vsp[1].unk5); - do { - memcpy(vus2, vus2 + 1, sizeof(VgaSprite)); - } while (++vus2 != vsp); - memcpy(vus2, &bak, sizeof(VgaSprite)); - } else { - vsp->unk5 = pri; - } - _vga_sprite_changed++; -} - -void SimonState::vc_24_set_image_xy() -{ - VgaSprite *vsp = find_cur_sprite(); - vsp->image = vc_read_var_or_word(); - - if (vsp->id == 0) { - warning("Trying to set XY of nonexistent sprite '%d'", _vga_cur_sprite_id); - } - - vsp->x += (int16)vc_read_next_word(); - vsp->y += (int16)vc_read_next_word(); - if (!(_game & GAME_SIMON2)) { - vsp->unk4 = vc_read_next_word(); - } else { - vsp->unk4 = vc_read_next_byte(); - } - - _vga_sprite_changed++; -} - -void SimonState::vc_25_del_sprite_and_get_out() -{ - VgaSprite *vsp = find_cur_sprite(); - while (vsp->id != 0) { - memcpy(vsp, vsp + 1, sizeof(VgaSprite)); - vsp++; - } - _vc_ptr = (byte *)&vc_get_out_of_code; - _vga_sprite_changed++; -} - -void SimonState::vc_26() -{ - uint16 *as = &_video_windows[vc_read_next_word() * 4]; - as[0] = vc_read_next_word(); - as[1] = vc_read_next_word(); - as[2] = vc_read_next_word(); - as[3] = vc_read_next_word(); -} - -void SimonState::vc_27_reset_simon1() -{ - VgaSprite bak, *vsp; - VgaSleepStruct *vfs; - VgaTimerEntry *vte, *vte2; - - _lock_word |= 8; - - memset(&bak, 0, sizeof(bak)); - - vsp = _vga_sprites; - while (vsp->id) { - if (vsp->id == 128) { - memcpy(&bak, vsp, sizeof(VgaSprite)); - } - vsp->id = 0; - vsp++; - } - - if (bak.id != 0) - memcpy(_vga_sprites, &bak, sizeof(VgaSprite)); - - vfs = _vga_sleep_structs; - while (vfs->ident) { - vfs->ident = 0; - vfs++; - } - - - vte = _vga_timer_list; - while (vte->delay) { - if (vte->sprite_id != 0x80) { - vte2 = vte; - while (vte2->delay) { - memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry)); - vte2++; - } - } else { - vte++; - } - } - - vc_write_var(0xFE, 0); - - _lock_word &= ~8; -} - - -void SimonState::vc_27_reset_simon2() -{ - _lock_word |= 8; - - { - VgaSprite *vsp = _vga_sprites; - while (vsp->id) { - vsp->id = 0; - vsp++; - } - } - - { - VgaSleepStruct *vfs = _vga_sleep_structs; - while (vfs->ident) { - vfs->ident = 0; - vfs++; - } - } - - { - VgaTimerEntry *vte = _vga_timer_list; - while (vte->delay) { - VgaTimerEntry *vte2 = vte; - while (vte2->delay) { - memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry)); - vte2++; - } - } - } - - vc_write_var(0xFE, 0); - - _lock_word &= ~8; -} - -void SimonState::vc_27_reset() -{ - if (!(_game & GAME_SIMON2)) - vc_27_reset_simon1(); - else - vc_27_reset_simon2(); -} - -void SimonState::vc_28() -{ - /* dummy opcode */ - _vc_ptr += 8; -} - -void SimonState::vc_29_stop_all_sounds() -{ - _mixer->stop_all(); -} - -void SimonState::vc_30_set_base_delay() -{ - _vga_base_delay = vc_read_next_word(); -} - -void SimonState::vc_31_set_palette_mode() -{ - _video_palette_mode = vc_read_next_word(); -} - -uint SimonState::vc_read_var(uint var) -{ - assert(var < 255); - return (uint16)_variableArray[var]; -} - -void SimonState::vc_write_var(uint var, int16 value) -{ - _variableArray[var] = value; -} - -void SimonState::vc_32_copy_var() -{ - uint16 a = vc_read_var(vc_read_next_word()); - vc_write_var(vc_read_next_word(), a); -} - -void SimonState::vc_33() -{ - if (_lock_counter != 0) { - _lock_counter = 1; - unlock(); - } -} - -void SimonState::vc_34() -{ - lock(); - _lock_counter = 200; - _left_button_down = 0; -} - -void SimonState::vc_35() -{ - /* not used? */ - _vc_ptr += 4; - _vga_sprite_changed++; -} - -void SimonState::vc_36() -{ - uint vga_res = vc_read_next_word(); - uint mode = vc_read_next_word(); - - if (!(_game & GAME_SIMON2)) { - if (mode == 16) { - _copy_partial_mode = 2; - } else { - set_video_mode_internal(mode, vga_res); - } - } else { - set_video_mode_internal(mode, vga_res); - } -} - -void SimonState::vc_37_sprite_unk3_add() -{ - VgaSprite *vsp = find_cur_sprite(); - vsp->y += vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; -} - -void SimonState::vc_38_skip_if_var_zero() -{ - uint var = vc_read_next_word(); - if (vc_read_var(var) == 0) - vc_skip_next_instruction(); -} - -void SimonState::vc_39_set_var() -{ - uint var = vc_read_next_word(); - int16 value = vc_read_next_word(); - vc_write_var(var, value); -} - -void SimonState::vc_40_var_add() -{ - uint var = vc_read_next_word(); - int16 value = vc_read_var(var) + vc_read_next_word(); - - if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { - int16 tmp; - - if (_vga_var2 != 0) { - if (_vga_var2 >= 0) - goto no_scroll; - _vga_var2 = 0; - } else { - if (_vga_var3 != 0) - goto no_scroll; - } - - if (value - _x_scroll >= 30) { - _vga_var2 = 20; - tmp = _vga_var1 - _x_scroll; - if (tmp < 20) - _vga_var2 = tmp; - add_vga_timer(10, NULL, 0, 0); /* special timer */ - } - } -no_scroll:; - - vc_write_var(var, value); -} - -void SimonState::vc_41_var_sub() -{ - uint var = vc_read_next_word(); - int16 value = vc_read_var(var) - vc_read_next_word(); - - if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { - int16 tmp; - - if (_vga_var2 != 0) { - if (_vga_var2 < 0) - goto no_scroll; - _vga_var2 = 0; - } else { - if (_vga_var3 != 0) - goto no_scroll; - } - - if ((uint16)(value - _x_scroll) < 11) { - _vga_var2 = -20; - tmp = _vga_var1 - _x_scroll; - if (_x_scroll < 20) - _vga_var2 = -_x_scroll; - add_vga_timer(10, NULL, 0, 0); /* special timer */ - } - } -no_scroll:; - - vc_write_var(var, value); -} - -void SimonState::vc_42_delay_if_not_eq() -{ - uint val = vc_read_var(vc_read_next_word()); - if (val == vc_read_next_word()) { - - add_vga_timer(_vga_base_delay + 1, _vc_ptr - 4, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&vc_get_out_of_code; - } -} - -void SimonState::vc_43_skip_if_bit_clear() -{ - if (!vc_get_bit(vc_read_next_word())) { - vc_skip_next_instruction(); - } -} - -void SimonState::vc_44_skip_if_bit_set() -{ - if (vc_get_bit(vc_read_next_word())) { - vc_skip_next_instruction(); - } -} - -void SimonState::vc_45_set_x() -{ - VgaSprite *vsp = find_cur_sprite(); - vsp->x = vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; -} - -void SimonState::vc_46_set_y() -{ - VgaSprite *vsp = find_cur_sprite(); - vsp->y = vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; -} - -void SimonState::vc_47_add_var_f() -{ - uint var = vc_read_next_word(); - vc_write_var(var, vc_read_var(var) + vc_read_var(vc_read_next_word())); -} - -void SimonState::vc_48() -{ - uint a = (uint16)_variableArray[12]; - uint b = (uint16)_variableArray[13]; - int c = _variableArray[14]; - uint16 *p = _pathfind_array[a - 1]; - int step; - int y1, y2; - int16 *vp; - - p += b * 2 + 1; - - step = 2; - if (c < 0) { - c = -c; - step = -2; - } - - vp = &_variableArray[20]; - - do { - y2 = READ_BE_UINT16_UNALIGNED(p); - p += step; - y1 = READ_BE_UINT16_UNALIGNED(p) - y2; - -// assert(READ_BE_UINT16_UNALIGNED(&p[1]) != 999); - - vp[0] = y1 >> 1; - vp[1] = y1 - (y1 >> 1); - - vp += 2; - } while (--c); - -} - -void SimonState::vc_set_bit_to(uint bit, bool value) -{ - uint16 *bits = &_bit_array[bit >> 4]; - *bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15)); -} - -bool SimonState::vc_get_bit(uint bit) -{ - uint16 *bits = &_bit_array[bit >> 4]; - return (*bits & (1 << (bit & 15))) != 0; -} - -void SimonState::vc_49_set_bit() -{ - vc_set_bit_to(vc_read_next_word(), true); -} - -void SimonState::vc_50_clear_bit() -{ - vc_set_bit_to(vc_read_next_word(), false); -} - -void SimonState::vc_51_clear_hitarea_bit_0x40() -{ - clear_hitarea_bit_0x40(vc_read_next_word()); -} - -void SimonState::vc_52() -{ - uint16 a = vc_read_next_word(); - - if (!(_game & GAME_SIMON2)) { - playSound(a); - } else { - if (a >= 0x8000) { - a = -a; - warning("vc_52(%d): unimpl"); - } else { - playSound(a); - } - } -} - -void SimonState::vc_53_no_op() -{ - /* no op */ -} - -void SimonState::vc_54_no_op() -{ - /* no op */ -} - -void SimonState::vc_55_offset_hit_area() -{ - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); - uint16 id = vc_read_next_word(); - int16 x = vc_read_next_word(); - int16 y = vc_read_next_word(); - - for (;;) { - if (ha->id == id) { - ha->x += x; - ha->y += y; - break; - } - ha++; - if (!--count) - break; - } - - _need_hitarea_recalc++; -} - -void SimonState::vc_56_no_op() -{ - /* No-Op in simon1 */ - if (_game & GAME_SIMON2) { - uint num = vc_read_var_or_word() * _vga_base_delay; - -#ifdef DUMP_CONTINOUS_VGASCRIPT - fprintf(_dump_file, "; sleep_ex = %d\n", num + gss->VGA_DELAY_BASE); -#endif - - add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&vc_get_out_of_code; - } -} - -void SimonState::vc_59() -{ - if (_game & GAME_SIMON2) { - uint file = vc_read_next_word(); - uint start = vc_read_next_word(); - uint end = vc_read_next_word() + 1; - - do { - vc_kill_thread(file, start); - } while (++start != end); - } else { - if (vc_59_helper()) - vc_skip_next_instruction(); - } -} - -void SimonState::vc_58() -{ - uint sprite = _vga_cur_sprite_id; - uint file = _vga_cur_file_id; - byte *vc_ptr; - uint16 tmp; - - _vga_cur_file_id = vc_read_next_word(); - _vga_cur_sprite_id = vc_read_next_word(); - - tmp = TO_BE_16(vc_read_next_word()); - - vc_ptr = _vc_ptr; - _vc_ptr = (byte *)&tmp; - vc_23_set_pri(); - - _vc_ptr = vc_ptr; - _vga_cur_sprite_id = sprite; - _vga_cur_file_id = file; -} - -void SimonState::vc_57_no_op() -{ - /* no op */ - -} - -void SimonState::vc_kill_thread(uint file, uint sprite) -{ - uint16 old_sprite_id, old_cur_file_id; - VgaSleepStruct *vfs; - VgaSprite *vsp; - VgaTimerEntry *vte; - byte *vc_org; - - old_sprite_id = _vga_cur_sprite_id; - old_cur_file_id = _vga_cur_file_id; - vc_org = _vc_ptr; - - _vga_cur_file_id = file; - _vga_cur_sprite_id = sprite; - - vfs = _vga_sleep_structs; - while (vfs->ident != 0) { - if (vfs->sprite_id == _vga_cur_sprite_id - && (vfs->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) - ) { - while (vfs->ident != 0) { - memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct)); - vfs++; - } - break; - } - vfs++; - } - - vsp = find_cur_sprite(); - if (vsp->id) { - vc_25_del_sprite_and_get_out(); - - vte = _vga_timer_list; - while (vte->delay != 0) { - if (vte->sprite_id == _vga_cur_sprite_id - && (vte->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) - ) { - delete_vga_timer(vte); - break; - } - vte++; - } - } - - _vga_cur_file_id = old_cur_file_id; - _vga_cur_sprite_id = old_sprite_id; - _vc_ptr = vc_org; -} - - -/* kill thread */ -void SimonState::vc_60() -{ - uint file; - - if (_game & GAME_SIMON2) { - file = vc_read_next_word(); - } else { - file = _vga_cur_file_id; - } - uint sprite = vc_read_next_word(); - vc_kill_thread(file, sprite); -} - -void SimonState::vc_61_sprite_change() -{ - VgaSprite *vsp = find_cur_sprite(); - - vsp->image = vc_read_var_or_word(); - - vsp->x += vc_read_next_word(); - vsp->y += vc_read_next_word(); - vsp->unk4 = 36; - - _vga_sprite_changed++; -} - -void SimonState::vc_62() -{ - uint i; - byte *vc_ptr_org = _vc_ptr; - - - vc_29_stop_all_sounds(); - -// if (!_video_var_3) { - _video_var_3 = true; - _video_num_pal_colors = 256; - if (_video_palette_mode == 4) - _video_num_pal_colors = 208; -// } - - memcpy(_video_buf_1, _palette_backup, _video_num_pal_colors * sizeof(uint32)); - for (i = NUM_PALETTE_FADEOUT; i != 0; --i) { - palette_fadeout((uint32 *)_video_buf_1, _video_num_pal_colors); - _system->set_palette(_video_buf_1, 0, _video_num_pal_colors); - _system->update_screen(); - delay(5); - } - - if (!(_game & GAME_SIMON2)) { - uint16 params[5]; /* parameters to vc_10 */ - VgaSprite *vsp; - VgaPointersEntry *vpe; - - vsp = _vga_sprites; - while (vsp->id != 0) { - if (vsp->id == 128) { - byte *f1 = _cur_vga_file_1; - byte *f2 = _cur_vga_file_2; - uint palmode = _video_palette_mode; - - vpe = &_vga_buffer_pointers[vsp->unk7]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; - _video_palette_mode = vsp->unk6; - - params[0] = READ_BE_UINT16_UNALIGNED(&vsp->image); - params[1] = READ_BE_UINT16_UNALIGNED(&vsp->base_color); - params[2] = READ_BE_UINT16_UNALIGNED(&vsp->x); - params[3] = READ_BE_UINT16_UNALIGNED(&vsp->y); - params[4] = READ_BE_UINT16_UNALIGNED(&vsp->unk4); - _vc_ptr = (byte *)params; - vc_10(); - - _video_palette_mode = palmode; - _cur_vga_file_1 = f1; - _cur_vga_file_2 = f2; - break; - } - vsp++; - } - } - - dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200); - - _vc_ptr = vc_ptr_org; -} - -void SimonState::vc_63() -{ - _palette_color_count = 208; - if (_video_palette_mode != 4) { - _palette_color_count = 256; - } - _video_var_3 = false; -} - -void SimonState::vc_64() -{ // Simon2 - if (vc_59_helper()) - vc_skip_next_instruction(); -} - -void SimonState::vc_65() -{ // Simon2 - error("vc_65 unimplemented"); -} - -void SimonState::vc_66() -{ // Simon2 - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - - if (vc_read_var(a) != vc_read_var(b)) - vc_skip_next_instruction(); -} - -void SimonState::vc_67() -{ // Simon2 - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - - if (vc_read_var(a) >= vc_read_var(b)) - vc_skip_next_instruction(); -} - -void SimonState::vc_68() -{ // Simon2 - uint a = vc_read_next_word(); - uint b = vc_read_next_word(); - - if (vc_read_var(a) <= vc_read_var(b)) - vc_skip_next_instruction(); -} - -void SimonState::vc_69() -{ // Simon2 - uint16 a = vc_read_next_word(); - uint16 b = vc_read_next_word(); - - warning("vc_69(%d,%d): music stuff?", a, b); -} - -void SimonState::vc_70() -{ // Simon2 - uint16 a = vc_read_next_word(); - uint16 b = vc_read_next_word(); - - _vc70_var1 = a; - _vc70_var2 = b; - - warning("vc_70(%d,%d): music stuff?", a, b); -} - - -void SimonState::vc_71() -{ // Simon2 - if (_vc72_var3 == 0xFFFF && _vc72_var1 == 0xFFFF) - vc_skip_next_instruction(); -} - -void SimonState::vc_72() -{ // Simon2 - uint16 a = vc_read_next_word(); - uint16 b = vc_read_next_word(); - if (a != _vc72_var1) { - _vc72_var2 = b; - _vc72_var3 = a; - } - - warning("vc_72(%d,%d): music stuff?", a, b); -} - -void SimonState::vc_73() -{ // Simon2 - vc_read_next_byte(); - _op_189_flags |= 1 << vc_read_next_byte(); -} - -void SimonState::vc_74() -{ // Simon2 - vc_read_next_byte(); - _op_189_flags &= ~(1 << vc_read_next_byte()); -} diff --git a/simon/sys.cpp b/simon/sys.cpp new file mode 100644 index 0000000000..5086ba9547 --- /dev/null +++ b/simon/sys.cpp @@ -0,0 +1,71 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "simon/simon.h" + +uint fileReadByte(FILE *in) +{ + byte b; + fread(&b, sizeof(b), 1, in); + return b; +} + +uint fileReadBE16(FILE *in) +{ + byte b[2]; + fread(b, sizeof(b), 1, in); + return (b[0] << 8) | b[1]; +} + +uint fileReadLE16(FILE *in) +{ + byte b[2]; + fread(b, sizeof(b), 1, in); + return (b[1] << 8) | b[0]; +} + +uint32 fileReadBE32(FILE *in) +{ + byte b[4]; + fread(b, sizeof(b), 1, in); + return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; +} + +uint32 fileReadLE32(FILE *in) +{ + byte b[4]; + fread(b, sizeof(b), 1, in); + return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; +} + + +void fileWriteBE32(FILE *in, uint32 value) +{ + value = TO_BE_32(value); + fwrite(&value, sizeof(value), 1, in); +} + +void fileWriteBE16(FILE *in, uint16 value) +{ + value = TO_BE_16(value); + fwrite(&value, sizeof(value), 1, in); +} diff --git a/simon/verb.cpp b/simon/verb.cpp new file mode 100644 index 0000000000..a81627bff2 --- /dev/null +++ b/simon/verb.cpp @@ -0,0 +1,449 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +// Verb and hitarea handling +#include "stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" + +void SimonState::defocusHitarea() +{ + HitArea *last; + HitArea *ha; + + if ((_game == GAME_SIMON2WIN) || (_game == GAME_SIMON2DOS)) { + if (_bit_array[4] & 0x8000) { + o_unk_120(202); + _last_hitarea_2_ptr = NULL; + return; + } + } + + last = _hitarea_ptr_5; + + if (last == _hitarea_ptr_7) + return; + + hitareaChangedHelper(); + _hitarea_ptr_7 = last; + + if (last != NULL && _hitarea_unk_6 && + (ha = findHitAreaByID(200)) && (ha->flags & 0x40) && !(last->flags & 0x40)) + focusVerb(last->id); +} + +static const char *const verb_names[] = { + "Walk to", + "Look at", + "Open", + "Move", + + "Consume", + "Pick up", + "Close", + "Use", + + "Talk to", + "Remove", + "Wear", + "Give" +}; + +static const char *const verb_prep_names[] = { + "", "", "", "", + "", "", "", "with what ?", + "", "", "", "to whom ?" +}; + +void SimonState::focusVerb(uint hitarea_id) +{ + uint x; + const char *txt; + + hitarea_id -= 101; + + CHECK_BOUNDS(hitarea_id, verb_prep_names); + + if (_show_preposition) { + txt = verb_prep_names[hitarea_id]; + } else { + txt = verb_names[hitarea_id]; + } + x = (53 - strlen(txt)) * 3; + showActionString(x, (const byte *)txt); + +} + +void SimonState::showActionString(uint x, const byte *string) +{ + FillOrCopyStruct *fcs; + + fcs = _fcs_ptr_array_3[1]; + if (fcs == NULL || fcs->text_color == 0) + return; + + fcs->textColumn = x >> 3; + fcs->textColumnOffset = x & 7; + + for (; *string; string++) + video_putchar(fcs, *string); +} + + +void SimonState::hitareaChangedHelper() +{ + FillOrCopyStruct *fcs; + + if ((_game == GAME_SIMON2WIN) || (_game == GAME_SIMON2WIN)) { + if (_bit_array[4] & 0x8000) + return; + } + + fcs = _fcs_ptr_array_3[1]; + if (fcs != NULL && fcs->text_color != 0) + video_fill_or_copy_from_3_to_2(fcs); + + _last_hitarea_2_ptr = NULL; + _hitarea_ptr_7 = NULL; +} + +HitArea *SimonState::findHitAreaByID(uint hitarea_id) +{ + HitArea *ha = _hit_areas; + uint count = ARRAYSIZE(_hit_areas); + + do { + if (ha->id == hitarea_id) + return ha; + } while (ha++, --count); + return NULL; +} + +HitArea *SimonState::findEmptyHitArea() +{ + HitArea *ha = _hit_areas; + uint count = ARRAYSIZE(_hit_areas); + + do { + if (ha->flags == 0) + return ha; + } while (ha++, --count); + return NULL; +} + +void SimonState::clear_hitarea_bit_0x40(uint hitarea) +{ + HitArea *ha = findHitAreaByID(hitarea); + if (ha != NULL) + ha->flags &= ~0x40; +} + +void SimonState::set_hitarea_bit_0x40(uint hitarea) +{ + HitArea *ha = findHitAreaByID(hitarea); + if (ha != NULL) { + ha->flags |= 0x40; + ha->flags &= ~2; + if (hitarea == 102) + hitarea_proc_1(); + } +} + +void SimonState::set_hitarea_x_y(uint hitarea, int x, int y) +{ + HitArea *ha = findHitAreaByID(hitarea); + if (ha != NULL) { + ha->x = x; + ha->y = y; + } +} + +void SimonState::delete_hitarea(uint hitarea) +{ + HitArea *ha = findHitAreaByID(hitarea); + if (ha != NULL) { + ha->flags = 0; + if (ha == _last_hitarea_2_ptr) + defocusHitarea(); + _need_hitarea_recalc++; + } +} + +bool SimonState::is_hitarea_0x40_clear(uint hitarea) +{ + HitArea *ha = findHitAreaByID(hitarea); + if (ha == NULL) + return false; + return (ha->flags & 0x40) == 0; +} + +void SimonState::addNewHitArea(int id, int x, int y, int width, int height, + int flags, int unk3, Item *item_ptr) +{ + + HitArea *ha; + delete_hitarea(id); + + ha = findEmptyHitArea(); + ha->x = x; + ha->y = y; + ha->width = width; + ha->height = height; + ha->flags = flags | 0x20; + ha->id = ha->layer = id; + ha->unk3 = unk3; + ha->item_ptr = item_ptr; + + _need_hitarea_recalc++; +} + +void SimonState::hitarea_proc_1() +{ + uint id; + HitArea *ha; + + if (_game & GAME_SIMON2) { + id = 2; + if (!(_bit_array[4] & 0x8000)) + id = (_mouse_y >= 136) ? 102 : 101; + } else { + id = (_mouse_y >= 136) ? 102 : 101; + + } + + _hitarea_unk_4 = id; + + ha = findHitAreaByID(id); + if (ha == NULL) + return; + + if (ha->flags & 0x40) { + _hitarea_unk_4 = 999; + _hitarea_ptr_5 = NULL; + } else { + _verb_hitarea = ha->unk3; + handle_verb_hitarea(ha); + } +} + +void SimonState::handle_verb_hitarea(HitArea * ha) +{ + HitArea *tmp = _hitarea_ptr_5; + + if (ha == tmp) + return; + + if (!(_game & GAME_SIMON2)) { + if (tmp != NULL) { + tmp->flags |= 8; + video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA); + } + + if (ha->flags & 2) + video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5); + else + video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA); + + ha->flags &= ~(2 + 8); + + } else { + if (ha->id < 101) + return; + _mouse_cursor = ha->id - 101; + _need_hitarea_recalc++; + + } + + _hitarea_ptr_5 = ha; +} + +void SimonState::hitarea_leave(HitArea * ha) +{ + if (!(_game & GAME_SIMON2)) { + video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5); + } else { + video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1); + } +} + +void SimonState::leaveHitAreaById(uint hitarea_id) +{ + HitArea *ha = findHitAreaByID(hitarea_id); + if (ha) + hitarea_leave(ha); +} + +void SimonState::handle_unk2_hitarea(FillOrCopyStruct *fcs) +{ + uint index; + + index = get_fcs_ptr_3_index(fcs); + + if (fcs->fcs_data->unk1 == 0) + return; + + lock(); + fcs_unk_proc_1(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 - 1, fcs->fcs_data->unk2); + unlock(); +} + +void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs) +{ + uint index; + + index = get_fcs_ptr_3_index(fcs); + + lock(); + fcs_unk_proc_1(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 + 1, fcs->fcs_data->unk2); + unlock(); +} + +void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode) +{ + HitArea *best_ha; + + if (_game & GAME_SIMON2) { + if (_bit_array[4] & 0x8000 || y < 134) { + x += _x_scroll * 8; + } + } + + { + HitArea *ha = _hit_areas; + uint count = ARRAYSIZE(_hit_areas); + uint16 layer = 0; + const uint16 x_ = x; + const uint16 y_ = y; + + best_ha = NULL; + + do { + if (ha->flags & 0x20) { + if (!(ha->flags & 0x40)) { + if (x_ >= ha->x && y_ >= ha->y && + x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) { + layer = ha->layer; + best_ha = ha; + } else { + if (ha->flags & 2) { + hitarea_leave(ha); + ha->flags &= ~2; + } + } + } else { + ha->flags &= ~2; + } + } + } while (ha++, --count); + } + + if (best_ha == NULL) { + defocusHitarea(); + return; + } + + if (mode != 0 && mode != 3) { + _last_hitarea = best_ha; + _variableArray[1] = x; + _variableArray[2] = y; + } + + if (best_ha->flags & 4) { + defocusHitarea(); + } else if (best_ha != _last_hitarea_2_ptr) { + new_current_hitarea(best_ha); + } + + if (best_ha->flags & 8 && !(best_ha->flags & 2)) { + hitarea_leave(best_ha); + best_ha->flags |= 2; + } + + return; +} + +void SimonState::new_current_hitarea(HitArea * ha) +{ + bool result; + + hitareaChangedHelper(); + if (ha->flags & 1) { + result = hitarea_proc_2(ha->flags >> 8); + } else { + result = hitarea_proc_3(ha->item_ptr); + } + + if (result) + _last_hitarea_2_ptr = ha; +} + +bool SimonState::hitarea_proc_2(uint a) +{ + uint x; + const byte *string_ptr; + + if (_game & GAME_SIMON2) { + if (_bit_array[4] & 0x8000) { + Subroutine *sub; + _variableArray[84] = a; + sub = getSubroutineByID(5003); + if (sub != NULL) + startSubroutineEx(sub); + return true; + } + } + + if (a >= 20) + return false; + + string_ptr = getStringPtrByID(_stringid_array_2[a]); + // Arisme : hack for long strings in the French version + if ((strlen((const char*)string_ptr) - 1) <= 53) + x = (53 - (strlen((const char *)string_ptr) - 1)) * 3; + else + x = 0; + showActionString(x, string_ptr); + + return true; +} + +bool SimonState::hitarea_proc_3(Item *item) +{ + Child2 *child2; + uint x; + const byte *string_ptr; + + if (item == 0 || item == _dummy_item_2 || item == _dummy_item_3) + return false; + + child2 = findChildOfType2(item); + if (child2 == NULL) + return false; + + string_ptr = getStringPtrByID(child2->string_id); + // Arisme : hack for long strings in the French version + if ((strlen((const char*)string_ptr) - 1) <= 53) + x = (53 - (strlen((const char *)string_ptr) - 1)) * 3; + else + x = 0; + showActionString(x, string_ptr); + return true; +} diff --git a/simon/vga.cpp b/simon/vga.cpp new file mode 100644 index 0000000000..39d56d0c85 --- /dev/null +++ b/simon/vga.cpp @@ -0,0 +1,1966 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +// Video script opcodes for Simon1/Simon2 +#include "stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" + +typedef void (SimonState::*VgaOpcodeProc) (); +static const uint16 vc_get_out_of_code = 0; + +// Opcode tables +static const VgaOpcodeProc vga_opcode_table[] = { + NULL, + &SimonState::vc_1, + &SimonState::vc_2, + &SimonState::vc_3, + &SimonState::vc_4, + &SimonState::vc_5, + &SimonState::vc_6_maybe_skip_3_inv, + &SimonState::vc_7_maybe_skip_3, + &SimonState::vc_8_maybe_skip_2, + &SimonState::vc_9_maybe_skip, + &SimonState::vc_10, + &SimonState::vc_11_clear_pathfind_array, + &SimonState::vc_12_sleep_variable, + &SimonState::vc_13_offset_x, + &SimonState::vc_14_offset_y, + &SimonState::vc_15_start_funkystruct_by_id, + &SimonState::vc_16_setup_funkystruct, + &SimonState::vc_17_set_pathfind_item, + &SimonState::vc_18_jump_rel, + &SimonState::vc_19, + &SimonState::vc_20, + &SimonState::vc_21, + &SimonState::vc_22, + &SimonState::vc_23_set_pri, + &SimonState::vc_24_set_image_xy, + &SimonState::vc_25_del_sprite_and_get_out, + &SimonState::vc_26, + &SimonState::vc_27_reset, + &SimonState::vc_28, + &SimonState::vc_29_stop_all_sounds, + &SimonState::vc_30_set_base_delay, + &SimonState::vc_31_set_palette_mode, + &SimonState::vc_32_copy_var, + &SimonState::vc_33, + &SimonState::vc_34, + &SimonState::vc_35, + &SimonState::vc_36, + &SimonState::vc_37_sprite_unk3_add, + &SimonState::vc_38_skip_if_var_zero, + &SimonState::vc_39_set_var, + &SimonState::vc_40_var_add, + &SimonState::vc_41_var_sub, + &SimonState::vc_42_delay_if_not_eq, + &SimonState::vc_43_skip_if_bit_clear, + &SimonState::vc_44_skip_if_bit_set, + &SimonState::vc_45_set_x, + &SimonState::vc_46_set_y, + &SimonState::vc_47_add_var_f, + &SimonState::vc_48, + &SimonState::vc_49_set_bit, + &SimonState::vc_50_clear_bit, + &SimonState::vc_51_clear_hitarea_bit_0x40, + &SimonState::vc_52, + &SimonState::vc_53_no_op, + &SimonState::vc_54_no_op, + &SimonState::vc_55_offset_hit_area, + &SimonState::vc_56_no_op, + &SimonState::vc_57_no_op, + &SimonState::vc_58, + &SimonState::vc_59, + &SimonState::vc_60, + &SimonState::vc_61_sprite_change, + &SimonState::vc_62, + &SimonState::vc_63, + &SimonState::vc_64, + &SimonState::vc_65, + &SimonState::vc_66, + &SimonState::vc_67, + &SimonState::vc_68, + &SimonState::vc_69, + &SimonState::vc_70, + &SimonState::vc_71, + &SimonState::vc_72, + &SimonState::vc_73, + &SimonState::vc_74, +}; + +// Script parser +void SimonState::run_vga_script() +{ + for (;;) { + uint opcode; + +#ifdef DUMP_CONTINOUS_VGASCRIPT + if ((void *)_vc_ptr != (void *)&vc_get_out_of_code) { +// if (_vga_cur_sprite_id==62 && _vga_cur_file_id==68 || +// _vga_cur_sprite_id==1 && _vga_cur_file_id==2) { + fprintf(_dump_file, "%.5d %.5X: %5d %4d ", _vga_tick_counter, _vc_ptr - _cur_vga_file_1, + _vga_cur_sprite_id, _vga_cur_file_id); + dump_video_script(_vc_ptr, true); +// } + } +#endif + + if (!(_game & GAME_SIMON2)) { + opcode = READ_BE_UINT16_UNALIGNED(_vc_ptr); + _vc_ptr += 2; + } else { + opcode = *_vc_ptr++; + } + + if (opcode >= gss->NUM_VIDEO_OP_CODES) + error("Invalid VGA opcode '%d' encountered", opcode); + + if (opcode == 0) + return; + + (this->*vga_opcode_table[opcode]) (); + } +} + +int SimonState::vc_read_var_or_word() +{ + int16 var = vc_read_next_word(); + if (var < 0) + var = vc_read_var(-var); + return var; +} + +uint SimonState::vc_read_next_word() +{ + uint a = READ_BE_UINT16_UNALIGNED(_vc_ptr); + _vc_ptr += 2; + return a; +} + +uint SimonState::vc_read_next_byte() +{ + return *_vc_ptr++; +} + + +void SimonState::vc_skip_next_instruction() +{ + static const byte opcode_param_len_simon1[] = { + 0, 6, 2, 10, 6, 4, 2, 2, + 4, 4, 10, 0, 2, 2, 2, 2, + 2, 0, 2, 0, 4, 2, 4, 2, + 8, 0, 10, 0, 8, 0, 2, 2, + 4, 0, 0, 4, 4, 2, 2, 4, + 4, 4, 4, 2, 2, 2, 2, 4, + 0, 2, 2, 2, 2, 4, 6, 6, + 0, 0, 0, 0, 2, 6, 0, 0, + }; + + static const byte opcode_param_len_simon2[] = { + 0, 6, 2, 12, 6, 4, 2, 2, + 4, 4, 9, 0, 1, 2, 2, 2, + 2, 0, 2, 0, 4, 2, 4, 2, + 7, 0, 10, 0, 8, 0, 2, 2, + 4, 0, 0, 4, 4, 2, 2, 4, + 4, 4, 4, 2, 2, 2, 2, 4, + 0, 2, 2, 2, 2, 4, 6, 6, + 2, 0, 6, 6, 4, 6, 0, 0, + 0, 0, 4, 4, 4, 4, 4, 0, + 4, 2, 2 + }; + + if (_game & GAME_SIMON2) { + uint opcode = vc_read_next_byte(); + _vc_ptr += opcode_param_len_simon2[opcode]; + } else { + uint opcode = vc_read_next_word(); + _vc_ptr += opcode_param_len_simon1[opcode]; + } + +#ifdef DUMP_CONTINOUS_VGASCRIPT + fprintf(_dump_file, "; skipped\n"); +#endif +} + +void SimonState::o_read_vgares_23() +{ // Simon1 Only + if (_vga_res_328_loaded == true) { + _vga_res_328_loaded = false; + _lock_word |= 0x4000; + read_vga_from_datfile_1(23); + _lock_word &= ~0x4000; + } +} + +void SimonState::o_read_vgares_328() +{ // Simon1 Only + if (_vga_res_328_loaded == false) { + _vga_res_328_loaded = true; + _lock_word |= 0x4000; + read_vga_from_datfile_1(328); + _lock_word &= ~0x4000; + } +} + + +// VGA Script commands +void SimonState::vc_1() +{ + /* dummy opcode */ + _vc_ptr += 6; +} + +void SimonState::vc_2() +{ + VgaPointersEntry *vpe; + uint num; + uint res; + byte *old_file_1, *old_file_2; + byte *b, *bb, *vc_ptr_org; + + num = vc_read_var_or_word(); + + old_file_1 = _cur_vga_file_1; + old_file_2 = _cur_vga_file_2; + + for (;;) { + res = num / 100; + vpe = &_vga_buffer_pointers[res]; + + _cur_vga_file_1 = vpe->vgaFile1; + _cur_vga_file_2 = vpe->vgaFile2; + if (vpe->vgaFile1 != NULL) + break; + if (_vga_cur_file_2 != res) + _video_var_7 = _vga_cur_file_2; + + ensureVgaResLoaded(res); + _video_var_7 = 0xFFFF; + } + + + bb = _cur_vga_file_1; + b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) bb)->hdr2_start); + b = bb + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) b)->unk2_offs); + + while (READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->id) != num) + b += sizeof(VgaFile1Struct0x8); + + vc_ptr_org = _vc_ptr; + + _vc_ptr = _cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->script_offs); + + +// dump_vga_script(_vc_ptr, res, num); + run_vga_script(); + + _cur_vga_file_1 = old_file_1; + _cur_vga_file_2 = old_file_2; + + _vc_ptr = vc_ptr_org; +} + +void SimonState::vc_3() +{ + uint16 a, b, c, d, e, f; + uint16 res; + VgaSprite *vsp; + VgaPointersEntry *vpe; + byte *p, *pp; + + a = vc_read_next_word(); /* 0 */ + + if (_game & GAME_SIMON2) { + f = vc_read_next_word(); /* 0 */ + b = vc_read_next_word(); /* 2 */ + } else { + b = vc_read_next_word(); /* 2 */ + f = b / 100; + } + + c = vc_read_next_word(); /* 4 */ + d = vc_read_next_word(); /* 6 */ + e = vc_read_next_word(); /* 8 */ + + /* 2nd param ignored with simon1 */ + if (has_vgastruct_with_id(b, f)) + return; + + vsp = _vga_sprites; + while (vsp->id) + vsp++; + + vsp->base_color = e; + vsp->unk6 = a; + vsp->unk5 = 0; + vsp->unk4 = 0; + vsp->image = 0; + vsp->x = c; + vsp->y = d; + vsp->id = b; + vsp->unk7 = res = f; + + for (;;) { + vpe = &_vga_buffer_pointers[res]; + _cur_vga_file_1 = vpe->vgaFile1; + + if (vpe->vgaFile1 != NULL) + break; + if (res != _vga_cur_file_2) + _video_var_7 = res; + + ensureVgaResLoaded(res); + _video_var_7 = 0xFFFF; + } + + pp = _cur_vga_file_1; + p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header *) pp)->hdr2_start); + p = pp + READ_BE_UINT16_UNALIGNED(&((VgaFile1Header2 *) p)->id_table); + + while (READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->id) != b) + p += sizeof(VgaFile1Struct0x6); + +#ifdef DUMP_FILE_NR + { + static bool dumped = false; + if (res == DUMP_FILE_NR && !dumped) { + dumped = true; + dump_vga_file(_cur_vga_file_1); + } + } +#endif + +#ifdef DUMP_BITMAPS_FILE_NR + { + static bool dumped = false; + if (res == DUMP_BITMAPS_FILE_NR && !dumped) { + dumped = true; + dump_vga_bitmaps(_cur_vga_file_2, _cur_vga_file_1, res); + } + } +#endif + +// dump_vga_script(_cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6*)p)->script_offs), res, b); + + add_vga_timer(gss->VGA_DELAY_BASE, + _cur_vga_file_1 + READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x6 *) p)->script_offs), + b, res); +} + +void SimonState::vc_4() +{ + /* dummy opcode */ + _vc_ptr += 6; +} + +void SimonState::vc_5() +{ + uint var = vc_read_next_word(); + uint value = vc_read_next_word(); + if (vc_read_var(var) != value) + vc_skip_next_instruction(); +} + +void SimonState::vc_6_maybe_skip_3_inv() +{ + if (!vc_maybe_skip_proc_3(vc_read_next_word())) + vc_skip_next_instruction(); +} + +void SimonState::vc_7_maybe_skip_3() +{ + if (vc_maybe_skip_proc_3(vc_read_next_word())) + vc_skip_next_instruction(); +} + +void SimonState::vc_8_maybe_skip_2() +{ + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + if (!vc_maybe_skip_proc_2(a, b)) + vc_skip_next_instruction(); +} + +void SimonState::vc_9_maybe_skip() +{ + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + if (!vc_maybe_skip_proc_1(a, b)) + vc_skip_next_instruction(); +} + +struct VC10_state { + int image; + uint16 e; + int x, y; + + byte base_color; + + uint draw_width, draw_height; + uint x_skip, y_skip; + + byte *surf2_addr; + uint surf2_pitch; + + byte *surf_addr; + uint surf_pitch; + + byte dl, dh; + + byte *depack_src; + int8 depack_cont; + + byte depack_dest[200]; +}; + +byte *vc_10_depack_column(VC10_state * vs) +{ + int8 a = vs->depack_cont; + byte *src = vs->depack_src; + byte *dst = vs->depack_dest; + byte dh = vs->dh; + byte color; + + if (a != -0x80) + goto start_here; + + for (;;) { + a = *src++; + start_here:; + if (a >= 0) { + color = *src++; + do { + *dst++ = color; + if (!--dh) { + if (--a < 0) + a = -0x80; + else + src--; + goto get_out; + } + } while (--a >= 0); + } else { + do { + *dst++ = *src++; + if (!--dh) { + if (++a == 0) + a = -0x80; + goto get_out; + } + } while (++a != 0); + } + } + +get_out:; + vs->depack_src = src; + vs->depack_cont = a; + return vs->depack_dest + vs->y_skip; +} + +void vc_10_skip_cols(VC10_state * vs) +{ + vs->depack_cont = -0x80; + while (vs->x_skip) { + vc_10_depack_column(vs); + vs->x_skip--; + } +} + +byte *SimonState::vc_10_depack_swap(byte *src, uint w, uint h) +{ + w <<= 3; + + { + byte *dst_org = _video_buf_1 + w; + byte color; + int8 cur = -0x80; + uint w_cur = w; + + do { + byte *dst = dst_org; + uint h_cur = h; + + if (cur == -0x80) + cur = *src++; + + for (;;) { + if (cur >= 0) { + /* rle_same */ + color = *src++; + do { + *dst = color; + dst += w; + if (!--h_cur) { + if (--cur < 0) + cur = -0x80; + else + src--; + goto next_line; + } + } while (--cur >= 0); + } else { + /* rle_diff */ + do { + *dst = *src++; + dst += w; + if (!--h_cur) { + if (++cur == 0) + cur = -0x80; + goto next_line; + } + } while (++cur != 0); + } + cur = *src++; + } + next_line: + dst_org++; + } while (--w_cur); + } + + { + byte *dst_org, *src_org; + uint i; + + src_org = dst_org = _video_buf_1 + w; + + do { + byte *dst = dst_org; + for (i = 0; i != w; ++i) { + byte b = src_org[i]; + b = (b >> 4) | (b << 4); + *--dst = b; + } + + src_org += w; + dst_org += w; + } while (--h); + + } + + return _video_buf_1; + +} + +byte *vc_10_no_depack_swap(byte *src) +{ + error("vc_10_no_depack_swap unimpl"); + return NULL; +} + +/* must not be const */ +static uint16 _video_windows[128] = { + 0, 0, 20, 200, + 0, 0, 3, 136, + 17, 0, 3, 136, + 0, 0, 20, 200, + 0, 0, 20, 134 +}; + +/* simon2 specific */ +void SimonState::vc_10_helper_8(byte *dst, byte *src) +{ + const uint pitch = _dx_surface_pitch; + int8 reps = (int8)0x80; + byte color; + byte *dst_org = dst; + uint h = _vga_var5, w = 8; + + for (;;) { + reps = *src++; + if (reps >= 0) { + color = *src++; + + do { + *dst = color; + dst += pitch; + + /* reached bottom? */ + if (--h == 0) { + /* reached right edge? */ + if (--w == 0) + return; + dst = ++dst_org; + h = _vga_var5; + } + } while (--reps >= 0); + } else { + + do { + *dst = *src++; + dst += pitch; + + /* reached bottom? */ + if (--h == 0) { + /* reached right edge? */ + if (--w == 0) + return; + dst = ++dst_org; + h = _vga_var5; + } + } while (++reps != 0); + } + } +} + +void SimonState::vc_10() +{ + byte *p2; + uint width, height; + byte flags; + const uint16 *vlut; + VC10_state state; + + int cur; + + state.image = (int16)vc_read_next_word(); + if (state.image == 0) + return; + +// if (_vga_cur_sprite_id != 802) +// return; + + state.base_color = (_vc_ptr[1] << 4); + _vc_ptr += 2; + state.x = (int16)vc_read_next_word(); + if (_game & GAME_SIMON2) { + state.x -= _x_scroll; + } + state.y = (int16)vc_read_next_word(); + + if (!(_game & GAME_SIMON2)) { + state.e = vc_read_next_word(); + } else { + state.e = vc_read_next_byte(); + } + + if (state.image < 0) + state.image = vc_read_var(-state.image); + + p2 = _cur_vga_file_2 + state.image * 8; + state.depack_src = _cur_vga_file_2 + READ_BE_UINT32_UNALIGNED(&*(uint32 *)p2); + + width = READ_BE_UINT16_UNALIGNED(p2 + 6) >> 4; + height = p2[5]; + flags = p2[4]; + + if (height == 0 || width == 0) + return; + +#ifdef DUMP_DRAWN_BITMAPS + dump_single_bitmap(_vga_cur_file_id, state.image, state.depack_src, width * 16, height, + state.base_color); +#endif + + if (flags & 0x80 && !(state.e & 0x10)) { + if (state.e & 1) { + state.e &= ~1; + state.e |= 0x10; + } else { + state.e |= 0x8; + } + } + + if (_game & GAME_SIMON2 && width >= 21) { + byte *src, *dst; + uint w; + + _vga_var1 = width * 2 - 40; + _vga_var7 = state.depack_src; + _vga_var5 = height; + if (_variableArray[34] == -1) + state.x = _variableArray[502 / 2]; + + _x_scroll = state.x; + + vc_write_var(0xfb, _x_scroll); + + dst = dx_lock_attached(); + src = state.depack_src + _x_scroll * 4; + + w = 40; + do { + vc_10_helper_8(dst, src + READ_BE_UINT32_UNALIGNED(&*(uint32 *)src)); + dst += 8; + src += 4; + } while (--w); + + dx_unlock_attached(); + + + return; + } + + if (state.e & 0x10) + state.depack_src = vc_10_depack_swap(state.depack_src, width, height); + else if (state.e & 1) + state.depack_src = vc_10_no_depack_swap(state.depack_src); + + + vlut = &_video_windows[_video_palette_mode * 4]; + + state.draw_width = width << 1; /* cl */ + state.draw_height = height; /* ch */ + + state.x_skip = 0; /* colums to skip = bh */ + state.y_skip = 0; /* rows to skip = bl */ + + cur = state.x; + if (cur < 0) { + do { + if (!--state.draw_width) + return; + state.x_skip++; + } while (++cur); + } + state.x = cur; + + cur += state.draw_width - (vlut[2] << 1); + if (cur > 0) { + do { + if (!--state.draw_width) + return; + } while (--cur); + } + + cur = state.y; + if (cur < 0) { + do { + if (!--state.draw_height) + return; + state.y_skip++; + } while (++cur); + } + state.y = cur; + + cur += state.draw_height - vlut[3]; + if (cur > 0) { + do { + if (!--state.draw_height) + return; + } while (--cur); + } + + assert(state.draw_width != 0 && state.draw_height != 0); + + state.draw_width <<= 2; + + state.surf2_addr = dx_lock_2(); + state.surf2_pitch = _dx_surface_pitch; + + state.surf_addr = dx_lock_attached(); + state.surf_pitch = _dx_surface_pitch; + + { + uint offs = ((vlut[0] - _video_windows[16]) * 2 + state.x) * 8; + uint offs2 = (vlut[1] - _video_windows[17] + state.y); + + state.surf2_addr += offs + offs2 * state.surf2_pitch; + state.surf_addr += offs + offs2 * state.surf_pitch; + } + + if (state.e & 0x20) { + byte *mask, *src, *dst; + byte h; + uint w; + + state.x_skip <<= 2; + state.dl = width; + state.dh = height; + + vc_10_skip_cols(&state); + + /* XXX: implement transparency */ + + w = 0; + do { + mask = vc_10_depack_column(&state); /* esi */ + src = state.surf2_addr + w * 2; /* ebx */ + dst = state.surf_addr + w * 2; /* edi */ + + h = state.draw_height; + do { + if (mask[0] & 0xF0) + dst[0] = src[0]; + if (mask[0] & 0x0F) + dst[1] = src[1]; + mask++; + dst += state.surf_pitch; + src += state.surf2_pitch; + } while (--h); + } while (++w != state.draw_width); + + /* vc_10_helper_5 */ + } else if (_lock_word & 0x20 && state.base_color == 0 || state.base_color == 0xC0) { + byte *src, *dst; + uint h, i; + + if (!(state.e & 8)) { + src = state.depack_src + (width * state.y_skip << 4) + (state.x_skip << 3); + dst = state.surf_addr; + + state.draw_width *= 2; + + if (state.e & 2) { + /* no transparency */ + h = state.draw_height; + do { + memcpy(dst, src, state.draw_width); + dst += 320; + src += width * 16; + } while (--h); + } else { + /* transparency */ + h = state.draw_height; + do { + for (i = 0; i != state.draw_width; i++) + if (src[i]) + dst[i] = src[i]; + dst += 320; + src += width * 16; + } while (--h); + } + + } else { + byte *dst_org = state.surf_addr; + src = state.depack_src; + /* AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE + * aaaaabbb bbcccccd ddddeeee efffffgg ggghhhhh + */ + + if (state.e & 2) { + /* no transparency */ + do { + uint count = state.draw_width >> 2; + + dst = dst_org; + do { + uint32 bits = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | (src[3]); + + dst[0] = (byte)((bits >> (32 - 5)) & 31); + dst[1] = (byte)((bits >> (32 - 10)) & 31); + dst[2] = (byte)((bits >> (32 - 15)) & 31); + dst[3] = (byte)((bits >> (32 - 20)) & 31); + dst[4] = (byte)((bits >> (32 - 25)) & 31); + dst[5] = (byte)((bits >> (32 - 30)) & 31); + + bits = (bits << 8) | src[4]; + + dst[6] = (byte)((bits >> (40 - 35)) & 31); + dst[7] = (byte)((bits) & 31); + + dst += 8; + src += 5; + } while (--count); + dst_org += 320; + } while (--state.draw_height); + } else { + /* transparency */ + do { + uint count = state.draw_width >> 2; + + dst = dst_org; + do { + uint32 bits = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | (src[3]); + byte tmp; + + tmp = (byte)((bits >> (32 - 5)) & 31); + if (tmp) + dst[0] = tmp; + tmp = (byte)((bits >> (32 - 10)) & 31); + if (tmp) + dst[1] = tmp; + tmp = (byte)((bits >> (32 - 15)) & 31); + if (tmp) + dst[2] = tmp; + tmp = (byte)((bits >> (32 - 20)) & 31); + if (tmp) + dst[3] = tmp; + tmp = (byte)((bits >> (32 - 25)) & 31); + if (tmp) + dst[4] = tmp; + tmp = (byte)((bits >> (32 - 30)) & 31); + if (tmp) + dst[5] = tmp; + + bits = (bits << 8) | src[4]; + + tmp = (byte)((bits >> (40 - 35)) & 31); + if (tmp) + dst[6] = tmp; + tmp = (byte)((bits) & 31); + if (tmp) + dst[7] = tmp; + + dst += 8; + src += 5; + } while (--count); + dst_org += 320; + } while (--state.draw_height); + } + } + /* vc_10_helper_4 */ + } else { + if (_game & GAME_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) { + state.surf_addr = state.surf2_addr; + state.surf_pitch = state.surf2_pitch; + warning("vc_10: (state.e&0x4)"); + } + + if (state.e & 0x8) { + uint w, h; + byte *src, *dst, *dst_org; + + state.x_skip <<= 2; /* reached */ + state.dl = width; + state.dh = height; + + vc_10_skip_cols(&state); + + if (state.e & 2) { + dst_org = state.surf_addr; + w = 0; + do { + src = vc_10_depack_column(&state); + dst = dst_org; + + h = 0; + do { + dst[0] = (*src >> 4) | state.base_color; + dst[1] = (*src & 15) | state.base_color; + dst += 320; + src++; + } while (++h != state.draw_height); + dst_org += 2; + } while (++w != state.draw_width); + } else { + dst_org = state.surf_addr; + if (state.e & 0x40) { /* reached */ + dst_org += vc_read_var(252); + } + w = 0; + do { + byte color; + + src = vc_10_depack_column(&state); + dst = dst_org; + + h = 0; + do { + color = (*src >> 4); + if (color) + dst[0] = color | state.base_color; + color = (*src & 15); + if (color) + dst[1] = color | state.base_color; + dst += 320; + src++; + } while (++h != state.draw_height); + dst_org += 2; + } while (++w != state.draw_width); + } + /* vc_10_helper_6 */ + } else { + byte *src, *dst; + uint count; + + src = state.depack_src + (width * state.y_skip) * 8; + dst = state.surf_addr; + state.x_skip <<= 2; + if (state.e & 2) { + do { + for (count = 0; count != state.draw_width; count++) { + dst[count * 2] = (src[count + state.x_skip] >> 4) | state.base_color; + dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.base_color; + } + dst += 320; + src += width * 8; + } while (--state.draw_height); + } else { + do { + for (count = 0; count != state.draw_width; count++) { + byte color; + color = (src[count + state.x_skip] >> 4); + if (color) + dst[count * 2] = color | state.base_color; + color = (src[count + state.x_skip] & 15); + if (color) + dst[count * 2 + 1] = color | state.base_color; + } + dst += 320; + src += width * 8; + } while (--state.draw_height); + + } + + /* vc_10_helper_7 */ + } + } + + dx_unlock_2(); + dx_unlock_attached(); + +} + +void SimonState::vc_11_clear_pathfind_array() +{ + memset(&_pathfind_array, 0, sizeof(_pathfind_array)); +} + +void SimonState::vc_12_sleep_variable() +{ + uint num; + + if (!(_game & GAME_SIMON2)) { + num = vc_read_var_or_word(); + } else { + num = vc_read_next_byte() * _vga_base_delay; + } + + add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); + _vc_ptr = (byte *)&vc_get_out_of_code; +} + +void SimonState::vc_13_offset_x() +{ + VgaSprite *vsp = find_cur_sprite(); + int16 a = vc_read_next_word(); + vsp->x += a; + _vga_sprite_changed++; +} + +void SimonState::vc_14_offset_y() +{ + VgaSprite *vsp = find_cur_sprite(); + int16 a = vc_read_next_word(); + vsp->y += a; + _vga_sprite_changed++; +} + +/* wakeup_id */ +void SimonState::vc_15_start_funkystruct_by_id() +{ + VgaSleepStruct *vfs = _vga_sleep_structs, *vfs_tmp; + uint16 id = vc_read_next_word(); + while (vfs->ident != 0) { + if (vfs->ident == id) { + add_vga_timer(gss->VGA_DELAY_BASE, vfs->code_ptr, vfs->sprite_id, vfs->cur_vga_file); + vfs_tmp = vfs; + do { + memcpy(vfs_tmp, vfs_tmp + 1, sizeof(VgaSleepStruct)); + vfs_tmp++; + } while (vfs_tmp->ident != 0); + } else { + vfs++; + } + } + + /* clear a wait event */ + if (id == _vga_wait_for) + _vga_wait_for = 0; +} + + +/* sleep_on_id */ +void SimonState::vc_16_setup_funkystruct() +{ + VgaSleepStruct *vfs = _vga_sleep_structs; + while (vfs->ident) + vfs++; + + vfs->ident = vc_read_next_word(); + vfs->code_ptr = _vc_ptr; + vfs->sprite_id = _vga_cur_sprite_id; + vfs->cur_vga_file = _vga_cur_file_id; + + _vc_ptr = (byte *)&vc_get_out_of_code; +} + +void SimonState::vc_17_set_pathfind_item() +{ + uint a = vc_read_next_word(); + _pathfind_array[a - 1] = (uint16 *)_vc_ptr; + while (READ_BE_UINT16_UNALIGNED(_vc_ptr) != 999) + _vc_ptr += 4; + _vc_ptr += 2; +} + +void SimonState::vc_18_jump_rel() +{ + int16 offs = vc_read_next_word(); + _vc_ptr += offs; +} + +/* chain to script? */ +void SimonState::vc_19() +{ + /* XXX: not implemented */ + error("vc_19: chain to script not implemented"); +} + + +/* helper routines */ + +/* write unaligned 16-bit */ +static void write_16_le(void *p, uint16 a) +{ + ((byte *)p)[0] = (byte)(a); + ((byte *)p)[1] = (byte)(a >> 8); +} + +/* read unaligned 16-bit */ +static uint16 read_16_le(void *p) +{ + return ((byte *)p)[0] | (((byte *)p)[1] << 8); +} + +/* FIXME: unaligned access */ +void SimonState::vc_20() +{ + uint16 a = vc_read_next_word(); + write_16_le(_vc_ptr, a); + _vc_ptr += 2; +} + +/* FIXME: unaligned access */ +void SimonState::vc_21() +{ + if (!(_game & GAME_SIMON2)) { + int16 a = vc_read_next_word(); + byte *tmp = _vc_ptr + a; + uint16 val = read_16_le(tmp + 4); + + if (val != 0) { + write_16_le(tmp + 4, val - 1); + _vc_ptr = tmp + 6; + } + } else { + int16 a = vc_read_next_word(); + byte *tmp = _vc_ptr + a; + uint16 val = read_16_le(tmp + 3); + + if (val != 0) { + write_16_le(tmp + 3, val - 1); + _vc_ptr = tmp + 5; + } + } +} + +void SimonState::vc_22() +{ + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + uint num = a == 0 ? 0x20 : 0x10; + byte *palptr, *src; + + palptr = &_palette[(a << 6)]; + + src = _cur_vga_file_1 + 6 + b * 96; + + do { + palptr[0] = src[0] << 2; + palptr[1] = src[1] << 2; + palptr[2] = src[2] << 2; + palptr[3] = 0; + + palptr += 4; + src += 3; + } while (--num); + + _video_var_9 = 2; + _vga_sprite_changed++; +} + +void SimonState::vc_23_set_pri() +{ + VgaSprite *vsp = find_cur_sprite(), *vus2; + uint16 pri = vc_read_next_word(); + VgaSprite bak; + + if (vsp->id == 0) { + warning("tried to set pri for unknown id %d", _vga_cur_sprite_id); + return; + } + + memcpy(&bak, vsp, sizeof(bak)); + bak.unk5 = pri; + bak.unk6 |= 0x8000; + + vus2 = vsp; + + if (vsp != _vga_sprites && pri < vsp[-1].unk5) { + do { + vsp--; + } while (vsp != _vga_sprites && pri < vsp[-1].unk5); + do { + memcpy(vus2, vus2 - 1, sizeof(VgaSprite)); + } while (--vus2 != vsp); + memcpy(vus2, &bak, sizeof(VgaSprite)); + } else if (vsp[1].id != 0 && pri >= vsp[1].unk5) { + do { + vsp++; + } while (vsp[1].id != 0 && pri >= vsp[1].unk5); + do { + memcpy(vus2, vus2 + 1, sizeof(VgaSprite)); + } while (++vus2 != vsp); + memcpy(vus2, &bak, sizeof(VgaSprite)); + } else { + vsp->unk5 = pri; + } + _vga_sprite_changed++; +} + +void SimonState::vc_24_set_image_xy() +{ + VgaSprite *vsp = find_cur_sprite(); + vsp->image = vc_read_var_or_word(); + + if (vsp->id == 0) { + warning("Trying to set XY of nonexistent sprite '%d'", _vga_cur_sprite_id); + } + + vsp->x += (int16)vc_read_next_word(); + vsp->y += (int16)vc_read_next_word(); + if (!(_game & GAME_SIMON2)) { + vsp->unk4 = vc_read_next_word(); + } else { + vsp->unk4 = vc_read_next_byte(); + } + + _vga_sprite_changed++; +} + +void SimonState::vc_25_del_sprite_and_get_out() +{ + VgaSprite *vsp = find_cur_sprite(); + while (vsp->id != 0) { + memcpy(vsp, vsp + 1, sizeof(VgaSprite)); + vsp++; + } + _vc_ptr = (byte *)&vc_get_out_of_code; + _vga_sprite_changed++; +} + +void SimonState::vc_26() +{ + uint16 *as = &_video_windows[vc_read_next_word() * 4]; + as[0] = vc_read_next_word(); + as[1] = vc_read_next_word(); + as[2] = vc_read_next_word(); + as[3] = vc_read_next_word(); +} + +void SimonState::vc_27_reset_simon1() +{ + VgaSprite bak, *vsp; + VgaSleepStruct *vfs; + VgaTimerEntry *vte, *vte2; + + _lock_word |= 8; + + memset(&bak, 0, sizeof(bak)); + + vsp = _vga_sprites; + while (vsp->id) { + if (vsp->id == 128) { + memcpy(&bak, vsp, sizeof(VgaSprite)); + } + vsp->id = 0; + vsp++; + } + + if (bak.id != 0) + memcpy(_vga_sprites, &bak, sizeof(VgaSprite)); + + vfs = _vga_sleep_structs; + while (vfs->ident) { + vfs->ident = 0; + vfs++; + } + + + vte = _vga_timer_list; + while (vte->delay) { + if (vte->sprite_id != 0x80) { + vte2 = vte; + while (vte2->delay) { + memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry)); + vte2++; + } + } else { + vte++; + } + } + + vc_write_var(0xFE, 0); + + _lock_word &= ~8; +} + + +void SimonState::vc_27_reset_simon2() +{ + _lock_word |= 8; + + { + VgaSprite *vsp = _vga_sprites; + while (vsp->id) { + vsp->id = 0; + vsp++; + } + } + + { + VgaSleepStruct *vfs = _vga_sleep_structs; + while (vfs->ident) { + vfs->ident = 0; + vfs++; + } + } + + { + VgaTimerEntry *vte = _vga_timer_list; + while (vte->delay) { + VgaTimerEntry *vte2 = vte; + while (vte2->delay) { + memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry)); + vte2++; + } + } + } + + vc_write_var(0xFE, 0); + + _lock_word &= ~8; +} + +void SimonState::vc_27_reset() +{ + if (!(_game & GAME_SIMON2)) + vc_27_reset_simon1(); + else + vc_27_reset_simon2(); +} + +void SimonState::vc_28() +{ + /* dummy opcode */ + _vc_ptr += 8; +} + +void SimonState::vc_29_stop_all_sounds() +{ + _mixer->stop_all(); +} + +void SimonState::vc_30_set_base_delay() +{ + _vga_base_delay = vc_read_next_word(); +} + +void SimonState::vc_31_set_palette_mode() +{ + _video_palette_mode = vc_read_next_word(); +} + +uint SimonState::vc_read_var(uint var) +{ + assert(var < 255); + return (uint16)_variableArray[var]; +} + +void SimonState::vc_write_var(uint var, int16 value) +{ + _variableArray[var] = value; +} + +void SimonState::vc_32_copy_var() +{ + uint16 a = vc_read_var(vc_read_next_word()); + vc_write_var(vc_read_next_word(), a); +} + +void SimonState::vc_33() +{ + if (_lock_counter != 0) { + _lock_counter = 1; + unlock(); + } +} + +void SimonState::vc_34() +{ + lock(); + _lock_counter = 200; + _left_button_down = 0; +} + +void SimonState::vc_35() +{ + /* not used? */ + _vc_ptr += 4; + _vga_sprite_changed++; +} + +void SimonState::vc_36() +{ + uint vga_res = vc_read_next_word(); + uint mode = vc_read_next_word(); + + if (!(_game & GAME_SIMON2)) { + if (mode == 16) { + _copy_partial_mode = 2; + } else { + set_video_mode_internal(mode, vga_res); + } + } else { + set_video_mode_internal(mode, vga_res); + } +} + +void SimonState::vc_37_sprite_unk3_add() +{ + VgaSprite *vsp = find_cur_sprite(); + vsp->y += vc_read_var(vc_read_next_word()); + _vga_sprite_changed++; +} + +void SimonState::vc_38_skip_if_var_zero() +{ + uint var = vc_read_next_word(); + if (vc_read_var(var) == 0) + vc_skip_next_instruction(); +} + +void SimonState::vc_39_set_var() +{ + uint var = vc_read_next_word(); + int16 value = vc_read_next_word(); + vc_write_var(var, value); +} + +void SimonState::vc_40_var_add() +{ + uint var = vc_read_next_word(); + int16 value = vc_read_var(var) + vc_read_next_word(); + + if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + int16 tmp; + + if (_vga_var2 != 0) { + if (_vga_var2 >= 0) + goto no_scroll; + _vga_var2 = 0; + } else { + if (_vga_var3 != 0) + goto no_scroll; + } + + if (value - _x_scroll >= 30) { + _vga_var2 = 20; + tmp = _vga_var1 - _x_scroll; + if (tmp < 20) + _vga_var2 = tmp; + add_vga_timer(10, NULL, 0, 0); /* special timer */ + } + } +no_scroll:; + + vc_write_var(var, value); +} + +void SimonState::vc_41_var_sub() +{ + uint var = vc_read_next_word(); + int16 value = vc_read_var(var) - vc_read_next_word(); + + if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + int16 tmp; + + if (_vga_var2 != 0) { + if (_vga_var2 < 0) + goto no_scroll; + _vga_var2 = 0; + } else { + if (_vga_var3 != 0) + goto no_scroll; + } + + if ((uint16)(value - _x_scroll) < 11) { + _vga_var2 = -20; + tmp = _vga_var1 - _x_scroll; + if (_x_scroll < 20) + _vga_var2 = -_x_scroll; + add_vga_timer(10, NULL, 0, 0); /* special timer */ + } + } +no_scroll:; + + vc_write_var(var, value); +} + +void SimonState::vc_42_delay_if_not_eq() +{ + uint val = vc_read_var(vc_read_next_word()); + if (val == vc_read_next_word()) { + + add_vga_timer(_vga_base_delay + 1, _vc_ptr - 4, _vga_cur_sprite_id, _vga_cur_file_id); + _vc_ptr = (byte *)&vc_get_out_of_code; + } +} + +void SimonState::vc_43_skip_if_bit_clear() +{ + if (!vc_get_bit(vc_read_next_word())) { + vc_skip_next_instruction(); + } +} + +void SimonState::vc_44_skip_if_bit_set() +{ + if (vc_get_bit(vc_read_next_word())) { + vc_skip_next_instruction(); + } +} + +void SimonState::vc_45_set_x() +{ + VgaSprite *vsp = find_cur_sprite(); + vsp->x = vc_read_var(vc_read_next_word()); + _vga_sprite_changed++; +} + +void SimonState::vc_46_set_y() +{ + VgaSprite *vsp = find_cur_sprite(); + vsp->y = vc_read_var(vc_read_next_word()); + _vga_sprite_changed++; +} + +void SimonState::vc_47_add_var_f() +{ + uint var = vc_read_next_word(); + vc_write_var(var, vc_read_var(var) + vc_read_var(vc_read_next_word())); +} + +void SimonState::vc_48() +{ + uint a = (uint16)_variableArray[12]; + uint b = (uint16)_variableArray[13]; + int c = _variableArray[14]; + uint16 *p = _pathfind_array[a - 1]; + int step; + int y1, y2; + int16 *vp; + + p += b * 2 + 1; + + step = 2; + if (c < 0) { + c = -c; + step = -2; + } + + vp = &_variableArray[20]; + + do { + y2 = READ_BE_UINT16_UNALIGNED(p); + p += step; + y1 = READ_BE_UINT16_UNALIGNED(p) - y2; + +// assert(READ_BE_UINT16_UNALIGNED(&p[1]) != 999); + + vp[0] = y1 >> 1; + vp[1] = y1 - (y1 >> 1); + + vp += 2; + } while (--c); + +} + +void SimonState::vc_set_bit_to(uint bit, bool value) +{ + uint16 *bits = &_bit_array[bit >> 4]; + *bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15)); +} + +bool SimonState::vc_get_bit(uint bit) +{ + uint16 *bits = &_bit_array[bit >> 4]; + return (*bits & (1 << (bit & 15))) != 0; +} + +void SimonState::vc_49_set_bit() +{ + vc_set_bit_to(vc_read_next_word(), true); +} + +void SimonState::vc_50_clear_bit() +{ + vc_set_bit_to(vc_read_next_word(), false); +} + +void SimonState::vc_51_clear_hitarea_bit_0x40() +{ + clear_hitarea_bit_0x40(vc_read_next_word()); +} + +void SimonState::vc_52() +{ + uint16 a = vc_read_next_word(); + + if (!(_game & GAME_SIMON2)) { + playSound(a); + } else { + if (a >= 0x8000) { + a = -a; + warning("vc_52(%d): unimpl"); + } else { + playSound(a); + } + } +} + +void SimonState::vc_53_no_op() +{ + /* no op */ +} + +void SimonState::vc_54_no_op() +{ + /* no op */ +} + +void SimonState::vc_55_offset_hit_area() +{ + HitArea *ha = _hit_areas; + uint count = ARRAYSIZE(_hit_areas); + uint16 id = vc_read_next_word(); + int16 x = vc_read_next_word(); + int16 y = vc_read_next_word(); + + for (;;) { + if (ha->id == id) { + ha->x += x; + ha->y += y; + break; + } + ha++; + if (!--count) + break; + } + + _need_hitarea_recalc++; +} + +void SimonState::vc_56_no_op() +{ + /* No-Op in simon1 */ + if (_game & GAME_SIMON2) { + uint num = vc_read_var_or_word() * _vga_base_delay; + +#ifdef DUMP_CONTINOUS_VGASCRIPT + fprintf(_dump_file, "; sleep_ex = %d\n", num + gss->VGA_DELAY_BASE); +#endif + + add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); + _vc_ptr = (byte *)&vc_get_out_of_code; + } +} + +void SimonState::vc_59() +{ + if (_game & GAME_SIMON2) { + uint file = vc_read_next_word(); + uint start = vc_read_next_word(); + uint end = vc_read_next_word() + 1; + + do { + vc_kill_thread(file, start); + } while (++start != end); + } else { + if (vc_59_helper()) + vc_skip_next_instruction(); + } +} + +void SimonState::vc_58() +{ + uint sprite = _vga_cur_sprite_id; + uint file = _vga_cur_file_id; + byte *vc_ptr; + uint16 tmp; + + _vga_cur_file_id = vc_read_next_word(); + _vga_cur_sprite_id = vc_read_next_word(); + + tmp = TO_BE_16(vc_read_next_word()); + + vc_ptr = _vc_ptr; + _vc_ptr = (byte *)&tmp; + vc_23_set_pri(); + + _vc_ptr = vc_ptr; + _vga_cur_sprite_id = sprite; + _vga_cur_file_id = file; +} + +void SimonState::vc_57_no_op() +{ + /* no op */ + +} + +void SimonState::vc_kill_thread(uint file, uint sprite) +{ + uint16 old_sprite_id, old_cur_file_id; + VgaSleepStruct *vfs; + VgaSprite *vsp; + VgaTimerEntry *vte; + byte *vc_org; + + old_sprite_id = _vga_cur_sprite_id; + old_cur_file_id = _vga_cur_file_id; + vc_org = _vc_ptr; + + _vga_cur_file_id = file; + _vga_cur_sprite_id = sprite; + + vfs = _vga_sleep_structs; + while (vfs->ident != 0) { + if (vfs->sprite_id == _vga_cur_sprite_id + && (vfs->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) + ) { + while (vfs->ident != 0) { + memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct)); + vfs++; + } + break; + } + vfs++; + } + + vsp = find_cur_sprite(); + if (vsp->id) { + vc_25_del_sprite_and_get_out(); + + vte = _vga_timer_list; + while (vte->delay != 0) { + if (vte->sprite_id == _vga_cur_sprite_id + && (vte->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) + ) { + delete_vga_timer(vte); + break; + } + vte++; + } + } + + _vga_cur_file_id = old_cur_file_id; + _vga_cur_sprite_id = old_sprite_id; + _vc_ptr = vc_org; +} + + +/* kill thread */ +void SimonState::vc_60() +{ + uint file; + + if (_game & GAME_SIMON2) { + file = vc_read_next_word(); + } else { + file = _vga_cur_file_id; + } + uint sprite = vc_read_next_word(); + vc_kill_thread(file, sprite); +} + +void SimonState::vc_61_sprite_change() +{ + VgaSprite *vsp = find_cur_sprite(); + + vsp->image = vc_read_var_or_word(); + + vsp->x += vc_read_next_word(); + vsp->y += vc_read_next_word(); + vsp->unk4 = 36; + + _vga_sprite_changed++; +} + +void SimonState::vc_62() +{ + uint i; + byte *vc_ptr_org = _vc_ptr; + + + vc_29_stop_all_sounds(); + +// if (!_video_var_3) { + _video_var_3 = true; + _video_num_pal_colors = 256; + if (_video_palette_mode == 4) + _video_num_pal_colors = 208; +// } + + memcpy(_video_buf_1, _palette_backup, _video_num_pal_colors * sizeof(uint32)); + for (i = NUM_PALETTE_FADEOUT; i != 0; --i) { + palette_fadeout((uint32 *)_video_buf_1, _video_num_pal_colors); + _system->set_palette(_video_buf_1, 0, _video_num_pal_colors); + _system->update_screen(); + delay(5); + } + + if (!(_game & GAME_SIMON2)) { + uint16 params[5]; /* parameters to vc_10 */ + VgaSprite *vsp; + VgaPointersEntry *vpe; + + vsp = _vga_sprites; + while (vsp->id != 0) { + if (vsp->id == 128) { + byte *f1 = _cur_vga_file_1; + byte *f2 = _cur_vga_file_2; + uint palmode = _video_palette_mode; + + vpe = &_vga_buffer_pointers[vsp->unk7]; + _cur_vga_file_1 = vpe->vgaFile1; + _cur_vga_file_2 = vpe->vgaFile2; + _video_palette_mode = vsp->unk6; + + params[0] = READ_BE_UINT16_UNALIGNED(&vsp->image); + params[1] = READ_BE_UINT16_UNALIGNED(&vsp->base_color); + params[2] = READ_BE_UINT16_UNALIGNED(&vsp->x); + params[3] = READ_BE_UINT16_UNALIGNED(&vsp->y); + params[4] = READ_BE_UINT16_UNALIGNED(&vsp->unk4); + _vc_ptr = (byte *)params; + vc_10(); + + _video_palette_mode = palmode; + _cur_vga_file_1 = f1; + _cur_vga_file_2 = f2; + break; + } + vsp++; + } + } + + dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200); + + _vc_ptr = vc_ptr_org; +} + +void SimonState::vc_63() +{ + _palette_color_count = 208; + if (_video_palette_mode != 4) { + _palette_color_count = 256; + } + _video_var_3 = false; +} + +void SimonState::vc_64() +{ // Simon2 + if (vc_59_helper()) + vc_skip_next_instruction(); +} + +void SimonState::vc_65() +{ // Simon2 + error("vc_65 unimplemented"); +} + +void SimonState::vc_66() +{ // Simon2 + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + + if (vc_read_var(a) != vc_read_var(b)) + vc_skip_next_instruction(); +} + +void SimonState::vc_67() +{ // Simon2 + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + + if (vc_read_var(a) >= vc_read_var(b)) + vc_skip_next_instruction(); +} + +void SimonState::vc_68() +{ // Simon2 + uint a = vc_read_next_word(); + uint b = vc_read_next_word(); + + if (vc_read_var(a) <= vc_read_var(b)) + vc_skip_next_instruction(); +} + +void SimonState::vc_69() +{ // Simon2 + uint16 a = vc_read_next_word(); + uint16 b = vc_read_next_word(); + + warning("vc_69(%d,%d): music stuff?", a, b); +} + +void SimonState::vc_70() +{ // Simon2 + uint16 a = vc_read_next_word(); + uint16 b = vc_read_next_word(); + + _vc70_var1 = a; + _vc70_var2 = b; + + warning("vc_70(%d,%d): music stuff?", a, b); +} + + +void SimonState::vc_71() +{ // Simon2 + if (_vc72_var3 == 0xFFFF && _vc72_var1 == 0xFFFF) + vc_skip_next_instruction(); +} + +void SimonState::vc_72() +{ // Simon2 + uint16 a = vc_read_next_word(); + uint16 b = vc_read_next_word(); + if (a != _vc72_var1) { + _vc72_var2 = b; + _vc72_var3 = a; + } + + warning("vc_72(%d,%d): music stuff?", a, b); +} + +void SimonState::vc_73() +{ // Simon2 + vc_read_next_byte(); + _op_189_flags |= 1 << vc_read_next_byte(); +} + +void SimonState::vc_74() +{ // Simon2 + vc_read_next_byte(); + _op_189_flags &= ~(1 << vc_read_next_byte()); +} diff --git a/smush.h b/smush.h deleted file mode 100644 index 1389a51b14..0000000000 --- a/smush.h +++ /dev/null @@ -1,144 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#define SP_MAX_FONTS 5 -#define MAX_STREAMER 10 - -class SmushPlayer { - -private: - -struct PersistentCodecData37 { - byte *deltaBuf; - byte *deltaBufs[2]; - uint32 deltaSize; - int32 width, height; - int32 curtable; - int32 unk2, unk3; - uint32 flags; - int16 *table1; - int32 table_last_pitch; - byte table_last_flags; -}; - -struct CodecData { - byte * out, * src; - int32 x, y; - int32 outwidth, outheight; - int32 w, h, pitch; - uint32 flags; -}; - - FILE * _in; - int32 fileSize; - byte * _block; - uint32 _blockTag; - uint32 _blockSize; - - byte * _cur; - byte * _renderBitmap; - uint32 _frameSize; - uint32 _frmeTag, _frmeSize; - bool _frameChanged; - - // Palette - uint16 _fluPalMul129[768]; - uint16 _fluPalWords[768]; - bool _paletteChanged; - byte _fluPalette[768]; - - // TRES - byte * _fonts[SP_MAX_FONTS]; - byte * _bufferTres; - - int32 _mixerNum; - - // PSAD: Full Throttle audio - uint32 _saudSize[MAX_STREAMER], _saudSubSize[MAX_STREAMER]; - uint32 _psadTrk[MAX_STREAMER], _strkRate[MAX_STREAMER]; - uint32 _saudSubTag[MAX_STREAMER]; - uint32 _strkFinalSize[MAX_STREAMER]; - bool _strkNewMixer[MAX_STREAMER]; - byte * _strkBuf[MAX_STREAMER]; - - // IACT: The Dig audio - uint32 _imusSize[MAX_STREAMER], _imusSubSize[MAX_STREAMER]; - uint32 _imusTrk[MAX_STREAMER], _imusRate[MAX_STREAMER], _imusChan[MAX_STREAMER]; - uint32 _imusSubTag[MAX_STREAMER]; - byte _imusData[MAX_STREAMER][3]; - uint32 _imusPos[MAX_STREAMER], _imusCodec[MAX_STREAMER]; - uint32 _imusFinalSize[MAX_STREAMER]; - byte _imusFlags[MAX_STREAMER]; - byte * _imusBuf[MAX_STREAMER]; - bool _imusNewMixer[MAX_STREAMER]; - - // Codec37 - PersistentCodecData37 pcd37; - byte * _deltaBuf; - int32 _deltaBufSize; - - bool _lock; - Scumm * _scumm; - - // TRES - byte * loadTres(); - void loadFonts(); - uint32 getCharWidth(uint8 c_font, byte txt); - uint32 getFontHeight(uint8 c_font); - byte * getStringTRES(int32 number); - void drawStringTRES(uint32 x, uint32 y, byte * txt); - void drawCharTRES(uint32 * x, uint32 y, uint32 c_line, uint8 c_font, uint8 color, uint8 txt); - - void openFile(byte* fileName); - - void setPalette(); - void codec44Depack(byte *dst, byte *src, uint32 len); - void codec1(CodecData * cd); - void codec37Maketable(PersistentCodecData37 * pcd, int32 pitch, byte idx); - bool codec37(int32 game, CodecData * cd, PersistentCodecData37 * pcd); - void codec37Init(PersistentCodecData37 * pcd, int32 width, int32 height); - void codec37Proc5(int32 game, byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table); - void codec37BompDepack(byte *dst, byte *src, int32 len); - void codec37Proc4(byte *dst, byte *src, int32 next_offs, int32 bw, int32 bh, int32 pitch, int16 *table); - uint32 nextBE32(); - void nextBlock(); - - bool parseTag(); - void parseAHDR(); - void parseFRME(); - void parseNPAL(); - void parseFOBJ(); - void parsePSAD(); - void parseTRES(); - void parseXPAL(); - void parseIACT(); - - void init(); - void deinit(); - void go(); - -public: - SmushPlayer(Scumm * parent); - ~SmushPlayer(); - void startVideo(short int arg, byte* videofile); - void update(); -}; diff --git a/sound.cpp b/sound.cpp deleted file mode 100644 index 2f947a7148..0000000000 --- a/sound.cpp +++ /dev/null @@ -1,1236 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "sound/mididrv.h" -#include "sound/imuse.h" -#include "actor.h" -#include "config-file.h" -#include "util.h" - -#ifdef _WIN32_WCE -extern void *bsearch(const void *, const void *, size_t, - size_t, int (*x) (const void *, const void *)); -#endif - -Sound::Sound(Scumm *parent) { - _scumm = parent; - _numberBundleMusic = -1; - _musicBundleBufFinal = NULL; - _musicBundleBufOutput = NULL; -} - -Sound::~Sound() { -} - -void Sound::addSoundToQueue(int sound) { - if (!(_scumm->_features & GF_AFTER_V7)) { - _scumm->_vars[_scumm->VAR_LAST_SOUND] = sound; - _scumm->ensureResourceLoaded(rtSound, sound); - addSoundToQueue2(sound); - } else { - // WARNING ! This may break something, maybe this sould be put inside if(_gameID == GID_FT) ? - // But why addSoundToQueue should not queue sound ? - _scumm->ensureResourceLoaded(rtSound, sound); - addSoundToQueue2(sound); - } - -// if (_features & GF_AUDIOTRACKS) -// warning("Requesting audio track: %d", sound); -} - -void Sound::addSoundToQueue2(int sound) { - if (_soundQue2Pos < 10) { - _soundQue2[_soundQue2Pos++] = sound; - } -} - -void Sound::processSoundQues() { - byte d; - int i, j; - int num; - int16 data[16]; - IMuse *se; - - processSfxQueues(); - - while (_soundQue2Pos) { - d = _soundQue2[--_soundQue2Pos]; - if (d) - playSound(d); - } - - for (i = 0; i < _soundQuePos;) { - num = _soundQue[i++]; - if (i + num > _soundQuePos) { - warning("processSoundQues: invalid num value"); - break; - } - for (j = 0; j < 16; j++) - data[j] = 0; - if (num > 0) { - for (j = 0; j < num; j++) - data[j] = _soundQue[i + j]; - i += num; - - se = _scumm->_imuse; -#if 0 - debug(1, "processSoundQues(%d,%d,%d,%d,%d,%d,%d,%d,%d)", - data[0] >> 8, - data[0] & 0xFF, - data[1], data[2], data[3], data[4], data[5], data[6], data[7] - ); -#endif - - if ((_scumm->_gameId == GID_DIG) && (data[0] == 4096)){ - playBundleMusic(data[1] - 1); - } - if ((_scumm->_gameId == GID_DIG) && ((data[0] == 12) || (data[0] == 14))){ - uint32 size = 0, rate = 0, tag, chan = 0, bits = 0; - uint8 * ptr = _scumm->getResourceAddress(rtSound, data[1]); - if (ptr != NULL) { - ptr+=16; /* Skip header */ - for (;;) { - tag = READ_BE_UINT32(ptr); ptr+=4; - switch(tag) { - case MKID_BE('FRMT'): - size = READ_BE_UINT32(ptr); ptr+=12; - bits = READ_BE_UINT32(ptr); ptr+=4; - rate = READ_BE_UINT32(ptr); ptr+=4; - chan = READ_BE_UINT32(ptr); ptr+=4; - break; - case MKID_BE('TEXT'): - case MKID_BE('REGN'): - case MKID_BE('STOP'): - case MKID_BE('JUMP'): - size = READ_BE_UINT32(ptr); ptr+=size+4; - break; - case MKID_BE('DATA'): - size = READ_BE_UINT32(ptr); ptr+=4; - break; - default: - error("Unknown sfx header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); - } - if (tag == MKID_BE('DATA')) break; - } - if (bits == 8) { - byte * buffer = (byte*)malloc (size); - memcpy(buffer, ptr, size); - if (chan == 1) { - _scumm->_mixer->play_raw(NULL, buffer, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED); - } - else if (chan == 2) { - _scumm->_mixer->play_raw(NULL, buffer, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_STEREO); - } - } else if (bits == 12) { - byte * buffer = NULL; - uint32 final_size = decode12BitsSample(ptr, &buffer, size); - if (chan == 1) { - _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS); - } - else if (chan == 2) { - _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO); - } - } - } - } - - if (!(_scumm->_features & GF_AFTER_V7)) { - if (se) - _scumm->_vars[_scumm->VAR_SOUNDRESULT] = - (short)se->do_command(data[0], data[1], data[2], data[3], data[4], - data[5], data[6], data[7]); - } - - } - } - _soundQuePos = 0; -} - -static char * read_creative_voc_file(byte * ptr, int & size, int & rate) { - assert(strncmp((char*)ptr, "Creative Voice File\x1A", 20) == 0); - int offset = READ_LE_UINT16(ptr+20); - short version = READ_LE_UINT16(ptr+22); - short code = READ_LE_UINT16(ptr+24); - assert(version == 0x010A || version == 0x0114); - assert(code == ~version + 0x1234); - bool quit = 0; - char * ret_sound = 0; size = 0; - while(!quit) { - int len = READ_LE_UINT32(ptr + offset); - offset += 4; - int code = len & 0xFF; // FIXME not sure this is endian correct - len >>= 8; - switch(code) { - case 0: quit = 1; break; - case 1: { - int time_constant = ptr[offset++]; - int packing = ptr[offset++]; - len -= 2; - rate = 1000000L / (256L - time_constant); - debug(9, "VOC Data Bloc : %d, %d, %d", rate, packing, len); - if(packing == 0) { - if(size) { - ret_sound = (char*)realloc(ret_sound, size + len); - } else { - ret_sound = (char*)malloc(len); - } - memcpy(ret_sound + size, ptr + offset, len); - size += len; - } else { - warning("VOC file packing %d unsupported", packing); - } - } break; - case 6: // begin of loop - debug(3, "loops in Creative files not supported"); - break; - case 7: // end of loop - break; - default: - warning("Invalid code in VOC file : %d", code); - //~ quit = 1; - break; - } - offset += len; - } - debug(9, "VOC Data Size : %d", size); - return ret_sound; -} - -void Sound::playSound(int sound) { - byte *ptr; - - ptr = _scumm->getResourceAddress(rtSound, sound); - if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('SOUN')) { - ptr += 8; - _scumm->_vars[_scumm->VAR_MI1_TIMER] = 0; -#ifdef COMPRESSED_SOUND_FILE - if ((playMP3CDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17], - (ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0)) == -1) -#endif - _scumm->_system->play_cdrom(ptr[16], ptr[17] == 0xff ? -1 : ptr[17], - (ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0); - - _scumm->current_cd_sound = sound; - return; - } - // Support for SFX in Monkey Island 1, Mac version - // This is rather hackish right now, but works OK. SFX are not sounding - // 100% correct, though, not sure right now what is causing this. - else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('Mac1')) { - - // Read info from the header - int size = READ_UINT32_UNALIGNED(ptr+0x60); - int rate = READ_UINT32_UNALIGNED(ptr+0x64) >> 16; - - // Skip over the header (fixed size) - ptr += 0x72; - - // Allocate a sound buffer, copy the data into it, and play - char *sound = (char*)malloc(size); - memcpy(sound, ptr, size); - _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - return; - } - // Support for Putt-Putt sounds - very hackish, too 8-) - else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('DIGI')) { - // TODO - discover what data the first chunk, HSHD, contains - // it might be useful here. - ptr += 8 + READ_BE_UINT32_UNALIGNED(ptr+12); - if (READ_UINT32_UNALIGNED(ptr) != MKID('SDAT')) - return; // abort - - int size = READ_BE_UINT32_UNALIGNED(ptr+4); - int rate = 8000; // FIXME - what value here ?!? this is just a guess for now - - // Allocate a sound buffer, copy the data into it, and play - char *sound = (char*)malloc(size); - memcpy(sound, ptr+8, size); - _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - return; - } - else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('Crea')) { - int size, rate; - char * sound = read_creative_voc_file(ptr, size, rate); - if(sound != NULL) { - _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - } - return; - } - // Support for sampled sound effects in Monkey1 and Monkey2 - else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('SBL ')) { - debug(2, "Using SBL sound effect"); - - // TODO - Figuring out how the SBL chunk works. Here's an - // example: - // - // 53 42 4c 20 00 00 11 ae |SBL ....| - // 41 55 68 64 00 00 00 03 |AUhd....| - // 00 00 80 41 55 64 74 00 |...AUdt.| - // 00 11 9b 01 96 11 00 a6 |........| - // 00 7f 7f 7e 7e 7e 7e 7e |...~~~~~| - // 7e 7f 7f 80 80 7f 7f 7f |~.......| - // 7f 80 80 7f 7e 7d 7d 7e |....~}}~| - // 7e 7e 7e 7e 7e 7e 7e 7f |~~~~~~~.| - // 7f 7f 7f 80 80 80 80 80 |........| - // 80 81 80 80 7f 7f 80 85 |........| - // 8b 8b 83 78 72 6d 6f 75 |...xrmou| - // 7a 78 77 7d 83 84 83 81 |zxw}....| - // - // The length of the AUhd chunk always seems to be 3 bytes. - // Let's skip that for now. - // - // The starting offset, length and sample rate is all pure - // guesswork. The result sounds reasonable to me, but I've - // never heard the original. - - int size = READ_BE_UINT32_UNALIGNED(ptr + 4) - 27; - int rate = 8000; - - // Allocate a sound buffer, copy the data into it, and play - char *sound = (char*)malloc(size); - memcpy(sound, ptr + 33, size); - _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - return; - } - - if ((_scumm->_features & GF_OLD256) && (ptr != NULL)) { - char *sound; - int size = READ_LE_UINT32(ptr); - -#if 0 - // FIXME - this is just some debug output for Zak256 - if (size != 30) { - char name[9]; - memcpy(name, ptr+22, 8); - name[8] = 0; - printf("Going to play Zak256 sound '%s':\n", name); - hexdump(ptr, 0x40); - } - /* - There seems to be some pattern in the Zak256 sound data. Two typical - examples are these: - - d7 10 00 00 53 4f d1 10 |....SO..| - 00 00 00 00 04 00 ff 00 |........| - 64 00 00 00 01 00 64 6f |d.....do| - 6f 72 6f 70 65 6e 40 a8 |oropen@.| - 57 14 a1 10 00 00 50 08 |W.....P.| - 00 00 00 00 00 00 b3 07 |........| - 00 00 3c 00 00 00 04 80 |..<.....| - 03 02 0a 01 8c 82 87 81 |........| - - 5b 07 00 00 53 4f 55 07 |[...SOU.| - 00 00 00 00 04 00 ff 00 |........| - 64 00 00 00 01 00 64 72 |d.....dr| - 77 6f 70 65 6e 00 53 a8 |wopen.S.| - 57 14 25 07 00 00 92 03 |W.%.....| - 00 00 00 00 00 00 88 03 |........| - 00 00 3c 00 00 00 82 82 |..<.....| - 83 84 86 88 89 8b 89 89 |........| - - As you can see, there are quite some patterns, e.g. - the 00 00 00 3c - the sound data seems to start at - offset 54. - */ -#endif - - ptr += 0x16; - if (size == 30) { - int result = 0; - int track = *ptr; - - if (track == _scumm->current_cd_sound) -#ifdef COMPRESSED_SOUND_FILE - if (pollMP3CD()) - result = 1; - else -#endif - result = _scumm->_system->poll_cdrom(); - if (result == 1) return; - -#ifdef COMPRESSED_SOUND_FILE - if (playMP3CDTrack(track, 1, 0, 0) == -1) -#endif - _scumm->_system->play_cdrom(track, 0, 0, 0); - _scumm->current_cd_sound = track; - return; - } - - size -= 0x36; - sound = (char*)malloc(size); - for (int x = 0; x < size; x++) { - int bit = *ptr++; - if (bit<0x80) sound[x] = 0x7F-bit; else sound[x] = bit; - } - - // FIXME: Something in the header signifies looping. Need to track it down and add a - // mixer flag or something. - _scumm->_mixer->play_raw(NULL, sound, size, 11000, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); - return; - } - - if (_scumm->_gameId == GID_MONKEY_VGA) - return; /* FIXME */ - - IMuse *se = _scumm->_imuse; - if (se) { - _scumm->getResourceAddress(rtSound, sound); - se->start_sound(sound); - } -} - -void Sound::processSfxQueues() { - Actor *a; - int act; - bool b, finished; - - if (_talk_sound_mode != 0) { - if (_talk_sound_mode == 2) - _talkChannel = startTalkSound(_talk_sound_a, _talk_sound_b, _talk_sound_mode); - else - startTalkSound(_talk_sound_a, _talk_sound_b, _talk_sound_mode); - _talk_sound_mode = 0; - } - - if (_scumm->_vars[_scumm->VAR_TALK_ACTOR]) { //_sfxMode == 2) { - act = _scumm->_vars[_scumm->VAR_TALK_ACTOR]; - if (_talkChannel < 0) - finished = false; - else if (_scumm->_mixer->_channels[_talkChannel] == NULL) - finished = true; - else - finished = false; - - - if (act != 0 && (uint) act < 0x80 && !_scumm->string[0].no_talk_anim) { - a = _scumm->derefActorSafe(act, "processSfxQueues"); - if (a->room == _scumm->_currentRoom && (finished || !_endOfMouthSync)) { - b = true; - if (!finished) - b = isMouthSyncOff(_curSoundPos); - if (_mouthSyncMode != b) { - _mouthSyncMode = b; - a->startAnimActor(b ? a->talkFrame2 : a->talkFrame1); - } - } - } - - if (finished && _scumm->_talkDelay == 0) { - _scumm->stopTalk(); - _sfxMode = 0; - _talkChannel = -1; - } - } - - if (_sfxMode == 1) { - if (isSfxFinished()) { - _sfxMode = 0; - } - } -} - -#ifdef COMPRESSED_SOUND_FILE -static int compar(const void *a, const void *b) -{ - return ((MP3OffsetTable *) a)->org_offset - - ((MP3OffsetTable *) b)->org_offset; -} -#endif - -int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { - int num = 0, i; - byte file_byte, file_byte_2; - int size; - - if (!_sfxFile) { - warning("startTalkSound: SFX file is not open"); - return -1; - } - - if (b > 8) { - num = (b - 8) >> 1; - } -#ifdef COMPRESSED_SOUND_FILE - if (offset_table != NULL) { - MP3OffsetTable *result = NULL, key; - - key.org_offset = offset; - result = (MP3OffsetTable *) bsearch(&key, offset_table, num_sound_effects, - sizeof(MP3OffsetTable), compar); - - if (result == NULL) { - warning("startTalkSound: did not find sound at offset %d !", offset); - return -1; - } - if (2 * num != result->num_tags) { - warning("startTalkSound: number of tags do not match (%d - %d) !", b, - result->num_tags); - num = result->num_tags; - } - offset = result->new_offset; - size = result->compressed_size; - } else -#endif - { - offset += 8; - size = -1; - } - - _scumm->fileSeek((FILE *) _sfxFile, offset, SEEK_SET); - i = 0; - while (num > 0) { - _scumm->fileRead((FILE *) _sfxFile, &file_byte, sizeof(file_byte)); - _scumm->fileRead((FILE *) _sfxFile, &file_byte_2, sizeof(file_byte_2)); - _mouthSyncTimes[i++] = file_byte | (file_byte_2 << 8); - num--; - } - _mouthSyncTimes[i] = 0xFFFF; - _sfxMode = mode; - _curSoundPos = 0; - _mouthSyncMode = true; - - return startSfxSound(_sfxFile, size); -} - -void Sound::stopTalkSound() { - if (_sfxMode == 2) { - stopSfxSound(); - _sfxMode = 0; - } -} - -bool Sound::isMouthSyncOff(uint pos) { - uint j; - bool val = true; - uint16 *ms = _mouthSyncTimes; - - _endOfMouthSync = false; - do { - val ^= 1; - j = *ms++; - if (j == 0xFFFF) { - _endOfMouthSync = true; - break; - } - } while (pos > j); - return val; -} - - -int Sound::isSoundRunning(int sound) { - IMuse *se; - int i; - - if (sound == _scumm->current_cd_sound) -#ifdef COMPRESSED_SOUND_FILE - if (pollMP3CD()) - return 1; - else -#endif - return _scumm->_system->poll_cdrom(); - - i = _soundQue2Pos; - while (i--) { - if (_soundQue2[i] == sound) - return 1; - } - - if (isSoundInQueue(sound)) - return 1; - - if (!_scumm->isResourceLoaded(rtSound, sound)) - return 0; - - se = _scumm->_imuse; - if (!se) - return 0; - return se->get_sound_status(sound); -} - -bool Sound::isSoundInQueue(int sound) { - int i = 0, j, num; - int16 table[16]; - - while (i < _soundQuePos) { - num = _soundQue[i++]; - - memset(table, 0, sizeof(table)); - - if (num > 0) { - for (j = 0; j < num; j++) - table[j] = _soundQue[i + j]; - i += num; - if (table[0] == 0x10F && table[1] == 8 && table[2] == sound) - return 1; - } - } - return 0; -} - -void Sound::stopSound(int a) { - IMuse *se; - int i; - - if (a != 0 && a == _scumm->current_cd_sound) { - _scumm->current_cd_sound = 0; -#ifdef COMPRESSED_SOUND_FILE - if (stopMP3CD() == -1) -#endif - _scumm->_system->stop_cdrom(); - } - - se = _scumm->_imuse; - if (se) - se->stop_sound(a); - - for (i = 0; i < 10; i++) - if (_soundQue2[i] == (byte)a) - _soundQue2[i] = 0; -} - -void Sound::stopAllSounds() -{ - IMuse *se = _scumm->_imuse; - - if (_scumm->current_cd_sound != 0) { - _scumm->current_cd_sound = 0; -#ifdef COMPRESSED_SOUND_FILE - if (stopMP3CD() == -1) -#endif - _scumm->_system->stop_cdrom(); - } - - if (se) { - se->stop_all_sounds(); - se->clear_queue(); - } - clearSoundQue(); - stopSfxSound(); -} - -void Sound::clearSoundQue() { - _soundQue2Pos = 0; - memset(_soundQue2, 0, sizeof(_soundQue2)); -} - -void Sound::soundKludge(int16 * list) { - int16 *ptr; - int i; - - if (list[0] == -1) { - processSoundQues(); - return; - } - _soundQue[_soundQuePos++] = 8; - - ptr = _soundQue + _soundQuePos; - _soundQuePos += 8; - - for (i = 0; i < 8; i++) - *ptr++ = list[i]; - if (_soundQuePos > 0x100) - error("Sound que buffer overflow"); -} - -void Sound::talkSound(uint32 a, uint32 b, int mode) { - _talk_sound_a = a; - _talk_sound_b = b; - _talk_sound_mode = mode; -} - -/* The sound code currently only supports General Midi. - * General Midi is used in Day Of The Tentacle. - * Roland music is also playable, but doesn't sound well. - * A mapping between roland instruments and GM instruments - * is needed. - */ - -void Sound::setupSound() { - if (_scumm->_imuse) { - _scumm->_imuse->setBase(_scumm->res.address[rtSound]); - - _sound_volume_music = scummcfg->getInt("music_volume", kDefaultMusicVolume); - _sound_volume_master = scummcfg->getInt("master_volume", kDefaultMasterVolume); - _sound_volume_sfx = scummcfg->getInt("sfx_volume", kDefaultSFXVolume); - - _scumm->_imuse->set_master_volume(_sound_volume_master); - _scumm->_imuse->set_music_volume(_sound_volume_music); - _scumm->_mixer->set_volume(_sound_volume_sfx); - _scumm->_mixer->set_music_volume(_sound_volume_music); - } - _sfxFile = openSfxFile(); -} - -void Sound::pauseSounds(bool pause) { - IMuse *se = _scumm->_imuse; - if (se) - se->pause(pause); - - _soundsPaused = pause; - _scumm->_mixer->pause(pause); -} - -int Sound::startSfxSound(void *file, int file_size) { - char ident[8]; - int block_type; - byte work[8]; - uint size = 0; - int rate, comp; - byte *data; - -#ifdef COMPRESSED_SOUND_FILE - if (file_size > 0) { - data = (byte *)calloc(file_size + MAD_BUFFER_GUARD, 1); - - if (fread(data, file_size, 1, (FILE *) file) != 1) { - /* no need to free the memory since error will shut down */ - error("startSfxSound: cannot read %d bytes", size); - return -1; - } - return playSfxSound_MP3(data, file_size); - } -#endif - if (fread(ident, 8, 1, (FILE *) file) != 1) - goto invalid; - - if (!memcmp(ident, "VTLK", 4)) { - fseek((FILE *) file, SOUND_HEADER_BIG_SIZE - 8, SEEK_CUR); - } else if (!memcmp(ident, "Creative", 8)) { - fseek((FILE *) file, SOUND_HEADER_SIZE - 8, SEEK_CUR); - } else { - invalid:; - warning("startSfxSound: invalid header"); - return -1; - } - - block_type = getc((FILE *) file); - if (block_type != 1) { - warning("startSfxSound: Expecting block_type == 1, got %d", block_type); - return -1; - } - - fread(work, 3, 1, (FILE *) file); - - size = (work[0] | (work[1] << 8) | (work[2] << 16)) - 2; - rate = getc((FILE *) file); - comp = getc((FILE *) file); - - if (comp != 0) { - warning("startSfxSound: Unsupported compression type %d", comp); - return -1; - } - - data = (byte *)malloc(size); - if (data == NULL) { - error("startSfxSound: out of memory"); - return -1; - } - - if (fread(data, size, 1, (FILE *) file) != 1) { - /* no need to free the memory since error will shut down */ - error("startSfxSound: cannot read %d bytes", size); - return -1; - } - - return playSfxSound(data, size, 1000000 / (256 - rate), true); -} - - -#ifdef COMPRESSED_SOUND_FILE -static int get_int(FILE * f) { - int ret = 0; - for (int size = 0; size < 4; size++) { - int c = fgetc(f); - if (c == EOF) { - error("Unexpected end of file !!!"); - } - ret <<= 8; - ret |= c; - } - return ret; -} -#endif - -void * Sound::openSfxFile() { - char buf[256]; - FILE *file = NULL; - - /* Try opening the file <_exe_name>.sou first, eg tentacle.sou. - * That way, you can keep .sou files for multiple games in the - * same directory */ -#ifdef COMPRESSED_SOUND_FILE - offset_table = NULL; - - sprintf(buf, "%s%s.so3", _scumm->getGameDataPath(), _scumm->_exe_name); - file = fopen(buf, "rb"); - if (!file) { - sprintf(buf, "%smonster.so3", _scumm->getGameDataPath()); - file = fopen(buf, "rb"); - } - if (file != NULL) { - /* Now load the 'offset' index in memory to be able to find the MP3 data - - The format of the .SO3 file is easy : - - number of bytes of the 'index' part - - N times the following fields (4 bytes each) : - + offset in the original sound file - + offset of the MP3 data in the .SO3 file WITHOUT taking into account - the index field and the 'size' field - + the number of 'tags' - + the size of the MP3 data - - and then N times : - + the tags - + the MP3 data - */ - int size, compressed_offset; - MP3OffsetTable *cur; - - compressed_offset = get_int(file); - offset_table = (MP3OffsetTable *) malloc(compressed_offset); - num_sound_effects = compressed_offset / 16; - - size = compressed_offset; - cur = offset_table; - while (size > 0) { - cur[0].org_offset = get_int(file); - cur[0].new_offset = get_int(file) + compressed_offset + 4; /* The + 4 is to take into accound the 'size' field */ - cur[0].num_tags = get_int(file); - cur[0].compressed_size = get_int(file); - size -= 4 * 4; - cur++; - } - return file; - } -#endif - sprintf(buf, "%s%s.sou", _scumm->getGameDataPath(), _scumm->_exe_name); - file = fopen(buf, "rb"); - if (!file) { - sprintf(buf, "%smonster.sou", _scumm->getGameDataPath()); - file = fopen(buf, "rb"); - } - return file; -} - -void Sound::stopSfxSound() { - _scumm->_mixer->stop_all(); -} - - -bool Sound::isSfxFinished() { - return !_scumm->_mixer->has_active_channel(); -} - -uint32 Sound::decode12BitsSample(byte * src, byte ** dst, uint32 size) { - uint32 s_size = (size * 4) / 3; - byte * ptr = *dst = (byte*)malloc (s_size + 4); - - uint32 r = 0, tmp, l; - for (l = 0; l < size; l += 3) { - tmp = (src[l + 1] & 0x0f) << 8; - tmp = (tmp | src[l + 0]) << 4; - tmp -= 0x8000; - ptr[r++] = (byte)((tmp >> 8) & 0xff); - ptr[r++] = (byte)(tmp & 0xff); - - tmp = (src[l + 1] & 0xf0) << 4; - tmp = (tmp | src[l + 2]) << 4; - tmp -= 0x8000; - ptr[r++] = (byte)((tmp >> 8) & 0xff); - ptr[r++] = (byte)(tmp & 0xff); - } - - return r; -} - -static void music_handler (Scumm * scumm) { - scumm->_sound->bundleMusicHandler(scumm); -} - -#define OUTPUT_SIZE 66150 // ((22050 * 2 * 2) / 4) * 3 - -void Sound::playBundleMusic(int32 song) { - char buf[256]; - - if (_numberBundleMusic == -1) { - sprintf(buf, "%s%smusic.bun", _scumm->getGameDataPath(), _scumm->_exe_name); - if (_scumm->_bundle->openMusicFile((char*)&buf) == false) - return; - _musicBundleBufFinal = (byte*)malloc(OUTPUT_SIZE); - _musicBundleBufOutput = (byte*)malloc(10 * 0x2000); - _currentSampleBundleMusic = 0; - _offsetSampleBundleMusic = 0; - _offsetBufBundleMusic = 0; - _pauseBundleMusic = false; - _numberSamplesBundleMusic = _scumm->_bundle->getNumberOfMusicSamplesByIndex(song); - _numberBundleMusic = song; - _scumm->_timer->installProcedure(&music_handler, 1000); - return; - } - if (_numberBundleMusic != song) { - _numberSamplesBundleMusic = _scumm->_bundle->getNumberOfMusicSamplesByIndex(song); - _numberBundleMusic = song; - _currentSampleBundleMusic = 0; - _offsetSampleBundleMusic = 0; - _offsetBufBundleMusic = 0; - } -} - -void Sound::pauseBundleMusic(bool state) { - _pauseBundleMusic = state; -} - -void Sound::stopBundleMusic() { - _scumm->_timer->releaseProcedure(&music_handler); - _numberBundleMusic = -1; - if (_musicBundleBufFinal) { - free(_musicBundleBufFinal); - _musicBundleBufFinal = NULL; - } - if (_musicBundleBufOutput) { - free(_musicBundleBufOutput); - _musicBundleBufOutput = NULL; - } -} - -void Sound::bundleMusicHandler(Scumm * scumm) { - byte * ptr; - int32 l, num = _numberSamplesBundleMusic, length, k; - int32 rate = 22050; - int32 tag, size = -1, header_size = 0; - - ptr = _musicBundleBufOutput; - - if (_pauseBundleMusic) - return; - - for (k = 0, l = _currentSampleBundleMusic; l < num; k++) { - length = _scumm->_bundle->decompressMusicSampleByIndex(_numberBundleMusic, l, (_musicBundleBufOutput + ((k * 0x2000) + _offsetBufBundleMusic))); - _offsetSampleBundleMusic += length; - - if (l == 0) { - tag = READ_BE_UINT32(ptr); ptr += 4; - if (tag != MKID_BE('iMUS')) { - warning("Decompression of bundle sound failed"); - _numberBundleMusic = -1; - return; - } - - ptr += 12; - while(tag != MKID_BE('DATA')) { - tag = READ_BE_UINT32(ptr); ptr += 4; - switch(tag) { - case MKID_BE('FRMT'): - size = READ_BE_UINT32(ptr); ptr += 24; - break; - case MKID_BE('TEXT'): - case MKID_BE('REGN'): - case MKID_BE('STOP'): - case MKID_BE('JUMP'): - size = READ_BE_UINT32(ptr); ptr += size + 4; - break; - case MKID_BE('DATA'): - size = READ_BE_UINT32(ptr); ptr += 4; - break; - - default: - error("Unknown sound header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); - } - } - if (size < 0) { - warning("Decompression sound failed (no size field)"); - _numberBundleMusic = -1; - return; - } - header_size = (ptr - _musicBundleBufOutput); - } - - l++; - _currentSampleBundleMusic = l; - - if (_offsetSampleBundleMusic >= OUTPUT_SIZE + header_size) { - memcpy(_musicBundleBufFinal, (_musicBundleBufOutput + header_size), OUTPUT_SIZE); - _offsetBufBundleMusic = _offsetSampleBundleMusic - OUTPUT_SIZE - header_size; - memcpy(_musicBundleBufOutput, (_musicBundleBufOutput + (OUTPUT_SIZE + header_size)), _offsetBufBundleMusic); - _offsetSampleBundleMusic = _offsetBufBundleMusic; - break; - } - } - - if (l == num) - l = 0; - - size = OUTPUT_SIZE; - ptr = _musicBundleBufFinal; - - byte * buffer = NULL; - uint32 final_size = decode12BitsSample(ptr, &buffer, size); - _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO); -} - -void Sound::playBundleSound(char *sound) { - char buf[256]; - byte * ptr; - - sprintf(buf, "%s%svoice.bun", _scumm->getGameDataPath(), _scumm->_exe_name); - _scumm->_bundle->openVoiceFile((char*)&buf); - ptr = (byte *)malloc(1000000); - if (_scumm->_bundle->decompressVoiceSampleByName(sound, ptr) == 0) { - delete ptr; - return; - } - - int rate = 22050; - int tag, size = -1; - - tag = READ_BE_UINT32(ptr); ptr+=4; - if (tag != MKID_BE('iMUS')) { - warning("Decompression of bundle sound failed"); - free(ptr); - return; - } - - ptr += 12; - while(tag != MKID_BE('DATA')) { - tag = READ_BE_UINT32(ptr); ptr+=4; - switch(tag) { - case MKID_BE('FRMT'): - size = READ_BE_UINT32(ptr); ptr+=16; - rate = READ_BE_UINT32(ptr); ptr+=8; - break; - case MKID_BE('TEXT'): - case MKID_BE('REGN'): - case MKID_BE('STOP'): - case MKID_BE('JUMP'): - size = READ_BE_UINT32(ptr); ptr+=size+4; - break; - - case MKID_BE('DATA'): - size = READ_BE_UINT32(ptr); ptr+=4; - break; - - default: - error("Unknown sound header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); - } - } - - if (size < 0) { - warning("Decompression sound failed (no size field)"); - free(ptr); - return; - } - - byte * final = (byte *)malloc(size); - memcpy(final, ptr, size); - _scumm->_mixer->play_raw(NULL, final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); -} - -int Sound::playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned) { - if (_soundsPaused) - return -1; - byte flags = SoundMixer::FLAG_AUTOFREE; - if (isUnsigned) - flags |= SoundMixer::FLAG_UNSIGNED; - return _scumm->_mixer->play_raw(NULL, sound, size, rate, flags); -} - -int Sound::playSfxSound_MP3(void *sound, uint32 size) { -#ifdef COMPRESSED_SOUND_FILE - if (_soundsPaused) - return -1; - return _scumm->_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE); -#endif - return -1; -} - -#ifdef COMPRESSED_SOUND_FILE - -int Sound::getCachedTrack(int track) { - int i; - char track_name[1024]; - FILE* file; - int current_index; - struct mad_stream stream; - struct mad_frame frame; - unsigned char buffer[8192]; - unsigned int buflen = 0; - int count = 0; - - // See if we find the track in the cache - for (i=0; igetGameDataPath(), track); - file = fopen(track_name, "rb"); - _cached_tracks[current_index] = track; - - /* First, close the previous file */ - if (_mp3_tracks[current_index]) - fclose(_mp3_tracks[current_index]); - _mp3_tracks[current_index] = NULL; - if (!file) { - // This warning is pretty pointless. - debug(1, "Track %d not available in mp3 format", track); - return -1; - } - // Check the format and bitrate - mad_stream_init(&stream); - mad_frame_init(&frame); - - while (1) { - if (buflen < sizeof(buffer)) { - int bytes; - - bytes = fread(buffer + buflen, 1, sizeof(buffer) - buflen, file); - if (bytes <= 0) { - if (bytes == -1) { - warning("Invalid format for track %d", track); - goto error; - } - break; - } - - buflen += bytes; - } - - mad_stream_buffer(&stream, buffer, buflen); - - while (1) { - if (mad_frame_decode(&frame, &stream) == -1) { - if (!MAD_RECOVERABLE(stream.error)) - break; - - if (stream.error != MAD_ERROR_BADCRC) - continue; - } - - if (count++) - break; - } - - if (count || stream.error != MAD_ERROR_BUFLEN) - break; - - memmove(buffer, stream.next_frame, - buflen = &buffer[buflen] - stream.next_frame); - } - - if (count) - memcpy(&_mad_header[current_index], &frame.header, sizeof(mad_header)); - else { - warning("Invalid format for track %d", track); - goto error; - } - - mad_frame_finish(&frame); - mad_stream_finish(&stream); - // Get file size - fseek(file, 0, SEEK_END); - _mp3_size[current_index] = ftell(file); - _mp3_tracks[current_index] = file; - - return current_index; - - error: - mad_frame_finish(&frame); - mad_stream_finish(&stream); - fclose(file); - - return -1; -} - -int Sound::playMP3CDTrack(int track, int num_loops, int start, int delay) { - int index; - unsigned int offset; - mad_timer_t duration; - _scumm->_vars[_scumm->VAR_MI1_TIMER] = 0; - - if (_soundsPaused) - return 0; - - if ((num_loops == 0) && (start == 0)) { - return 0; - } - - index = getCachedTrack(track); - if (index < 0) - return -1; - - // Calc offset. As all bitrates are in kilobit per seconds, the division by 200 is always exact - offset = (start * (_mad_header[index].bitrate / (8 * 25))) / 3; - - // Calc delay - if (!delay) { - mad_timer_set(&duration, (_mp3_size[index] * 8) / _mad_header[index].bitrate, - (_mp3_size[index] * 8) % _mad_header[index].bitrate, _mad_header[index].bitrate); - } else { - mad_timer_set(&duration, delay / 75, delay % 75, 75); - } - - // Go - fseek(_mp3_tracks[index], offset, SEEK_SET); - - if (_mp3_cd_playing == true) - _scumm->_mixer->stop(_mp3_index); - _mp3_index = _scumm->_mixer->play_mp3_cdtrack(NULL, _mp3_tracks[index], duration); - _mp3_cd_playing = true; - return 0; -} - -int Sound::stopMP3CD() { - if (_mp3_cd_playing == true) { - _scumm->_mixer->stop(_mp3_index); - _mp3_cd_playing = false; - return 0; - } - return -1; -} - -int Sound::pollMP3CD() { - if (_mp3_cd_playing == true) - return 1; - return 0; -} - -int Sound::updateMP3CD() { - if (_mp3_cd_playing == false) - return -1; - - if (_scumm->_mixer->_channels[_mp3_index] == NULL) { - warning("Error in MP3 decoding"); - return -1; - } - - if (_scumm->_mixer->_channels[_mp3_index]->sound_finished()) - stopMP3CD(); - return 0; -} -#endif diff --git a/sound.h b/sound.h deleted file mode 100644 index 4d2a554d6c..0000000000 --- a/sound.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef SOUND_H -#define SOUND_H - -#include "scummsys.h" -#include "sound/mixer.h" - -class Scumm; - -class Sound { - -private: - -enum { - SOUND_HEADER_SIZE = 26, - SOUND_HEADER_BIG_SIZE = 26 + 8, - -}; - - int16 _soundQuePos, _soundQue[0x100]; - byte _soundQue2Pos, _soundQue2[10]; - bool _soundsPaused2; - bool _soundVolumePreset; - - int32 _numberBundleMusic; - int32 _currentSampleBundleMusic; - int32 _numberSamplesBundleMusic; - int32 _offsetSampleBundleMusic; - int32 _offsetBufBundleMusic; - byte * _musicBundleBufFinal; - byte * _musicBundleBufOutput; - bool _pauseBundleMusic; - - - int _talkChannel; /* Mixer channel actor is talking on */ - void *_sfxFile; - uint32 _talk_sound_a, _talk_sound_b; - byte _talk_sound_mode; - bool _mouthSyncMode; - bool _endOfMouthSync; - uint16 _mouthSyncTimes[52]; - uint _curSoundPos; - - MP3OffsetTable *offset_table; // SO3 MP3 compressed audio - int num_sound_effects; // SO3 MP3 compressed audio -#ifdef COMPRESSED_SOUND_FILE - - #define CACHE_TRACKS 10 - - /* used for mp3 CD music */ - - int _cached_tracks[CACHE_TRACKS]; - struct mad_header _mad_header[CACHE_TRACKS]; - long _mp3_size[CACHE_TRACKS]; - FILE *_mp3_tracks[CACHE_TRACKS]; - int _mp3_index; - bool _mp3_cd_playing; -#endif - - Scumm * _scumm; - -public: - -#ifdef COMPRESSED_SOUND_FILE - - int _current_cache; - -#endif - - bool _soundsPaused; - int16 _sound_volume_master, _sound_volume_music, _sound_volume_sfx; - byte _sfxMode; - - Sound(Scumm *parent); - ~Sound(); - void addSoundToQueue(int sound); - void addSoundToQueue2(int sound); - void processSoundQues(); - void playSound(int sound); - void processSfxQueues(); - int startTalkSound(uint32 offset, uint32 b, int mode); - void stopTalkSound(); - bool isMouthSyncOff(uint pos); - int isSoundRunning(int sound); - bool isSoundInQueue(int sound); - void stopSound(int a); - void stopAllSounds(); - void clearSoundQue(); - void soundKludge(int16 * list); - void talkSound(uint32 a, uint32 b, int mode); - void setupSound(); - void pauseSounds(bool pause); - int startSfxSound(void *file, int file_size); - void * openSfxFile(); - void stopSfxSound(); - bool isSfxFinished(); - uint32 decode12BitsSample(byte * src, byte ** dst, uint32 size); - void playBundleMusic(int32 song); - void pauseBundleMusic(bool state); - void bundleMusicHandler(Scumm * scumm); - void stopBundleMusic(); - void playBundleSound(char *sound); - int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned); - int playSfxSound_MP3(void *sound, uint32 size); - -#ifdef COMPRESSED_SOUND_FILE - int getCachedTrack(int track); - int playMP3CDTrack(int track, int num_loops, int start, int delay); - int stopMP3CD(); - int pollMP3CD(); - int updateMP3CD(); -#endif - -}; - -#endif - diff --git a/sound/imuse.cpp b/sound/imuse.cpp deleted file mode 100644 index a0df85aa70..0000000000 --- a/sound/imuse.cpp +++ /dev/null @@ -1,4584 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" -#include "fmopl.h" -#include "mididrv.h" -#include "imuse.h" -#include "saveload.h" - -/* - * Some constants - */ -#define TICKS_PER_BEAT 480 - -#define SYSEX_ID 0x7D -#define PERCUSSION_CHANNEL 9 - -#define TRIGGER_ID 0 -#define COMMAND_ID 1 - -#define MDPG_TAG "MDpg" -#define MDHD_TAG "MDhd" - - -/* Roland to General Midi patch table. Still needs some work. */ -static const byte mt32_to_gmidi[128] = { -// 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x - 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x - 88, 54, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x - 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x - 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x - 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x - 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x - 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x -}; - - -/* Put IMUSE specific classes here, instead of in a .h file - * they will only be used from this file, so it will reduce - * compile time */ - -class IMuseDriver; - -struct Part; -struct MidiChannelAdl; -struct MidiChannelGM; -struct Instrument; - - -struct HookDatas { - byte _jump, _transpose; - byte _part_onoff[16]; - byte _part_volume[16]; - byte _part_program[16]; - byte _part_transpose[16]; - - int query_param(int param, byte chan); - int set(byte cls, byte value, byte chan); -}; - - -struct Player { - IMuseInternal *_se; - - Part *_parts; - bool _active; - bool _scanning; - int _id; - byte _priority; - byte _volume; - int8 _pan; - int8 _transpose; - int8 _detune; - uint _vol_chan; - byte _vol_eff; - - uint _song_index; - uint _track_index; - uint _timer_counter; - uint _loop_to_beat; - uint _loop_from_beat; - uint _loop_counter; - uint _loop_to_tick; - uint _loop_from_tick; - uint32 _tempo; - uint32 _tempo_eff; /* NoSave */ - uint32 _cur_pos; - uint32 _next_pos; - uint32 _song_offset; - uint32 _timer_speed; /* NoSave */ - uint _tick_index; - uint _beat_index; - uint _ticks_per_beat; - byte _speed; /* NoSave */ - bool _abort; - - HookDatas _hook; - - bool _mt32emulate; - - /* Player part */ - void hook_clear(); - void clear(); - bool start_sound(int sound); - void uninit_parts(); - byte *parse_midi(byte *s); - void key_off(uint8 chan, byte data); - void key_on(uint8 chan, byte data, byte velocity); - void part_set_transpose(uint8 chan, byte relative, int8 b); - void parse_sysex(byte *p, uint len); - void maybe_jump(byte *data); - void maybe_set_transpose(byte *data); - void maybe_part_onoff(byte *data); - void maybe_set_volume(byte *data); - void maybe_set_program(byte *data); - void maybe_set_transpose_part(byte *data); - uint update_actives(); - Part *get_part(uint8 part); - void turn_off_pedals(); - int set_vol(byte vol); - int get_param(int param, byte chan); - int query_part_param(int param, byte chan); - int set_transpose(byte relative, int b); - void set_priority(int pri); - void set_pan(int pan); - void set_detune(int detune); - void turn_off_parts(); - void play_active_notes(); - void cancel_volume_fade(); - - static void decode_sysex_bytes(byte *src, byte *dst, int len); - - void clear_active_note(int chan, byte note); - void set_active_note(int chan, byte note); - void clear_active_notes(); - - /* Sequencer part */ - bool set_loop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick); - void clear_loop(); - void set_speed(byte speed); - bool jump(uint track, uint beat, uint tick); - void uninit_seq(); - void set_tempo(uint32 data); - int start_seq_sound(int sound); - void find_sustaining_notes(byte *a, byte *b, uint32 l); - int scan(uint totrack, uint tobeat, uint totick); - int query_param(int param); - - int fade_vol(byte vol, int time); - void sequencer_timer(); -}; - -struct VolumeFader { - Player *player; - bool active; - byte curvol; - uint16 speed_lo_max, num_steps; - int8 speed_hi; - int8 direction; - int8 speed_lo; - uint16 speed_lo_counter; - - void initialize() { - active = false; - } void on_timer(); -}; - -struct SustainingNotes { - SustainingNotes *next; - SustainingNotes *prev; - Player *player; - byte note, chan; - uint32 off_pos; - uint32 pos; - uint16 counter; -}; - -struct CommandQueue { - uint16 array[8]; -}; - - -struct IsNoteCmdData { - byte chan; - byte note; - byte vel; -}; - - - -struct MidiChannel { - Part *_part; - MidiChannelAdl *adl() { return (MidiChannelAdl *)this; } - MidiChannelGM *gm() { return (MidiChannelGM *)this; } -}; - - -struct MidiChannelGM : MidiChannel { - byte _chan; - uint16 _actives[8]; -}; - - -struct Part { - int _slot; - IMuseDriver *_drv; - Part *_next, *_prev; - MidiChannel *_mc; - Player *_player; - int16 _pitchbend; - byte _pitchbend_factor; - int8 _transpose, _transpose_eff; - byte _vol, _vol_eff; - int8 _detune, _detune_eff; - int8 _pan, _pan_eff; - bool _on; - byte _modwheel; - bool _pedal; - byte _program; - int8 _pri; - byte _pri_eff; - byte _chan; - byte _effect_level; - byte _chorus; - byte _percussion; - byte _bank; - - void key_on(byte note, byte velocity); - void key_off(byte note); - void set_param(byte param, int value); - void init(IMuseDriver * _driver); - void setup(Player *player); - void uninit(); - void off(); - void silence(); - void set_instrument(uint b); - void set_instrument(Instrument * data); - - void set_transpose(int8 transpose); - void set_vol(uint8 volume); - void set_detune(int8 detune); - void set_pri(int8 pri); - void set_pan(int8 pan); - void set_modwheel(uint value); - void set_pedal(bool value); - void set_pitchbend(int value); - void release_pedal(); - void set_program(byte program); - void set_chorus(uint chorus); - void set_effect_level(uint level); - - int update_actives(uint16 *active); - void set_pitchbend_factor(uint8 value); - void set_onoff(bool on); - void fix_after_load(); - - void update_pris(); - - void changed(byte what); -}; - -/* Abstract IMuseInternal driver class */ -class IMuseDriver { -public: - enum { - pcMod = 1, - pcVolume = 2, - pcPedal = 4, - pcModwheel = 8, - pcPan = 16, - pcEffectLevel = 32, - pcProgram = 64, - pcChorus = 128, - pcAll = 255, - }; - - virtual void on_timer() = 0; - virtual uint32 get_base_tempo() = 0; - virtual byte get_hardware_type() = 0; - virtual void init(IMuseInternal *eng, OSystem *syst) = 0; - virtual void update_pris() = 0; - virtual void set_instrument(uint slot, byte *instr) = 0; - virtual void part_set_instrument(Part *part, Instrument * instr) = 0; - virtual void part_key_on(Part *part, byte note, byte velocity) = 0; - virtual void part_key_off(Part *part, byte note) = 0; - virtual void part_off(Part *part) = 0; - virtual void part_changed(Part *part, byte what) = 0; - virtual void part_set_param(Part *part, byte param, int value) = 0; - virtual int part_update_active(Part *part, uint16 *active) = 0; -}; - - -// WARNING: This is the internal variant of the IMUSE class. -// imuse.h contains a public version of the same class. -// the public version, only contains a set of methods. -class IMuseInternal { - friend struct Player; -private: - IMuseDriver * _driver; - - byte **_base_sounds; - - byte _locked; - byte _hardware_type; - -private: - - - bool _paused; - bool _active_volume_faders; - bool _initialized; - byte _volume_fader_counter; - - int _game_tempo; - - uint _queue_end, _queue_pos, _queue_sound; - byte _queue_adding; - - SustainingNotes *_sustain_notes_used; - SustainingNotes *_sustain_notes_free; - SustainingNotes *_sustain_notes_head; - - byte _queue_marker; - byte _queue_cleared; - byte _master_volume; /* Master volume. 0-127 */ - byte _music_volume; /* Global music volume. 0-128 */ - - uint16 _trigger_count; - - uint16 _channel_volume[8]; - uint16 _channel_volume_eff[8]; /* NoSave */ - uint16 _volchan_table[8]; - - Player _players[8]; - SustainingNotes _sustaining_notes[24]; - VolumeFader _volume_fader[8]; - Part _parts[32]; - - uint16 _active_notes[128]; - CommandQueue _cmd_queue[64]; - - byte *findTag(int sound, char *tag, int index); - bool isMT32(int sound); - int get_queue_sound_status(int sound); - Player *allocate_player(byte priority); - void handle_marker(uint id, byte data); - int get_channel_volume(uint a); - void init_players(); - void init_parts(); - void init_volume_fader(); - void init_sustaining_notes(); - void init_queue(); - - void sequencer_timers(); - void expire_sustain_notes(); - void expire_volume_faders(); - - Part *allocate_part(byte pri); - - int enqueue_command(int a, int b, int c, int d, int e, int f, int g); - int enqueue_trigger(int sound, int marker); - int query_queue(int param); - Player *get_player_byid(int id); - - int get_volchan_entry(uint a); - int set_volchan_entry(uint a, uint b); - int set_channel_volume(uint chan, uint vol); - void update_volumes(); - void reset_tick(); - VolumeFader *allocate_volume_fader(); - - int set_volchan(int sound, int volchan); - - void fix_parts_after_load(); - void fix_players_after_load(Scumm *scumm); - - static int saveReference(IMuseInternal *me, byte type, void *ref); - static void *loadReference(IMuseInternal *me, byte type, int ref); - - void lock(); - void unlock(); - - int set_master_volume_intern(uint vol); - -public: - Part *parts_ptr() { - return _parts; - } - IMuseDriver *driver() { - return _driver; - } - - int initialize(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); - - /* Public interface */ - - void on_timer(); - void pause(bool paused); - int terminate(); - int save_or_load(Serializer *ser, Scumm *scumm); - int set_music_volume(uint vol); - int get_music_volume(); - int set_master_volume(uint vol); - int get_master_volume(); - bool start_sound(int sound); - int stop_sound(int sound); - int stop_all_sounds(); - int get_sound_status(int sound); - int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h); - int clear_queue(); - void setBase(byte **base); - - uint32 property(int prop, uint32 value); - - static IMuseInternal *create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); -}; - - -/* IMuseAdlib classes */ - -struct Struct10 { - byte active; - int16 cur_val; - int16 count; - uint16 param; - int16 start_value; - byte loop; - byte table_a[4]; - byte table_b[4]; - int8 unk3; - int8 modwheel; - int8 modwheel_last; - uint16 speed_lo_max; - uint16 num_steps; - int16 speed_hi; - int8 direction; - uint16 speed_lo; - uint16 speed_lo_counter; -}; - -struct Struct11 { - int16 modify_val; - byte param, flag0x40, flag0x10; - Struct10 *s10; -}; - -struct InstrumentExtra { - byte a, b, c, d, e, f, g, h; -}; - -struct Instrument { - byte flags_1; - byte oplvl_1; - byte atdec_1; - byte sustrel_1; - byte waveform_1; - byte flags_2; - byte oplvl_2; - byte atdec_2; - byte sustrel_2; - byte waveform_2; - byte feedback; - byte flags_a; - InstrumentExtra extra_a; - byte flags_b; - InstrumentExtra extra_b; - byte duration; -}; - -struct MidiChannelAdl : MidiChannel { - MidiChannelAdl *_next, *_prev; - byte _waitforpedal; - byte _note; - byte _channel; - byte _twochan; - byte _vol_1, _vol_2; - int16 _duration; - - Struct10 _s10a; - Struct11 _s11a; - Struct10 _s10b; - Struct11 _s11b; -}; - -class IMuseAdlib:public IMuseDriver { -private: - FM_OPL *_opl; - byte *_adlib_reg_cache; - IMuseInternal *_se; - SoundMixer *_mixer; - - int _adlib_timer_counter; - - uint16 channel_table_2[9]; - int _midichan_index; - int _next_tick; - uint16 curnote_table[9]; - MidiChannelAdl _midi_channels[9]; - - Instrument _part_instr[32]; - Instrument _glob_instr[32]; - - void adlib_key_off(int chan); - void adlib_note_on(int chan, byte note, int mod); - void adlib_note_on_ex(int chan, byte note, int mod); - int adlib_read_param(int chan, byte data); - void adlib_setup_channel(int chan, Instrument * instr, byte vol_1, byte vol_2); - byte adlib_read(byte port) { - return _adlib_reg_cache[port]; - } - void adlib_set_param(int channel, byte param, int value); - void adlib_key_onoff(int channel); - void adlib_write(byte port, byte value); - void adlib_playnote(int channel, int note); - - MidiChannelAdl *allocate_midichan(byte pri); - - void reset_tick(); - void mc_off(MidiChannel * mc); - - static void link_mc(Part *part, MidiChannelAdl *mc); - static void mc_inc_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11); - static void mc_init_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11, byte flags, - InstrumentExtra * ie); - static void struct10_init(Struct10 * s10, InstrumentExtra * ie); - static byte struct10_ontimer(Struct10 * s10, Struct11 * s11); - static void struct10_setup(Struct10 * s10); - static int random_nr(int a); - void mc_key_on(MidiChannel * mc, byte note, byte velocity); - - static void premix_proc(void *param, int16 *buf, uint len); - -public: - IMuseAdlib(SoundMixer *mixer) { - _mixer = mixer; - } - void uninit(); - void init(IMuseInternal *eng, OSystem *syst); - void update_pris() { - } - void generate_samples(int16 *buf, int len); - void on_timer(); - void set_instrument(uint slot, byte *instr); - void part_set_instrument(Part *part, Instrument * instr); - void part_key_on(Part *part, byte note, byte velocity); - void part_key_off(Part *part, byte note); - void part_set_param(Part *part, byte param, int value); - void part_changed(Part *part, byte what); - void part_off(Part *part); - int part_update_active(Part *part, uint16 *active); - void adjust_priorities() { - } - - uint32 get_base_tempo() { -#ifdef _WIN32_WCE - return 0x1F0000 * 2; // Sampled down to 11 kHz -#else //_WIN32_WCE - return 0x1F0000; // Was: 0x1924E0; -#endif //_WIN32_WCE - } - - byte get_hardware_type() { - return 1; - } -}; - - -/* IMuseGM classes */ - -class IMuseGM : public IMuseDriver { - IMuseInternal *_se; - OSystem *_system; - MidiDriver *_md; - MidiChannelGM _midi_channels[9]; - - int16 _midi_pitchbend_last[16]; - uint8 _midi_volume_last[16]; - bool _midi_pedal_last[16]; - byte _midi_modwheel_last[16]; - byte _midi_effectlevel_last[16]; - byte _midi_chorus_last[16]; - int8 _midi_pan_last[16]; - - - void midiPitchBend(byte chan, int16 pitchbend); - void midiVolume(byte chan, byte volume); - void midiPedal(byte chan, bool pedal); - void midiModWheel(byte chan, byte modwheel); - void midiEffectLevel(byte chan, byte level); - void midiChorus(byte chan, byte chorus); - void midiControl0(byte chan, byte value); - void midiProgram(byte chan, byte program, bool mt32emulate); - void midiPan(byte chan, int8 pan); - void midiNoteOn(byte chan, byte note, byte velocity); - void midiNoteOff(byte chan, byte note); - void midiSilence(byte chan); - void midiInit(); - -public: - IMuseGM(MidiDriver *midi) { _md = midi; } - void uninit(); - void init(IMuseInternal *eng, OSystem *os); - void update_pris(); - void part_off(Part *part); - int part_update_active(Part *part, uint16 *active); - - void on_timer() {} - void set_instrument(uint slot, byte *instr) {} - void part_set_instrument(Part *part, Instrument * instr) {} - void part_set_param(Part *part, byte param, int value) {} - void part_key_on(Part *part, byte note, byte velocity); - void part_key_off(Part *part, byte note); - void part_changed(Part *part, byte what); - - static int midi_driver_thread(void *param); - - uint32 get_base_tempo() { return 0x460000; } - byte get_hardware_type() { return 5; } -}; - - - -//********************************* -//**** IMUSE helper functions **** -//********************************* - - -static int clamp(int val, int min, int max) -{ - if (val < min) - return min; - if (val > max) - return max; - return val; -} - -static int transpose_clamp(int a, int b, int c) -{ - if (b > a) - a += (b - a + 11) / 12 * 12; - if (c < a) - a -= (a - c + 11) / 12 * 12; - return a; -} - -static uint32 get_delta_time(byte **s) -{ - byte *d = *s, b; - uint32 time = 0; - do { - b = *d++; - time = (time << 7) | (b & 0x7F); - } while (b & 0x80); - *s = d; - return time; -} - -static uint read_word(byte *a) -{ - return (a[0] << 8) + a[1]; -} - -static void skip_midi_cmd(byte **song_ptr) -{ - byte *s, code; - - const byte num_skip[] = { - 2, 2, 2, 2, 1, 1, 2 - }; - - s = *song_ptr; - - code = *s++; - - if (code < 0x80) { - s = NULL; - } else if (code < 0xF0) { - s += num_skip[(code & 0x70) >> 4]; - } else { - if (code == 0xF0 || code == 0xF7 || code == 0xFF && *s++ != 0x2F) { - s += get_delta_time(&s); - } else { - s = NULL; - } - } - *song_ptr = s; -} - -static int is_note_cmd(byte **a, IsNoteCmdData * isnote) -{ - byte *s = *a; - byte code; - - code = *s++; - - switch (code >> 4) { - case 8: /* key off */ - isnote->chan = code & 0xF; - isnote->note = *s++; - isnote->vel = *s++; - *a = s; - return 1; - case 9: /* key on */ - isnote->chan = code & 0xF; - isnote->note = *s++; - isnote->vel = *s++; - *a = s; - if (isnote->vel) - return 2; - return 1; - case 0xA: - case 0xB: - case 0xE: - s++; - case 0xC: - case 0xD: - s++; - break; - case 0xF: - if (code == 0xF0 || code == 0xF7 || code == 0xFF && *s++ != 0x2F) { - s += get_delta_time(&s); - break; - } - return -1; - default: - return -1; - } - *a = s; - return 0; -} - -/**********************************************************************/ - -void IMuseInternal::lock() -{ - _locked++; -} - -void IMuseInternal::unlock() -{ - _locked--; -} - -byte *IMuseInternal::findTag(int sound, char *tag, int index) -{ - byte *ptr = NULL; - int32 size, pos; - - if (_base_sounds) - ptr = _base_sounds[sound]; - - if (ptr == NULL) { - // debug(1, "IMuseInternal::findTag completely failed finding sound %d", - // sound); - return NULL; - - } - - ptr += 8; - size = READ_BE_UINT32_UNALIGNED(ptr); - ptr += 4; - - pos = 0; - - while (pos < size) { - if (!memcmp(ptr + pos, tag, 4) && !index--) - return ptr + pos + 8; - pos += READ_BE_UINT32_UNALIGNED(ptr + pos + 4) + 8; - } - - debug(1, "IMuseInternal::findTag failed finding sound %d", sound); - return NULL; -} - -bool IMuseInternal::isMT32(int sound) -{ - byte *ptr = NULL; - uint32 tag; - - if (_base_sounds) - ptr = _base_sounds[sound]; - - if (ptr == NULL) - return false; - - tag = *(((uint32 *)ptr) + 1); - switch (tag) { - case MKID('ADL '): - return false; - case MKID('ROL '): - return true; - case MKID('GMD '): - return false; - case MKID('MAC '): - return true; - case MKID('SPK '): - return false; - } - - return false; -} - -bool IMuseInternal::start_sound(int sound) -{ - Player *player; - void *mdhd; - - mdhd = findTag(sound, MDHD_TAG, 0); - if (!mdhd) { - mdhd = findTag(sound, MDPG_TAG, 0); - if (!mdhd) { - warning("SE::start_sound failed: Couldn't find %s", MDHD_TAG); - return false; - } - } - player = allocate_player(128); - if (!player) - return false; - - player->clear(); - return player->start_sound(sound); -} - - -Player *IMuseInternal::allocate_player(byte priority) -{ - Player *player = _players, *best = NULL; - int i; - byte bestpri = 255; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - if (!player->_active) - return player; - if (player->_priority < bestpri) { - best = player; - bestpri = player->_priority; - } - } - - if (bestpri < priority) - return best; - - debug(1, "Denying player request"); - return NULL; -} - -void IMuseInternal::init_players() -{ - Player *player = _players; - int i; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - player->_active = false; - player->_se = this; - } -} - -void IMuseInternal::init_sustaining_notes() -{ - SustainingNotes *next = NULL, *sn = _sustaining_notes; - int i; - - _sustain_notes_used = NULL; - _sustain_notes_head = NULL; - - for (i = ARRAYSIZE(_sustaining_notes); i != 0; i--, sn++) { - sn->next = next; - next = sn; - } - _sustain_notes_free = next; -} - -void IMuseInternal::init_volume_fader() -{ - VolumeFader *vf = _volume_fader; - int i; - - for (i = ARRAYSIZE(_volume_fader); i != 0; i--, vf++) - vf->initialize(); - - _active_volume_faders = false; -} - -void IMuseInternal::init_parts() -{ - Part *part; - int i; - - for (i = 0, part = _parts; i != ARRAYSIZE(_parts); i++, part++) { - part->init(_driver); - part->_slot = i; - } -} - -int IMuseInternal::stop_sound(int sound) -{ - Player *player = _players; - int i; - int r = -1; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - if (player->_active && player->_id == sound) { - player->clear(); - r = 0; - } - } - return r; -} - -int IMuseInternal::stop_all_sounds() -{ - Player *player = _players; - int i; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - if (player->_active) - player->clear(); - } - return 0; -} - -void IMuseInternal::on_timer() -{ - if (_locked || _paused) - return; - - lock(); - - sequencer_timers(); - expire_sustain_notes(); - expire_volume_faders(); - _driver->on_timer(); - - unlock(); -} - -void IMuseInternal::sequencer_timers() -{ - Player *player = _players; - int i; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - if (player->_active) - player->sequencer_timer(); - } -} - -void IMuseInternal::handle_marker(uint id, byte data) -{ - uint16 *p; - uint pos; - - pos = _queue_end; - if (pos == _queue_pos) - return; - - if (_queue_adding && _queue_sound == id && data == _queue_marker) - return; - - p = _cmd_queue[pos].array; - - if (p[0] != TRIGGER_ID || p[1] != id || p[2] != data) - return; - - _trigger_count--; - _queue_cleared = false; - do { - pos = (pos + 1) & (ARRAYSIZE(_cmd_queue) - 1); - if (_queue_pos == pos) - break; - p = _cmd_queue[pos].array; - if (*p++ != COMMAND_ID) - break; - _queue_end = pos; - - do_command(p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0); - - if (_queue_cleared) - return; - pos = _queue_end; - } while (1); - - _queue_end = pos; -} - -int IMuseInternal::get_channel_volume(uint a) -{ - if (a < 8) - return _channel_volume_eff[a]; - return _master_volume; -} - -Part *IMuseInternal::allocate_part(byte pri) -{ - Part *part, *best = NULL; - int i; - - for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { - if (!part->_player) - return part; - if (pri >= part->_pri_eff) { - pri = part->_pri_eff; - best = part; - } - } - - if (best) - best->uninit(); - else - debug(1, "Denying part request"); - return best; -} - -void IMuseInternal::expire_sustain_notes() -{ - SustainingNotes *sn, *next; - Player *player; - uint32 counter; - - for (sn = _sustain_notes_head; sn; sn = next) { - next = sn->next; - player = sn->player; - - counter = sn->counter + player->_timer_speed; - sn->pos += counter >> 16; - sn->counter = (unsigned short)counter & 0xFFFF; - - if (sn->pos >= sn->off_pos) { - player->key_off(sn->chan, sn->note); - - /* Unlink the node */ - if (next) - next->prev = sn->prev; - if (sn->prev) - sn->prev->next = next; - else - _sustain_notes_head = next; - - /* And put it in the free list */ - sn->next = _sustain_notes_free; - _sustain_notes_free = sn; - } - } -} - -void IMuseInternal::expire_volume_faders() -{ - VolumeFader *vf; - int i; - - if (++_volume_fader_counter & 7) - return; - - if (!_active_volume_faders) - return; - - _active_volume_faders = false; - vf = _volume_fader; - for (i = ARRAYSIZE(_volume_fader); i != 0; i--, vf++) { - if (vf->active) { - _active_volume_faders = true; - vf->on_timer(); - } - } -} - -void VolumeFader::on_timer() -{ - byte newvol; - - newvol = curvol + speed_hi; - speed_lo_counter += speed_lo; - - if (speed_lo_counter >= speed_lo_max) { - speed_lo_counter -= speed_lo_max; - newvol += direction; - } - - if (curvol != newvol) { - if (!newvol) { - player->clear(); - active = false; - return; - } - curvol = newvol; - player->set_vol(newvol); - } - - if (!--num_steps) { - active = false; - } -} - -int IMuseInternal::get_sound_status(int sound) -{ - int i; - Player *player; - - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active && player->_id == (uint16)sound) - return 1; - } - return get_queue_sound_status(sound); -} - -int IMuseInternal::get_queue_sound_status(int sound) -{ - uint16 *a; - int i, j; - - j = _queue_pos; - i = _queue_end; - - while (i != j) { - a = _cmd_queue[i].array; - if (a[0] == COMMAND_ID && a[1] == 8 && a[2] == (uint16)sound) - return 2; - i = (i + 1) & (ARRAYSIZE(_cmd_queue) - 1); - } - return 0; -} - -int IMuseInternal::set_volchan(int sound, int volchan) -{ - int r; - int i; - int num; - Player *player, *best, *sameid; - - r = get_volchan_entry(volchan); - if (r == -1) - return -1; - - if (r >= 8) { - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active && player->_id == (uint16)sound && player->_vol_chan != (uint16)volchan) { - player->_vol_chan = volchan; - player->set_vol(player->_volume); - return 0; - } - } - return -1; - } else { - best = NULL; - num = 0; - sameid = NULL; - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active) { - if (player->_vol_chan == (uint16)volchan) { - num++; - if (!best || player->_priority <= best->_priority) - best = player; - } else if (player->_id == (uint16)sound) { - sameid = player; - } - } - } - if (sameid == NULL) - return -1; - if (num >= r) - best->clear(); - player->_vol_chan = volchan; - player->set_vol(player->_volume); - return 0; - } -} - -int IMuseInternal::clear_queue() -{ - _queue_adding = false; - _queue_cleared = true; - _queue_pos = 0; - _queue_end = 0; - _trigger_count = 0; - return 0; -} - -int IMuseInternal::enqueue_command(int a, int b, int c, int d, int e, int f, int g) -{ - uint16 *p; - uint i; - - i = _queue_pos; - - if (i == _queue_end) - return -1; - - if (a == -1) { - _queue_adding = false; - _trigger_count++; - return 0; - } - - p = _cmd_queue[_queue_pos].array; - p[0] = COMMAND_ID; - p[1] = a; - p[2] = b; - p[3] = c; - p[4] = d; - p[5] = e; - p[6] = f; - p[7] = g; - - i = (i + 1) & (ARRAYSIZE(_cmd_queue) - 1); - - if (_queue_end != i) { - _queue_pos = i; - return 0; - } else { - _queue_pos = (i - 1) & (ARRAYSIZE(_cmd_queue) - 1); - return -1; - } -} - -int IMuseInternal::query_queue(int param) -{ - switch (param) { - case 0: /* get trigger count */ - return _trigger_count; - case 1: /* get trigger type */ - if (_queue_end == _queue_pos) - return -1; - return _cmd_queue[_queue_end].array[1]; - case 2: /* get trigger sound */ - if (_queue_end == _queue_pos) - return 0xFF; - return _cmd_queue[_queue_end].array[2]; - default: - return -1; - } -} - -int IMuseInternal::get_music_volume() -{ - return _music_volume * 2; -} - -int IMuseInternal::set_music_volume(uint vol) -{ - if (vol > 256) - vol = 256; - else if (vol < 0) - vol = 0; - - _music_volume = vol / 2; - return 0; -} - -int IMuseInternal::set_master_volume_intern(uint vol) -{ - if (vol > 127) - return -1; - - if (_music_volume > 0) - vol = vol * _music_volume / 128; - - _master_volume = vol; - for (int i = 0; i != 8; i++) - _channel_volume_eff[i] = (_channel_volume[i] + 1) * vol >> 7; - update_volumes(); - - return 0; -} - -int IMuseInternal::set_master_volume(uint vol) -{ - // recalibrate from 0-256 range - vol = vol * 127 / 256; - - return set_master_volume_intern(vol); -} - -int IMuseInternal::get_master_volume() -{ - // recalibrate to 0-256 range - return _master_volume * 256 / 127; -} - -int IMuseInternal::terminate() -{ - return 0; - /* not implemented */ -} - - -int IMuseInternal::enqueue_trigger(int sound, int marker) -{ - uint16 *p; - uint pos; - - pos = _queue_pos; - - p = _cmd_queue[pos].array; - p[0] = TRIGGER_ID; - p[1] = sound; - p[2] = marker; - - pos = (pos + 1) & (ARRAYSIZE(_cmd_queue) - 1); - if (_queue_end == pos) { - _queue_pos = (pos - 1) & (ARRAYSIZE(_cmd_queue) - 1); - return -1; - } - - _queue_pos = pos; - _queue_adding = true; - _queue_sound = sound; - _queue_marker = marker; - return 0; -} - -int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g, int h) -{ - byte cmd = a & 0xFF; - byte param = a >> 8; - Player *player = NULL; - - if (!_initialized && (cmd || param)) - return -1; - - if (param == 0) { - switch (cmd) { - case 6: - return set_master_volume_intern(b); - case 7: - return _master_volume; - case 8: - return start_sound(b) ? 0 : -1; - case 9: - return stop_sound(b); - case 10: - return stop_all_sounds(); //FIXME: Sam and Max unknown - case 11: - return stop_all_sounds(); - case 13: - return get_sound_status(b); - case 14:{ // FIXME: Sam and Max command - Total guess - int i; // Seems to work as a volume fader - Player *player; - - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active && player->_id == (uint16)b) { - player->fade_vol(e, f); - return 0; - } - } - } - case 15:{ // FIXME: Sam and Max command - Total guess - int i; // Something to do with position? - Player *player; - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active && player->_id == (uint16)b) { - player->jump(player->_track_index + 1, 0, 0); - return 0; - } - } - } - - case 16: - return set_volchan(b, c); - case 17: - return set_channel_volume(b, c); - case 18: - return set_volchan_entry(b, c); - case 19: - return stop_sound(b); //FIXME: Sam and Max unknown - case 20: - return stop_sound(b); //FIXME: Sam and Max unknown - case 2: - case 3: - return 0; - default: - warning("IMuseInternal::do_command invalid command %d", cmd); - } - } else if (param == 1) { - - if ((1 << cmd) & (0x783FFF)) { - player = get_player_byid(b); - if (!player) - return -1; - if ((1 << cmd) & (1 << 11 | 1 << 22)) { - assert(c >= 0 && c <= 15); - player = (Player *)player->get_part(c); - if (!player) - return -1; - } - } - - switch (cmd) { - case 0: - return player->get_param(c, d); - case 1: - player->set_priority(c); - return 0; - case 2: - return player->set_vol(c); - case 3: - player->set_pan(c); - return 0; - case 4: - return player->set_transpose(c, d); - case 5: - player->set_detune(c); - return 0; - case 6: - player->set_speed(c); - return 0; - case 7: - return player->jump(c, d, e) ? 0 : -1; - case 8: - return player->scan(c, d, e); - case 9: - return player->set_loop(c, d, e, f, g) ? 0 : -1; - case 10: - player->clear_loop(); - return 0; - case 11: - ((Part *)player)->set_onoff(d != 0); - return 0; - case 12: - return player->_hook.set(c, d, e); - case 13: - return player->fade_vol(c, d); - case 14: - return enqueue_trigger(b, c); - case 15: - return enqueue_command(b, c, d, e, f, g, h); - case 16: - return clear_queue(); - case 19: - return player->get_param(c, d); - case 20: - return player->_hook.set(c, d, e); - case 21: - return -1; - case 22: - ((Part *)player)->set_vol(d); - return 0; - case 23: - return query_queue(b); - case 24: - return 0; - default: - warning("IMuseInternal::do_command default midi command %d", cmd); - return -1; - } - } - - return -1; -} - -int IMuseInternal::set_channel_volume(uint chan, uint vol) -{ - if (chan >= 8 || vol > 127) - return -1; - - _channel_volume[chan] = vol; - _channel_volume_eff[chan] = _master_volume * (vol + 1) >> 7; - update_volumes(); - return 0; -} - -void IMuseInternal::update_volumes() -{ - Player *player; - int i; - - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active) - player->set_vol(player->_volume); - } -} - -int IMuseInternal::set_volchan_entry(uint a, uint b) -{ - if (a >= 8) - return -1; - _volchan_table[a] = b; - return 0; -} - -int HookDatas::query_param(int param, byte chan) -{ - switch (param) { - case 18: - return _jump; - case 19: - return _transpose; - case 20: - return _part_onoff[chan]; - case 21: - return _part_volume[chan]; - case 22: - return _part_program[chan]; - case 23: - return _part_transpose[chan]; - default: - return -1; - } -} - -int HookDatas::set(byte cls, byte value, byte chan) -{ - switch (cls) { - case 0: - _jump = value; - break; - case 1: - _transpose = value; - break; - case 2: - if (chan < 16) - _part_onoff[chan] = value; - else if (chan == 16) - memset(_part_onoff, value, 16); - break; - case 3: - if (chan < 16) - _part_volume[chan] = value; - else if (chan == 16) - memset(_part_volume, value, 16); - break; - case 4: - if (chan < 16) - _part_program[chan] = value; - else if (chan == 16) - memset(_part_program, value, 16); - break; - case 5: - if (chan < 16) - _part_transpose[chan] = value; - else if (chan == 16) - memset(_part_transpose, value, 16); - break; - default: - return -1; - } - return 0; -} - - -VolumeFader *IMuseInternal::allocate_volume_fader() -{ - VolumeFader *vf; - int i; - - vf = _volume_fader; - for (i = ARRAYSIZE(_volume_fader); vf->active;) { - vf++; - if (!--i) - return NULL; - } - - vf->active = true; - _active_volume_faders = true; - return vf; -} - -Player *IMuseInternal::get_player_byid(int id) -{ - int i; - Player *player, *found = NULL; - - for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { - if (player->_active && player->_id == (uint16)id) { - if (found) - return NULL; - found = player; - } - } - return found; -} - -int IMuseInternal::get_volchan_entry(uint a) -{ - if (a < 8) - return _volchan_table[a]; - return -1; -} - -uint32 IMuseInternal::property(int prop, uint32 value) -{ - switch (prop) { - case IMuse::PROP_TEMPO_BASE: - _game_tempo = value; - break; - } - return 0; -} - -void IMuseInternal::setBase(byte **base) -{ - _base_sounds = base; -} - - -IMuseInternal *IMuseInternal::create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) -{ - IMuseInternal *i = new IMuseInternal; - i->initialize(syst, midi, mixer); - return i; -} - - -int IMuseInternal::initialize(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) -{ - int i; - - IMuseDriver *driv; - - if (midi == NULL) { - driv = new IMuseAdlib(mixer); - } else { - driv = new IMuseGM(midi); - } - - _driver = driv; - _hardware_type = driv->get_hardware_type(); - _game_tempo = driv->get_base_tempo(); - - driv->init(this, syst); - - _master_volume = 127; - if (_music_volume < 1) - _music_volume = kDefaultMusicVolume; - - for (i = 0; i != 8; i++) - _channel_volume[i] = _channel_volume_eff[i] = _volchan_table[i] = 127; - - init_players(); - init_sustaining_notes(); - init_volume_fader(); - init_queue(); - init_parts(); - - _initialized = true; - - return 0; -} - -void IMuseInternal::init_queue() -{ - _queue_adding = false; - _queue_pos = 0; - _queue_end = 0; - _trigger_count = 0; -} - -void IMuseInternal::pause(bool paused) -{ - lock(); - - int i; - Part *part; - - for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { - if (part->_player) { - if (paused) { - part->_vol_eff = 0; - } else { - part->set_vol(part->_vol); - } - part->changed(IMuseDriver::pcVolume); - } - } - - _paused = paused; - - unlock(); -} - - -/*************************************************************************/ - -int Player::fade_vol(byte vol, int time) -{ - VolumeFader *vf; - int i; - - cancel_volume_fade(); - if (time == 0) { - set_vol(vol); - return 0; - } - - vf = _se->allocate_volume_fader(); - if (vf == NULL) - return -1; - - vf->player = this; - vf->num_steps = vf->speed_lo_max = time; - vf->curvol = _volume; - i = (vol - vf->curvol); - vf->speed_hi = i / time; - if (i < 0) { - i = -i; - vf->direction = -1; - } else { - vf->direction = 1; - } - vf->speed_lo = i % time; - vf->speed_lo_counter = 0; - return 0; -} - -void Player::clear() -{ - uninit_seq(); - cancel_volume_fade(); - uninit_parts(); - _active = false; - _ticks_per_beat = TICKS_PER_BEAT; -} - -bool Player::start_sound(int sound) -{ - void *mdhd; - - mdhd = _se->findTag(sound, MDHD_TAG, 0); - if (mdhd == NULL) { - mdhd = _se->findTag(sound, MDPG_TAG, 0); - if (mdhd == NULL) { - warning("P::start_sound failed: Couldn't find %s", MDHD_TAG); - return false; - } - } - - _mt32emulate = _se->isMT32(sound); - _parts = NULL; - _active = true; - _id = sound; - _priority = 0x80; - _volume = 0x7F; - _vol_chan = 0xFFFF; - - _vol_eff = (_se->get_channel_volume(0xFFFF) << 7) >> 7; - - _pan = 0; - _transpose = 0; - _detune = 0; - - hook_clear(); - if (start_seq_sound(sound) != 0) { - _active = false; - return false; - } - return true; -} - -void Player::hook_clear() -{ - memset(&_hook, 0, sizeof(_hook)); -} - -int Player::start_seq_sound(int sound) -{ - byte *ptr, *track_ptr; - - _song_index = sound; - _timer_counter = 0; - _loop_to_beat = 1; - _loop_from_beat = 1; - _track_index = 0; - _loop_counter = 0; - _loop_to_tick = 0; - _loop_from_tick = 0; - - set_tempo(500000); - set_speed(128); - ptr = _se->findTag(sound, "MTrk", _track_index); - if (ptr == NULL) - return -1; - - track_ptr = ptr; - _cur_pos = _next_pos = get_delta_time(&track_ptr); - _song_offset = track_ptr - ptr; - - _tick_index = _cur_pos; - _beat_index = 1; - - if (_tick_index >= _ticks_per_beat) { - _beat_index += _tick_index / _ticks_per_beat; - _tick_index %= _ticks_per_beat; - } - - return 0; -} - -void Player::set_tempo(uint32 b) -{ - uint32 i, j; - - i = _se->_game_tempo; - - j = _tempo = b; - - while (i & 0xFFFF0000 || j & 0xFFFF0000) { - i >>= 1; - j >>= 1; - } - - _tempo_eff = (i << 16) / j; - - set_speed(_speed); -} - -void Player::cancel_volume_fade() -{ - VolumeFader *vf = _se->_volume_fader; - int i; - - for (i = 0; i < 8; i++, vf++) { - if (vf->active && vf->player == this) - vf->active = false; - } -} - -void Player::uninit_parts() -{ - if (_parts && _parts->_player != this) - error("asd"); - while (_parts) - _parts->uninit(); -} - -void Player::uninit_seq() -{ - _abort = true; -} - -void Player::set_speed(byte speed) -{ - _speed = speed; - _timer_speed = (_tempo_eff * speed >> 7); -} - -byte *Player::parse_midi(byte *s) -{ - byte cmd, chan, note, velocity, control; - uint value; - Part *part; - - cmd = *s++; - - chan = cmd & 0xF; - - switch (cmd >> 4) { - case 0x8: /* key off */ - note = *s++; - if (!_scanning) { - key_off(chan, note); - } else { - clear_active_note(chan, note); - } - s++; /* skip velocity */ - break; - - case 0x9: /* key on */ - note = *s++; - velocity = *s++; - if (velocity) { - if (!_scanning) - key_on(chan, note, velocity); - else - set_active_note(chan, note); - } else { - if (!_scanning) - key_off(chan, note); - else - clear_active_note(chan, note); - } - break; - - case 0xA: /* aftertouch */ - s += 2; - break; - - case 0xB: /* control change */ - control = *s++; - value = *s++; - part = get_part(chan); - if (!part) - break; - - switch (control) { - case 1: /* modulation wheel */ - part->set_modwheel(value); - break; - case 7: /* volume */ - part->set_vol(value); - break; - case 10: /* pan position */ - part->set_pan(value - 0x40); - break; - case 16: /* pitchbend factor */ - part->set_pitchbend_factor(value); - break; - case 17: /* gp slider 2 */ - part->set_detune(value - 0x40); - break; - case 18: /* gp slider 3 */ - part->set_pri(value - 0x40); - _se->_driver->update_pris(); - break; - case 64: /* hold pedal */ - part->set_pedal(value != 0); - break; - case 91: /* effects level */ - part->set_effect_level(value); - break; - case 93: /* chorus */ - part->set_chorus(value); - break; - case 123: /* unhold pedal */ - part->set_pedal(false); - break; - default: - warning("parse_midi: invalid control %d", control); - } - break; - - case 0xC: /* program change */ - value = *s++; - part = get_part(chan); - if (part) - part->set_program(value); - break; - - case 0xD: /* channel pressure */ - s++; - break; - - case 0xE: /* pitch bend */ - part = get_part(chan); - if (part) - part->set_pitchbend(((s[1] - 0x40) << 7) | s[0]); - s += 2; - break; - - case 0xF: - if (chan == 0) { - uint size = get_delta_time(&s); - if (*s == SYSEX_ID) - parse_sysex(s, size); - s += size; - } else if (chan == 0xF) { - cmd = *s++; - if (cmd == 47) - goto Error; /* end of song */ - if (cmd == 81) { - set_tempo((s[1] << 16) | (s[2] << 8) | s[3]); - s += 4; - break; - } - s += get_delta_time(&s); - } else if (chan == 0x7) { - s += get_delta_time(&s); - } else { - goto Error; - } - break; - - default: - Error:; - if (!_scanning) - clear(); - return NULL; - } - return s; -} - -void Player::parse_sysex(byte *p, uint len) -{ - byte code; - byte a; - uint b; - byte buf[128]; - Part *part; - - /* too big? */ - if (len >= sizeof(buf) * 2) - return; - - /* skip sysex manufacturer */ - p++; - len -= 2; - - switch (code = *p++) { - case 16: /* set instrument in part */ - a = *p++ & 0x0F; - if (_se->_hardware_type != *p++) - break; - decode_sysex_bytes(p, buf, len - 3); - part = get_part(a); - if (part) - part->set_instrument((Instrument *) buf); - break; - - case 17: /* set global instrument */ - p++; - if (_se->_hardware_type != *p++) - break; - a = *p++; - decode_sysex_bytes(p, buf, len - 4); - _se->_driver->set_instrument(a, buf); - break; - - case 33: /* param adjust */ - a = *p++ & 0x0F; - if (_se->_hardware_type != *p++) - break; - decode_sysex_bytes(p, buf, len - 3); - part = get_part(a); - if (part) - part->set_param(read_word(buf), read_word(buf + 2)); - break; - - case 48: /* hook - jump */ - if (_scanning) - break; - decode_sysex_bytes(p + 1, buf, len - 2); - maybe_jump(buf); - break; - - case 49: /* hook - global transpose */ - decode_sysex_bytes(p + 1, buf, len - 2); - maybe_set_transpose(buf); - break; - - case 50: /* hook - part on/off */ - buf[0] = *p++ & 0x0F; - decode_sysex_bytes(p, buf + 1, len - 2); - maybe_part_onoff(buf); - break; - - case 51: /* hook - set volume */ - buf[0] = *p++ & 0x0F; - decode_sysex_bytes(p, buf + 1, len - 2); - maybe_set_volume(buf); - break; - - case 52: /* hook - set program */ - buf[0] = *p++ & 0x0F; - decode_sysex_bytes(p, buf + 1, len - 2); - maybe_set_program(buf); - break; - - case 53: /* hook - set transpose */ - buf[0] = *p++ & 0x0F; - decode_sysex_bytes(p, buf + 1, len - 2); - maybe_set_transpose_part(buf); - break; - - case 64: /* marker */ - p++; - len -= 2; - while (len--) { - _se->handle_marker(_id, *p++); - } - break; - - case 80: /* loop */ - decode_sysex_bytes(p + 1, buf, len - 2); - set_loop(read_word(buf), - read_word(buf + 2), read_word(buf + 4), read_word(buf + 6), read_word(buf + 8) - ); - break; - - case 81: /* end loop */ - clear_loop(); - break; - - case 96: /* set instrument */ - part = get_part(p[0] & 0x0F); - b = (p[1] & 0x0F) << 12 | (p[2] & 0x0F) << 8 | (p[4] & 0x0F) << 4 | (p[4] & 0x0F); - if (part) - part->set_instrument(b); - break; - - default: - debug(6, "unknown sysex %d", code); - } -} - -void Player::decode_sysex_bytes(byte *src, byte *dst, int len) -{ - while (len >= 0) { - *dst++ = (src[0] << 4) | (src[1] & 0xF); - src += 2; - len -= 2; - } -} - -void Player::maybe_jump(byte *data) -{ - byte cmd; - - cmd = data[0]; - - /* is this the hook i'm waiting for? */ - if (cmd && _hook._jump != cmd) - return; - - /* reset hook? */ - if (cmd != 0 && cmd < 0x80) - _hook._jump = 0; - - jump(read_word(data + 1), read_word(data + 3), read_word(data + 5)); -} - -void Player::maybe_set_transpose(byte *data) -{ - byte cmd; - - cmd = data[0]; - - /* is this the hook i'm waiting for? */ - if (cmd && _hook._transpose != cmd) - return; - - /* reset hook? */ - if (cmd != 0 && cmd < 0x80) - _hook._transpose = 0; - - set_transpose(data[1], (int8)data[2]); -} - -void Player::maybe_part_onoff(byte *data) -{ - byte cmd, *p; - uint chan; - Part *part; - - cmd = data[1]; - chan = data[0]; - - p = &_hook._part_onoff[chan]; - - /* is this the hook i'm waiting for? */ - if (cmd && *p != cmd) - return; - - if (cmd != 0 && cmd < 0x80) - *p = 0; - - part = get_part(chan); - if (part) - part->set_onoff(data[2] != 0); -} - -void Player::maybe_set_volume(byte *data) -{ - byte cmd; - byte *p; - uint chan; - Part *part; - - cmd = data[1]; - chan = data[0]; - - p = &_hook._part_volume[chan]; - - /* is this the hook i'm waiting for? */ - if (cmd && *p != cmd) - return; - - /* reset hook? */ - if (cmd != 0 && cmd < 0x80) - *p = 0; - - part = get_part(chan); - if (part) - part->set_vol(data[2]); -} - -void Player::maybe_set_program(byte *data) -{ - byte cmd; - byte *p; - uint chan; - Part *part; - - cmd = data[1]; - chan = data[0]; - - /* is this the hook i'm waiting for? */ - p = &_hook._part_program[chan]; - - if (cmd && *p != cmd) - return; - - if (cmd != 0 && cmd < 0x80) - *p = 0; - - part = get_part(chan); - if (part) - part->set_program(data[2]); -} - -void Player::maybe_set_transpose_part(byte *data) -{ - byte cmd; - byte *p; - uint chan; - - cmd = data[1]; - chan = data[0]; - - /* is this the hook i'm waiting for? */ - p = &_hook._part_transpose[chan]; - - if (cmd && *p != cmd) - return; - - /* reset hook? */ - if (cmd != 0 && cmd < 0x80) - *p = 0; - - part_set_transpose(chan, data[2], (int8)data[3]); -} - -int Player::set_transpose(byte relative, int b) -{ - Part *part; - - if (b > 24 || b < -24 || relative > 1) - return -1; - if (relative) - b = transpose_clamp(_transpose + b, -7, 7); - - _transpose = b; - - for (part = _parts; part; part = part->_next) { - part->set_transpose(part->_transpose); - } - - return 0; -} - -void Player::clear_active_notes() -{ - memset(_se->_active_notes, 0, sizeof(_se->_active_notes)); -} - -void Player::clear_active_note(int chan, byte note) -{ - _se->_active_notes[note] &= ~(1 << chan); -} - -void Player::set_active_note(int chan, byte note) -{ - _se->_active_notes[note] |= (1 << chan); -} - -void Player::part_set_transpose(uint8 chan, byte relative, int8 b) -{ - Part *part; - - if (b > 24 || b < -24) - return; - - part = get_part(chan); - if (!part) - return; - if (relative) - b = transpose_clamp(b + part->_transpose, -7, 7); - part->set_transpose(b); -} - -void Player::key_on(uint8 chan, uint8 note, uint8 velocity) -{ - Part *part; - - part = get_part(chan); - if (!part || !part->_on) - return; - - part->key_on(note, velocity); -} - -void Player::key_off(uint8 chan, uint8 note) -{ - Part *part; - - for (part = _parts; part; part = part->_next) { - if (part->_chan == (byte)chan && part->_on) - part->key_off(note); - } -} - -bool Player::jump(uint track, uint beat, uint tick) -{ - byte *mtrk, *cur_mtrk, *scanpos; - uint32 topos, curpos, track_offs; - - if (!_active) - return false; - - mtrk = _se->findTag(_song_index, "MTrk", track); - if (!mtrk) - return false; - - cur_mtrk = _se->findTag(_song_index, "MTrk", _track_index); - if (!cur_mtrk) - return false; - - _se->lock(); - - if (beat == 0) - beat = 1; - - topos = (beat - 1) * _ticks_per_beat + tick; - - if (track == _track_index && topos >= _cur_pos) { - scanpos = _song_offset + mtrk; - curpos = _next_pos; - } else { - scanpos = mtrk; - curpos = get_delta_time(&scanpos); - } - - while (curpos < topos) { - skip_midi_cmd(&scanpos); - if (!scanpos) { - _se->unlock(); - return false; - } - curpos += get_delta_time(&scanpos); - } - - track_offs = scanpos - mtrk; - - turn_off_pedals(); - - find_sustaining_notes(cur_mtrk + _song_offset, mtrk + track_offs, curpos - topos); - - _beat_index = beat; - _tick_index = tick; - _cur_pos = topos; - _next_pos = curpos; - _timer_counter = 0; - _song_offset = track_offs; - if (track != _track_index) { - _track_index = track; - _loop_counter = 0; - } - _abort = true; - _se->unlock(); - return true; -} - -bool Player::set_loop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick) -{ - if (tobeat + 1 >= frombeat) - return false; - - if (tobeat == 0) - tobeat = 1; - - _loop_counter = 0; /* because of possible interrupts */ - _loop_to_beat = tobeat; - _loop_to_tick = totick; - _loop_from_beat = frombeat; - _loop_from_tick = fromtick; - _loop_counter = count; - - return true; -} - -void Player::clear_loop() -{ - _loop_counter = 0; -} - -void Player::turn_off_pedals() -{ - Part *part; - - for (part = _parts; part; part = part->_next) { - if (part->_pedal) - part->set_pedal(false); - } -} - -void Player::find_sustaining_notes(byte *a, byte *b, uint32 l) -{ - uint32 pos; - uint16 mask; - uint16 *bitlist_ptr; - SustainingNotes *sn, *next; - IsNoteCmdData isnote; - int j; - uint num_active; - uint max_off_pos; - - num_active = update_actives(); - - /* pos contains number of ticks since current position */ - pos = _next_pos - _cur_pos; - if ((int32)pos < 0) - pos = 0; - - /* locate the positions where the notes are turned off. - * remember each note that was turned off - */ - while (num_active != 0) { - /* is note off? */ - j = is_note_cmd(&a, &isnote); - if (j == -1) - break; - if (j == 1) { - mask = 1 << isnote.chan; - bitlist_ptr = _se->_active_notes + isnote.note; - if (*bitlist_ptr & mask) { - *bitlist_ptr &= ~mask; - num_active--; - /* Get a node from the free list */ - if ((sn = _se->_sustain_notes_free) == NULL) - return; - _se->_sustain_notes_free = sn->next; - - /* Insert it in the beginning of the used list */ - sn->next = _se->_sustain_notes_used; - _se->_sustain_notes_used = sn; - sn->prev = NULL; - if (sn->next) - sn->next->prev = sn; - - sn->note = isnote.note; - sn->chan = isnote.chan; - sn->player = this; - sn->off_pos = pos; - sn->pos = 0; - sn->counter = 0; - } - } - pos += get_delta_time(&a); - } - - /* find the maximum position where a note was turned off */ - max_off_pos = 0; - for (sn = _se->_sustain_notes_used; sn; sn = sn->next) { - _se->_active_notes[sn->note] |= (1 << sn->chan); - if (sn->off_pos > max_off_pos) { - max_off_pos = sn->off_pos; - } - } - - /* locate positions where notes are turned on */ - pos = l; - while (pos < max_off_pos) { - j = is_note_cmd(&b, &isnote); - if (j == -1) - break; - if (j == 2) { - mask = 1 << isnote.chan; - bitlist_ptr = _se->_active_notes + isnote.note; - - if (*bitlist_ptr & mask) { - sn = _se->_sustain_notes_used; - while (sn) { - next = sn->next; - if (sn->note == isnote.note && sn->chan == isnote.chan && pos < sn->off_pos) { - *bitlist_ptr &= ~mask; - /* Unlink from the sustain list */ - if (next) - next->prev = sn->prev; - if (sn->prev) - sn->prev->next = next; - else - _se->_sustain_notes_used = next; - /* Insert into the free list */ - sn->next = _se->_sustain_notes_free; - _se->_sustain_notes_free = sn; - } - sn = next; - } - } - } - pos += get_delta_time(&b); - } - - /* Concatenate head and used list */ - if (!_se->_sustain_notes_head) { - _se->_sustain_notes_head = _se->_sustain_notes_used; - _se->_sustain_notes_used = NULL; - return; - } - sn = _se->_sustain_notes_head; - while (sn->next) - sn = sn->next; - sn->next = _se->_sustain_notes_used; - _se->_sustain_notes_used = NULL; - if (sn->next) - sn->next->prev = sn; -} - -Part *Player::get_part(uint8 chan) -{ - Part *part; - - part = _parts; - while (part) { - if (part->_chan == chan) - return part; - part = part->_next; - } - - part = _se->allocate_part(_priority); - if (!part) { - warning("no parts available"); - return NULL; - } - - part->_chan = chan; - part->setup(this); - - return part; -} - -uint Player::update_actives() -{ - Part *part; - uint16 *active; - int count = 0; - - clear_active_notes(); - active = _se->_active_notes; - for (part = _parts; part; part = part->_next) { - if (part->_mc) - count += part->update_actives(active); - } - return count; -} - -void Player::set_priority(int pri) -{ - Part *part; - - _priority = pri; - for (part = _parts; part; part = part->_next) { - part->set_pri(part->_pri); - } - _se->_driver->update_pris(); -} - -void Player::set_pan(int pan) -{ - Part *part; - - _pan = pan; - for (part = _parts; part; part = part->_next) { - part->set_pan(part->_pan); - } -} - -void Player::set_detune(int detune) -{ - Part *part; - - _detune = detune; - for (part = _parts; part; part = part->_next) { - part->set_detune(part->_detune); - } -} - -int Player::scan(uint totrack, uint tobeat, uint totick) -{ - byte *mtrk, *scanptr; - uint32 curpos, topos; - uint32 pos; - - assert(totrack >= 0 && tobeat >= 0 && totick >= 0); - - if (!_active) - return -1; - - mtrk = _se->findTag(_song_index, "MTrk", totrack); - if (!mtrk) - return -1; - - _se->lock(); - if (tobeat == 0) - tobeat++; - - turn_off_parts(); - clear_active_notes(); - scanptr = mtrk; - curpos = get_delta_time(&scanptr); - _scanning = true; - - topos = (tobeat - 1) * _ticks_per_beat + totick; - - while (curpos < topos) { - scanptr = parse_midi(scanptr); - if (!scanptr) { - _scanning = false; - _se->unlock(); - return -1; - } - curpos += get_delta_time(&scanptr); - } - pos = scanptr - mtrk; - - _scanning = false; - _se->driver()->update_pris(); - play_active_notes(); - _beat_index = tobeat; - _tick_index = totick; - _cur_pos = topos; - _next_pos = curpos; - _timer_counter = 0; - _song_offset = pos; - if (_track_index != totrack) { - _track_index = totrack; - _loop_counter = 0; - } - _se->unlock(); - return 0; -} - -void Player::turn_off_parts() -{ - Part *part; - - for (part = _parts; part; part = part->_next) - part->off(); -} - -void Player::play_active_notes() -{ - int i, j; - uint mask; - - for (i = 0; i != 128; i++) { - mask = _se->_active_notes[i]; - for (j = 0; j != 16; j++, mask >>= 1) { - if (mask & 1) { - key_on(j, i, 80); - } - } - } -} - -int Player::set_vol(byte vol) -{ - Part *part; - - if (vol > 127) - return -1; - - _volume = vol; - _vol_eff = _se->get_channel_volume(_vol_chan) * (vol + 1) >> 7; - - for (part = _parts; part; part = part->_next) { - part->set_vol(part->_vol); - } - - return 0; -} - -int Player::get_param(int param, byte chan) -{ - switch (param) { - case 0: - return (byte)_priority; - case 1: - return (byte)_volume; - case 2: - return (byte)_pan; - case 3: - return (byte)_transpose; - case 4: - return (byte)_detune; - case 5: - return _speed; - case 6: - return _track_index; - case 7: - return _beat_index; - case 8: - return _tick_index; - case 9: - return _loop_counter; - case 10: - return _loop_to_beat; - case 11: - return _loop_to_tick; - case 12: - return _loop_from_beat; - case 13: - return _loop_from_tick; - case 14: - case 15: - case 16: - case 17: - return query_part_param(param, chan); - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - return _hook.query_param(param, chan); - default: - return -1; - } -} - -int Player::query_part_param(int param, byte chan) -{ - Part *part; - - part = _parts; - while (part) { - if (part->_chan == chan) { - switch (param) { - case 14: - return part->_on; - case 15: - return part->_vol; - case 16: - return part->_program; - case 17: - return part->_transpose; - default: - return -1; - } - } - part = part->_next; - } - return 129; -} - -void Player::sequencer_timer() -{ - byte *mtrk; - uint32 counter; - byte *song_ptr; - - counter = _timer_counter + _timer_speed; - _timer_counter = counter & 0xFFFF; - _cur_pos += counter >> 16; - _tick_index += counter >> 16; - - if (_tick_index >= _ticks_per_beat) { - _beat_index += _tick_index / _ticks_per_beat; - _tick_index %= _ticks_per_beat; - } - if (_loop_counter && _beat_index >= _loop_from_beat && _tick_index >= _loop_from_tick) { - _loop_counter--; - jump(_track_index, _loop_to_beat, _loop_to_tick); - } - if (_next_pos <= _cur_pos) { - mtrk = _se->findTag(_song_index, "MTrk", _track_index); - if (!mtrk) { - warning("Sound %d was unloaded while active", _song_index); - clear(); - } else { - song_ptr = mtrk + _song_offset; - _abort = false; - - while (_next_pos <= _cur_pos) { - song_ptr = parse_midi(song_ptr); - if (!song_ptr || _abort) - return; - _next_pos += get_delta_time(&song_ptr); - } - _song_offset = song_ptr - mtrk; - } - } -} - -/*******************************************************************/ - -#define OFFS(type,item) ((int)(&((type*)0)->item)) -#define SIZE(type,item) sizeof(((type*)0)->item) -#define MKLINE(type,item,saveas) {OFFS(type,item),saveas,SIZE(type,item)} -#define MKARRAY(type,item,saveas,num) {OFFS(type,item),128|saveas,SIZE(type,item)}, {num,0,0} -#define MKEND() {0xFFFF,0xFF,0xFF} - -#define MKREF(type,item,refid) {OFFS(type,item),refid,0xFF} - -enum { - TYPE_PART = 1, - TYPE_PLAYER = 2, -}; - -int IMuseInternal::saveReference(IMuseInternal *me, byte type, void *ref) -{ - switch (type) { - case TYPE_PART: - return (Part *)ref - me->_parts; - case TYPE_PLAYER: - return (Player *)ref - me->_players; - default: - error("saveReference: invalid type"); - } -} - -void *IMuseInternal::loadReference(IMuseInternal *me, byte type, int ref) -{ - switch (type) { - case TYPE_PART: - return &me->_parts[ref]; - case TYPE_PLAYER: - return &me->_players[ref]; - default: - error("loadReference: invalid type"); - } -} - -int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) -{ - const SaveLoadEntry mainEntries[] = { - MKLINE(IMuseInternal, _queue_end, sleUint8), - MKLINE(IMuseInternal, _queue_pos, sleUint8), - MKLINE(IMuseInternal, _queue_sound, sleUint16), - MKLINE(IMuseInternal, _queue_adding, sleByte), - MKLINE(IMuseInternal, _queue_marker, sleByte), - MKLINE(IMuseInternal, _queue_cleared, sleByte), - MKLINE(IMuseInternal, _master_volume, sleByte), - MKLINE(IMuseInternal, _trigger_count, sleUint16), - MKARRAY(IMuseInternal, _channel_volume[0], sleUint16, 8), - MKARRAY(IMuseInternal, _volchan_table[0], sleUint16, 8), - MKEND() - }; - - const SaveLoadEntry playerEntries[] = { - MKREF(Player, _parts, TYPE_PART), - MKLINE(Player, _active, sleByte), - MKLINE(Player, _id, sleUint16), - MKLINE(Player, _priority, sleByte), - MKLINE(Player, _volume, sleByte), - MKLINE(Player, _pan, sleInt8), - MKLINE(Player, _transpose, sleByte), - MKLINE(Player, _detune, sleInt8), - MKLINE(Player, _vol_chan, sleUint16), - MKLINE(Player, _vol_eff, sleByte), - MKLINE(Player, _speed, sleByte), - MKLINE(Player, _song_index, sleUint16), - MKLINE(Player, _track_index, sleUint16), - MKLINE(Player, _timer_counter, sleUint16), - MKLINE(Player, _loop_to_beat, sleUint16), - MKLINE(Player, _loop_from_beat, sleUint16), - MKLINE(Player, _loop_counter, sleUint16), - MKLINE(Player, _loop_to_tick, sleUint16), - MKLINE(Player, _loop_from_tick, sleUint16), - MKLINE(Player, _tempo, sleUint32), - MKLINE(Player, _cur_pos, sleUint32), - MKLINE(Player, _next_pos, sleUint32), - MKLINE(Player, _song_offset, sleUint32), - MKLINE(Player, _tick_index, sleUint16), - MKLINE(Player, _beat_index, sleUint16), - MKLINE(Player, _ticks_per_beat, sleUint16), - MKLINE(Player, _hook._jump, sleByte), - MKLINE(Player, _hook._transpose, sleByte), - MKARRAY(Player, _hook._part_onoff[0], sleByte, 16), - MKARRAY(Player, _hook._part_volume[0], sleByte, 16), - MKARRAY(Player, _hook._part_program[0], sleByte, 16), - MKARRAY(Player, _hook._part_transpose[0], sleByte, 16), - MKEND() - }; - - const SaveLoadEntry volumeFaderEntries[] = { - MKREF(VolumeFader, player, TYPE_PLAYER), - MKLINE(VolumeFader, active, sleUint8), - MKLINE(VolumeFader, curvol, sleUint8), - MKLINE(VolumeFader, speed_lo_max, sleUint16), - MKLINE(VolumeFader, num_steps, sleUint16), - MKLINE(VolumeFader, speed_hi, sleInt8), - MKLINE(VolumeFader, direction, sleInt8), - MKLINE(VolumeFader, speed_lo, sleInt8), - MKLINE(VolumeFader, speed_lo_counter, sleUint16), - MKEND() - }; - - const SaveLoadEntry partEntries[] = { - MKREF(Part, _next, TYPE_PART), - MKREF(Part, _prev, TYPE_PART), - MKREF(Part, _player, TYPE_PLAYER), - MKLINE(Part, _pitchbend, sleInt16), - MKLINE(Part, _pitchbend_factor, sleUint8), - MKLINE(Part, _transpose, sleInt8), - MKLINE(Part, _vol, sleUint8), - MKLINE(Part, _detune, sleInt8), - MKLINE(Part, _pan, sleInt8), - MKLINE(Part, _on, sleUint8), - MKLINE(Part, _modwheel, sleUint8), - MKLINE(Part, _pedal, sleUint8), - MKLINE(Part, _program, sleUint8), - MKLINE(Part, _pri, sleUint8), - MKLINE(Part, _chan, sleUint8), - MKLINE(Part, _effect_level, sleUint8), - MKLINE(Part, _chorus, sleUint8), - MKLINE(Part, _percussion, sleUint8), - MKLINE(Part, _bank, sleUint8), - MKEND() - }; - - if (!ser->isSaving()) { - stop_all_sounds(); - } -#ifdef _WIN32_WCE // Don't break savegames made with andys' build - if (!ser->isSaving() && ser->checkEOFLoadStream()) - return 0; -#endif - - ser->_ref_me = this; - ser->_saveload_ref = ser->isSaving()? ((void *)&saveReference) : ((void *)&loadReference); - - ser->saveLoadEntries(this, mainEntries); - ser->saveLoadArrayOf(_players, ARRAYSIZE(_players), sizeof(_players[0]), playerEntries); - ser->saveLoadArrayOf(_parts, ARRAYSIZE(_parts), sizeof(_parts[0]), partEntries); - ser->saveLoadArrayOf(_volume_fader, ARRAYSIZE(_volume_fader), - sizeof(_volume_fader[0]), volumeFaderEntries); - - if (!ser->isSaving()) { - /* Load all sounds that we need */ - fix_players_after_load(scumm); - init_sustaining_notes(); - _active_volume_faders = true; - fix_parts_after_load(); - _driver->update_pris(); - } - - return 0; -} - -#undef MKLINE -#undef MKEND - -void IMuseInternal::fix_parts_after_load() -{ - Part *part; - int i; - - for (i = ARRAYSIZE(_parts), part = _parts; i != 0; i--, part++) { - if (part->_player) - part->fix_after_load(); - } -} - -/* Only call this routine from the main thread, - * since it uses getResourceAddress */ -void IMuseInternal::fix_players_after_load(Scumm *scumm) -{ - Player *player = _players; - int i; - - for (i = ARRAYSIZE(_players); i != 0; i--, player++) { - if (player->_active) { - player->set_tempo(player->_tempo); - scumm->getResourceAddress(rtSound, player->_id); - player->_mt32emulate = isMT32(player->_id); - } - } -} - -void Part::set_detune(int8 detune) -{ - _detune_eff = clamp((_detune = detune) + _player->_detune, -128, 127); - changed(IMuseDriver::pcMod); -} - -void Part::set_pitchbend(int value) -{ - _pitchbend = value * _pitchbend_factor >> 6; - changed(IMuseDriver::pcMod); -} - -void Part::set_vol(uint8 vol) -{ - _vol_eff = ((_vol = vol) + 1) * _player->_vol_eff >> 7; - changed(IMuseDriver::pcVolume); -} - -void Part::set_pri(int8 pri) -{ - _pri_eff = clamp((_pri = pri) + _player->_priority, 0, 255); -} - -void Part::set_pan(int8 pan) -{ - _pan_eff = clamp((_pan = pan) + _player->_pan, -64, 63); - changed(IMuseDriver::pcPan); -} - -void Part::set_transpose(int8 transpose) -{ - _transpose_eff = transpose_clamp((_transpose = transpose) + _player->_transpose, -12, 12); - changed(IMuseDriver::pcMod); -} - -void Part::set_pedal(bool value) -{ - _pedal = value; - changed(IMuseDriver::pcPedal); -} - -void Part::set_modwheel(uint value) -{ - _modwheel = value; - changed(IMuseDriver::pcModwheel); -} - -void Part::set_chorus(uint chorus) -{ - _chorus = chorus; - changed(IMuseDriver::pcChorus); -} - -void Part::set_effect_level(uint level) -{ - _effect_level = level; - changed(IMuseDriver::pcEffectLevel); -} - -void Part::fix_after_load() -{ - set_transpose(_transpose); - set_vol(_vol); - set_detune(_detune); - set_pri(_pri); - set_pan(_pan); -} - -void Part::set_pitchbend_factor(uint8 value) -{ - if (value > 12) - return; - set_pitchbend(0); - _pitchbend_factor = value; -} - -void Part::set_onoff(bool on) -{ - if (_on != on) { - _on = on; - if (!on) - off(); - if (!_percussion) - update_pris(); - } -} - -void Part::set_instrument(Instrument * data) -{ - _drv->part_set_instrument(this, data); -} - -void Part::key_on(byte note, byte velocity) -{ - _drv->part_key_on(this, note, velocity); -} - -void Part::key_off(byte note) -{ - _drv->part_key_off(this, note); -} - -void Part::init(IMuseDriver * driver) -{ - _drv = driver; - _player = NULL; - _next = NULL; - _prev = NULL; - _mc = NULL; -} - -void Part::setup(Player *player) -{ - _player = player; - - /* Insert first into player's list */ - _prev = NULL; - _next = player->_parts; - if (player->_parts) - player->_parts->_prev = this; - player->_parts = this; - - _percussion = true; - _on = true; - _pri_eff = player->_priority; - _pri = 0; - _vol = 127; - _vol_eff = player->_vol_eff; - _pan = clamp(player->_pan, -64, 63); - _transpose_eff = player->_transpose; - _transpose = 0; - _detune = 0; - _detune_eff = player->_detune; - _pitchbend_factor = 2; - _pitchbend = 0; - _effect_level = 64; - _program = 255; - _chorus = 0; - _modwheel = 0; - _bank = 0; - _pedal = false; - _mc = NULL; -} - -void Part::uninit() -{ - if (!_player) - return; - off(); - - /* unlink */ - if (_next) - _next->_prev = _prev; - if (_prev) - _prev->_next = _next; - else - _player->_parts = _next; - _player = NULL; - _next = NULL; - _prev = NULL; -} - -void Part::off() -{ - _drv->part_off(this); -} - -void Part::changed(byte what) -{ - _drv->part_changed(this, what); -} - -void Part::set_param(byte param, int value) -{ - _drv->part_set_param(this, param, value); -} - -void Part::update_pris() -{ - _drv->update_pris(); -} - -int Part::update_actives(uint16 *active) -{ - return _drv->part_update_active(this, active); -} - -void Part::set_program(byte program) -{ - if (_program != program || _bank != 0) { - _program = program; - _bank = 0; - changed(IMuseDriver::pcProgram); - } -} - -void Part::set_instrument(uint b) -{ - _bank = (byte)(b >> 8); - _program = (byte)b; - changed(IMuseDriver::pcProgram); -} - - -//******************************************** -//***** ADLIB PART OF IMUSE STARTS HERE ****** -//******************************************** - - -static byte lookup_table[64][32]; -const byte volume_table[] = { - 0, 4, 7, 11, - 13, 16, 18, 20, - 22, 24, 26, 27, - 29, 30, 31, 33, - 34, 35, 36, 37, - 38, 39, 40, 41, - 42, 43, 44, 44, - 45, 46, 47, 47, - 48, 49, 49, 50, - 51, 51, 52, 53, - 53, 54, 54, 55, - 55, 56, 56, 57, - 57, 58, 58, 59, - 59, 60, 60, 60, - 61, 61, 62, 62, - 62, 63, 63, 63 -}; - -int lookup_volume(int a, int b) -{ - if (b == 0) - return 0; - - if (b == 31) - return a; - - if (a < -63 || a > 63) { - return b * (a + 1) >> 5; - } - - if (b < 0) { - if (a < 0) { - return lookup_table[-a][-b]; - } else { - return -lookup_table[a][-b]; - } - } else { - if (a < 0) { - return -lookup_table[-a][b]; - } else { - return lookup_table[a][b]; - } - } -} - -void create_lookup_table() -{ - int i, j; - int sum; - - for (i = 0; i < 64; i++) { - sum = i; - for (j = 0; j < 32; j++) { - lookup_table[i][j] = sum >> 5; - sum += i; - } - } - for (i = 0; i < 64; i++) - lookup_table[i][0] = 0; -} - -MidiChannelAdl *IMuseAdlib::allocate_midichan(byte pri) -{ - MidiChannelAdl *ac, *best = NULL; - int i; - - for (i = 0; i < 9; i++) { - if (++_midichan_index >= 9) - _midichan_index = 0; - ac = &_midi_channels[_midichan_index]; - if (!ac->_part) - return ac; - if (!ac->_next) { - if (ac->_part->_pri_eff <= pri) { - pri = ac->_part->_pri_eff; - best = ac; - } - } - } - - if (best) - mc_off(best); - else; //debug(1, "Denying adlib channel request"); - return best; -} - -void IMuseAdlib::premix_proc(void *param, int16 *buf, uint len) -{ - ((IMuseAdlib *) param)->generate_samples(buf, len); -} - -void IMuseAdlib::init(IMuseInternal *eng, OSystem *syst) -{ - int i; - MidiChannelAdl *mc; - - _se = eng; - - for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++) { - mc->_channel = i; - mc->_s11a.s10 = &mc->_s10b; - mc->_s11b.s10 = &mc->_s10a; - } - - _adlib_reg_cache = (byte *)calloc(256, 1); - - _opl = OPLCreate(OPL_TYPE_YM3812, 3579545, syst->property(OSystem::PROP_GET_SAMPLE_RATE, 0)); - - adlib_write(1, 0x20); - adlib_write(8, 0x40); - adlib_write(0xBD, 0x00); - create_lookup_table(); - - _mixer->setup_premix(this, premix_proc); -} - -void IMuseAdlib::adlib_write(byte port, byte value) -{ - if (_adlib_reg_cache[port] == value) - return; - _adlib_reg_cache[port] = value; - - OPLWriteReg(_opl, port, value); -} - -void IMuseAdlib::adlib_key_off(int chan) -{ - byte port = chan + 0xB0; - adlib_write(port, adlib_read(port) & ~0x20); -} - -struct AdlibSetParams { - byte a, b, c, d; -}; - -static const byte channel_mappings[9] = { - 0, 1, 2, 8, - 9, 10, 16, 17, - 18 -}; - -static const byte channel_mappings_2[9] = { - 3, 4, 5, 11, - 12, 13, 19, 20, - 21 -}; - -static const AdlibSetParams adlib_setparam_table[] = { - {0x40, 0, 63, 63}, /* level */ - {0xE0, 2, 0, 0}, /* unused */ - {0x40, 6, 192, 0}, /* level key scaling */ - {0x20, 0, 15, 0}, /* modulator frequency multiple */ - {0x60, 4, 240, 15}, /* attack rate */ - {0x60, 0, 15, 15}, /* decay rate */ - {0x80, 4, 240, 15}, /* sustain level */ - {0x80, 0, 15, 15}, /* release rate */ - {0xE0, 0, 3, 0}, /* waveform select */ - {0x20, 7, 128, 0}, /* amp mod */ - {0x20, 6, 64, 0}, /* vib */ - {0x20, 5, 32, 0}, /* eg typ */ - {0x20, 4, 16, 0}, /* ksr */ - {0xC0, 0, 1, 0}, /* decay alg */ - {0xC0, 1, 14, 0} /* feedback */ -}; - -void IMuseAdlib::adlib_set_param(int channel, byte param, int value) -{ - const AdlibSetParams *as; - byte port; - - assert(channel >= 0 && channel < 9); - - if (param <= 12) { - port = channel_mappings_2[channel]; - } else if (param <= 25) { - param -= 13; - port = channel_mappings[channel]; - } else if (param <= 27) { - param -= 13; - port = channel; - } else if (param == 28 || param == 29) { - if (param == 28) - value -= 15; - else - value -= 383; - value <<= 4; - channel_table_2[channel] = value; - adlib_playnote(channel, curnote_table[channel] + value); - return; - } else { - return; - } - - as = &adlib_setparam_table[param]; - if (as->d) - value = as->d - value; - port += as->a; - adlib_write(port, (adlib_read(port) & ~as->c) | (((byte)value) << as->b)); -} - -static const byte octave_numbers[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7 -}; - -static const byte note_numbers[] = { - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10 -}; - -static const byte note_to_f_num[] = { - 90, 91, 92, 92, 93, 94, 94, 95, - 96, 96, 97, 98, 98, 99, 100, 101, - 101, 102, 103, 104, 104, 105, 106, 107, - 107, 108, 109, 110, 111, 111, 112, 113, - 114, 115, 115, 116, 117, 118, 119, 120, - 121, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, - 143, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 157, 158, 159, 160, - 161, 162, 163, 165, 166, 167, 168, 169, - 171, 172, 173, 174, 176, 177, 178, 180, - 181, 182, 184, 185, 186, 188, 189, 190, - 192, 193, 194, 196, 197, 199, 200, 202, - 203, 205, 206, 208, 209, 211, 212, 214, - 215, 217, 218, 220, 222, 223, 225, 226, - 228, 230, 231, 233, 235, 236, 238, 240, - 242, 243, 245, 247, 249, 251, 252, 254, -}; - -void IMuseAdlib::adlib_playnote(int channel, int note) -{ - byte old, oct, notex; - int note2; - int i; - - note2 = (note >> 7) - 4; - - oct = octave_numbers[note2] << 2; - notex = note_numbers[note2]; - - old = adlib_read(channel + 0xB0); - if (old & 0x20) { - old &= ~0x20; - if (oct > old) { - if (notex < 6) { - notex += 12; - oct -= 4; - } - } else if (oct < old) { - if (notex > 11) { - notex -= 12; - oct += 4; - } - } - } - - i = (notex << 3) + ((note >> 4) & 0x7); - adlib_write(channel + 0xA0, note_to_f_num[i]); - adlib_write(channel + 0xB0, oct | 0x20); -} - -void IMuseAdlib::adlib_note_on(int chan, byte note, int mod) -{ - int code; - assert(chan >= 0 && chan < 9); - code = (note << 7) + mod; - curnote_table[chan] = code; - adlib_playnote(chan, channel_table_2[chan] + code); -} - -void IMuseAdlib::adlib_note_on_ex(int chan, byte note, int mod) -{ - int code; - assert(chan >= 0 && chan < 9); - code = (note << 7) + mod; - curnote_table[chan] = code; - channel_table_2[chan] = 0; - adlib_playnote(chan, code); -} - -void IMuseAdlib::adlib_key_onoff(int channel) -{ - byte val; - byte port = channel + 0xB0; - assert(channel >= 0 && channel < 9); - - val = adlib_read(port); - adlib_write(port, val & ~0x20); - adlib_write(port, val | 0x20); -} - -void IMuseAdlib::adlib_setup_channel(int chan, Instrument * instr, byte vol_1, byte vol_2) -{ - byte port; - - assert(chan >= 0 && chan < 9); - - port = channel_mappings[chan]; - adlib_write(port + 0x20, instr->flags_1); - adlib_write(port + 0x40, (instr->oplvl_1 | 0x3F) - vol_1); - adlib_write(port + 0x60, ~instr->atdec_1); - adlib_write(port + 0x80, ~instr->sustrel_1); - adlib_write(port + 0xE0, instr->waveform_1); - - port = channel_mappings_2[chan]; - adlib_write(port + 0x20, instr->flags_2); - adlib_write(port + 0x40, (instr->oplvl_2 | 0x3F) - vol_2); - adlib_write(port + 0x60, ~instr->atdec_2); - adlib_write(port + 0x80, ~instr->sustrel_2); - adlib_write(port + 0xE0, instr->waveform_2); - - adlib_write((byte)chan + 0xC0, instr->feedback); -} - -int IMuseAdlib::adlib_read_param(int chan, byte param) -{ - const AdlibSetParams *as; - byte val; - byte port; - - assert(chan >= 0 && chan < 9); - - if (param <= 12) { - port = channel_mappings_2[chan]; - } else if (param <= 25) { - param -= 13; - port = channel_mappings[chan]; - } else if (param <= 27) { - param -= 13; - port = chan; - } else if (param == 28) { - return 0xF; - } else if (param == 29) { - return 0x17F; - } else { - return 0; - } - - as = &adlib_setparam_table[param]; - val = adlib_read(port + as->a); - val &= as->c; - val >>= as->b; - if (as->d) - val = as->d - val; - - return val; -} - -void IMuseAdlib::generate_samples(int16 *data, int len) -{ - int step; - - if (!_opl) { - memset(data, 0, len * sizeof(int16)); - return; - } - - do { - step = len; - if (step > _next_tick) - step = _next_tick; - YM3812UpdateOne(_opl, data, step); - - if (!(_next_tick -= step)) { - _se->on_timer(); - reset_tick(); - } - data += step; - } while (len -= step); -} - - -void IMuseAdlib::reset_tick() -{ - _next_tick = 88; -} - -void IMuseAdlib::on_timer() -{ - MidiChannelAdl *mc; - int i; - - _adlib_timer_counter += 0xD69; - while (_adlib_timer_counter >= 0x411B) { - _adlib_timer_counter -= 0x411B; - mc = _midi_channels; - for (i = 0; i != ARRAYSIZE(_midi_channels); i++, mc++) { - if (!mc->_part) - continue; - if (mc->_duration && (mc->_duration -= 0x11) <= 0) { - mc_off(mc); - return; - } - if (mc->_s10a.active) { - mc_inc_stuff(mc, &mc->_s10a, &mc->_s11a); - } - if (mc->_s10b.active) { - mc_inc_stuff(mc, &mc->_s10b, &mc->_s11b); - } - } - } -} - -const byte param_table_1[16] = { - 29, 28, 27, 0, - 3, 4, 7, 8, - 13, 16, 17, 20, - 21, 30, 31, 0 -}; - -const uint16 param_table_2[16] = { - 0x2FF, 0x1F, 0x7, 0x3F, - 0x0F, 0x0F, 0x0F, 0x3, - 0x3F, 0x0F, 0x0F, 0x0F, - 0x3, 0x3E, 0x1F, 0 -}; - -static const uint16 num_steps_table[] = { - 1, 2, 4, 5, - 6, 7, 8, 9, - 10, 12, 14, 16, - 18, 21, 24, 30, - 36, 50, 64, 82, - 100, 136, 160, 192, - 240, 276, 340, 460, - 600, 860, 1200, 1600 -}; - -int IMuseAdlib::random_nr(int a) -{ - static byte _rand_seed = 1; - if (_rand_seed & 1) { - _rand_seed >>= 1; - _rand_seed ^= 0xB8; - } else { - _rand_seed >>= 1; - } - return _rand_seed * a >> 8; -} - -void IMuseAdlib::struct10_setup(Struct10 * s10) -{ - int b, c, d, e, f, g, h; - byte t; - - b = s10->unk3; - f = s10->active - 1; - - t = s10->table_a[f]; - e = num_steps_table[lookup_table[t & 0x7F][b]]; - if (t & 0x80) { - e = random_nr(e); - } - if (e == 0) - e++; - - s10->num_steps = s10->speed_lo_max = e; - - if (f != 2) { - c = s10->param; - g = s10->start_value; - t = s10->table_b[f]; - d = lookup_volume(c, (t & 0x7F) - 31); - if (t & 0x80) { - d = random_nr(d); - } - if (d + g > c) { - h = c - g; - } else { - h = d; - if (d + g < 0) - h = -g; - } - h -= s10->cur_val; - } else { - h = 0; - } - - s10->speed_hi = h / e; - if (h < 0) { - h = -h; - s10->direction = -1; - } else { - s10->direction = 1; - } - - s10->speed_lo = h % e; - s10->speed_lo_counter = 0; -} - -byte IMuseAdlib::struct10_ontimer(Struct10 * s10, Struct11 * s11) -{ - byte result = 0; - int i; - - if (s10->count && (s10->count -= 17) <= 0) { - s10->active = 0; - return 0; - } - - i = s10->cur_val + s10->speed_hi; - s10->speed_lo_counter += s10->speed_lo; - if (s10->speed_lo_counter >= s10->speed_lo_max) { - s10->speed_lo_counter -= s10->speed_lo_max; - i += s10->direction; - } - if (s10->cur_val != i || s10->modwheel != s10->modwheel_last) { - s10->cur_val = i; - s10->modwheel_last = s10->modwheel; - i = lookup_volume(i, s10->modwheel_last); - if (i != s11->modify_val) { - s11->modify_val = i; - result = 1; - } - } - - if (!--s10->num_steps) { - s10->active++; - if (s10->active > 4) { - if (s10->loop) { - s10->active = 1; - result |= 2; - struct10_setup(s10); - } else { - s10->active = 0; - } - } else { - struct10_setup(s10); - } - } - - return result; -} - -void IMuseAdlib::struct10_init(Struct10 * s10, InstrumentExtra * ie) -{ - s10->active = 1; - s10->cur_val = 0; - s10->modwheel_last = 31; - s10->count = ie->a; - if (s10->count) - s10->count *= 63; - s10->table_a[0] = ie->b; - s10->table_a[1] = ie->d; - s10->table_a[2] = ie->f; - s10->table_a[3] = ie->g; - - s10->table_b[0] = ie->c; - s10->table_b[1] = ie->e; - s10->table_b[2] = 0; - s10->table_b[3] = ie->h; - - struct10_setup(s10); -} - -void IMuseAdlib::mc_init_stuff(MidiChannelAdl *mc, Struct10 * s10, - Struct11 * s11, byte flags, InstrumentExtra * ie) -{ - Part *part = mc->_part; - - s11->modify_val = 0; - s11->flag0x40 = flags & 0x40; - s10->loop = flags & 0x20; - s11->flag0x10 = flags & 0x10; - s11->param = param_table_1[flags & 0xF]; - s10->param = param_table_2[flags & 0xF]; - s10->unk3 = 31; - if (s11->flag0x40) { - s10->modwheel = part->_modwheel >> 2; - } else { - s10->modwheel = 31; - } - - switch (s11->param) { - case 0: - s10->start_value = mc->_vol_2; - break; - case 13: - s10->start_value = mc->_vol_1; - break; - case 30: - s10->start_value = 31; - s11->s10->modwheel = 0; - break; - case 31: - s10->start_value = 0; - s11->s10->unk3 = 0; - break; - default: - s10->start_value = ((IMuseAdlib *) part->_drv)->adlib_read_param(mc->_channel, s11->param); - } - - struct10_init(s10, ie); -} - -void IMuseAdlib::mc_inc_stuff(MidiChannelAdl *mc, Struct10 * s10, Struct11 * s11) -{ - byte code; - Part *part = mc->_part; - - code = struct10_ontimer(s10, s11); - - if (code & 1) { - switch (s11->param) { - case 0: - mc->_vol_2 = s10->start_value + s11->modify_val; - ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 0, - volume_table[lookup_table[mc->_vol_2] - [part->_vol_eff >> 2]]); - break; - case 13: - mc->_vol_1 = s10->start_value + s11->modify_val; - if (mc->_twochan) { - ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 13, - volume_table[lookup_table[mc->_vol_1] - [part->_vol_eff >> 2]]); - } else { - ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, 13, mc->_vol_1); - } - break; - case 30: - s11->s10->modwheel = (char)s11->modify_val; - break; - case 31: - s11->s10->unk3 = (char)s11->modify_val; - break; - default: - ((IMuseAdlib *) part->_drv)->adlib_set_param(mc->_channel, s11->param, - s10->start_value + s11->modify_val); - break; - } - } - - if (code & 2 && s11->flag0x10) - ((IMuseAdlib *) part->_drv)->adlib_key_onoff(mc->_channel); -} - -void IMuseAdlib::part_changed(Part *part, byte what) -{ - MidiChannelAdl *mc; - - if (what & pcProgram) { - if (part->_program < 32) { - part_set_instrument(part, &_glob_instr[part->_program]); - } - } - - if (what & pcMod) { - for (mc = part->_mc->adl(); mc; mc = mc->_next) { - adlib_note_on(mc->_channel, mc->_note + part->_transpose_eff, - part->_pitchbend + part->_detune_eff); - } - } - - if (what & pcVolume) { - for (mc = part->_mc->adl(); mc; mc = mc->_next) { - adlib_set_param(mc->_channel, 0, volume_table[lookup_table[mc->_vol_2] - [part->_vol_eff >> 2]]); - if (mc->_twochan) { - adlib_set_param(mc->_channel, 13, volume_table[lookup_table[mc->_vol_1] - [part->_vol_eff >> 2]]); - } - } - } - - if (what & pcPedal) { - if (!part->_pedal) { - for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { - if (mc->_waitforpedal) - mc_off(mc); - } - } - } - - if (what & pcModwheel) { - for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { - if (mc->_s10a.active && mc->_s11a.flag0x40) - mc->_s10a.modwheel = part->_modwheel >> 2; - if (mc->_s10b.active && mc->_s11b.flag0x40) - mc->_s10b.modwheel = part->_modwheel >> 2; - } - } -} - -void IMuseAdlib::mc_key_on(MidiChannel * mc2, byte note, byte velocity) -{ - MidiChannelAdl *mc = (MidiChannelAdl *)mc2; - Part *part = mc->_part; - Instrument *instr = &_part_instr[part->_slot]; - int c; - byte vol_1, vol_2; - - mc->_twochan = instr->feedback & 1; - mc->_note = note; - mc->_waitforpedal = false; - mc->_duration = instr->duration; - if (mc->_duration != 0) - mc->_duration *= 63; - - vol_1 = (instr->oplvl_1 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_1 >> 2]; - if (vol_1 > 0x3F) - vol_1 = 0x3F; - mc->_vol_1 = vol_1; - - vol_2 = (instr->oplvl_2 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_2 >> 2]; - if (vol_2 > 0x3F) - vol_2 = 0x3F; - mc->_vol_2 = vol_2; - - c = part->_vol_eff >> 2; - - vol_2 = volume_table[lookup_table[vol_2][c]]; - if (mc->_twochan) - vol_1 = volume_table[lookup_table[vol_1][c]]; - - adlib_setup_channel(mc->_channel, instr, vol_1, vol_2); - adlib_note_on_ex(mc->_channel, part->_transpose_eff + note, part->_detune_eff + part->_pitchbend); - - if (instr->flags_a & 0x80) { - mc_init_stuff(mc, &mc->_s10a, &mc->_s11a, instr->flags_a, &instr->extra_a); - } else { - mc->_s10a.active = 0; - } - - if (instr->flags_b & 0x80) { - mc_init_stuff(mc, &mc->_s10b, &mc->_s11b, instr->flags_b, &instr->extra_b); - } else { - mc->_s10b.active = 0; - } -} - -void IMuseAdlib::set_instrument(uint slot, byte *data) -{ - if (slot < 32) { - memcpy(&_glob_instr[slot], data, sizeof(Instrument)); - } -} - - -void IMuseAdlib::link_mc(Part *part, MidiChannelAdl *mc) -{ - mc->_part = part; - mc->_next = (MidiChannelAdl *)part->_mc; - part->_mc = mc; - mc->_prev = NULL; - - if (mc->_next) - mc->_next->_prev = mc; -} - -void IMuseAdlib::part_key_on(Part *part, byte note, byte velocity) -{ - MidiChannelAdl *mc; - - mc = allocate_midichan(part->_pri_eff); - if (!mc) - return; - - link_mc(part, mc); - mc_key_on(mc, note, velocity); -} - -void IMuseAdlib::part_key_off(Part *part, byte note) -{ - MidiChannelAdl *mc; - - for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { - if (mc->_note == note) { - if (part->_pedal) - mc->_waitforpedal = true; - else - mc_off(mc); - } - } -} - -struct AdlibInstrSetParams { - byte param; - byte shl; - byte mask; -}; - -#define MKLINE(_a_,_b_,_c_) { (int)&((Instrument*)0)->_a_, _b_, ((1<<(_c_))-1)<<(_b_) } -static const AdlibInstrSetParams adlib_instr_params[69] = { - MKLINE(oplvl_2, 0, 6), - MKLINE(waveform_2, 2, 5), - MKLINE(oplvl_2, 6, 2), - MKLINE(flags_2, 0, 4), - MKLINE(atdec_2, 4, 4), - MKLINE(atdec_2, 0, 4), - MKLINE(sustrel_2, 4, 4), - MKLINE(sustrel_2, 0, 4), - MKLINE(waveform_2, 0, 2), - MKLINE(flags_2, 7, 1), - MKLINE(flags_2, 6, 1), - MKLINE(flags_2, 5, 1), - MKLINE(flags_2, 4, 1), - - MKLINE(oplvl_1, 0, 6), - MKLINE(waveform_1, 2, 5), - MKLINE(oplvl_1, 6, 2), - MKLINE(flags_1, 0, 4), - MKLINE(atdec_1, 4, 4), - MKLINE(atdec_1, 0, 4), - MKLINE(sustrel_1, 4, 4), - MKLINE(sustrel_1, 0, 4), - MKLINE(waveform_1, 0, 2), - MKLINE(flags_1, 7, 1), - MKLINE(flags_1, 6, 1), - MKLINE(flags_1, 5, 1), - MKLINE(flags_1, 4, 1), - - MKLINE(feedback, 0, 1), - MKLINE(feedback, 1, 3), - - MKLINE(flags_a, 7, 1), - MKLINE(flags_a, 6, 1), - MKLINE(flags_a, 5, 1), - MKLINE(flags_a, 4, 1), - MKLINE(flags_a, 0, 4), - MKLINE(extra_a.a, 0, 8), - MKLINE(extra_a.b, 0, 7), - MKLINE(extra_a.c, 0, 7), - MKLINE(extra_a.d, 0, 7), - MKLINE(extra_a.e, 0, 7), - MKLINE(extra_a.f, 0, 7), - MKLINE(extra_a.g, 0, 7), - MKLINE(extra_a.h, 0, 7), - MKLINE(extra_a.b, 7, 1), - MKLINE(extra_a.c, 7, 1), - MKLINE(extra_a.d, 7, 1), - MKLINE(extra_a.e, 7, 1), - MKLINE(extra_a.f, 7, 1), - MKLINE(extra_a.g, 7, 1), - MKLINE(extra_a.h, 7, 1), - - MKLINE(flags_b, 7, 1), - MKLINE(flags_b, 6, 1), - MKLINE(flags_b, 5, 1), - MKLINE(flags_b, 4, 1), - MKLINE(flags_b, 0, 4), - MKLINE(extra_b.a, 0, 8), - MKLINE(extra_b.b, 0, 7), - MKLINE(extra_b.c, 0, 7), - MKLINE(extra_b.d, 0, 7), - MKLINE(extra_b.e, 0, 7), - MKLINE(extra_b.f, 0, 7), - MKLINE(extra_b.g, 0, 7), - MKLINE(extra_b.h, 0, 7), - MKLINE(extra_b.b, 7, 1), - MKLINE(extra_b.c, 7, 1), - MKLINE(extra_b.d, 7, 1), - MKLINE(extra_b.e, 7, 1), - MKLINE(extra_b.f, 7, 1), - MKLINE(extra_b.g, 7, 1), - MKLINE(extra_b.h, 7, 1), - - MKLINE(duration, 0, 8), -}; -#undef MKLINE - -void IMuseAdlib::part_set_param(Part *part, byte param, int value) -{ - const AdlibInstrSetParams *sp = &adlib_instr_params[param]; - byte *p = (byte *)&_part_instr[part->_slot] + sp->param; - *p = (*p & ~sp->mask) | (value << sp->shl); - - if (param < 28) { - MidiChannelAdl *mc; - - for (mc = (MidiChannelAdl *)part->_mc; mc; mc = mc->_next) { - adlib_set_param(mc->_channel, param, value); - } - } -} - -void IMuseAdlib::part_off(Part *part) -{ - MidiChannelAdl *mc = (MidiChannelAdl *)part->_mc; - part->_mc = NULL; - for (; mc; mc = mc->_next) { - mc_off(mc); - } -} - -void IMuseAdlib::mc_off(MidiChannel * mc2) -{ - MidiChannelAdl *mc = (MidiChannelAdl *)mc2, *tmp; - - adlib_key_off(mc->_channel); - - tmp = mc->_prev; - - if (mc->_next) - mc->_next->_prev = tmp; - if (tmp) - tmp->_next = mc->_next; - else - mc->_part->_mc = mc->_next; - mc->_part = NULL; -} - -void IMuseAdlib::part_set_instrument(Part *part, Instrument * instr) -{ - Instrument *i = &_part_instr[part->_slot]; - memcpy(i, instr, sizeof(Instrument)); -} - -int IMuseAdlib::part_update_active(Part *part, uint16 *active) -{ - uint16 bits; - int count = 0; - MidiChannelAdl *mc; - - bits = 1 << part->_chan; - - for (mc = part->_mc->adl(); mc; mc = mc->_next) { - if (!(active[mc->_note] & bits)) { - active[mc->_note] |= bits; - count++; - } - } - return count; -} - -//******************************************** -//** GENERAL MIDI PART OF IMUSE STARTS HERE ** -//******************************************** - -void IMuseGM::midiPitchBend(byte chan, int16 pitchbend) -{ - uint16 tmp; - - if (_midi_pitchbend_last[chan] != pitchbend) { - _midi_pitchbend_last[chan] = pitchbend; - tmp = (pitchbend << 2) + 0x2000; - _md->send(((tmp >> 7) & 0x7F) << 16 | (tmp & 0x7F) << 8 | 0xE0 | chan); - } -} - -void IMuseGM::midiVolume(byte chan, byte volume) -{ - if (_midi_volume_last[chan] != volume) { - _midi_volume_last[chan] = volume; - _md->send(volume << 16 | 7 << 8 | 0xB0 | chan); - } -} -void IMuseGM::midiPedal(byte chan, bool pedal) -{ - if (_midi_pedal_last[chan] != pedal) { - _midi_pedal_last[chan] = pedal; - _md->send(pedal << 16 | 64 << 8 | 0xB0 | chan); - } -} - -void IMuseGM::midiModWheel(byte chan, byte modwheel) -{ - if (_midi_modwheel_last[chan] != modwheel) { - _midi_modwheel_last[chan] = modwheel; - _md->send(modwheel << 16 | 1 << 8 | 0xB0 | chan); - } -} - -void IMuseGM::midiEffectLevel(byte chan, byte level) -{ - if (_midi_effectlevel_last[chan] != level) { - _midi_effectlevel_last[chan] = level; - _md->send(level << 16 | 91 << 8 | 0xB0 | chan); - } -} - -void IMuseGM::midiChorus(byte chan, byte chorus) -{ - if (_midi_chorus_last[chan] != chorus) { - _midi_chorus_last[chan] = chorus; - _md->send(chorus << 16 | 93 << 8 | 0xB0 | chan); - } -} - -void IMuseGM::midiControl0(byte chan, byte value) -{ - _md->send(value << 16 | 0 << 8 | 0xB0 | chan); -} - - -void IMuseGM::midiProgram(byte chan, byte program, bool mt32emulate) -{ - if (mt32emulate) { /* Don't convert the percussion channel, it is the same in GM and MT32 */ - if (chan != PERCUSSION_CHANNEL) - program = mt32_to_gmidi[program]; - } - - _md->send(program << 8 | 0xC0 | chan); -} - -void IMuseGM::midiPan(byte chan, int8 pan) -{ - if (_midi_pan_last[chan] != pan) { - _midi_pan_last[chan] = pan; - _md->send(((pan - 64) & 0x7F) << 16 | 10 << 8 | 0xB0 | chan); - } -} - -void IMuseGM::midiNoteOn(byte chan, byte note, byte velocity) -{ - _md->send(velocity << 16 | note << 8 | 0x90 | chan); -} - -void IMuseGM::midiNoteOff(byte chan, byte note) -{ - _md->send(note << 8 | 0x80 | chan); -} - -void IMuseGM::midiSilence(byte chan) -{ - _md->send((64 << 8) | 0xB0 | chan); - _md->send((123 << 8) | 0xB0 | chan); -} - - -void IMuseGM::part_key_on(Part *part, byte note, byte velocity) -{ - MidiChannelGM *mc = part->_mc->gm(); - - if (mc) { - mc->_actives[note >> 4] |= (1 << (note & 0xF)); - midiNoteOn(mc->_chan, note, velocity); - } else if (part->_percussion) { - midiVolume(PERCUSSION_CHANNEL, part->_vol_eff); - midiProgram(PERCUSSION_CHANNEL, part->_bank, part->_player->_mt32emulate); - midiNoteOn(PERCUSSION_CHANNEL, note, velocity); - } -} - -void IMuseGM::part_key_off(Part *part, byte note) -{ - MidiChannelGM *mc = part->_mc->gm(); - - if (mc) { - mc->_actives[note >> 4] &= ~(1 << (note & 0xF)); - midiNoteOff(mc->_chan, note); - } else if (part->_percussion) { - midiNoteOff(PERCUSSION_CHANNEL, note); - } -} - -#if !defined(__MORPHOS__) -int IMuseGM::midi_driver_thread(void *param) -{ - IMuseGM *mid = (IMuseGM *) param; - int old_time, cur_time; - - old_time = mid->_system->get_msecs(); - - for (;;) { - mid->_system->delay_msecs(10); - - cur_time = mid->_system->get_msecs(); - while (old_time < cur_time) { - old_time += 10; - mid->_se->on_timer(); - } - } -} -#else -#include -#include -#include -#include "../morphos/morphos.h" -int IMuseGM::midi_driver_thread(void *param) -{ - IMuseGM *mid = (IMuseGM *) param; - int old_time, cur_time; - bool initialized; - - ObtainSemaphore(&ScummMusicThreadRunning); - - initialized = init_morphos_music(0); - - old_time = mid->_system->get_msecs(); - - if (!initialized) - Wait(SIGBREAKF_CTRL_C); - else { - for (;;) { - MusicTimerIORequest->tr_time.tv_micro = 10000; - MusicTimerIORequest->tr_node.io_Command = TR_ADDREQUEST; - MusicTimerIORequest->tr_time.tv_secs = 0; - DoIO((struct IORequest *)MusicTimerIORequest); - - if (CheckSignal(SIGBREAKF_CTRL_C)) - break; - - cur_time = mid->_system->get_msecs(); - while (old_time < cur_time) { - old_time += 10; - mid->_se->on_timer(); - } - } - } - - exit_morphos_music(); - - ReleaseSemaphore(&ScummMusicThreadRunning); - RemTask(NULL); - return 0; -} -#endif - -void IMuseGM::init(IMuseInternal *eng, OSystem *syst) -{ - int i; - MidiChannelGM *mc; - - _system = syst; - - /* open midi driver */ - int result = _md->open(MidiDriver::MO_SIMPLE); - if (result) - error("IMuseGM::error = %s", MidiDriver::get_error_name(result)); - - /* Install the on_timer thread */ - _se = eng; - syst->create_thread(midi_driver_thread, this); - - for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++) - mc->_chan = i; -} - -void IMuseGM::update_pris() -{ - Part *part, *hipart; - int i; - byte hipri, lopri; - MidiChannelGM *mc, *lomc; - - while (true) { - hipri = 0; - hipart = NULL; - for (i = 32, part = _se->parts_ptr(); i; i--, part++) { - if (part->_player && !part->_percussion && part->_on && !part->_mc && part->_pri_eff >= hipri) { - hipri = part->_pri_eff; - hipart = part; - } - } - - if (!hipart) - return; - - lopri = 255; - lomc = NULL; - for (i = ARRAYSIZE(_midi_channels), mc = _midi_channels;; mc++) { - if (!mc->_part) { - lomc = mc; - break; - } - if (mc->_part->_pri_eff <= lopri) { - lopri = mc->_part->_pri_eff; - lomc = mc; - } - - if (!--i) { - if (lopri >= hipri) - return; - lomc->_part->off(); - break; - } - } - - hipart->_mc = lomc; - lomc->_part = hipart; - hipart->changed(pcAll); - } -} - -int IMuseGM::part_update_active(Part *part, uint16 *active) -{ - int i, j; - uint16 *act, mask, bits; - int count = 0; - - bits = 1 << part->_chan; - - act = part->_mc->gm()->_actives; - - for (i = 8; i; i--) { - mask = *act++; - if (mask) { - for (j = 16; j; j--, mask >>= 1, active++) { - if (mask & 1 && !(*active & bits)) { - *active |= bits; - count++; - } - } - } else { - active += 16; - } - } - return count; -} - -void IMuseGM::part_changed(Part *part, byte what) -{ - MidiChannelGM *mc; - - /* Mark for re-schedule if program changed when in pre-state */ - if (what & pcProgram && part->_percussion) { - part->_percussion = false; - update_pris(); - } - - if (!(mc = part->_mc->gm())) - return; - - if (part->_player == NULL) { /* No player, so dump phantom channel */ - part->_mc = NULL; - mc->_part = NULL; - memset(mc->_actives, 0, sizeof(mc->_actives)); - return; - } - - if (what & pcMod) - midiPitchBend(mc->_chan, - clamp(part->_pitchbend + part->_detune_eff + - (part->_transpose_eff << 7), -2048, 2047)); - - if (what & pcVolume) - midiVolume(mc->_chan, part->_vol_eff); - - if (what & pcPedal) - midiPedal(mc->_chan, part->_pedal); - - if (what & pcModwheel) - midiModWheel(mc->_chan, part->_modwheel); - - if (what & pcPan) - midiPan(mc->_chan, part->_pan_eff); - - if (what & pcEffectLevel) - midiEffectLevel(mc->_chan, part->_effect_level); - - if (what & pcProgram) { - if (part->_bank) { - midiControl0(mc->_chan, part->_bank); - midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate); - midiControl0(mc->_chan, 0); - } else { - midiProgram(mc->_chan, part->_program, part->_player->_mt32emulate); - } - } - - if (what & pcChorus) - midiChorus(mc->_chan, part->_effect_level); -} - - -void IMuseGM::part_off(Part *part) -{ - MidiChannelGM *mc = part->_mc->gm(); - if (mc) { - part->_mc = NULL; - mc->_part = NULL; - memset(mc->_actives, 0, sizeof(mc->_actives)); - midiSilence(mc->_chan); - } -} - - - -/* - * Implementation of the dummy IMuse class that acts as a proxy for - * our real IMuseInternal class. This way we reduce the compile time - * and inter source dependencies. - */ -IMuse::IMuse():_imuse(NULL) -{ -} - -IMuse::~IMuse() -{ - if (_imuse) - delete _imuse; -} - -void IMuse::on_timer() -{ - _imuse->on_timer(); -} - -void IMuse::pause(bool paused) -{ - _imuse->pause(paused); -} - -int IMuse::save_or_load(Serializer *ser, Scumm *scumm) -{ - return _imuse->save_or_load(ser, scumm); -} - -int IMuse::set_music_volume(uint vol) -{ - return _imuse->set_music_volume(vol); -} - -int IMuse::get_music_volume() -{ - return _imuse->get_music_volume(); -} - -int IMuse::set_master_volume(uint vol) -{ - return _imuse->set_master_volume(vol); -} - -int IMuse::get_master_volume() -{ - return _imuse->get_master_volume(); -} - -bool IMuse::start_sound(int sound) -{ - return _imuse->start_sound(sound); -} - -int IMuse::stop_sound(int sound) -{ - return _imuse->stop_sound(sound); -} - -int IMuse::stop_all_sounds() -{ - return _imuse->stop_all_sounds(); -} - -int IMuse::get_sound_status(int sound) -{ - return _imuse->get_sound_status(sound); -} - -int32 IMuse::do_command(int a, int b, int c, int d, int e, int f, int g, int h) -{ - return _imuse->do_command(a, b, c, d, e, f, g, h); -} - -int IMuse::clear_queue() -{ - return _imuse->clear_queue(); -} - -void IMuse::setBase(byte **base) -{ - _imuse->setBase(base); -} - -uint32 IMuse::property(int prop, uint32 value) -{ - return _imuse->property(prop, value); -} - -IMuse *IMuse::create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer) -{ - IMuse *i = new IMuse; - i->_imuse = IMuseInternal::create(syst, midi, mixer); - return i; -} diff --git a/sound/imuse.h b/sound/imuse.h deleted file mode 100644 index f265f52492..0000000000 --- a/sound/imuse.h +++ /dev/null @@ -1,61 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -class IMuseInternal; - -class IMuse { -public: - enum { - PROP_TEMPO_BASE = 1, - }; - - IMuse(); - ~IMuse(); - - void on_timer(); // For the MacOS 9 port only - void pause(bool paused); - int save_or_load(Serializer *ser, Scumm *scumm); - int set_music_volume(uint vol); - int get_music_volume(); - int set_master_volume(uint vol); - int get_master_volume(); - bool start_sound(int sound); - int stop_sound(int sound); - int stop_all_sounds(); - int get_sound_status(int sound); - int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h); - int clear_queue(); - void setBase(byte **base); - uint32 property(int prop, uint32 value); - - static IMuse *create(OSystem *syst, MidiDriver *midi, SoundMixer *mixer); - - static IMuse *create_adlib(OSystem *syst, SoundMixer *mixer) { - return create(syst, NULL, mixer); - } - static IMuse *create_midi(OSystem *syst, MidiDriver *midi) { - return create(syst, midi, NULL); - } - -private: - IMuseInternal *_imuse; // Pointer to the real imuse object -}; diff --git a/sound/sound.cpp b/sound/sound.cpp new file mode 100644 index 0000000000..69bdfc8143 --- /dev/null +++ b/sound/sound.cpp @@ -0,0 +1,1236 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "scumm/scumm.h" +#include "sound/mididrv.h" +#include "scumm/imuse.h" +#include "scumm/actor.h" +#include "config-file.h" +#include "util.h" + +#ifdef _WIN32_WCE +extern void *bsearch(const void *, const void *, size_t, + size_t, int (*x) (const void *, const void *)); +#endif + +Sound::Sound(Scumm *parent) { + _scumm = parent; + _numberBundleMusic = -1; + _musicBundleBufFinal = NULL; + _musicBundleBufOutput = NULL; +} + +Sound::~Sound() { +} + +void Sound::addSoundToQueue(int sound) { + if (!(_scumm->_features & GF_AFTER_V7)) { + _scumm->_vars[_scumm->VAR_LAST_SOUND] = sound; + _scumm->ensureResourceLoaded(rtSound, sound); + addSoundToQueue2(sound); + } else { + // WARNING ! This may break something, maybe this sould be put inside if(_gameID == GID_FT) ? + // But why addSoundToQueue should not queue sound ? + _scumm->ensureResourceLoaded(rtSound, sound); + addSoundToQueue2(sound); + } + +// if (_features & GF_AUDIOTRACKS) +// warning("Requesting audio track: %d", sound); +} + +void Sound::addSoundToQueue2(int sound) { + if (_soundQue2Pos < 10) { + _soundQue2[_soundQue2Pos++] = sound; + } +} + +void Sound::processSoundQues() { + byte d; + int i, j; + int num; + int16 data[16]; + IMuse *se; + + processSfxQueues(); + + while (_soundQue2Pos) { + d = _soundQue2[--_soundQue2Pos]; + if (d) + playSound(d); + } + + for (i = 0; i < _soundQuePos;) { + num = _soundQue[i++]; + if (i + num > _soundQuePos) { + warning("processSoundQues: invalid num value"); + break; + } + for (j = 0; j < 16; j++) + data[j] = 0; + if (num > 0) { + for (j = 0; j < num; j++) + data[j] = _soundQue[i + j]; + i += num; + + se = _scumm->_imuse; +#if 0 + debug(1, "processSoundQues(%d,%d,%d,%d,%d,%d,%d,%d,%d)", + data[0] >> 8, + data[0] & 0xFF, + data[1], data[2], data[3], data[4], data[5], data[6], data[7] + ); +#endif + + if ((_scumm->_gameId == GID_DIG) && (data[0] == 4096)){ + playBundleMusic(data[1] - 1); + } + if ((_scumm->_gameId == GID_DIG) && ((data[0] == 12) || (data[0] == 14))){ + uint32 size = 0, rate = 0, tag, chan = 0, bits = 0; + uint8 * ptr = _scumm->getResourceAddress(rtSound, data[1]); + if (ptr != NULL) { + ptr+=16; /* Skip header */ + for (;;) { + tag = READ_BE_UINT32(ptr); ptr+=4; + switch(tag) { + case MKID_BE('FRMT'): + size = READ_BE_UINT32(ptr); ptr+=12; + bits = READ_BE_UINT32(ptr); ptr+=4; + rate = READ_BE_UINT32(ptr); ptr+=4; + chan = READ_BE_UINT32(ptr); ptr+=4; + break; + case MKID_BE('TEXT'): + case MKID_BE('REGN'): + case MKID_BE('STOP'): + case MKID_BE('JUMP'): + size = READ_BE_UINT32(ptr); ptr+=size+4; + break; + case MKID_BE('DATA'): + size = READ_BE_UINT32(ptr); ptr+=4; + break; + default: + error("Unknown sfx header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); + } + if (tag == MKID_BE('DATA')) break; + } + if (bits == 8) { + byte * buffer = (byte*)malloc (size); + memcpy(buffer, ptr, size); + if (chan == 1) { + _scumm->_mixer->play_raw(NULL, buffer, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED); + } + else if (chan == 2) { + _scumm->_mixer->play_raw(NULL, buffer, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_STEREO); + } + } else if (bits == 12) { + byte * buffer = NULL; + uint32 final_size = decode12BitsSample(ptr, &buffer, size); + if (chan == 1) { + _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS); + } + else if (chan == 2) { + _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO); + } + } + } + } + + if (!(_scumm->_features & GF_AFTER_V7)) { + if (se) + _scumm->_vars[_scumm->VAR_SOUNDRESULT] = + (short)se->do_command(data[0], data[1], data[2], data[3], data[4], + data[5], data[6], data[7]); + } + + } + } + _soundQuePos = 0; +} + +static char * read_creative_voc_file(byte * ptr, int & size, int & rate) { + assert(strncmp((char*)ptr, "Creative Voice File\x1A", 20) == 0); + int offset = READ_LE_UINT16(ptr+20); + short version = READ_LE_UINT16(ptr+22); + short code = READ_LE_UINT16(ptr+24); + assert(version == 0x010A || version == 0x0114); + assert(code == ~version + 0x1234); + bool quit = 0; + char * ret_sound = 0; size = 0; + while(!quit) { + int len = READ_LE_UINT32(ptr + offset); + offset += 4; + int code = len & 0xFF; // FIXME not sure this is endian correct + len >>= 8; + switch(code) { + case 0: quit = 1; break; + case 1: { + int time_constant = ptr[offset++]; + int packing = ptr[offset++]; + len -= 2; + rate = 1000000L / (256L - time_constant); + debug(9, "VOC Data Bloc : %d, %d, %d", rate, packing, len); + if(packing == 0) { + if(size) { + ret_sound = (char*)realloc(ret_sound, size + len); + } else { + ret_sound = (char*)malloc(len); + } + memcpy(ret_sound + size, ptr + offset, len); + size += len; + } else { + warning("VOC file packing %d unsupported", packing); + } + } break; + case 6: // begin of loop + debug(3, "loops in Creative files not supported"); + break; + case 7: // end of loop + break; + default: + warning("Invalid code in VOC file : %d", code); + //~ quit = 1; + break; + } + offset += len; + } + debug(9, "VOC Data Size : %d", size); + return ret_sound; +} + +void Sound::playSound(int sound) { + byte *ptr; + + ptr = _scumm->getResourceAddress(rtSound, sound); + if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('SOUN')) { + ptr += 8; + _scumm->_vars[_scumm->VAR_MI1_TIMER] = 0; +#ifdef COMPRESSED_SOUND_FILE + if ((playMP3CDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17], + (ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0)) == -1) +#endif + _scumm->_system->play_cdrom(ptr[16], ptr[17] == 0xff ? -1 : ptr[17], + (ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0); + + _scumm->current_cd_sound = sound; + return; + } + // Support for SFX in Monkey Island 1, Mac version + // This is rather hackish right now, but works OK. SFX are not sounding + // 100% correct, though, not sure right now what is causing this. + else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('Mac1')) { + + // Read info from the header + int size = READ_UINT32_UNALIGNED(ptr+0x60); + int rate = READ_UINT32_UNALIGNED(ptr+0x64) >> 16; + + // Skip over the header (fixed size) + ptr += 0x72; + + // Allocate a sound buffer, copy the data into it, and play + char *sound = (char*)malloc(size); + memcpy(sound, ptr, size); + _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + return; + } + // Support for Putt-Putt sounds - very hackish, too 8-) + else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('DIGI')) { + // TODO - discover what data the first chunk, HSHD, contains + // it might be useful here. + ptr += 8 + READ_BE_UINT32_UNALIGNED(ptr+12); + if (READ_UINT32_UNALIGNED(ptr) != MKID('SDAT')) + return; // abort + + int size = READ_BE_UINT32_UNALIGNED(ptr+4); + int rate = 8000; // FIXME - what value here ?!? this is just a guess for now + + // Allocate a sound buffer, copy the data into it, and play + char *sound = (char*)malloc(size); + memcpy(sound, ptr+8, size); + _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + return; + } + else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('Crea')) { + int size, rate; + char * sound = read_creative_voc_file(ptr, size, rate); + if(sound != NULL) { + _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + } + return; + } + // Support for sampled sound effects in Monkey1 and Monkey2 + else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('SBL ')) { + debug(2, "Using SBL sound effect"); + + // TODO - Figuring out how the SBL chunk works. Here's an + // example: + // + // 53 42 4c 20 00 00 11 ae |SBL ....| + // 41 55 68 64 00 00 00 03 |AUhd....| + // 00 00 80 41 55 64 74 00 |...AUdt.| + // 00 11 9b 01 96 11 00 a6 |........| + // 00 7f 7f 7e 7e 7e 7e 7e |...~~~~~| + // 7e 7f 7f 80 80 7f 7f 7f |~.......| + // 7f 80 80 7f 7e 7d 7d 7e |....~}}~| + // 7e 7e 7e 7e 7e 7e 7e 7f |~~~~~~~.| + // 7f 7f 7f 80 80 80 80 80 |........| + // 80 81 80 80 7f 7f 80 85 |........| + // 8b 8b 83 78 72 6d 6f 75 |...xrmou| + // 7a 78 77 7d 83 84 83 81 |zxw}....| + // + // The length of the AUhd chunk always seems to be 3 bytes. + // Let's skip that for now. + // + // The starting offset, length and sample rate is all pure + // guesswork. The result sounds reasonable to me, but I've + // never heard the original. + + int size = READ_BE_UINT32_UNALIGNED(ptr + 4) - 27; + int rate = 8000; + + // Allocate a sound buffer, copy the data into it, and play + char *sound = (char*)malloc(size); + memcpy(sound, ptr + 33, size); + _scumm->_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + return; + } + + if ((_scumm->_features & GF_OLD256) && (ptr != NULL)) { + char *sound; + int size = READ_LE_UINT32(ptr); + +#if 0 + // FIXME - this is just some debug output for Zak256 + if (size != 30) { + char name[9]; + memcpy(name, ptr+22, 8); + name[8] = 0; + printf("Going to play Zak256 sound '%s':\n", name); + hexdump(ptr, 0x40); + } + /* + There seems to be some pattern in the Zak256 sound data. Two typical + examples are these: + + d7 10 00 00 53 4f d1 10 |....SO..| + 00 00 00 00 04 00 ff 00 |........| + 64 00 00 00 01 00 64 6f |d.....do| + 6f 72 6f 70 65 6e 40 a8 |oropen@.| + 57 14 a1 10 00 00 50 08 |W.....P.| + 00 00 00 00 00 00 b3 07 |........| + 00 00 3c 00 00 00 04 80 |..<.....| + 03 02 0a 01 8c 82 87 81 |........| + + 5b 07 00 00 53 4f 55 07 |[...SOU.| + 00 00 00 00 04 00 ff 00 |........| + 64 00 00 00 01 00 64 72 |d.....dr| + 77 6f 70 65 6e 00 53 a8 |wopen.S.| + 57 14 25 07 00 00 92 03 |W.%.....| + 00 00 00 00 00 00 88 03 |........| + 00 00 3c 00 00 00 82 82 |..<.....| + 83 84 86 88 89 8b 89 89 |........| + + As you can see, there are quite some patterns, e.g. + the 00 00 00 3c - the sound data seems to start at + offset 54. + */ +#endif + + ptr += 0x16; + if (size == 30) { + int result = 0; + int track = *ptr; + + if (track == _scumm->current_cd_sound) +#ifdef COMPRESSED_SOUND_FILE + if (pollMP3CD()) + result = 1; + else +#endif + result = _scumm->_system->poll_cdrom(); + if (result == 1) return; + +#ifdef COMPRESSED_SOUND_FILE + if (playMP3CDTrack(track, 1, 0, 0) == -1) +#endif + _scumm->_system->play_cdrom(track, 0, 0, 0); + _scumm->current_cd_sound = track; + return; + } + + size -= 0x36; + sound = (char*)malloc(size); + for (int x = 0; x < size; x++) { + int bit = *ptr++; + if (bit<0x80) sound[x] = 0x7F-bit; else sound[x] = bit; + } + + // FIXME: Something in the header signifies looping. Need to track it down and add a + // mixer flag or something. + _scumm->_mixer->play_raw(NULL, sound, size, 11000, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); + return; + } + + if (_scumm->_gameId == GID_MONKEY_VGA) + return; /* FIXME */ + + IMuse *se = _scumm->_imuse; + if (se) { + _scumm->getResourceAddress(rtSound, sound); + se->start_sound(sound); + } +} + +void Sound::processSfxQueues() { + Actor *a; + int act; + bool b, finished; + + if (_talk_sound_mode != 0) { + if (_talk_sound_mode == 2) + _talkChannel = startTalkSound(_talk_sound_a, _talk_sound_b, _talk_sound_mode); + else + startTalkSound(_talk_sound_a, _talk_sound_b, _talk_sound_mode); + _talk_sound_mode = 0; + } + + if (_scumm->_vars[_scumm->VAR_TALK_ACTOR]) { //_sfxMode == 2) { + act = _scumm->_vars[_scumm->VAR_TALK_ACTOR]; + if (_talkChannel < 0) + finished = false; + else if (_scumm->_mixer->_channels[_talkChannel] == NULL) + finished = true; + else + finished = false; + + + if (act != 0 && (uint) act < 0x80 && !_scumm->string[0].no_talk_anim) { + a = _scumm->derefActorSafe(act, "processSfxQueues"); + if (a->room == _scumm->_currentRoom && (finished || !_endOfMouthSync)) { + b = true; + if (!finished) + b = isMouthSyncOff(_curSoundPos); + if (_mouthSyncMode != b) { + _mouthSyncMode = b; + a->startAnimActor(b ? a->talkFrame2 : a->talkFrame1); + } + } + } + + if (finished && _scumm->_talkDelay == 0) { + _scumm->stopTalk(); + _sfxMode = 0; + _talkChannel = -1; + } + } + + if (_sfxMode == 1) { + if (isSfxFinished()) { + _sfxMode = 0; + } + } +} + +#ifdef COMPRESSED_SOUND_FILE +static int compar(const void *a, const void *b) +{ + return ((MP3OffsetTable *) a)->org_offset - + ((MP3OffsetTable *) b)->org_offset; +} +#endif + +int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { + int num = 0, i; + byte file_byte, file_byte_2; + int size; + + if (!_sfxFile) { + warning("startTalkSound: SFX file is not open"); + return -1; + } + + if (b > 8) { + num = (b - 8) >> 1; + } +#ifdef COMPRESSED_SOUND_FILE + if (offset_table != NULL) { + MP3OffsetTable *result = NULL, key; + + key.org_offset = offset; + result = (MP3OffsetTable *) bsearch(&key, offset_table, num_sound_effects, + sizeof(MP3OffsetTable), compar); + + if (result == NULL) { + warning("startTalkSound: did not find sound at offset %d !", offset); + return -1; + } + if (2 * num != result->num_tags) { + warning("startTalkSound: number of tags do not match (%d - %d) !", b, + result->num_tags); + num = result->num_tags; + } + offset = result->new_offset; + size = result->compressed_size; + } else +#endif + { + offset += 8; + size = -1; + } + + _scumm->fileSeek((FILE *) _sfxFile, offset, SEEK_SET); + i = 0; + while (num > 0) { + _scumm->fileRead((FILE *) _sfxFile, &file_byte, sizeof(file_byte)); + _scumm->fileRead((FILE *) _sfxFile, &file_byte_2, sizeof(file_byte_2)); + _mouthSyncTimes[i++] = file_byte | (file_byte_2 << 8); + num--; + } + _mouthSyncTimes[i] = 0xFFFF; + _sfxMode = mode; + _curSoundPos = 0; + _mouthSyncMode = true; + + return startSfxSound(_sfxFile, size); +} + +void Sound::stopTalkSound() { + if (_sfxMode == 2) { + stopSfxSound(); + _sfxMode = 0; + } +} + +bool Sound::isMouthSyncOff(uint pos) { + uint j; + bool val = true; + uint16 *ms = _mouthSyncTimes; + + _endOfMouthSync = false; + do { + val ^= 1; + j = *ms++; + if (j == 0xFFFF) { + _endOfMouthSync = true; + break; + } + } while (pos > j); + return val; +} + + +int Sound::isSoundRunning(int sound) { + IMuse *se; + int i; + + if (sound == _scumm->current_cd_sound) +#ifdef COMPRESSED_SOUND_FILE + if (pollMP3CD()) + return 1; + else +#endif + return _scumm->_system->poll_cdrom(); + + i = _soundQue2Pos; + while (i--) { + if (_soundQue2[i] == sound) + return 1; + } + + if (isSoundInQueue(sound)) + return 1; + + if (!_scumm->isResourceLoaded(rtSound, sound)) + return 0; + + se = _scumm->_imuse; + if (!se) + return 0; + return se->get_sound_status(sound); +} + +bool Sound::isSoundInQueue(int sound) { + int i = 0, j, num; + int16 table[16]; + + while (i < _soundQuePos) { + num = _soundQue[i++]; + + memset(table, 0, sizeof(table)); + + if (num > 0) { + for (j = 0; j < num; j++) + table[j] = _soundQue[i + j]; + i += num; + if (table[0] == 0x10F && table[1] == 8 && table[2] == sound) + return 1; + } + } + return 0; +} + +void Sound::stopSound(int a) { + IMuse *se; + int i; + + if (a != 0 && a == _scumm->current_cd_sound) { + _scumm->current_cd_sound = 0; +#ifdef COMPRESSED_SOUND_FILE + if (stopMP3CD() == -1) +#endif + _scumm->_system->stop_cdrom(); + } + + se = _scumm->_imuse; + if (se) + se->stop_sound(a); + + for (i = 0; i < 10; i++) + if (_soundQue2[i] == (byte)a) + _soundQue2[i] = 0; +} + +void Sound::stopAllSounds() +{ + IMuse *se = _scumm->_imuse; + + if (_scumm->current_cd_sound != 0) { + _scumm->current_cd_sound = 0; +#ifdef COMPRESSED_SOUND_FILE + if (stopMP3CD() == -1) +#endif + _scumm->_system->stop_cdrom(); + } + + if (se) { + se->stop_all_sounds(); + se->clear_queue(); + } + clearSoundQue(); + stopSfxSound(); +} + +void Sound::clearSoundQue() { + _soundQue2Pos = 0; + memset(_soundQue2, 0, sizeof(_soundQue2)); +} + +void Sound::soundKludge(int16 * list) { + int16 *ptr; + int i; + + if (list[0] == -1) { + processSoundQues(); + return; + } + _soundQue[_soundQuePos++] = 8; + + ptr = _soundQue + _soundQuePos; + _soundQuePos += 8; + + for (i = 0; i < 8; i++) + *ptr++ = list[i]; + if (_soundQuePos > 0x100) + error("Sound que buffer overflow"); +} + +void Sound::talkSound(uint32 a, uint32 b, int mode) { + _talk_sound_a = a; + _talk_sound_b = b; + _talk_sound_mode = mode; +} + +/* The sound code currently only supports General Midi. + * General Midi is used in Day Of The Tentacle. + * Roland music is also playable, but doesn't sound well. + * A mapping between roland instruments and GM instruments + * is needed. + */ + +void Sound::setupSound() { + if (_scumm->_imuse) { + _scumm->_imuse->setBase(_scumm->res.address[rtSound]); + + _sound_volume_music = scummcfg->getInt("music_volume", kDefaultMusicVolume); + _sound_volume_master = scummcfg->getInt("master_volume", kDefaultMasterVolume); + _sound_volume_sfx = scummcfg->getInt("sfx_volume", kDefaultSFXVolume); + + _scumm->_imuse->set_master_volume(_sound_volume_master); + _scumm->_imuse->set_music_volume(_sound_volume_music); + _scumm->_mixer->set_volume(_sound_volume_sfx); + _scumm->_mixer->set_music_volume(_sound_volume_music); + } + _sfxFile = openSfxFile(); +} + +void Sound::pauseSounds(bool pause) { + IMuse *se = _scumm->_imuse; + if (se) + se->pause(pause); + + _soundsPaused = pause; + _scumm->_mixer->pause(pause); +} + +int Sound::startSfxSound(void *file, int file_size) { + char ident[8]; + int block_type; + byte work[8]; + uint size = 0; + int rate, comp; + byte *data; + +#ifdef COMPRESSED_SOUND_FILE + if (file_size > 0) { + data = (byte *)calloc(file_size + MAD_BUFFER_GUARD, 1); + + if (fread(data, file_size, 1, (FILE *) file) != 1) { + /* no need to free the memory since error will shut down */ + error("startSfxSound: cannot read %d bytes", size); + return -1; + } + return playSfxSound_MP3(data, file_size); + } +#endif + if (fread(ident, 8, 1, (FILE *) file) != 1) + goto invalid; + + if (!memcmp(ident, "VTLK", 4)) { + fseek((FILE *) file, SOUND_HEADER_BIG_SIZE - 8, SEEK_CUR); + } else if (!memcmp(ident, "Creative", 8)) { + fseek((FILE *) file, SOUND_HEADER_SIZE - 8, SEEK_CUR); + } else { + invalid:; + warning("startSfxSound: invalid header"); + return -1; + } + + block_type = getc((FILE *) file); + if (block_type != 1) { + warning("startSfxSound: Expecting block_type == 1, got %d", block_type); + return -1; + } + + fread(work, 3, 1, (FILE *) file); + + size = (work[0] | (work[1] << 8) | (work[2] << 16)) - 2; + rate = getc((FILE *) file); + comp = getc((FILE *) file); + + if (comp != 0) { + warning("startSfxSound: Unsupported compression type %d", comp); + return -1; + } + + data = (byte *)malloc(size); + if (data == NULL) { + error("startSfxSound: out of memory"); + return -1; + } + + if (fread(data, size, 1, (FILE *) file) != 1) { + /* no need to free the memory since error will shut down */ + error("startSfxSound: cannot read %d bytes", size); + return -1; + } + + return playSfxSound(data, size, 1000000 / (256 - rate), true); +} + + +#ifdef COMPRESSED_SOUND_FILE +static int get_int(FILE * f) { + int ret = 0; + for (int size = 0; size < 4; size++) { + int c = fgetc(f); + if (c == EOF) { + error("Unexpected end of file !!!"); + } + ret <<= 8; + ret |= c; + } + return ret; +} +#endif + +void * Sound::openSfxFile() { + char buf[256]; + FILE *file = NULL; + + /* Try opening the file <_exe_name>.sou first, eg tentacle.sou. + * That way, you can keep .sou files for multiple games in the + * same directory */ +#ifdef COMPRESSED_SOUND_FILE + offset_table = NULL; + + sprintf(buf, "%s%s.so3", _scumm->getGameDataPath(), _scumm->_exe_name); + file = fopen(buf, "rb"); + if (!file) { + sprintf(buf, "%smonster.so3", _scumm->getGameDataPath()); + file = fopen(buf, "rb"); + } + if (file != NULL) { + /* Now load the 'offset' index in memory to be able to find the MP3 data + + The format of the .SO3 file is easy : + - number of bytes of the 'index' part + - N times the following fields (4 bytes each) : + + offset in the original sound file + + offset of the MP3 data in the .SO3 file WITHOUT taking into account + the index field and the 'size' field + + the number of 'tags' + + the size of the MP3 data + - and then N times : + + the tags + + the MP3 data + */ + int size, compressed_offset; + MP3OffsetTable *cur; + + compressed_offset = get_int(file); + offset_table = (MP3OffsetTable *) malloc(compressed_offset); + num_sound_effects = compressed_offset / 16; + + size = compressed_offset; + cur = offset_table; + while (size > 0) { + cur[0].org_offset = get_int(file); + cur[0].new_offset = get_int(file) + compressed_offset + 4; /* The + 4 is to take into accound the 'size' field */ + cur[0].num_tags = get_int(file); + cur[0].compressed_size = get_int(file); + size -= 4 * 4; + cur++; + } + return file; + } +#endif + sprintf(buf, "%s%s.sou", _scumm->getGameDataPath(), _scumm->_exe_name); + file = fopen(buf, "rb"); + if (!file) { + sprintf(buf, "%smonster.sou", _scumm->getGameDataPath()); + file = fopen(buf, "rb"); + } + return file; +} + +void Sound::stopSfxSound() { + _scumm->_mixer->stop_all(); +} + + +bool Sound::isSfxFinished() { + return !_scumm->_mixer->has_active_channel(); +} + +uint32 Sound::decode12BitsSample(byte * src, byte ** dst, uint32 size) { + uint32 s_size = (size * 4) / 3; + byte * ptr = *dst = (byte*)malloc (s_size + 4); + + uint32 r = 0, tmp, l; + for (l = 0; l < size; l += 3) { + tmp = (src[l + 1] & 0x0f) << 8; + tmp = (tmp | src[l + 0]) << 4; + tmp -= 0x8000; + ptr[r++] = (byte)((tmp >> 8) & 0xff); + ptr[r++] = (byte)(tmp & 0xff); + + tmp = (src[l + 1] & 0xf0) << 4; + tmp = (tmp | src[l + 2]) << 4; + tmp -= 0x8000; + ptr[r++] = (byte)((tmp >> 8) & 0xff); + ptr[r++] = (byte)(tmp & 0xff); + } + + return r; +} + +static void music_handler (Scumm * scumm) { + scumm->_sound->bundleMusicHandler(scumm); +} + +#define OUTPUT_SIZE 66150 // ((22050 * 2 * 2) / 4) * 3 + +void Sound::playBundleMusic(int32 song) { + char buf[256]; + + if (_numberBundleMusic == -1) { + sprintf(buf, "%s%smusic.bun", _scumm->getGameDataPath(), _scumm->_exe_name); + if (_scumm->_bundle->openMusicFile((char*)&buf) == false) + return; + _musicBundleBufFinal = (byte*)malloc(OUTPUT_SIZE); + _musicBundleBufOutput = (byte*)malloc(10 * 0x2000); + _currentSampleBundleMusic = 0; + _offsetSampleBundleMusic = 0; + _offsetBufBundleMusic = 0; + _pauseBundleMusic = false; + _numberSamplesBundleMusic = _scumm->_bundle->getNumberOfMusicSamplesByIndex(song); + _numberBundleMusic = song; + _scumm->_timer->installProcedure(&music_handler, 1000); + return; + } + if (_numberBundleMusic != song) { + _numberSamplesBundleMusic = _scumm->_bundle->getNumberOfMusicSamplesByIndex(song); + _numberBundleMusic = song; + _currentSampleBundleMusic = 0; + _offsetSampleBundleMusic = 0; + _offsetBufBundleMusic = 0; + } +} + +void Sound::pauseBundleMusic(bool state) { + _pauseBundleMusic = state; +} + +void Sound::stopBundleMusic() { + _scumm->_timer->releaseProcedure(&music_handler); + _numberBundleMusic = -1; + if (_musicBundleBufFinal) { + free(_musicBundleBufFinal); + _musicBundleBufFinal = NULL; + } + if (_musicBundleBufOutput) { + free(_musicBundleBufOutput); + _musicBundleBufOutput = NULL; + } +} + +void Sound::bundleMusicHandler(Scumm * scumm) { + byte * ptr; + int32 l, num = _numberSamplesBundleMusic, length, k; + int32 rate = 22050; + int32 tag, size = -1, header_size = 0; + + ptr = _musicBundleBufOutput; + + if (_pauseBundleMusic) + return; + + for (k = 0, l = _currentSampleBundleMusic; l < num; k++) { + length = _scumm->_bundle->decompressMusicSampleByIndex(_numberBundleMusic, l, (_musicBundleBufOutput + ((k * 0x2000) + _offsetBufBundleMusic))); + _offsetSampleBundleMusic += length; + + if (l == 0) { + tag = READ_BE_UINT32(ptr); ptr += 4; + if (tag != MKID_BE('iMUS')) { + warning("Decompression of bundle sound failed"); + _numberBundleMusic = -1; + return; + } + + ptr += 12; + while(tag != MKID_BE('DATA')) { + tag = READ_BE_UINT32(ptr); ptr += 4; + switch(tag) { + case MKID_BE('FRMT'): + size = READ_BE_UINT32(ptr); ptr += 24; + break; + case MKID_BE('TEXT'): + case MKID_BE('REGN'): + case MKID_BE('STOP'): + case MKID_BE('JUMP'): + size = READ_BE_UINT32(ptr); ptr += size + 4; + break; + case MKID_BE('DATA'): + size = READ_BE_UINT32(ptr); ptr += 4; + break; + + default: + error("Unknown sound header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); + } + } + if (size < 0) { + warning("Decompression sound failed (no size field)"); + _numberBundleMusic = -1; + return; + } + header_size = (ptr - _musicBundleBufOutput); + } + + l++; + _currentSampleBundleMusic = l; + + if (_offsetSampleBundleMusic >= OUTPUT_SIZE + header_size) { + memcpy(_musicBundleBufFinal, (_musicBundleBufOutput + header_size), OUTPUT_SIZE); + _offsetBufBundleMusic = _offsetSampleBundleMusic - OUTPUT_SIZE - header_size; + memcpy(_musicBundleBufOutput, (_musicBundleBufOutput + (OUTPUT_SIZE + header_size)), _offsetBufBundleMusic); + _offsetSampleBundleMusic = _offsetBufBundleMusic; + break; + } + } + + if (l == num) + l = 0; + + size = OUTPUT_SIZE; + ptr = _musicBundleBufFinal; + + byte * buffer = NULL; + uint32 final_size = decode12BitsSample(ptr, &buffer, size); + _scumm->_mixer->play_raw(NULL, buffer, final_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO); +} + +void Sound::playBundleSound(char *sound) { + char buf[256]; + byte * ptr; + + sprintf(buf, "%s%svoice.bun", _scumm->getGameDataPath(), _scumm->_exe_name); + _scumm->_bundle->openVoiceFile((char*)&buf); + ptr = (byte *)malloc(1000000); + if (_scumm->_bundle->decompressVoiceSampleByName(sound, ptr) == 0) { + delete ptr; + return; + } + + int rate = 22050; + int tag, size = -1; + + tag = READ_BE_UINT32(ptr); ptr+=4; + if (tag != MKID_BE('iMUS')) { + warning("Decompression of bundle sound failed"); + free(ptr); + return; + } + + ptr += 12; + while(tag != MKID_BE('DATA')) { + tag = READ_BE_UINT32(ptr); ptr+=4; + switch(tag) { + case MKID_BE('FRMT'): + size = READ_BE_UINT32(ptr); ptr+=16; + rate = READ_BE_UINT32(ptr); ptr+=8; + break; + case MKID_BE('TEXT'): + case MKID_BE('REGN'): + case MKID_BE('STOP'): + case MKID_BE('JUMP'): + size = READ_BE_UINT32(ptr); ptr+=size+4; + break; + + case MKID_BE('DATA'): + size = READ_BE_UINT32(ptr); ptr+=4; + break; + + default: + error("Unknown sound header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag); + } + } + + if (size < 0) { + warning("Decompression sound failed (no size field)"); + free(ptr); + return; + } + + byte * final = (byte *)malloc(size); + memcpy(final, ptr, size); + _scumm->_mixer->play_raw(NULL, final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); +} + +int Sound::playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned) { + if (_soundsPaused) + return -1; + byte flags = SoundMixer::FLAG_AUTOFREE; + if (isUnsigned) + flags |= SoundMixer::FLAG_UNSIGNED; + return _scumm->_mixer->play_raw(NULL, sound, size, rate, flags); +} + +int Sound::playSfxSound_MP3(void *sound, uint32 size) { +#ifdef COMPRESSED_SOUND_FILE + if (_soundsPaused) + return -1; + return _scumm->_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE); +#endif + return -1; +} + +#ifdef COMPRESSED_SOUND_FILE + +int Sound::getCachedTrack(int track) { + int i; + char track_name[1024]; + FILE* file; + int current_index; + struct mad_stream stream; + struct mad_frame frame; + unsigned char buffer[8192]; + unsigned int buflen = 0; + int count = 0; + + // See if we find the track in the cache + for (i=0; igetGameDataPath(), track); + file = fopen(track_name, "rb"); + _cached_tracks[current_index] = track; + + /* First, close the previous file */ + if (_mp3_tracks[current_index]) + fclose(_mp3_tracks[current_index]); + _mp3_tracks[current_index] = NULL; + if (!file) { + // This warning is pretty pointless. + debug(1, "Track %d not available in mp3 format", track); + return -1; + } + // Check the format and bitrate + mad_stream_init(&stream); + mad_frame_init(&frame); + + while (1) { + if (buflen < sizeof(buffer)) { + int bytes; + + bytes = fread(buffer + buflen, 1, sizeof(buffer) - buflen, file); + if (bytes <= 0) { + if (bytes == -1) { + warning("Invalid format for track %d", track); + goto error; + } + break; + } + + buflen += bytes; + } + + mad_stream_buffer(&stream, buffer, buflen); + + while (1) { + if (mad_frame_decode(&frame, &stream) == -1) { + if (!MAD_RECOVERABLE(stream.error)) + break; + + if (stream.error != MAD_ERROR_BADCRC) + continue; + } + + if (count++) + break; + } + + if (count || stream.error != MAD_ERROR_BUFLEN) + break; + + memmove(buffer, stream.next_frame, + buflen = &buffer[buflen] - stream.next_frame); + } + + if (count) + memcpy(&_mad_header[current_index], &frame.header, sizeof(mad_header)); + else { + warning("Invalid format for track %d", track); + goto error; + } + + mad_frame_finish(&frame); + mad_stream_finish(&stream); + // Get file size + fseek(file, 0, SEEK_END); + _mp3_size[current_index] = ftell(file); + _mp3_tracks[current_index] = file; + + return current_index; + + error: + mad_frame_finish(&frame); + mad_stream_finish(&stream); + fclose(file); + + return -1; +} + +int Sound::playMP3CDTrack(int track, int num_loops, int start, int delay) { + int index; + unsigned int offset; + mad_timer_t duration; + _scumm->_vars[_scumm->VAR_MI1_TIMER] = 0; + + if (_soundsPaused) + return 0; + + if ((num_loops == 0) && (start == 0)) { + return 0; + } + + index = getCachedTrack(track); + if (index < 0) + return -1; + + // Calc offset. As all bitrates are in kilobit per seconds, the division by 200 is always exact + offset = (start * (_mad_header[index].bitrate / (8 * 25))) / 3; + + // Calc delay + if (!delay) { + mad_timer_set(&duration, (_mp3_size[index] * 8) / _mad_header[index].bitrate, + (_mp3_size[index] * 8) % _mad_header[index].bitrate, _mad_header[index].bitrate); + } else { + mad_timer_set(&duration, delay / 75, delay % 75, 75); + } + + // Go + fseek(_mp3_tracks[index], offset, SEEK_SET); + + if (_mp3_cd_playing == true) + _scumm->_mixer->stop(_mp3_index); + _mp3_index = _scumm->_mixer->play_mp3_cdtrack(NULL, _mp3_tracks[index], duration); + _mp3_cd_playing = true; + return 0; +} + +int Sound::stopMP3CD() { + if (_mp3_cd_playing == true) { + _scumm->_mixer->stop(_mp3_index); + _mp3_cd_playing = false; + return 0; + } + return -1; +} + +int Sound::pollMP3CD() { + if (_mp3_cd_playing == true) + return 1; + return 0; +} + +int Sound::updateMP3CD() { + if (_mp3_cd_playing == false) + return -1; + + if (_scumm->_mixer->_channels[_mp3_index] == NULL) { + warning("Error in MP3 decoding"); + return -1; + } + + if (_scumm->_mixer->_channels[_mp3_index]->sound_finished()) + stopMP3CD(); + return 0; +} +#endif diff --git a/sound/sound.h b/sound/sound.h new file mode 100644 index 0000000000..4d2a554d6c --- /dev/null +++ b/sound/sound.h @@ -0,0 +1,136 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + */ + +#ifndef SOUND_H +#define SOUND_H + +#include "scummsys.h" +#include "sound/mixer.h" + +class Scumm; + +class Sound { + +private: + +enum { + SOUND_HEADER_SIZE = 26, + SOUND_HEADER_BIG_SIZE = 26 + 8, + +}; + + int16 _soundQuePos, _soundQue[0x100]; + byte _soundQue2Pos, _soundQue2[10]; + bool _soundsPaused2; + bool _soundVolumePreset; + + int32 _numberBundleMusic; + int32 _currentSampleBundleMusic; + int32 _numberSamplesBundleMusic; + int32 _offsetSampleBundleMusic; + int32 _offsetBufBundleMusic; + byte * _musicBundleBufFinal; + byte * _musicBundleBufOutput; + bool _pauseBundleMusic; + + + int _talkChannel; /* Mixer channel actor is talking on */ + void *_sfxFile; + uint32 _talk_sound_a, _talk_sound_b; + byte _talk_sound_mode; + bool _mouthSyncMode; + bool _endOfMouthSync; + uint16 _mouthSyncTimes[52]; + uint _curSoundPos; + + MP3OffsetTable *offset_table; // SO3 MP3 compressed audio + int num_sound_effects; // SO3 MP3 compressed audio +#ifdef COMPRESSED_SOUND_FILE + + #define CACHE_TRACKS 10 + + /* used for mp3 CD music */ + + int _cached_tracks[CACHE_TRACKS]; + struct mad_header _mad_header[CACHE_TRACKS]; + long _mp3_size[CACHE_TRACKS]; + FILE *_mp3_tracks[CACHE_TRACKS]; + int _mp3_index; + bool _mp3_cd_playing; +#endif + + Scumm * _scumm; + +public: + +#ifdef COMPRESSED_SOUND_FILE + + int _current_cache; + +#endif + + bool _soundsPaused; + int16 _sound_volume_master, _sound_volume_music, _sound_volume_sfx; + byte _sfxMode; + + Sound(Scumm *parent); + ~Sound(); + void addSoundToQueue(int sound); + void addSoundToQueue2(int sound); + void processSoundQues(); + void playSound(int sound); + void processSfxQueues(); + int startTalkSound(uint32 offset, uint32 b, int mode); + void stopTalkSound(); + bool isMouthSyncOff(uint pos); + int isSoundRunning(int sound); + bool isSoundInQueue(int sound); + void stopSound(int a); + void stopAllSounds(); + void clearSoundQue(); + void soundKludge(int16 * list); + void talkSound(uint32 a, uint32 b, int mode); + void setupSound(); + void pauseSounds(bool pause); + int startSfxSound(void *file, int file_size); + void * openSfxFile(); + void stopSfxSound(); + bool isSfxFinished(); + uint32 decode12BitsSample(byte * src, byte ** dst, uint32 size); + void playBundleMusic(int32 song); + void pauseBundleMusic(bool state); + void bundleMusicHandler(Scumm * scumm); + void stopBundleMusic(); + void playBundleSound(char *sound); + int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned); + int playSfxSound_MP3(void *sound, uint32 size); + +#ifdef COMPRESSED_SOUND_FILE + int getCachedTrack(int track); + int playMP3CDTrack(int track, int num_loops, int start, int delay); + int stopMP3CD(); + int pollMP3CD(); + int updateMP3CD(); +#endif + +}; + +#endif + diff --git a/stdafx.cpp b/stdafx.cpp deleted file mode 100644 index fd4f341c7b..0000000000 --- a/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/stdafx.h b/stdafx.h deleted file mode 100644 index a3daba0b54..0000000000 --- a/stdafx.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - * $Id$ - * - * $Log$ - * Revision 1.18 2002/07/08 13:33:10 fingolfin - * two more small QNX fixes - * - * Revision 1.17 2002/06/02 20:28:09 bbrox - * Small warning fix + double inclusion protection (can always be useful - * :) ). - * - * Revision 1.16 2002/05/05 20:04:25 fingolfin - * cleaning up the mess drigo left... - * - * Revision 1.15 2002/05/05 19:06:51 drigo - * Fixed some things for Macintosh ports - * - * Revision 1.14 2002/04/18 21:40:23 tomjoad - * Reenable MorphOS Midi driver, small updates to CD open code (only when CD audio is requested) and start options - * - * Revision 1.13 2002/04/12 21:26:34 strigeus - * new video engine (expect broken non-sdl builds), - * simon the sorcerer 1 & 2 support (non SCUMM games) - * - * Revision 1.12 2002/03/14 22:45:22 arisme - * Minor changes to compile WinCE port - * - * Revision 1.11 2002/03/09 13:48:53 drigo - * Support for MacOS classic port - * - * Revision 1.10 2002/03/08 17:05:09 mutle - * Some changes, need to be done to get the Mac Port running. For example Point is now called ScummPoint, as the name Point is already in use by Apple. - * - * Revision 1.9 2002/03/06 12:24:56 ender - * Applied cleanup and scaling patch by Rob. - * - * Revision 1.8 2001/11/20 07:13:01 vasyl - * Added ability for ports to override all includes in stdafx.h. To use this feature - * port must define symbol NONSTANDARD_PORT. Port must also provide - * port-specific portdefs.h with all includes, symbol defines and everything else - * port needs. - * - * Revision 1.7 2001/11/11 16:54:45 strigeus - * implemented some sam&max specific features, - * fixed some bugs - * - * Revision 1.6 2001/11/06 22:59:59 cmatsuoka - * Re-added changes to allow cygwin and beos cross-compilation. - * - */ - -#ifndef _STDAFX_H -#define _STDAFX_H - -#if defined(NONSTANDARD_PORT) - -#include - -#elif defined(WIN32) - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -#if !defined(_WIN32_WCE) - - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define NOGDICAPMASKS -#define OEMRESOURCE -#define NONLS -#define NOICONS -#define NOMCX -#define NOPROFILER -#define NOKANJI -#define NOSERVICE -#define NOMETAFILE -#define NOCOMM -#define NOCRYPT -#define NOIME -#define NOATOM -#define NOCTLMGR -#define NOCLIPBOARD -#define NOMEMMGR -#define NOSYSMETRICS -#define NOMENUS -#define NOOPENFILE -#define NOWH -#define NOSOUND -#define NODRAWTEXT - - -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#else - -#if defined(__MORPHOS__) -#include -#undef CMD_INVALID -#endif -#if !defined(macintosh) -#include -#include -#endif -#if !defined (__BEOS__) -#include -#endif -#if defined(__QNXNTO__) -#include /* For strcasecmp */ -#endif -#include -#include -#include -#include -#include -#include -#include - - -#endif - - -/* Semi-Platform-specific version info */ -#ifdef ALLOW_GDI -/* Assume Win32 GDI is used, then... */ -#define SCUMMVM_PLATFORM_VERSION "Win32 GDI version" - -#else -#ifdef ALLOW_X11 -/* Assume pure X11 is used, then... */ -#define SCUMMVM_PLATFORM_VERSION "X11 version" - -#else - -#ifdef MACOS_CARBON -#define SCUMMVM_PLATFORM_VERSION "Macintosh version" -#else - -#ifdef SDL_COMPILEDVERSION -#define SCUMMVM_PLATFORM_VERSION "SDL version" -//SDL_COMPILEDVERSION is a number... :( -//SDL_Linked_Version returns an SDL_Version structure... - -#endif -#endif -#endif -#endif - -#endif diff --git a/string.cpp b/string.cpp deleted file mode 100644 index 00f1cdd04d..0000000000 --- a/string.cpp +++ /dev/null @@ -1,1056 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "actor.h" - -int CharsetRenderer::getStringWidth(int arg, byte *text, int pos) -{ - byte *ptr; - int width, offs, w; - byte chr; - - width = 1; - ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; - if (_vm->_features & GF_SMALL_HEADER) - ptr -= 12; - - while ((chr = text[pos++]) != 0) { - if (chr == 0xD) - break; - if (chr == '@') - continue; - if (chr == 254) - chr = 255; - if (chr == 255) { - chr = text[pos++]; - if (chr == 3) - break; - if (chr == 8) { - if (arg == 1) - break; - while (text[pos] == ' ') - text[pos++] = '@'; - continue; - } - if (chr == 10 || chr == 21 || chr == 12 || chr == 13) { - pos += 2; - continue; - } - if (chr == 9 || chr == 1 || chr == 2) - break; - if (chr == 14) { - int set = text[pos] | (text[pos + 1] << 8); - pos += 2; - ptr = _vm->getResourceAddress(rtCharset, set) + 29; - if (_vm->_features & GF_SMALL_HEADER) - ptr -= 12; - continue; - } - } - if (_vm->_features & GF_OLD256) { - width += 8; - } else { - offs = READ_LE_UINT32(ptr + chr * 4 + 4); - if (offs) { - if (ptr[offs + 2] >= 0x80) { - w = ptr[offs + 2] - 0x100; - } else { - w = ptr[offs + 2]; - } - width += ptr[offs] + w; - } - } - } - return width; -} - -void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) -{ - int lastspace = -1; - int curw = 1; - int offs, w; - byte *ptr; - byte chr; - - ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; - if (_vm->_features & GF_SMALL_HEADER) - ptr -= 12; - - while ((chr = str[pos++]) != 0) { - if (chr == '@') - continue; - if (chr == 254) - chr = 255; - if (chr == 255) { - chr = str[pos++]; - if (chr == 3) - break; - if (chr == 8) { - if (a == 1) { - curw = 1; - } else { - while (str[pos] == ' ') - str[pos++] = '@'; - } - continue; - } - if (chr == 10 || chr == 21 || chr == 12 || chr == 13) { - pos += 2; - continue; - } - if (chr == 1) { - curw = 1; - continue; - } - if (chr == 2) - break; - if (chr == 14) { - int set = str[pos] | (str[pos + 1] << 8); - pos += 2; - ptr = _vm->getResourceAddress(rtCharset, set) + 29; - if (_vm->_features & GF_SMALL_HEADER) - ptr -= 12; - continue; - } - } - - if (chr == ' ') - lastspace = pos - 1; - if (_vm->_features & GF_OLD256) { - curw += getSpacing(chr); - } else { - offs = READ_LE_UINT32(ptr + chr * 4 + 4); - if (offs) { - if (ptr[offs + 2] >= 0x80) { - w = ptr[offs + 2] - 0x100; - } else { - w = ptr[offs + 2]; - } - curw += w + ptr[offs]; - } - } - if (lastspace == -1) - continue; - if (curw > maxwidth) { - str[lastspace] = 0xD; - curw = 1; - pos = lastspace + 1; - lastspace = -1; - } - } -} - -void Scumm::unkMessage1() -{ - byte buffer[100]; - _msgPtrToAdd = buffer; - _messagePtr = addMessageToStack(_messagePtr); - - if (buffer[0] == 0xFF && buffer[1] == 10) { - uint32 a, b; - - a = buffer[2] | (buffer[3] << 8) | (buffer[6] << 16) | (buffer[7] << 24); - b = buffer[10] | (buffer[11] << 8) | (buffer[14] << 16) | (buffer[15] << 24); -// if (_saveSound != 1) - _sound->talkSound(a, b, 1); - } -// warning("unkMessage1(\"%s\")", buffer); -} - -void Scumm::unkMessage2() -{ - byte buf[100], *tmp; - - _msgPtrToAdd = buf; - tmp = _messagePtr = addMessageToStack(_messagePtr); - - if (string[3].color == 0) - string[3].color = 4; - - warning("unkMessage2(\"%s\")", buf); - _messagePtr = tmp; -} - - -void Scumm::CHARSET_1() -{ - int s, i, t, c; - int frme; - Actor *a; - byte *buffer; - - if (!_haveMsg) - return; - - // FIXME: This Zak check fixes several hangs (Yak hang, and opening - // 'secret room while walking' hang. It doesn't do the camera check - // when the talk target isn't an actor. The question is, can we make - // this a more general case? Does it really need to be Zak specific? - if (!(_features & GF_AFTER_V7) && !(_gameId==GID_ZAK256 && _vars[VAR_TALK_ACTOR] == 0xFF)) { - if ((camera._dest.x >> 3) != (camera._cur.x >> 3) || camera._cur.x != camera._last.x) - return; - } - - a = NULL; - if (_vars[VAR_TALK_ACTOR] != 0xFF) - a = derefActorSafe(_vars[VAR_TALK_ACTOR], "CHARSET_1"); - - if (a && string[0].overhead != 0) { - if (!(_features & GF_AFTER_V6)) { - string[0].xpos = a->x - camera._cur.x + 160; - - if (_vars[VAR_V5_TALK_STRING_Y] < 0) { - s = (a->scaley * (int)_vars[VAR_V5_TALK_STRING_Y]) / 0xFF; - string[0].ypos = ((_vars[VAR_V5_TALK_STRING_Y] - s) >> 1) + s - a->elevation + a->y; - } else { - string[0].ypos = _vars[VAR_V5_TALK_STRING_Y]; - } - if (string[0].ypos < 1) - string[0].ypos = 1; - - if (string[0].xpos < 80) - string[0].xpos = 80; - if (string[0].xpos > 240) - string[0].xpos = 240; - } else { - s = a->scaley * a->new_1 / 0xFF; - string[0].ypos = ((a->new_1 - s) >> 1) + s - a->elevation + a->y; - if (string[0].ypos < 1) - string[0].ypos = 1; - - if (string[0].ypos < camera._cur.y - 100) - - string[0].ypos = camera._cur.y - 100; - - s = a->scalex * a->new_2 / 0xFF; - string[0].xpos = ((a->new_2 - s) >> 1) + s + a->x - camera._cur.x + 160; - if (string[0].xpos < 80) - string[0].xpos = 80; - if (string[0].xpos > 240) - string[0].xpos = 240; - } - } - - charset._top = string[0].ypos; - charset._left = string[0].xpos; - charset._left2 = string[0].xpos; - charset._curId = string[0].charset; - - if (a && a->charset) - charset._curId = a->charset; - - charset._center = string[0].center; - charset._right = string[0].right; - charset._color = _charsetColor; - _bkColor = 0; - - if (!(_features & GF_OLD256)) // FIXME - for (i = 0; i < 4; i++) - if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; - else - charset._colorMap[i] = _charsetData[charset._curId][i]; - - if (_keepText) { - charset._strLeft = gdi._mask_left; - charset._strRight = gdi._mask_right; - charset._strTop = gdi._mask_top; - charset._strBottom = gdi._mask_bottom; - } - - if (_talkDelay) - return; - - if (_haveMsg != 0xFF && _haveMsg != 0xFE) { - if (_sound->_sfxMode == 0) - stopTalk(); - return; - } - - if (a && !string[0].no_talk_anim) { - a->startAnimActor(a->talkFrame1); - _useTalkAnims = true; - } - - _talkDelay = _defaultTalkDelay; - - if (!_keepText) { - if (_features & GF_OLD256) { - gdi._mask_left = string[0].xpos; - gdi._mask_top = string[0].ypos; - gdi._mask_bottom = string[0].ypos + 8; - gdi._mask_right = 320; - if (string[0].ypos <= 16) // If we are cleaning the text line, clean 2 lines. - gdi._mask_bottom = 16; - } - restoreCharsetBg(); - charset._xpos2 = string[0].xpos; - charset._ypos2 = string[0].ypos; - } - - t = charset._right - string[0].xpos - 1; - if (charset._center) { - if (t > charset._xpos2) - t = charset._xpos2; - t <<= 1; - } - - buffer = charset._buffer + charset._bufPos; - charset.addLinebreaks(0, buffer, 0, t); - - _lastXstart = virtscr[0].xstart; - if (charset._center) { - charset._xpos2 -= charset.getStringWidth(0, buffer, 0) >> 1; - if (charset._xpos2 < 0) - charset._xpos2 = 0; - } - - charset._disableOffsX = charset._unk12 = !_keepText; - - do { - c = *buffer++; - if (c == 0) { - // End of text reached, set _haveMsg to 1 so that the text will be - // removed next time CHARSET_1 is called. - _haveMsg = 1; - _keepText = false; - break; - } - if (c == 13) { - newLine:; - if (_features & GF_OLD256) { - charset._ypos2 = 8; - charset._xpos2 = 0; - continue; - } else { - charset._xpos2 = string[0].xpos; - if (charset._center) { - charset._xpos2 -= charset.getStringWidth(0, buffer, 0) >> 1; - } - if (_features & GF_SMALL_HEADER) - charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[18]; - else - charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30]; - charset._disableOffsX = 1; - continue; - } - } - - if (c == 0xFE) - c = 0xFF; - - if (c != 0xFF) { - charset._left = charset._xpos2; - charset._top = charset._ypos2; - if (_features & GF_OLD256) - charset.printCharOld(c); - else if (!(_features & GF_AFTER_V6)) { -// if (!_vars[VAR_V5_CHARFLAG]) { /* FIXME */ - if (!(_haveMsg == 0xFE && _noSubtitles)) - charset.printChar(c); -// } - } else { - if (!(_haveMsg == 0xFE && _noSubtitles)) - charset.printChar(c); - } - - charset._xpos2 = charset._left; - charset._ypos2 = charset._top; - _talkDelay += _vars[VAR_CHARINC]; - continue; - } - - c = *buffer++; - if (c == 3) { - if (_haveMsg != 0xFE) - _haveMsg = 0xFF; - _keepText = false; - break; - } else if (c == 1) { - goto newLine; - } else if (c == 2) { - _haveMsg = 0; - _keepText = true; - break; - } else if (c == 9) { - frme = *buffer++; - frme |= *buffer++ << 8; - if (a) - a->startAnimActor(frme); - } else if (c == 10) { - uint32 tmpA, tmpB; - - tmpA = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24); - tmpB = buffer[8] | (buffer[9] << 8) | (buffer[12] << 16) | (buffer[13] << 24); - _sound->talkSound(tmpA, tmpB, 2); - buffer += 14; - - // Set flag that speech variant exist of this msg - if (_haveMsg == 0xFF) - _haveMsg = 0xFE; - } else if (c == 14) { - int oldy = getResourceAddress(rtCharset, charset._curId)[30]; - - charset._curId = *buffer++; - buffer += 2; - for (i = 0; i < 4; i++) - if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; - else - charset._colorMap[i] = _charsetData[charset._curId][i]; - charset._ypos2 -= getResourceAddress(rtCharset, charset._curId)[30] - oldy; - } else if (c == 12) { - int color; - color = *buffer++; - color |= *buffer++ << 8; - if (color == 0xFF) - charset._color = _charsetColor; - else - charset._color = color; - } else if (c == 13) { - buffer += 2; - } else { - warning("CHARSET_1: invalid code %d", c); - } - } while (1); - - charset._bufPos = buffer - charset._buffer; - - gdi._mask_left = charset._strLeft; - gdi._mask_right = charset._strRight; - gdi._mask_top = charset._strTop; - gdi._mask_bottom = charset._strBottom; -} - -void Scumm::description() -{ - int c; - byte *buffer; - - buffer = charset._buffer + charset._bufPos; - string[0].ypos = camera._cur.y + 88; - string[0].xpos = 160 - (charset.getStringWidth(0, buffer, 0) >> 1); - if (string[0].xpos < 0) - string[0].xpos = 0; - - charset._top = string[0].ypos; - charset._left = string[0].xpos; - charset._left2 = string[0].xpos; - charset._right = 319; - charset._xpos2 = string[0].xpos; - charset._ypos2 = string[0].ypos; - charset._disableOffsX = charset._unk12 = 1; - charset._curId = 3; - charset._center = false; - charset._color = 15; - _bkColor = 0; - _talkDelay = 1; - - restoreCharsetBg(); - - _lastXstart = virtscr[0].xstart; - - do { - c = *buffer++; - if (c == 0) { - _haveMsg = 1; - break; - } - if (c != 0xFF) { - charset._left = charset._xpos2; - charset._top = charset._ypos2; - charset.printChar(c); - charset._xpos2 = charset._left; - charset._ypos2 = charset._top; - continue; - } - - } while (1); - - gdi._mask_left = charset._strLeft; - gdi._mask_right = charset._strRight; - gdi._mask_top = charset._strTop; - gdi._mask_bottom = charset._strBottom; -} - -void Scumm::drawString(int a) -{ - byte buf[256]; - byte *charsetptr, *space; - int i; - byte byte1 = 0, chr; - uint color; - - _msgPtrToAdd = buf; - _messagePtr = addMessageToStack(_messagePtr); - - charset._left2 = charset._left = string[a].xpos; - charset._top = string[a].ypos; - charset._curId = string[a].charset; - charset._center = string[a].center; - charset._right = string[a].right; - charset._color = string[a].color; - _bkColor = 0; - charset._unk12 = 1; - charset._disableOffsX = 1; - - if (!(_features & GF_OLD256)) { - charsetptr = getResourceAddress(rtCharset, charset._curId); - assert(charsetptr); - charsetptr += 29; - if (_features & GF_SMALL_HEADER) - charsetptr -= 12; - - for (i = 0; i < 4; i++) - if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; - else - charset._colorMap[i] = _charsetData[charset._curId][i]; - - byte1 = charsetptr[1]; - } - - _msgPtrToAdd = buf; - - /* trim from the right */ - space = NULL; - while (*_msgPtrToAdd) { - if (*_msgPtrToAdd == ' ') { - if (!space) - space = _msgPtrToAdd; - } else { - space = NULL; - } - _msgPtrToAdd++; - } - if (space) - *space = '\0'; - if (charset._center) { - charset._left -= charset.getStringWidth(a, buf, 0) >> 1; - } - - charset._ignoreCharsetMask = 1; - - if (!buf[0]) { - buf[0] = ' '; - buf[1] = 0; - } - - for (i = 0; (chr = buf[i++]) != 0;) { - if (chr == 254) - chr = 255; - if (chr == 255) { - chr = buf[i++]; - switch (chr) { - case 9: - case 10: - case 13: - case 14: - i += 2; - break; - case 1: - case 8: - if (charset._center) { - charset._left = charset._left2 - charset.getStringWidth(a, buf, i); - } else { - charset._left = charset._left2; - } - charset._top += byte1; - break; - case 12: - color = buf[i] + (buf[i + 1] << 8); - i += 2; - if (color == 0xFF) - charset._color = string[a].color; - else - charset._color = color; - break; - } - } else { - if (a == 1 && (_features & GF_AFTER_V6)) - - if (string[a].no_talk_anim == 0) - charset._blitAlso = true; - if (_features & GF_OLD256) - charset.printCharOld(chr); - else - charset.printChar(chr); - charset._blitAlso = false; - } - } - - charset._ignoreCharsetMask = 0; - - if (a == 0) { - charset._xpos2 = charset._left; - charset._ypos2 = charset._top; - } -} - -byte *Scumm::addMessageToStack(byte *msg) -{ - int num, numorg; - byte *ptr, chr; - - numorg = num = _numInMsgStack; - ptr = getResourceAddress(rtTemp, 6); - - if (ptr == NULL) - error("Message stack not allocated"); - - if (msg == NULL) { - warning("Bad message in addMessageToStack, ignoring"); - return NULL; - } - - while ((chr = *msg++) != 0) { - if (num > 500) - error("Message stack overflow"); - - ptr[num++] = chr; - - if (chr == 255) { - ptr[num++] = chr = *msg++; - - if (chr != 1 && chr != 2 && chr != 3 && chr != 8) { - ptr[num++] = chr = *msg++; - ptr[num++] = chr = *msg++; - } - } - } - ptr[num++] = 0; - - _numInMsgStack = num; - num = numorg; - - while (1) { - ptr = getResourceAddress(rtTemp, 6); - chr = ptr[num++]; - if (chr == 0) - break; - if (chr == 0xFF) { - chr = ptr[num++]; - switch (chr) { - case 4: - unkAddMsgToStack2(READ_LE_UINT16(ptr + num)); - num += 2; - break; - case 5: - unkAddMsgToStack3(READ_LE_UINT16(ptr + num)); - num += 2; - break; - case 6: - unkAddMsgToStack4(READ_LE_UINT16(ptr + num)); - num += 2; - break; - case 7: - unkAddMsgToStack5(READ_LE_UINT16(ptr + num)); - num += 2; - break; - case 9: -//#if defined(DOTT) - case 10: - case 12: - case 13: - case 14: -//#endif - *_msgPtrToAdd++ = 0xFF; - *_msgPtrToAdd++ = chr; - *_msgPtrToAdd++ = ptr[num++]; - *_msgPtrToAdd++ = ptr[num++]; - break; - default: - *_msgPtrToAdd++ = 0xFF; - *_msgPtrToAdd++ = chr; - } - } else { - if (chr != '@') { - *_msgPtrToAdd++ = chr; - } - } - } - *_msgPtrToAdd = 0; - _numInMsgStack = numorg; - - return msg; -} - -void Scumm::unkAddMsgToStack2(int var) -{ - int num, max; - byte flag; - - num = readVar(var); - if (num < 0) { - *_msgPtrToAdd++ = '-'; - num = -num; - } - - flag = 0; - max = 10000; - do { - if (num >= max || flag) { - *_msgPtrToAdd++ = num / max + '0'; - num -= (num / max) * max; - flag = 1; - } - max /= 10; - if (max == 1) - flag = 1; - } while (max); -} - -void Scumm::unkAddMsgToStack3(int var) -{ - int num, i; - - num = readVar(var); - if (num) { - for (i = 1; i < _maxVerbs; i++) { - if (num == _verbs[i].verbid && !_verbs[i].type && !_verbs[i].saveid) { - addMessageToStack(getResourceAddress(rtVerb, i)); - break; - } - } - } else { - addMessageToStack((byte *)""); - } -} - -void Scumm::unkAddMsgToStack4(int var) -{ - int num; - - num = readVar(var); - if (num) { - addMessageToStack(getObjOrActorName(num)); - } else { - addMessageToStack((byte *)""); - } -} - -void Scumm::unkAddMsgToStack5(int var) -{ - byte *ptr; - - if (_features & GF_AFTER_V6 || _gameId == GID_INDY3_256) - var = readVar(var); - - if (var) { - ptr = getStringAddress(var); - if (ptr) { - addMessageToStack(ptr); - return; - } - } - addMessageToStack((byte *)""); -} - -void Scumm::initCharset(int charsetno) -{ - int i; - - if (_features & GF_OLD256) - charsetno = !charsetno; - - if (_features & GF_SMALL_HEADER) - loadCharset(charsetno); - else if (!getResourceAddress(rtCharset, charsetno)) - loadCharset(charsetno); - - string[0].t_charset = charsetno; - string[1].t_charset = charsetno; - - for (i = 0; i < 0x10; i++) - if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; - else - charset._colorMap[i] = _charsetData[charset._curId][i]; -} - -void CharsetRenderer::printCharOld(int chr) -{ // Loom3 / Zak256 - VirtScreen *vs; - byte *char_ptr, *dest_ptr; - unsigned int buffer = 0, mask = 0, x = 0, y = 0; - unsigned char color; - - _vm->checkRange(_vm->_maxCharsets - 1, 0, _curId, "Printing with bad charset %d"); - - if ((vs = _vm->findVirtScreen(_top)) == NULL) - return; - - if (chr == '@') - return; - - if (_unk12) { - _strLeft = _left; - _strTop = _top; - _strRight = _left; - _strBottom = _top; - _unk12 = 0; - } - char_ptr = _vm->getResourceAddress(rtCharset, _curId) + 224 + (chr + 1) * 8; - dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * 320 + _left; - _vm->updateDirtyRect(vs->number, _left, _left + 8, _top - vs->topline, _top - vs->topline + 8, 0); - - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) { - if ((mask >>= 1) == 0) { - buffer = *char_ptr++; - mask = 0x80; - } - color = ((buffer & mask) != 0); - if (color) - *(dest_ptr + y * 320 + x) = _color; - } - } - - _left += getSpacing(chr); - - if (_left > _strRight) - _strRight = _left; - - if (_top + 8 > _strBottom) - _strBottom = _top + 8; - -} - - -void CharsetRenderer::printChar(int chr) -{ - int d, right; - VirtScreen *vs; - - _vm->checkRange(_vm->_maxCharsets - 1, 1, _curId, "Printing with bad charset %d"); - if ((vs = _vm->findVirtScreen(_top)) == NULL) - return; - - if (chr == '@') - return; - - _ptr = _vm->getResourceAddress(rtCharset, _curId) + 29; - if (_vm->_features & GF_SMALL_HEADER) - _ptr -= 12; - - _bpp = _unk2 = *_ptr; - _invNumBits = 8 - _bpp; - _bitMask = 0xFF << _invNumBits; - _colorMap[1] = _color; - - _charOffs = READ_LE_UINT32(_ptr + chr * 4 + 4); - - if (!_charOffs) - return; - - assert(_charOffs < 0x10000); - - _charPtr = _ptr + _charOffs; - - _width = _charPtr[0]; - _height = _charPtr[1]; - if (_unk12) { - _strLeft = 0; - _strTop = 0; - _strRight = 0; - _strBottom = 0; - } - - if (_disableOffsX) { - _offsX = 0; - } else { - d = _charPtr[2]; - if (d >= 0x80) - d -= 0x100; - _offsX = d; - } - - d = _charPtr[3]; - if (d >= 0x80) - d -= 0x100; - _offsY = d; - - _top += _offsY; - _left += _offsX; - - right = _left + _width; - - if (right > _right + 1 || _left < 0) { - _left = right; - _top -= _offsY; - return; - } - - _disableOffsX = 0; - - if (_unk12) { - _strLeft = _left; - _strTop = _top; - _strRight = _left; - _strBottom = _top; - _unk12 = 0; - } - - if (_left < _strLeft) - _strLeft = _left; - - if (_top < _strTop) - _strTop = _top; - - _drawTop = _top - vs->topline; - if (_drawTop < 0) - _drawTop = 0; - - _bottom = _drawTop + _height + _offsY; - - _vm->updateDirtyRect(vs->number, _left, right, _drawTop, _bottom, 0); - -#if defined(OLD) - if (vs->number == 0) - _hasMask = true; -#else - if (vs->number != 0) - _blitAlso = false; - if (vs->number == 0 && _blitAlso == 0) - _hasMask = true; -#endif - - _dest_ptr = _backbuff_ptr = vs->screenPtr + vs->xstart + _drawTop * 320 + _left; - -#if !defined(OLD) - if (_blitAlso) { -#else - if (1) { -#endif - _dest_ptr = _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number + 5) - + vs->xstart + _drawTop * 320 + _left; - } - - _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) - + _drawTop * 40 + _left / 8 + _vm->_screenStartStrip; - - _revBitMask = revBitMask[_left & 7]; - - _virtScreenHeight = vs->height; - _charPtr += 4; - - drawBits(); - -#if !defined(OLD) - if (_blitAlso) - blit(_backbuff_ptr, _bgbak_ptr, _width, _height); -#endif - - _left += _width; - if (_left > _strRight) - _strRight = _left; - - if (_top + _height > _strBottom) - _strBottom = _top + _height; - - _top -= _offsY; -} - -void CharsetRenderer::drawBits() -{ - bool usemask; - byte *dst, *mask, maskmask; - int y, x; - int maskpos; - int color; - byte numbits, bits; - - usemask = (_vm->_curVirtScreen->number == 0 && _ignoreCharsetMask == 0); - - bits = *_charPtr++; - numbits = 8; - - dst = _dest_ptr; - mask = _mask_ptr; - y = 0; - - for (y = 0; y < _height && y + _drawTop < _virtScreenHeight;) { - maskmask = _revBitMask; - maskpos = 0; - - for (x = 0; x < _width; x++) { - color = (bits & _bitMask) >> _invNumBits; - if (color) { - if (usemask) { - mask[maskpos] |= maskmask; - } - *dst = _colorMap[color]; - } - dst++; - bits <<= _bpp; - if ((numbits -= _bpp) == 0) { - bits = *_charPtr++; - numbits = 8; - } - if ((maskmask >>= 1) == 0) { - maskmask = 0x80; - maskpos++; - } - } - dst = (_dest_ptr += 320); - mask += 40; - y++; - } -} - -int CharsetRenderer::getSpacing(char chr) -{ - int space; - - if (_curId == 1) { // do spacing for variable width old-style font - switch (chr) { - case '.': - space = 1; - break; - case 'i': - case '\'': - case 'I': - case '!': - space = 2; - break; - case 'l': - space = 3; - break; - case ' ': - space = 4; - break; - case 'W': - case 'w': - case 'N': - case 'M': - case 'm': - space = 8; - break; - default: - space = 6; - } - } else - space = 7; - return space; -} diff --git a/sys.cpp b/sys.cpp deleted file mode 100644 index ce797ffd26..0000000000 --- a/sys.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" - -void *Scumm::fileOpen(const char *filename, int mode) -{ - clearFileReadFailed(_fileHandle); - - if (mode == 1) - return fopen(filename, "rb"); - - error("This should not happen!"); - return NULL; -} - -void Scumm::fileClose(void *file) -{ - if (file) - fclose((FILE *)file); -} - -bool Scumm::fileReadFailed(void *file) -{ - return _fileReadFailed != 0; -} - -void Scumm::clearFileReadFailed(void *file) -{ - _fileReadFailed = false; -} - -bool Scumm::fileEof(void *file) -{ - return feof((FILE *)file) != 0; -} - -uint32 Scumm::filePos(void *handle) -{ - return ftell((FILE *)handle); -} - -void Scumm::fileSeek(void *file, long offs, int whence) -{ - if (fseek((FILE *)file, offs, whence) != 0) - clearerr((FILE *)file); -} - -void Scumm::fileRead(void *file, void *ptr, uint32 size) -{ - byte *ptr2 = (byte *)ptr, *src; - - if (size == 0) - return; - - if ((uint32)fread(ptr2, size, 1, (FILE *)file) != 1) { - clearerr((FILE *)file); - _fileReadFailed = true; - } - - do { - *ptr2++ ^= _encbyte; - } while (--size); -} - -int Scumm::fileReadByte() -{ - byte b; - byte *src; - - if (fread(&b, 1, 1, (FILE *)_fileHandle) != 1) { - clearerr((FILE *)_fileHandle); - _fileReadFailed = true; - } - return b ^ _encbyte; -} - -uint Scumm::fileReadWordLE() -{ - uint a = fileReadByte(); - uint b = fileReadByte(); - return a | (b << 8); -} - -uint32 Scumm::fileReadDwordLE() -{ - uint a = fileReadWordLE(); - uint b = fileReadWordLE(); - return (b << 16) | a; -} - -uint Scumm::fileReadWordBE() -{ - uint b = fileReadByte(); - uint a = fileReadByte(); - return a | (b << 8); -} - -uint32 Scumm::fileReadDwordBE() -{ - uint b = fileReadWordBE(); - uint a = fileReadWordBE(); - return (b << 16) | a; -} - -/* Overloaded versions */ -int Scumm::fileReadByte(void *handle) -{ - byte b; - - if (fread(&b, 1, 1, (FILE *)handle) != 1) { - clearerr((FILE *)handle); - _fileReadFailed = true; - } - return b ^ _encbyte; -} - -uint Scumm::fileReadWordLE(void *handle) -{ - uint a = fileReadByte(handle); - uint b = fileReadByte(handle); - return a | (b << 8); -} - -uint32 Scumm::fileReadDwordLE(void *handle) -{ - uint a = fileReadWordLE(handle); - uint b = fileReadWordLE(handle); - return (b << 16) | a; -} - -uint Scumm::fileReadWordBE(void *handle) -{ - uint b = fileReadByte(handle); - uint a = fileReadByte(handle); - return a | (b << 8); -} - -uint32 Scumm::fileReadDwordBE(void *handle) -{ - uint b = fileReadWordBE(handle); - uint a = fileReadWordBE(handle); - return (b << 16) | a; -} - -bool Scumm::checkFixedDisk() -{ - return true; -} - - -#ifdef NEED_STRDUP -char *strdup(const char *s) -{ - if (s) { - int len = strlen(s) + 1; - char *d = (char *)malloc(len); - if (d) - memcpy(d, s, len); - return d; - } - return NULL; -} -#endif /* NEED_STRDUP */ - - -void *operator new(size_t size) -{ - return calloc(size, 1); -} - -void operator delete(void *ptr) -{ - free(ptr); -} diff --git a/system.h b/system.h deleted file mode 100644 index b8255eff48..0000000000 --- a/system.h +++ /dev/null @@ -1,199 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef _SYSTEM_H -#define _SYSTEM_H - -/* Interface to what's below ScummVM */ - -class OSystem { -public: - typedef int ThreadProc(void *param); - typedef void SoundProc(void *param, byte *buf, int len); - - struct Event { - int event_code; - struct { - uint16 ascii; - byte flags; - int keycode; - } kbd; - struct { - int x,y; - } mouse; - }; - - enum { - EVENT_KEYDOWN = 1, - EVENT_KEYUP = 2, - EVENT_MOUSEMOVE = 3, - EVENT_LBUTTONDOWN = 4, - EVENT_LBUTTONUP = 5, - EVENT_RBUTTONDOWN = 6, - EVENT_RBUTTONUP = 7, - }; - - enum { - KBD_CTRL = 1, - KBD_ALT = 2, - KBD_SHIFT = 4, - }; - - enum { - PROP_TOGGLE_FULLSCREEN = 1, - PROP_SET_WINDOW_CAPTION = 2, - PROP_OPEN_CD = 3, - PROP_SET_GFX_MODE = 4, - PROP_SHOW_DEFAULT_CURSOR = 5, - PROP_GET_SAMPLE_RATE = 6, - PROP_GET_FULLSCREEN = 7 - }; - union Property { - char *caption; - int cd_num; - int gfx_mode; - bool show_cursor; - }; - - enum { - SOUND_8BIT = 0, - SOUND_16BIT = 1, - }; - - // Set colors of the palette - virtual void set_palette(const byte *colors, uint start, uint num) = 0; - - // Set the size of the video bitmap. - // Typically, 320x200 - virtual void init_size(uint w, uint h) = 0; - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) = 0; - - // Update the dirty areas of the screen - virtual void update_screen() = 0; - - // Either show or hide the mouse cursor - virtual bool show_mouse(bool visible) = 0; - - // Set the position of the mouse cursor - virtual void set_mouse_pos(int x, int y) = 0; - - // Set the bitmap that's used when drawing the cursor. - virtual void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) = 0; - - // Shaking is used in SCUMM. Set current shake position. - virtual void set_shake_pos(int shake_pos) = 0; - - // Get the number of milliseconds since the program was started. - virtual uint32 get_msecs() = 0; - - // Delay for a specified amount of milliseconds - virtual void delay_msecs(uint msecs) = 0; - - // Create a thread - virtual void *create_thread(ThreadProc *proc, void *param) = 0; - - // Get the next event. - // Returns true if an event was retrieved. - virtual bool poll_event(Event *event) = 0; - - // Set the function to be invoked whenever samples need to be generated - // Format is the sample type format. - // Only 16-bit signed mode is needed for simon & scumm - virtual bool set_sound_proc(void *param, SoundProc *proc, byte format) = 0; - - // Get or set a property - virtual uint32 property(int param, Property *value) = 0; - - // Poll cdrom status - // Returns true if cd audio is playing - virtual bool poll_cdrom() = 0; - - // Play cdrom audio track - virtual void play_cdrom(int track, int num_loops, int start_frame, int end_frame) = 0; - - // Stop cdrom audio track - virtual void stop_cdrom() = 0; - - // Update cdrom audio status - virtual void update_cdrom() = 0; - - // Add a new callback timer - virtual void set_timer(int timer, int (*callback)(int)) = 0; - - // Mutex handling - virtual void *create_mutex(void) = 0; - virtual void lock_mutex(void *mutex) = 0; - virtual void unlock_mutex(void *mutex) = 0; - virtual void delete_mutex(void *mutex) = 0; - - // Quit - virtual void quit() = 0; -}; - - -/* Factory functions. This means we don't have to include the - * OSystem_SDL header file. (which in turn would require the SDL headers) - */ - -/* OSystem_SDL */ -extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen); -extern OSystem *OSystem_NULL_create(); -extern OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen); -extern OSystem *OSystem_Dreamcast_create(); -extern OSystem *OSystem_WINCE3_create(); -extern OSystem *OSystem_X11_create(); -extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen); - -enum { - GFX_NORMAL = 0, - GFX_DOUBLESIZE = 1, - GFX_TRIPLESIZE = 2, - GFX_2XSAI = 3, - GFX_SUPER2XSAI = 4, - GFX_SUPEREAGLE = 5, - GFX_ADVMAME2X = 6 -}; - - -/* Graphics drivers */ -enum { - GD_NULL = 0, - GD_SDL, - GD_X, - GD_MORPHOS, - GD_WINCE, - GD_MAC, - GD_DC -}; - -enum { -#ifdef _WIN32_WCE - SAMPLES_PER_SEC = 11025 -#else - SAMPLES_PER_SEC = 22050 -#endif -}; - -#endif diff --git a/timer.cpp b/timer.cpp deleted file mode 100644 index 2a3fc74024..0000000000 --- a/timer.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "scumm.h" -#include "scummsys.h" -#include "timer.h" - -static Scumm * scumm; - -Timer::Timer(Scumm * parent) { - _initialized = false; - _timerRunning = false; - scumm = _scumm = parent; -} - -Timer::~Timer() { - release (); -} - -static int timer_handler (int t) -{ - scumm->_timer->handler (&t); - return t; -} - -int Timer::handler(int * t) { - uint32 interval, l; - - if (_timerRunning) { - _lastTime = _thisTime; - _thisTime = _osystem->get_msecs(); - interval = _thisTime - _lastTime; - - for (l = 0; l < MAX_TIMERS; l++) { - if ((_timerSlots[l].procedure) && (_timerSlots[l].interval > 0)) { - _timerSlots[l].counter -= interval; - if (_timerSlots[l].counter <= 0) { - _timerSlots[l].counter += _timerSlots[l].interval; - _timerSlots[l].procedure (_scumm); - } - } - } - } - - return *t; -} - -bool Timer::init() { - int32 l; - - _osystem = _scumm->_system; - if (_osystem == NULL) { - printf("Timer: OSystem not initialized !\n"); - return false; - } - - if (_initialized == true) - return true; - - for (l = 0; l < MAX_TIMERS; l++) { - _timerSlots[l].procedure = NULL; - _timerSlots[l].interval = 0; - _timerSlots[l].counter = 0; - } - - _thisTime = _osystem->get_msecs(); - _osystem->set_timer (10, &timer_handler); - - _timerRunning = true; - _initialized = true; - return true; -} - -void Timer::release() { - int32 l; - - if (_initialized == false) - return; - - _timerRunning = false; - _osystem->set_timer (0, NULL); - _initialized = false; - - for (l = 0; l < MAX_TIMERS; l++) { - _timerSlots[l].procedure = NULL; - _timerSlots[l].interval = 0; - _timerSlots[l].counter = 0; - } -} - -bool Timer::installProcedure (TimerProc procedure, int32 interval) { - int32 l; - bool found = false; - - if (_initialized == false) { - printf ("Timer: is not initialized !"); - return false; - } - - _timerRunning = false; - for (l = 0; l < MAX_TIMERS; l++) { - if (!_timerSlots[l].procedure) { - _timerSlots[l].procedure = procedure; - _timerSlots[l].interval = interval; - _timerSlots[l].counter = interval; - found = true; - break; - } - } - - _timerRunning = true; - if (!found) { - printf ("Can't find free slot !"); - return false; - } - - return true; -} - -void Timer::releaseProcedure (TimerProc procedure) { - int32 l; - - if (_initialized == false) { - printf ("Timer: is not initialized !"); - return; - } - - _timerRunning = false; - for (l = 0; l < MAX_TIMERS; l++) { - if (_timerSlots[l].procedure == procedure) { - _timerSlots[l].procedure = 0; - _timerSlots[l].interval = 0; - _timerSlots[l].counter = 0; - } - } - _timerRunning = true; -} - - diff --git a/timer.h b/timer.h deleted file mode 100644 index a4f4c7080d..0000000000 --- a/timer.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef TIMER_H -#define TIMER_H - -#include "scummsys.h" - -#define MAX_TIMERS 5 - -typedef void (*TimerProc)(Scumm *); - -#ifdef __MORPHOS__ -#include "morphos/morphos_timer.h" -#else - -class OSystem; - -class Timer { - -private: - OSystem *_osystem; - Scumm *_scumm; - bool _initialized; - bool _timerRunning; - void *_timerHandler; - int32 _thisTime; - int32 _lastTime; - - struct TimerSlots { - TimerProc procedure; - int32 interval; - int32 counter; - } _timerSlots[MAX_TIMERS]; - -public: - Timer(Scumm *system); - ~Timer(); - - int handler(int *t); - bool init(); - void release(); - bool installProcedure(TimerProc procedure, int32 interval); - void releaseProcedure(TimerProc procedure); -}; - -#endif - -#endif diff --git a/util.cpp b/util.cpp deleted file mode 100644 index 4a5d50e369..0000000000 --- a/util.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#include "stdafx.h" -#include "util.h" - -// 8-bit alpha blending routines -int BlendCache[256][256]; - -int RGBMatch(byte *palette, int r, int g, int b) -{ - int i, bestidx = 0, besterr = 0xFFFFFF; - int error = 0; - - for (i = 0;i < 256;i++) { - byte *pal = palette + (i * 3); - int r_diff = r - (int)*pal++; - int g_diff = g - (int)*pal++; - int b_diff = b - (int)*pal++; - r_diff *= r_diff; g_diff *= g_diff; b_diff *= b_diff; - - error = r_diff + g_diff + b_diff; - if (error < besterr) { - besterr = error; - bestidx = i; - } - } - return bestidx; -} - -int Blend(int src, int dst, byte *palette) -{ - int r, g, b; - int alpha = 128; // Level of transparency [0-256] - byte *srcpal = palette + (dst * 3); - byte *dstpal = palette + (src * 3); - - if (BlendCache[dst][src] > -1) - return BlendCache[dst][src]; - - r = (*srcpal++ * alpha); - r += (*dstpal++ * (256-alpha)); - r /= 256; - - g = (*srcpal++ * alpha); - g += (*dstpal++ * (256-alpha)); - g /= 256; - - b = (*srcpal++ * alpha); - b += (*dstpal++ * (256-alpha)); - b /= 256; - - return (BlendCache[dst][src] = RGBMatch(palette, r , g , b )); -} - -void ClearBlendCache(byte *palette, int weight) -{ - for (int i = 0; i < 256; i++) - for (int j = 0 ; j < 256 ; j++) -// BlendCache[i][j] = i; // No alphablending -// BlendCache[i][j] = j; // 100% translucent - BlendCache[i][j] = -1; // Enable alphablending -} - - -#pragma mark - - -/* - * Print hexdump of the data passed in, 8 bytes a row - */ -void hexdump(const byte * data, int len) -{ - int i; - byte c; - while (len >= 8) { - for (i = 0; i < 8; i++) - printf("%02x ", data[i]); - printf(" |"); - for (i = 0; i < 8; i++) { - c = data[i]; - if (c < 32 || c > 127) - c = '.'; - printf("%c", c); - } - printf("|\n"); - data += 8; - len -= 8; - } - - if (len <= 0) - return; - - for (i = 0; i < len; i++) - printf("%02x ", data[i]); - for (; i < 8; i++) - printf(" "); - printf(" |"); - for (i = 0; i < len; i++) { - c = data[i]; - if (c < 32 || c > 127) - c = '.'; - printf("%c", c); - } - for (; i < 8; i++) - printf(" "); - printf("|\n"); -} - - -#pragma mark - - - -namespace ScummVM { - -String::String(const char *str) -{ - _refCount = new int(1); - _capacity = _len = strlen(str); - _str = (char *)calloc(1, _capacity+1); - memcpy(_str, str, _len+1); -} - -String::String(const String &str) -{ - ++(*str._refCount); - - _refCount = str._refCount; - _capacity = str._capacity; - _len = str._capacity; - _str = str._str; -} - -String::~String() -{ - decRefCount(); -} - -void String::decRefCount() -{ - --(*_refCount); - if (*_refCount <= 0) { - delete _refCount; - if (_str) - free(_str); - } -} - -String& String::operator =(const char* str) -{ - int len = strlen(str); - if (len > 0) { - ensureCapacity(len, false); - - _len = len; - memcpy(_str, str, _len + 1); - } else if (_len > 0) { - decRefCount(); - - _refCount = new int(1); - _capacity = 0; - _len = 0; - _str = 0; - } - return *this; -} - -String& String::operator =(const String& str) -{ - ++(*str._refCount); - - decRefCount(); - - _refCount = str._refCount; - _capacity = str._capacity; - _len = str._len; - _str = str._str; - - return *this; -} - -String& String::operator +=(const char* str) -{ - int len = strlen(str); - if (len > 0) { - ensureCapacity(_len + len, true); - - memcpy(_str + _len, str, len + 1); - _len += len; - } - return *this; -} - -String& String::operator +=(const String& str) -{ - int len = str._len; - if (len > 0) { - ensureCapacity(_len + len, true); - - memcpy(_str + _len, str._str, len + 1); - _len += len; - } - return *this; -} - -String& String::operator +=(char c) -{ - ensureCapacity(_len + 1, true); - - _str[_len++] = c; - _str[_len] = 0; - - return *this; -} - -bool String::operator ==(const String& x) -{ - return (_len == x._len) && ((_len == 0) || (0 == strcmp(_str, x._str))); -} - -bool String::operator ==(const char* x) -{ - if (_str == 0) - return (x == 0) || (*x == 0); - if (x == 0) - return (_len == 0); - return (0 != strcmp(_str, x)); -} - -bool String::operator !=(const String& x) -{ - return (_len != x._len) || ((_len != 0) && (0 != strcmp(_str, x._str))); -} - -bool String::operator !=(const char* x) -{ - if (_str == 0) - return (x != 0) && (*x != 0); - if (x == 0) - return (_len != 0); - return (0 == strcmp(_str, x)); -} - - -void String::deleteLastChar() { - if (_len > 0) { - ensureCapacity(_len - 1, true); - _str[--_len] = 0; - } -} - -void String::clear() -{ - if (_capacity) { - decRefCount(); - - _refCount = new int(1); - _capacity = 0; - _len = 0; - _str = 0; - } -} - -void String::ensureCapacity(int new_len, bool keep_old) -{ - // If there is not enough space, or if we are not the only owner - // of the current data, then we have to reallocate it. - if (new_len <= _capacity && *_refCount == 1) - return; - - int newCapacity = (new_len <= _capacity) ? _capacity : new_len + 32; - char *newStr = (char *)calloc(1, newCapacity+1); - - if (keep_old && _str) - memcpy(newStr, _str, _len + 1); - else - _len = 0; - - decRefCount(); - - _refCount = new int(1); - _capacity = newCapacity; - _str = newStr; -} - -bool operator == (const char* y, const String& x) -{ - return x == y; -} - -bool operator != (const char* y, const String& x) -{ - return x != y; -} - -}; // End of namespace ScummVM diff --git a/util.h b/util.h deleted file mode 100644 index 0f74ede00f..0000000000 --- a/util.h +++ /dev/null @@ -1,183 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - */ - -#ifndef UTIL_H -#define UTIL_H - -#include "scummsys.h" - -int RGBMatch(byte *palette, int r, int g, int b); -int Blend(int src, int dst, byte *palette); -void ClearBlendCache(byte *palette, int weight); - -/* - * Print hexdump of the data passed in, 8 bytes a row - */ -void hexdump(const byte * data, int len); - - -namespace ScummVM { - -template -class List { -protected: - int _capacity; - int _size; - T *_data; - -public: - List() : _capacity(0), _size(0), _data(0) {} - List(const List& list) : _capacity(0), _size(0), _data(0) - { - _size = list._size; - _capacity = _size + 32; - _data = new T[_capacity]; - for (int i = 0; i < _size; i++) - _data[i] = list._data[i]; - } - - ~List() - { - if (_data) - delete [] _data; - } - - void push_back(const T& str) - { - ensureCapacity(_size + 1); - _data[_size++] = str; - } - - // TODO: insert, remove, ... - - T& operator [](int idx) - { - assert(idx >= 0 && idx < _size); - return _data[idx]; - } - - const T& operator [](int idx) const - { - assert(idx >= 0 && idx < _size); - return _data[idx]; - } - - List& operator =(const List& list) - { - if (_data) - delete [] _data; - _size = list._size; - _capacity = _size + 32; - _data = new T[_capacity]; - for (int i = 0; i < _size; i++) - _data[i] = list._data[i]; - - return *this; - } - - int size() const { return _size; } - - void clear() - { - if (_data) { - delete [] _data; - _data = 0; - } - _size = 0; - _capacity = 0; - } - - bool isEmpty() const { return (_size == 0); } - -protected: - void ensureCapacity(int new_len) - { - if (new_len <= _capacity) - return; - - T *old_data = _data; - _capacity = new_len + 32; - _data = new T[_capacity]; - - if (old_data) { - // Copy old data - for (int i = 0; i < _size; i++) - _data[i] = old_data[i]; - delete [] old_data; - } - } -}; - - -class String { -protected: - int *_refCount; - int _capacity; - int _len; - char *_str; -public: - String() : _capacity(0), _len(0), _str(0) { _refCount = new int(1); } - String(const char *str); - String(const String &str); - ~String(); - - String& operator =(const char* str); - String& operator =(const String& str); - String& operator +=(const char* str); - String& operator +=(const String& str); - String& operator +=(char c); - - bool operator ==(const String& x); - bool operator ==(const char* x); - bool operator !=(const String& x); - bool operator !=(const char* x); - -// operator char *() { return _str; } - operator const char *() const { return _str; } - const char *c_str() const { return _str; } - int size() const { return _len; } - - void deleteLastChar(); - void clear(); - - bool isEmpty() const { return (_len == 0); } - -protected: - void ensureCapacity(int new_len, bool keep_old); - void decRefCount(); -}; - -// Some useful additional comparision operators for Strings -bool operator == (const char* x, const String& y); -bool operator != (const char* x, const String& y); - -class StringList : public List { -public: - void push_back(const char* str) - { - ensureCapacity(_size + 1); - _data[_size] = str; - _size++; - } -}; - -}; // End of namespace ScummVM - -#endif diff --git a/v3/resource_v3.cpp b/v3/resource_v3.cpp deleted file mode 100644 index c3af1c9ef2..0000000000 --- a/v3/resource_v3.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "resource.h" - - -void Scumm_v3::readIndexFile() -{ - uint16 blocktype; - uint32 itemsize; - int numblock = 0; - int num, i; - - debug(9, "readIndexFile()"); - - openRoom(-1); - openRoom(0); - - while (!fileEof(_fileHandle)) { - itemsize = fileReadDwordLE(); - blocktype = fileReadWordLE(); - if (fileReadFailed(_fileHandle)) - break; - - switch (blocktype) { - case 0x4E52: // 'NR' - fileReadWordLE(); - break; - case 0x5230: // 'R0' - _numRooms = fileReadWordLE(); - break; - case 0x5330: // 'S0' - _numScripts = fileReadWordLE(); - break; - case 0x4E30: // 'N0' - _numSounds = fileReadWordLE(); - break; - case 0x4330: // 'C0' - _numCostumes = fileReadWordLE(); - break; - case 0x4F30: // 'O0' - _numGlobalObjects = fileReadWordLE(); - break; - } - fileSeek(_fileHandle, itemsize - 8, SEEK_CUR); - } - - clearFileReadFailed(_fileHandle); - fileSeek(_fileHandle, 0, SEEK_SET); - - /* I'm not sure for those values yet, they will have to be rechecked */ - - _numVariables = 800; /* 800 */ - _numBitVariables = 4096; /* 2048 */ - _numLocalObjects = 200; /* 200 */ - _numArray = 50; - _numVerbs = 100; - _numNewNames = 0; - _objectRoomTable = NULL; - _numCharsets = 9; /* 9 */ - _numInventory = 80; /* 80 */ - _numGlobalScripts = 200; - - _shadowPaletteSize = 256; - _shadowPalette = (byte *) calloc(_shadowPaletteSize, 1); // stupid for now. Need to be removed later - _numFlObject = 50; - allocateArrays(); - - while (1) { - itemsize = fileReadDwordLE(); - - if (fileReadFailed(_fileHandle)) - break; - - blocktype = fileReadWordLE(); - - numblock++; - - switch (blocktype) { - - case 0x4E52: // 'NR' - fileSeek(_fileHandle, itemsize - 6, SEEK_CUR); - break; - - case 0x5230: // 'R0' - readResTypeList(rtRoom, MKID('ROOM'), "room"); - break; - - case 0x5330: // 'S0' - readResTypeList(rtScript, MKID('SCRP'), "script"); - break; - - case 0x4E30: // 'N0' - readResTypeList(rtSound, MKID('SOUN'), "sound"); - break; - - case 0x4330: // 'C0' - readResTypeList(rtCostume, MKID('COST'), "costume"); - break; - - case 0x4F30: // 'O0' - num = fileReadWordLE(); - assert(num == _numGlobalObjects); - for (i = 0; i != num; i++) { - uint32 bits = fileReadByte(); - byte tmp; - bits |= fileReadByte() << 8; - bits |= fileReadByte() << 16; - _classData[i] = bits; - tmp = fileReadByte(); - _objectOwnerTable[i] = tmp & OF_OWNER_MASK; - _objectStateTable[i] = tmp >> OF_STATE_SHL; - } - - break; - - default: - error("Bad ID %c%c found in directory!", blocktype & 0xFF, blocktype >> 8); - return; - } - } - - openRoom(-1); -} - -void Scumm_v3::loadCharset(int no) -{ - uint32 size; - memset(_charsetData, 0, sizeof(_charsetData)); - - checkRange(4, 0, no, "Loading illegal charset %d"); - openRoom(-1); - - openRoom(98 + no); - - size = fileReadWordLE(); - - fileRead(_fileHandle, createResource(6, no, size), size); - openRoom(-1); -} diff --git a/v4/resource_v4.cpp b/v4/resource_v4.cpp deleted file mode 100644 index 64ba6c2255..0000000000 --- a/v4/resource_v4.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" - -void Scumm_v4::loadCharset(int no) -{ - uint32 size; - memset(_charsetData, 0, sizeof(_charsetData)); - - checkRange(4, 0, no, "Loading illegal charset %d"); - openRoom(-1); - - openRoom(900 + no); - - size = fileReadDwordLE() + 11; - - fileRead(_fileHandle, createResource(6, no, size), size); - openRoom(-1); -} diff --git a/vars.cpp b/vars.cpp deleted file mode 100644 index 18c6076e83..0000000000 --- a/vars.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - - -#include "stdafx.h" -#include "scumm.h" - -void Scumm::setupScummVarsOld() -{ - - VAR_EGO = 1; - VAR_CAMERA_POS_X = 2; - VAR_HAVE_MSG = 3; - VAR_ROOM = 4; - VAR_OVERRIDE = 5; - VAR_MACHINE_SPEED = 6; - VAR_ME = 7; - VAR_NUM_ACTOR = 8; - VAR_CURRENT_LIGHTS = 9; - VAR_CURRENTDRIVE = 10; - VAR_TMR_1 = 11; - VAR_TMR_2 = 12; - VAR_TMR_3 = 13; - VAR_MUSIC_FLAG = 14; - VAR_ACTOR_RANGE_MIN = 15; - VAR_ACTOR_RANGE_MAX = 16; - VAR_CAMERA_MIN_X = 17; - VAR_CAMERA_MAX_X = 18; - VAR_TIMER_NEXT = 19; - VAR_VIRT_MOUSE_X = 20; - VAR_VIRT_MOUSE_Y = 21; - VAR_ROOM_RESOURCE = 22; - VAR_LAST_SOUND = 23; - VAR_CUTSCENEEXIT_KEY = 24; - VAR_TALK_ACTOR = 25; - VAR_CAMERA_FAST_X = 26; - VAR_SCROLL_SCRIPT = 27; - VAR_ENTRY_SCRIPT = 28; - VAR_ENTRY_SCRIPT2 = 29; - VAR_EXIT_SCRIPT = 30; - VAR_EXIT_SCRIPT2 = 31; - VAR_VERB_SCRIPT = 32; - VAR_SENTENCE_SCRIPT = 33; - VAR_HOOK_SCRIPT = 34; - VAR_CUTSCENE_START_SCRIPT = 35; - VAR_CUTSCENE_END_SCRIPT = 36; - VAR_CHARINC = 37; - VAR_WALKTO_OBJ = 38; - VAR_DEBUGMODE = 39; - VAR_HEAPSPACE = 40; - VAR_RESTART_KEY = 42; - VAR_PAUSE_KEY = 43; - VAR_MOUSE_X = 44; - VAR_MOUSE_Y = 45; - VAR_TIMER = 46; - VAR_TMR_4 = 47; - VAR_SOUNDCARD = 48; - VAR_VIDEOMODE = 49; - VAR_SAVELOADDIALOG_KEY = 50; - VAR_FIXEDDISK = 51; - VAR_CURSORSTATE = 52; - VAR_USERPUT = 53; - VAR_SOUNDRESULT = 56; - VAR_TALKSTOP_KEY = 57; - VAR_59 = 59; - - VAR_SOUNDPARAM = 64; - VAR_SOUNDPARAM2 = 65; - VAR_SOUNDPARAM3 = 66; - VAR_MOUSEPRESENT = 67; - VAR_PERFORMANCE_1 = 68; - VAR_PERFORMANCE_2 = 69; // Zak256 Note: Cashcard for Zak - VAR_ROOM_FLAG = 70; // Zak256 Note: Cashcard for Annie - VAR_GAME_LOADED = 71; // Zak256 Note: Cashcard for Melissa - VAR_NEW_ROOM = 72; // Zak256 Note: Cashcard for Leslie - VAR_VERSION = 75; - - VAR_V5_DRAWFLAGS = 9; - VAR_MI1_TIMER = 14; - - VAR_V5_OBJECT_LO = 15; - VAR_V5_OBJECT_HI = 16; - - VAR_V5_TALK_STRING_Y = 54; - VAR_V5_CHARFLAG = 60; - - VAR_V6_SCREEN_WIDTH = 41; - VAR_V6_SCREEN_HEIGHT = 54; - VAR_V6_EMSSPACE = 76; - VAR_V6_RANDOM_NR = 118; -} - - -void Scumm::setupScummVarsNew() -{ - - VAR_MOUSE_X = 1; - VAR_MOUSE_Y = 2; - VAR_VIRT_MOUSE_X = 3; - VAR_VIRT_MOUSE_Y = 4; - VAR_V6_SCREEN_WIDTH = 5; - VAR_V6_SCREEN_HEIGHT = 6; - VAR_CAMERA_POS_X = 7; - VAR_CAMERA_POS_Y = 8; - VAR_OVERRIDE = 9; - VAR_ROOM = 10; - VAR_ROOM_RESOURCE = 11; - VAR_TALK_ACTOR = 12; - VAR_HAVE_MSG = 13; - VAR_TIMER = 14; - VAR_TMR_4 = 15; - VAR_LEFTBTN_DOWN = 22; - VAR_RIGHTBTN_DOWN = 23; - VAR_LEFTBTN_HOLD = 24; - VAR_RIGHTBTN_HOLD = 25; - - VAR_PERFORMANCE_1 = 26; - VAR_PERFORMANCE_2 = 27; - VAR_GAME_LOADED = 29; - VAR_V6_RANDOM_NR = 34; - VAR_NEW_ROOM = 35; - VAR_WALKTO_OBJ = 36; - - - VAR_CAMERA_DEST_X = 38; - - VAR_CAMERA_DEST_Y = 39; - - VAR_CAMERA_FOLLOWED_ACTOR = 40; - - - VAR_SCROLL_SCRIPT = 50; - VAR_ENTRY_SCRIPT = 51; - VAR_ENTRY_SCRIPT2 = 52; - VAR_EXIT_SCRIPT = 53; - VAR_EXIT_SCRIPT2 = 54; - VAR_VERB_SCRIPT = 55; - VAR_SENTENCE_SCRIPT = 56; - VAR_HOOK_SCRIPT = 57; - VAR_CUTSCENE_START_SCRIPT = 58; - VAR_CUTSCENE_END_SCRIPT = 59; - VAR_UNK_SCRIPT = 60; - VAR_UNK_SCRIPT_2 = 61; - - VAR_PAUSE_KEY = 64; - VAR_RESTART_KEY = 63; /* ?? */ - VAR_TALKSTOP_KEY = 66; /* ?? */ - VAR_SAVELOADDIALOG_KEY = 65; /* ?? */ - VAR_CUTSCENEEXIT_KEY = 62; - - VAR_TIMER_NEXT = 97; - VAR_TMR_1 = 98; - VAR_TMR_2 = 99; - VAR_TMR_3 = 100; - - VAR_CAMERA_MIN_X = 101; - VAR_CAMERA_MAX_X = 102; - VAR_CAMERA_MIN_Y = 103; - VAR_CAMERA_MAX_Y = 104; - VAR_CAMERA_THRESHOLD_X = 105; - VAR_CAMERA_THRESHOLD_Y = 106; - VAR_CAMERA_SPEED_X = 107; - VAR_CAMERA_SPEED_Y = 108; - VAR_CAMERA_ACCEL_X = 109; - VAR_CAMERA_ACCEL_Y = 110; - - VAR_EGO = 111; - - VAR_CURSORSTATE = 112; - VAR_USERPUT = 113; - VAR_DEFAULT_TALK_DELAY = 114; - VAR_CHARINC = 115; - VAR_DEBUGMODE = 116; - - VAR_CHARSET_MASK = 119; - VAR_VIDEONAME = 0xF6/2; - VAR_CUSTOMSCALETABLE = 131; - - //VAR_V5_DRAWFLAGS = 9; - VAR_MI1_TIMER = 14; - VAR_V5_OBJECT_LO = 15; - VAR_V5_OBJECT_HI = 16; - VAR_V5_TALK_STRING_Y = 54; - VAR_V5_CHARFLAG = 60; - - VAR_V6_EMSSPACE = 76; - VAR_STRING2DRAW = 130; -} diff --git a/verbs.cpp b/verbs.cpp deleted file mode 100644 index 131bde0312..0000000000 --- a/verbs.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "scumm.h" -#include "object.h" -#include "resource.h" - -void Scumm::redrawVerbs() -{ - int i; - for (i = 0; i < _maxVerbs; i++) - drawVerb(i, 0); - verbMouseOver(0); -} - -void Scumm::checkExecVerbs() -{ - int i, over; - VerbSlot *vs; - - if (_userPut <= 0 || _mouseButStat == 0) - return; - - if (_mouseButStat < MBS_MAX_KEY) { - /* Check keypresses */ - vs = &_verbs[1]; - for (i = 1; i < _maxVerbs; i++, vs++) { - if (vs->verbid && vs->saveid == 0 && vs->curmode == 1) { - if (_mouseButStat == vs->key) { - runInputScript(1, vs->verbid, 1); - return; - } - } - } - runInputScript(4, _mouseButStat, 1); - } else if (_mouseButStat & MBS_MOUSE_MASK) { - byte code = _mouseButStat & MBS_LEFT_CLICK ? 1 : 2; - if (mouse.y >= virtscr[0].topline && mouse.y < virtscr[0].topline + virtscr[0].height) { - over = checkMouseOver(mouse.x, mouse.y); - if (over != 0) { - runInputScript(1, _verbs[over].verbid, code); - return; - } - runInputScript(2, 0, code); - } else { - over = checkMouseOver(mouse.x, mouse.y); - - // FIXME For the future: Indy3 and under inv scrolling - /* - if (over >= 31 && over <= 36) - over += _inventoryOffset; - */ - runInputScript(1, over != 0 ? _verbs[over].verbid : 0, code); - } - } -} - -void Scumm::verbMouseOver(int verb) -{ - if (_verbMouseOver == verb) - return; - - if (_verbs[_verbMouseOver].type != 1) { - drawVerb(_verbMouseOver, 0); - _verbMouseOver = verb; - } - - if (_verbs[verb].type != 1 && _verbs[verb].hicolor) { - drawVerb(verb, 1); - _verbMouseOver = verb; - } -} - -int Scumm::checkMouseOver(int x, int y) -{ - VerbSlot *vs; - int i = _maxVerbs - 1; - - vs = &_verbs[i]; - do { - if (vs->curmode != 1 || !vs->verbid || vs->saveid || y < vs->y || y >= vs->bottom) - continue; - if (vs->center) { - if (x < -(vs->right - vs->x - vs->x) || x >= vs->right) - continue; - } else { - if (x < vs->x || x >= vs->right) - continue; - } - - return i; - } while (--vs, --i); - return 0; -} - -void Scumm::drawVerb(int vrb, int mode) -{ - VerbSlot *vs; - byte tmp; - - if (!vrb) - return; - - vs = &_verbs[vrb]; - - if (!vs->saveid && vs->curmode && vs->verbid) { - if (vs->type == 1) { - drawVerbBitmap(vrb, vs->x, vs->y); - return; - } - restoreVerbBG(vrb); - - string[4].charset = vs->charset_nr; - string[4].xpos = vs->x; - string[4].ypos = vs->y; - string[4].right = 319; - string[4].center = vs->center; - - if (vs->curmode == 2) - string[4].color = vs->dimcolor; - else if (mode && vs->hicolor) - string[4].color = vs->hicolor; - else - string[4].color = vs->color; - - // FIXME For the future: Indy3 and under inv scrolling - /* - if (vrb >= 31 && vrb <= 36) - vrb += _inventoryOffset; - */ - - _messagePtr = getResourceAddress(rtVerb, vrb); - if (!_messagePtr) - return; - assert(_messagePtr); - - tmp = charset._center; - charset._center = 0; - drawString(4); - charset._center = tmp; - - vs->right = charset._strRight; - vs->bottom = charset._strBottom; - vs->oldleft = charset._strLeft; - vs->oldright = charset._strRight; - vs->oldtop = charset._strTop; - vs->oldbottom = charset._strBottom; - charset._strLeft = charset._strRight; - } else { - restoreVerbBG(vrb); - } -} - -void Scumm::restoreVerbBG(int verb) -{ - VerbSlot *vs; - - vs = &_verbs[verb]; - - if (vs->oldleft != -1) { - _bkColor = vs->bkcolor; - restoreBG(vs->oldleft, vs->oldtop, vs->oldright, vs->oldbottom); - vs->oldleft = -1; - } -} - -void Scumm::drawVerbBitmap(int vrb, int x, int y) -{ - VirtScreen *vs; - VerbSlot *vst; - byte twobufs, *imptr; - int ydiff, xstrip; - int imgw, imgh; - int i, tmp; - byte *obim; - ImageHeader *imhd; - uint32 size; - - if ((vs = findVirtScreen(y)) == NULL) - return; - - _lastXstart = virtscr[0].xstart; - - gdi.disableZBuffer(); - - twobufs = vs->alloctwobuffers; - vs->alloctwobuffers = 0; - - xstrip = x >> 3; - ydiff = y - vs->topline; - - obim = getResourceAddress(rtVerb, vrb); - if (_features & GF_SMALL_HEADER) { - int obj; - obj = READ_LE_UINT16(obim + 6); - size = READ_LE_UINT32(obim); - - imgw = (*(obim + size + 11)); - imgh = (*(obim + size + 17)) >> 3; - imptr = (obim + 8); - } else { - imhd = (ImageHeader *)findResourceData(MKID('IMHD'), obim); - if (_features & GF_AFTER_V7) { - imgw = READ_LE_UINT16(&imhd->v7.width) >> 3; - imgh = READ_LE_UINT16(&imhd->v7.height) >> 3; - } else { - imgw = READ_LE_UINT16(&imhd->old.width) >> 3; - imgh = READ_LE_UINT16(&imhd->old.height) >> 3; - } - - imptr = findResource(MKID('IM01'), obim); - if (!imptr) - error("No image for verb %d", vrb); - } - for (i = 0; i < imgw; i++) { - tmp = xstrip + i; - if ((uint) tmp < 40) - gdi.drawBitmap(imptr, vs, tmp, ydiff, imgh << 3, i, 1, true); - } - - vst = &_verbs[vrb]; - vst->right = vst->x + imgw * 8 - 1; - vst->bottom = vst->y + imgh * 8 - 1; - vst->oldleft = vst->x; - vst->oldright = vst->right; - vst->oldtop = vst->y; - vst->oldbottom = vst->bottom; - - gdi.enableZBuffer(); - - vs->alloctwobuffers = twobufs; -} - -int Scumm::getVerbSlot(int id, int mode) -{ - int i; - for (i = 1; i < _maxVerbs; i++) { - if (_verbs[i].verbid == id && _verbs[i].saveid == mode) { - return i; - } - } - return 0; -} - -void Scumm::killVerb(int slot) -{ - VerbSlot *vs; - - if (slot == 0) - return; - - vs = &_verbs[slot]; - vs->verbid = 0; - vs->curmode = 0; - - nukeResource(rtVerb, slot); - - if (vs->saveid == 0) { - drawVerb(slot, 0); - verbMouseOver(0); - } - vs->saveid = 0; -} - -void Scumm::setVerbObject(uint room, uint object, uint verb) -{ - byte *obimptr; - byte *obcdptr; - uint32 size, size2; - FindObjectInRoom foir; - int i; - - if (whereIsObject(object) == WIO_FLOBJECT) - error("Can't grab verb image from flobject"); - - if (_features & GF_SMALL_HEADER) { - for (i = _numObjectsInRoom; i > 0; i--) { - if (_objs[i].obj_nr == object) { - findObjectInRoom(&foir, foImageHeader, object, room); - size = READ_LE_UINT32(foir.obim); - obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); - size2 = READ_LE_UINT32(obcdptr); - createResource(rtVerb, verb, size + size2); - obimptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obim; - obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); - memcpy(getResourceAddress(rtVerb, verb), obimptr, size); - memcpy(getResourceAddress(rtVerb, verb) + size, obcdptr, size2); - } - } - } else { - findObjectInRoom(&foir, foImageHeader, object, room); - size = READ_BE_UINT32_UNALIGNED(foir.obim + 4); - createResource(rtVerb, verb, size); - obimptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obim; - memcpy(getResourceAddress(rtVerb, verb), obimptr, size); - } -} diff --git a/whatsnew.txt b/whatsnew.txt deleted file mode 100644 index b5ebaabfc9..0000000000 --- a/whatsnew.txt +++ /dev/null @@ -1,28 +0,0 @@ -For a more comprehensive changelog for the latest experimental CVS code, see: - http://scummvm.sourceforge.net/daily/ChangeLog - -0.2.0 (2002-04-14) -- core engine rewrite -- enhanced ingame GUI, including options/volume settings. -- auto-save feature -- added more command-line options, and configuration file -- new ports and platforms (MorphOS, Macintosh, Dreamcast, Solaris, IRIX, etc) -- graphics filtering added (2xSAI, Super2xSAI, SuperEagle, AdvMame2x) -- support for MAD MP3 compressed audio -- support for first non-SCUMM games (Simon the Sorcerer) -- support for V4 games (Loom CD) -- enhanced V6 game support (Sam and Max is now completable) -- experimental support for V7 games (Full Throttle/The Dig) -- experimental support for V3 games (Zak256/Indy3) - -0.1.0 (2002-01-13) -- loads of changes - -0.0.2 (2001-10-12): -- bug fixes -- save & load support - -0.0.1 (2001-10-08): -- initial version - - diff --git a/wince/MenuTitle.bmp b/wince/MenuTitle.bmp deleted file mode 100755 index bcd8c68d14..0000000000 Binary files a/wince/MenuTitle.bmp and /dev/null differ diff --git a/wince/PocketSCUMM.rc b/wince/PocketSCUMM.rc deleted file mode 100644 index 15fc9433ba..0000000000 --- a/wince/PocketSCUMM.rc +++ /dev/null @@ -1,209 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "newres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""newres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_GAMESELECT DIALOG DISCARDABLE 0, 0, 128, 134 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "Choose a Game" -FONT 8, "System" -BEGIN - LISTBOX IDC_LISTAVAILABLE,6,47,113,70,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - CONTROL 133,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,0,2, - 125,35 - LTEXT "",IDC_GAMEDESC,2,117,116,8 - PUSHBUTTON "Play",IDC_PLAY,52,125,19,9 - LTEXT "",IDC_FILEPATH,5,39,120,8 - PUSHBUTTON "Scan",IDC_SCAN,4,125,19,9 - PUSHBUTTON "Exit",IDC_EXIT,100,125,19,9 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menubar -// - -IDM_MENU MENU DISCARDABLE -BEGIN - POPUP "PocketSCUMM" - BEGIN - MENUITEM "Load/Save", IDC_LOADSAVE - MENUITEM "Options", IDC_OPTIONS - MENUITEM "Exit", IDC_EXIT - MENUITEM SEPARATOR - MENUITEM "Landscape", IDC_LANDSCAPE - MENUITEM "Skip section", IDC_SKIP - MENUITEM SEPARATOR - MENUITEM "Sound", IDC_SOUND - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Data -// - -IDM_MENU SHMENUBAR DISCARDABLE -BEGIN - IDM_MENU, 1, - I_IMAGENONE, IDM_POCKETSCUMM, TBSTATE_ENABLED, - TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_POCKETSCUMM, 0, 0, -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_GAMESELECT, DIALOG - BEGIN - RIGHTMARGIN, 125 - HORZGUIDE, 2 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CAP_POCKETSCUMM "PocketSCUMM" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 90 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "System" -BEGIN - DEFPUSHBUTTON "OK",IDOK,129,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 83 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDL_POCKETSCUMM ICON DISCARDABLE "PocketSCUMM.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_MENUTITLE BITMAP DISCARDABLE "MenuTitle.bmp" -#endif // French (France) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/wince/PocketSCUMM.vcc b/wince/PocketSCUMM.vcc deleted file mode 100755 index 9a25751416..0000000000 --- a/wince/PocketSCUMM.vcc +++ /dev/null @@ -1,74 +0,0 @@ -; CLW file contains information for the MFC ClassWizard - -[General Info] -Version=1 -LastClass= -LastTemplate=CDialog -NewFileInclude1=#include "stdafx.h" -NewFileInclude2=#include "pocketscumm.h" -LastPage=0 - -ClassCount=0 - -ResourceCount=5 -Resource1=IDM_MENU -Resource2=IDD_DIALOG1 -Resource3=IDD_GAMESELECT -Resource4=IDD_GAMESELECT (English (U.S.)) -Resource5=IDM_MENU (English (U.S.)) - -[DLG:IDD_GAMESELECT (English (U.S.))] -Type=1 -Class=? -ControlCount=7 -Control1=IDC_LISTAVAILABLE,listbox,1352728833 -Control2=IDC_STATIC,static,1342177806 -Control3=IDC_GAMEDESC,static,1342308352 -Control4=IDC_PLAY,button,1342242816 -Control5=IDC_FILEPATH,static,1342308352 -Control6=IDC_SCAN,button,1342242816 -Control7=IDC_EXIT,button,1342242816 - -[MNU:IDM_MENU (English (U.S.))] -Type=1 -Class=? -Command1=IDC_LOADSAVE -Command2=IDC_OPTIONS -Command3=IDC_EXIT -Command4=IDC_LANDSCAPE -Command5=IDC_SKIP -Command6=IDC_SOUND -CommandCount=6 - -[DLG:IDD_GAMESELECT] -Type=1 -Class=? -ControlCount=7 -Control1=IDC_LISTAVAILABLE,listbox,1352728833 -Control2=IDC_STATIC,static,1342177806 -Control3=IDC_GAMEDESC,static,1342308352 -Control4=IDC_PLAY,button,1342242816 -Control5=IDC_FILEPATH,static,1342308352 -Control6=IDC_SCAN,button,1342242816 -Control7=IDC_EXIT,button,1342242816 - -[MNU:IDM_MENU] -Type=1 -Class=? -Command1=IDC_LOADSAVE -Command2=IDC_OPTIONS -Command3=IDC_EXIT -Command4=IDC_LANDSCAPE -Command5=IDC_SKIP -Command6=IDC_SOUND -CommandCount=6 - - - -[DLG:IDD_DIALOG1] -Type=1 -Class=? -ControlCount=2 -Control1=IDOK,button,1342242817 -Control2=IDCANCEL,button,1342242816 - diff --git a/wince/PocketSCUMM.vcp b/wince/PocketSCUMM.vcp deleted file mode 100644 index 5809a4d948..0000000000 --- a/wince/PocketSCUMM.vcp +++ /dev/null @@ -1,9228 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="PocketSCUMM" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 -# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 -# TARGTYPE "Win32 (WCE SH4) Application" 0x8601 -# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 - -CFG=PocketSCUMM - Win32 (WCE MIPS) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "PocketSCUMM.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "PocketSCUMM.vcn" CFG="PocketSCUMM - Win32 (WCE MIPS) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "PocketSCUMM - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") -!MESSAGE "PocketSCUMM - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "MIPS" /D "_MIPS_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "__AUTO_MIXER_ADJUST__" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/MIPS" /libpath:"mad/lib/MIPS" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH4Rel" -# PROP BASE Intermediate_Dir "SH4Rel" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH4Rel" -# PROP Intermediate_Dir "SH4Rel" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Qsh4 /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /D "SHx" /D "SH4" /D "_SH4_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Qsh4 /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH4Dbg" -# PROP BASE Intermediate_Dir "SH4Dbg" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH4Dbg" -# PROP Intermediate_Dir "SH4Dbg" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /Qsh4 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Qsh4 /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "SHx" /D "SH3" /D "_SH3_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "USE_ADLIB" /D "__AUTO_MIXER_ADJUST__" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/SH3" /libpath:"mad/lib/SH3" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "../sound" /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "ARM" /D "_ARM_" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/ARM" /libpath:"mad/lib/ARM" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "../sound" /I "gapi/inc" /I "SDLAudio/include" /I "mad/include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /D "FPM_DEFAULT" /D "COMPRESSED_SOUND_FILE" /FR /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib SDLAudio.lib mad.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /libpath:"SDLAudio/lib/ARM" /libpath:"mad/lib/ARM" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -# ADD CPP /nologo /W3 /I "." /I "missing" /I ".." /I "gapi/inc" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "i486" /D "_X86_" /D "x86" /D "NDEBUG" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Gz /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86EMDbg" -# PROP BASE Intermediate_Dir "X86EMDbg" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86EMDbg" -# PROP Intermediate_Dir "X86EMDbg" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c -# ADD CPP /nologo /W3 /Zi /Od /I "." /I "missing" /I ".." /I "gapi/inc" /D "DEBUG" /D "i486" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_X86_" /D "x86" /D "WIN32" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "SCUMM_NEED_ALIGNMENT" /YX /Gz /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 - -!ENDIF - -# Begin Target - -# Name "PocketSCUMM - Win32 (WCE MIPS) Release" -# Name "PocketSCUMM - Win32 (WCE MIPS) Debug" -# Name "PocketSCUMM - Win32 (WCE SH4) Release" -# Name "PocketSCUMM - Win32 (WCE SH4) Debug" -# Name "PocketSCUMM - Win32 (WCE SH3) Release" -# Name "PocketSCUMM - Win32 (WCE SH3) Debug" -# Name "PocketSCUMM - Win32 (WCE ARM) Release" -# Name "PocketSCUMM - Win32 (WCE ARM) Debug" -# Name "PocketSCUMM - Win32 (WCE x86em) Release" -# Name "PocketSCUMM - Win32 (WCE x86em) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "sound" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\sound\fmopl.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_FMOPL=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FMOPL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FMOPL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FMOPL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FMOPL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_FMOPL=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FMOPL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FMOPL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_FMOPL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FMOPL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_FMOPL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FMOPL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FMOPL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_FMOPL=\ - "..\sound\fmopl.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sound\imuse.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_IMUSE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\morphos\morphos.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_IMUSE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_IMUSE=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_IMUSE=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_IMUSE=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_IMUSE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\morphos\morphos.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_IMUSE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_IMUSE=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_IMUSE=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\morphos\morphos.h"\ - "..\saveload.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_IMUSE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_IMUSE=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\morphos\morphos.h"\ - "..\saveload.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_IMUSE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_IMUSE=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_IMUSE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_IMUSE=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sound\mididrv.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDID=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\fmopl.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDID=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_MIDID=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDID=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_MIDID=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\fmopl.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDID=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_MIDID=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\sys\time.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDID=\ - "..\sound.h"\ - "..\sound\gmidi.h"\ - "..\sound\QuickTimeMusic.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sound\mididrv.h -# End Source File -# Begin Source File - -SOURCE=..\sound\mixer.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIXER=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIXER=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_MIXER=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIXER=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_MIXER=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIXER=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_MIXER=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sound\mixer.h -# End Source File -# End Group -# Begin Group "v3" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\v3\resource_v3.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_RESOU=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\myresource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_RESOU=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\myresource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_RESOU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "v4" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\v4\resource_v4.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOUR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOUR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_RESOUR=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOUR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_RESOUR=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOUR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_RESOUR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOUR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "simon" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\simon\midi.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDI_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDI_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDI_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_MIDI_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_MIDI_=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_MIDI_=\ - "..\simon\gmidi.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simon.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMON=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMON=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMON=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMON=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMON=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simon.h -# End Source File -# Begin Source File - -SOURCE=..\simon\simondebug.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMOND=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMOND=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simonitems.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMONI=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONI=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simonres.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMONR=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONR=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simonsys.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMONS=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simonverb.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMONV=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONV=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\simon\simonvga.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SIMONVG=\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SIMONVG=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "gui" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\gui\dialog.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_DIALO=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_DIALO=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_DIALO=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_DIALO=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gui\dialog.h -# End Source File -# Begin Source File - -SOURCE=..\gui\ListWidget.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_LISTW=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_LISTW=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_LISTW=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_LISTW=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_LISTW=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_LISTW=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gui\ListWidget.h -# End Source File -# Begin Source File - -SOURCE=..\gui\ScrollBarWidget.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCROL=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCROL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCROL=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCROL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCROL=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ScrollBarWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCROL=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gui\ScrollBarWidget.h -# End Source File -# Begin Source File - -SOURCE=..\gui\widget.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_WIDGE=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_WIDGE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_WIDGE=\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_WIDGE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_WIDGE=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_WIDGE=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gui\widget.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\actor.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_ACTOR=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_ACTOR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_ACTOR=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_ACTOR=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_ACTOR=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_ACTOR=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_ACTOR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_ACTOR=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_ACTOR=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\costume.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_ACTOR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_ACTOR=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\costume.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_ACTOR=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_ACTOR=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_ACTOR=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_ACTOR=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\akos.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_AKOS_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_AKOS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_AKOS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_AKOS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_AKOS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_AKOS_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_AKOS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_AKOS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_AKOS_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_AKOS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_AKOS_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_AKOS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_AKOS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_AKOS_=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_AKOS_=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\boxes.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_BOXES=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BOXES=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_BOXES=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_BOXES=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_BOXES=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_BOXES=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BOXES=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_BOXES=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_BOXES=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BOXES=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_BOXES=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BOXES=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_BOXES=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_BOXES=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BOXES=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\bundle.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_BUNDL=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_BUNDL=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE="..\config-file.cpp" - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_CONFI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_CONFI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_CONFI=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_CONFI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_CONFI=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_CONFI=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_CONFI=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\costume.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_COSTU=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_COSTU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_COSTU=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_COSTU=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_COSTU=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_COSTU=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_COSTU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_COSTU=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_COSTU=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\costume.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_COSTU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_COSTU=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\costume.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_COSTU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_COSTU=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_COSTU=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_COSTU=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gameDetector.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GAMED=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GAMED=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_GAMED=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GAMED=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_GAMED=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GAMED=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_GAMED=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GAMED=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gfx.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_GFX_C=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GFX_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_GFX_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_GFX_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_GFX_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_GFX_C=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GFX_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_GFX_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_GFX_C=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\newgui.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GFX_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_GFX_C=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\newgui.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GFX_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_GFX_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_GFX_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GFX_C=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\gui.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_GUI_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\guimaps.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GUI_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_GUI_C=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_GUI_C=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_GUI_C=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_GUI_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\guimaps.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GUI_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_GUI_C=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_GUI_C=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\guimaps.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GUI_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_GUI_C=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\guimaps.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_GUI_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_GUI_C=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_GUI_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\guimaps.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_GUI_C=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\insane.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_INSAN=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_INSAN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_INSAN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_INSAN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_INSAN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_INSAN=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_INSAN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_INSAN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_INSAN=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_INSAN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_INSAN=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_INSAN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_INSAN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_INSAN=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_INSAN=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\newgui.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_NEWGU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\ListWidget.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_NEWGU=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_NEWGU=\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui\dialog.h"\ - "..\gui\widget.h"\ - "..\guimaps.h"\ - "..\newgui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_NEWGU=\ - "..\gui\util.h"\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\object.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_OBJEC=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_OBJEC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_OBJEC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_OBJEC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_OBJEC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_OBJEC=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_OBJEC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_OBJEC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_OBJEC=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_OBJEC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_OBJEC=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_OBJEC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_OBJEC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_OBJEC=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_OBJEC=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\resource.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_RESOURC=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOURC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_RESOURC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_RESOURC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_RESOURC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_RESOURC=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOURC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_RESOURC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_RESOURC=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOURC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_RESOURC=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_RESOURC=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_RESOURC=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_RESOURC=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_RESOURC=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\saveload.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SAVEL=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SAVEL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SAVEL=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SAVEL=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SAVEL=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SAVEL=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SAVEL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SAVEL=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SAVEL=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\saveload.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SAVEL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SAVEL=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\saveload.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SAVEL=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SAVEL=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SAVEL=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SAVEL=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\scaler.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCALE=\ - "..\scaler.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCALE=\ - "..\macos.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\script.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCRIP=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIP=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCRIP=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCRIP=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCRIP=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCRIP=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIP=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCRIP=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCRIP=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIP=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCRIP=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIP=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCRIP=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCRIP=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIP=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\script_v1.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCRIPT=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCRIPT=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCRIPT=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCRIPT=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCRIPT=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCRIPT=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCRIPT=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCRIPT=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCRIPT=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCRIPT=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT=\ - "..\cdmusic.h"\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\script_v2.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCRIPT_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCRIPT_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCRIPT_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCRIPT_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCRIPT_=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCRIPT_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCRIPT_=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCRIPT_=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCRIPT_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCRIPT_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCRIPT_=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCRIPT_=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\scummvm.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCUMM=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCUMM=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCUMM=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCUMM=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCUMM=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCUMM=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCUMM=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCUMM=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCUMM=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\debug.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\newgui.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCUMM=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCUMM=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\debug.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\newgui.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SCUMM=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCUMM=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCUMM=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gameDetector.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SCUMM=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sound.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SOUND=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SOUND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SOUND=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SOUND=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SOUND=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SOUND=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SOUND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SOUND=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SOUND=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SOUND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SOUND=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\imuse.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SOUND=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SOUND=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\sound.h"\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SOUND=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SOUND=\ - "..\cdmusic.h"\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\stdafx.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STDAF=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STDAF=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STDAF=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STDAF=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STDAF=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_STDAF=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\string.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_STRIN=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_STRIN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_STRIN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_STRIN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_STRIN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_STRIN=\ - "..\actor.h"\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_STRIN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_STRIN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_STRIN=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_STRIN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_STRIN=\ - "..\actor.h"\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_STRIN=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_STRIN=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_STRIN=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_STRIN=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\sys.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SYS_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SYS_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SYS_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SYS_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SYS_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SYS_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SYS_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SYS_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SYS_C=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SYS_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SYS_C=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_SYS_C=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SYS_C=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SYS_C=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_SYS_C=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\util.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_UTIL_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\vars.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_VARS_=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VARS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_VARS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_VARS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_VARS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_VARS_=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VARS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_VARS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_VARS_=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VARS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_VARS_=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VARS_=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_VARS_=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_VARS_=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VARS_=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\verbs.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_VERBS=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VERBS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_VERBS=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_VERBS=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_VERBS=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_VERBS=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VERBS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_VERBS=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_VERBS=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VERBS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_VERBS=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\gfx.h"\ - "..\object.h"\ - "..\resource.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_VERBS=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_VERBS=\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_VERBS=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_VERBS=\ - "..\gmidi.h"\ - "..\sound.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\akos.h -# End Source File -# Begin Source File - -SOURCE=..\boxes.h -# End Source File -# Begin Source File - -SOURCE=..\bundle.h -# End Source File -# Begin Source File - -SOURCE="..\config-file.h" -# End Source File -# Begin Source File - -SOURCE=..\sound\fmopl.h -# End Source File -# Begin Source File - -SOURCE=..\gapi_keys.h -# End Source File -# Begin Source File - -SOURCE=..\gui.h -# End Source File -# Begin Source File - -SOURCE=..\guimaps.h -# End Source File -# Begin Source File - -SOURCE=..\newgui.h -# End Source File -# Begin Source File - -SOURCE=..\scaler.h -# End Source File -# Begin Source File - -SOURCE=..\scumm.h -# End Source File -# Begin Source File - -SOURCE=..\scummsys.h -# End Source File -# Begin Source File - -SOURCE=..\stdafx.h -# End Source File -# Begin Source File - -SOURCE=..\util.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\MenuTitle.bmp -# End Source File -# Begin Source File - -SOURCE=.\pocketscumm.ico -# End Source File -# End Group -# Begin Group "Port Source Files" - -# PROP Default_Filter "cpp" -# Begin Source File - -SOURCE=.\bitmaps.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_BITMA=\ - ".\screen.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\findgame.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_FINDG=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FINDG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FINDG=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FINDG=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FINDG=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_FINDG=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FINDG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FINDG=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_FINDG=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FINDG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_FINDG=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\gfx.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - -NODEP_CPP_FINDG=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_FINDG=\ - ".\SDL.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_FINDG=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gapi_keys.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_GAPI_=\ - "..\gapi_keys.h"\ - "..\stdafx.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\gapi\inc\gx.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\gapi\inc\gx.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_GAPI_=\ - "..\gapi_keys.h"\ - "..\stdafx.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_GAPI_=\ - "..\gapi_keys.h"\ - "..\stdafx.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_GAPI_=\ - "..\gapi_keys.h"\ - "..\stdafx.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_GAPI_=\ - "..\stdafx.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_GAPI_=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\missing\missing.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_MISSI=\ - ".\missing\dirent.h"\ - ".\missing\sys\time.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\pocketpc.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_POCKE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\smush.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - ".\SDLAudio\include\begin_code.h"\ - ".\SDLAudio\include\close_code.h"\ - ".\SDLAudio\include\SDL.h"\ - ".\SDLAudio\include\SDL_active.h"\ - ".\SDLAudio\include\SDL_audio.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - ".\SDLAudio\include\SDL_cdrom.h"\ - ".\SDLAudio\include\SDL_error.h"\ - ".\SDLAudio\include\SDL_events.h"\ - ".\SDLAudio\include\SDL_getenv.h"\ - ".\SDLAudio\include\SDL_joystick.h"\ - ".\SDLAudio\include\SDL_keyboard.h"\ - ".\SDLAudio\include\SDL_keysym.h"\ - ".\SDLAudio\include\SDL_main.h"\ - ".\SDLAudio\include\SDL_mouse.h"\ - ".\SDLAudio\include\SDL_mutex.h"\ - ".\SDLAudio\include\SDL_quit.h"\ - ".\SDLAudio\include\SDL_rwops.h"\ - ".\SDLAudio\include\SDL_thread.h"\ - ".\SDLAudio\include\SDL_timer.h"\ - ".\SDLAudio\include\SDL_types.h"\ - ".\SDLAudio\include\SDL_version.h"\ - ".\SDLAudio\include\SDL_video.h"\ - -NODEP_CPP_POCKE=\ - "..\macos.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_POCKE=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_POCKE=\ - "..\sound.h"\ - ".\ipapi.h"\ - ".\screen.h"\ - ".\SDL.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_POCKE=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_POCKE=\ - ".\screen.h"\ - ".\SDL.h"\ - ".\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_POCKE=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_POCKE=\ - ".\screen.h"\ - ".\SDL.h"\ - ".\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_POCKE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\config-file.h"\ - "..\gameDetector.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\smush.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\gapi\inc\gx.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - ".\SDLAudio\include\begin_code.h"\ - ".\SDLAudio\include\close_code.h"\ - ".\SDLAudio\include\SDL.h"\ - ".\SDLAudio\include\SDL_active.h"\ - ".\SDLAudio\include\SDL_audio.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - ".\SDLAudio\include\SDL_cdrom.h"\ - ".\SDLAudio\include\SDL_error.h"\ - ".\SDLAudio\include\SDL_events.h"\ - ".\SDLAudio\include\SDL_getenv.h"\ - ".\SDLAudio\include\SDL_joystick.h"\ - ".\SDLAudio\include\SDL_keyboard.h"\ - ".\SDLAudio\include\SDL_keysym.h"\ - ".\SDLAudio\include\SDL_main.h"\ - ".\SDLAudio\include\SDL_mouse.h"\ - ".\SDLAudio\include\SDL_mutex.h"\ - ".\SDLAudio\include\SDL_quit.h"\ - ".\SDLAudio\include\SDL_rwops.h"\ - ".\SDLAudio\include\SDL_thread.h"\ - ".\SDLAudio\include\SDL_timer.h"\ - ".\SDLAudio\include\SDL_types.h"\ - ".\SDLAudio\include\SDL_version.h"\ - ".\SDLAudio\include\SDL_video.h"\ - -NODEP_CPP_POCKE=\ - "..\macos.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_POCKE=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_POCKE=\ - ".\screen.h"\ - ".\SDL.h"\ - ".\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_POCKE=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\debug.h"\ - "..\gameDetector.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\gapi\inc\gx.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - ".\SDLAudio\include\begin_code.h"\ - ".\SDLAudio\include\close_code.h"\ - ".\SDLAudio\include\SDL.h"\ - ".\SDLAudio\include\SDL_active.h"\ - ".\SDLAudio\include\SDL_audio.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - ".\SDLAudio\include\SDL_cdrom.h"\ - ".\SDLAudio\include\SDL_error.h"\ - ".\SDLAudio\include\SDL_events.h"\ - ".\SDLAudio\include\SDL_getenv.h"\ - ".\SDLAudio\include\SDL_joystick.h"\ - ".\SDLAudio\include\SDL_keyboard.h"\ - ".\SDLAudio\include\SDL_keysym.h"\ - ".\SDLAudio\include\SDL_main.h"\ - ".\SDLAudio\include\SDL_mouse.h"\ - ".\SDLAudio\include\SDL_mutex.h"\ - ".\SDLAudio\include\SDL_quit.h"\ - ".\SDLAudio\include\SDL_rwops.h"\ - ".\SDLAudio\include\SDL_thread.h"\ - ".\SDLAudio\include\SDL_timer.h"\ - ".\SDLAudio\include\SDL_types.h"\ - ".\SDLAudio\include\SDL_version.h"\ - ".\SDLAudio\include\SDL_video.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - -NODEP_CPP_POCKE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_POCKE=\ - "..\boxes.h"\ - "..\bundle.h"\ - "..\config-file.h"\ - "..\debug.h"\ - "..\gameDetector.h"\ - "..\gapi_keys.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\simon\simon.h"\ - "..\sound\mididrv.h"\ - "..\sound\mixer.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\gapi\inc\gx.h"\ - ".\mad\include\mad.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - ".\SDLAudio\include\begin_code.h"\ - ".\SDLAudio\include\close_code.h"\ - ".\SDLAudio\include\SDL.h"\ - ".\SDLAudio\include\SDL_active.h"\ - ".\SDLAudio\include\SDL_audio.h"\ - ".\SDLAudio\include\SDL_byteorder.h"\ - ".\SDLAudio\include\SDL_cdrom.h"\ - ".\SDLAudio\include\SDL_error.h"\ - ".\SDLAudio\include\SDL_events.h"\ - ".\SDLAudio\include\SDL_getenv.h"\ - ".\SDLAudio\include\SDL_joystick.h"\ - ".\SDLAudio\include\SDL_keyboard.h"\ - ".\SDLAudio\include\SDL_keysym.h"\ - ".\SDLAudio\include\SDL_main.h"\ - ".\SDLAudio\include\SDL_mouse.h"\ - ".\SDLAudio\include\SDL_mutex.h"\ - ".\SDLAudio\include\SDL_quit.h"\ - ".\SDLAudio\include\SDL_rwops.h"\ - ".\SDLAudio\include\SDL_thread.h"\ - ".\SDLAudio\include\SDL_timer.h"\ - ".\SDLAudio\include\SDL_types.h"\ - ".\SDLAudio\include\SDL_version.h"\ - ".\SDLAudio\include\SDL_video.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - -NODEP_CPP_POCKE=\ - "..\macos.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_POCKE=\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\stdafx.h"\ - ".\missing\unistd.h"\ - -NODEP_CPP_POCKE=\ - ".\screen.h"\ - ".\SDL.h"\ - ".\sound.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_POCKE=\ - "..\akos.h"\ - "..\boxes.h"\ - "..\gfx.h"\ - "..\gui.h"\ - "..\scumm.h"\ - "..\scummsys.h"\ - "..\smush.h"\ - "..\stdafx.h"\ - "..\system.h"\ - ".\gapi\inc\gx.h"\ - ".\missing\unistd.h"\ - ".\screen.h"\ - -NODEP_CPP_POCKE=\ - "..\gmidi.h"\ - "..\sound.h"\ - ".\ipapi.h"\ - ".\SDL.h"\ - ".\SDL_audio.h"\ - ".\SDL_thread.h"\ - ".\SDL_timer.h"\ - ".\ygshell.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\PocketSCUMM.rc - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\screen.cpp - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -DEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -DEP_CPP_SCREE=\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -DEP_CPP_SCREE=\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -DEP_CPP_SCREE=\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -DEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -DEP_CPP_SCREE=\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -DEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\screen.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -DEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\screen.h"\ - {$(INCLUDE)}"Aygshell.h"\ - {$(INCLUDE)}"sipapi.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -DEP_CPP_SCREE=\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -DEP_CPP_SCREE=\ - ".\gapi\inc\gx.h"\ - ".\screen.h"\ - -NODEP_CPP_SCREE=\ - ".\ipapi.h"\ - ".\ygshell.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gapi\ARM\gx.lib - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gapi\emu\gx.lib - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gapi\MIPS\gx.lib - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\gapi\SH\gx.lib - -!IF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE MIPS) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH4) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Release" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE SH3) Debug" - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE ARM) Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "PocketSCUMM - Win32 (WCE x86em) Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Group -# Begin Group "Port Header Files" - -# PROP Default_Filter "h" -# Begin Source File - -SOURCE=.\missing\assert.h -# End Source File -# Begin Source File - -SOURCE=.\missing\conio.h -# End Source File -# Begin Source File - -SOURCE=.\missing\dir.h -# End Source File -# Begin Source File - -SOURCE=.\missing\direct.h -# End Source File -# Begin Source File - -SOURCE=.\missing\dirent.h -# End Source File -# Begin Source File - -SOURCE=.\missing\errno.h -# End Source File -# Begin Source File - -SOURCE=.\missing\fcntl.h -# End Source File -# Begin Source File - -SOURCE=.\missing\io.h -# End Source File -# Begin Source File - -SOURCE=.\newres.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\screen.h -# End Source File -# Begin Source File - -SOURCE=.\missing\signal.h -# End Source File -# Begin Source File - -SOURCE=.\missing\sys\stat.h -# End Source File -# Begin Source File - -SOURCE=.\missing\sys\time.h -# End Source File -# Begin Source File - -SOURCE=.\missing\time.h -# End Source File -# Begin Source File - -SOURCE=.\missing\sys\types.h -# End Source File -# Begin Source File - -SOURCE=.\missing\unistd.h -# End Source File -# End Group -# End Target -# End Project diff --git a/wince/PocketSCUMM.vcw b/wince/PocketSCUMM.vcw deleted file mode 100755 index 9961cf0d39..0000000000 --- a/wince/PocketSCUMM.vcw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "PocketSCUMM"=.\PocketSCUMM.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/wince/bitmaps.cpp b/wince/bitmaps.cpp deleted file mode 100755 index 3b23330fde..0000000000 --- a/wince/bitmaps.cpp +++ /dev/null @@ -1,10720 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifdef _WIN32_WCE - -// Bitmaps used for WCE - -#include -#include "screen.h" - -// Loading - -unsigned char item_loading_colors[] = { - 0x04, 0x02, 0x04, - 0x21, 0x11, 0x1d, - 0x40, 0x21, 0x37, - 0x2c, 0x17, 0x26, - 0x7d, 0x41, 0x6b, - 0xf6, 0x80, 0xd3, - 0xb9, 0x60, 0x9f, - 0x90, 0x4b, 0x7c, - 0x18, 0x0c, 0x15, - 0x9b, 0x51, 0x85, - 0x5e, 0x31, 0x51, - 0xcd, 0x6b, 0xb0, - 0xe1, 0x75, 0xc1, - 0x36, 0x1c, 0x2f, - 0xc3, 0x65, 0xa7, - 0x4a, 0x27, 0x40, - 0xd8, 0x70, 0xb9, - 0x72, 0x3b, 0x62, - 0x55, 0x2c, 0x49, - 0x87, 0x46, 0x74, - 0xaf, 0x5b, 0x96, - 0xec, 0x7b, 0xca, - 0x69, 0x36, 0x5a, - 0xa5, 0x56, 0x8e - -}; -unsigned char item_loading[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x07, - 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x02, 0x08, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, 0x05, 0x05, 0x05, - 0x05, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, - 0x0b, 0x05, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0d, 0x0b, 0x05, 0x0c, 0x09, 0x09, 0x05, 0x06, 0x00, - 0x00, 0x07, 0x06, 0x06, 0x00, 0x00, 0x07, 0x06, 0x06, - 0x08, 0x07, 0x0c, 0x05, 0x0e, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x0b, 0x05, 0x05, 0x0b, 0x04, 0x04, 0x04, - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x0b, 0x05, 0x05, 0x0b, - 0x0b, 0x05, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x10, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x11, 0x00, 0x00, 0x00, - 0x12, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, - 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, - 0x05, 0x0b, 0x05, 0x05, 0x05, 0x05, 0x10, 0x00, 0x00, - 0x00, 0x12, 0x05, 0x05, 0x09, 0x13, 0x0c, 0x05, 0x05, - 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x12, - 0x00, 0x00, 0x04, 0x05, 0x05, 0x0a, 0x00, 0x00, 0x12, - 0x05, 0x14, 0x01, 0x08, 0x14, 0x05, 0x06, 0x00, 0x00, - 0x03, 0x05, 0x05, 0x05, 0x14, 0x04, 0x0e, 0x05, 0x05, - 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, - 0x05, 0x05, 0x05, 0x0e, 0x13, 0x0c, 0x05, 0x05, 0x03, - 0x00, 0x00, 0x0c, 0x05, 0x04, 0x00, 0x00, 0x0d, 0x05, - 0x15, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x05, 0x0b, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, - 0x00, 0x09, 0x05, 0x05, 0x16, 0x00, 0x00, 0x00, 0x13, - 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, - 0x06, 0x05, 0x05, 0x16, 0x00, 0x00, 0x13, 0x05, 0x05, - 0x02, 0x00, 0x00, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x05, - 0x13, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x11, 0x14, 0x10, 0x05, 0x06, - 0x00, 0x00, 0x0c, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, - 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x05, 0x02, 0x00, 0x00, 0x0c, 0x05, 0x04, 0x00, 0x00, - 0x0d, 0x05, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, - 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x07, 0x05, 0x05, 0x10, 0x10, 0x05, - 0x06, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, - 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x12, 0x05, 0x05, 0x13, - 0x13, 0x0c, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x05, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x05, - 0x05, 0x00, 0x00, 0x14, 0x05, 0x0b, 0x0d, 0x00, 0x04, - 0x05, 0x06, 0x00, 0x00, 0x05, 0x05, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, - 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x0f, 0x0c, 0x15, - 0x05, 0x05, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x05, - 0x05, 0x14, 0x00, 0x03, 0x05, 0x05, 0x01, 0x00, 0x00, - 0x04, 0x05, 0x06, 0x00, 0x00, 0x06, 0x05, 0x05, 0x0d, - 0x00, 0x00, 0x00, 0x13, 0x05, 0x06, 0x00, 0x00, 0x06, - 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x17, 0x05, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x05, 0x16, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x00, 0x09, 0x05, 0x05, 0x12, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x0a, 0x00, 0x02, 0x05, 0x05, 0x01, 0x00, - 0x08, 0x0b, 0x05, 0x06, 0x00, 0x00, 0x0a, 0x05, 0x05, - 0x0c, 0x11, 0x02, 0x04, 0x05, 0x05, 0x06, 0x00, 0x00, - 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x02, 0x05, 0x05, - 0x0c, 0x06, 0x04, 0x11, 0x02, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, - 0x06, 0x03, 0x00, 0x00, 0x07, 0x06, 0x06, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x06, 0x00, 0x08, 0x0c, 0x05, 0x05, 0x06, 0x10, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x05, 0x0c, - 0x06, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x0d, 0x00, 0x0b, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x00, - 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, 0x09, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0e, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x06, 0x00, 0x00, 0x03, 0x0e, 0x05, 0x05, - 0x05, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, - 0x05, 0x05, 0x10, 0x02, 0x0c, 0x05, 0x05, 0x11, 0x00, - 0x08, 0x0e, 0x05, 0x05, 0x05, 0x10, 0x17, 0x05, 0x06, - 0x00, 0x00, 0x06, 0x05, 0x05, 0x00, 0x00, 0x06, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x05, 0x02, 0x00, - 0x00, 0x04, 0x05, 0x0e, 0x06, 0x0b, 0x05, 0x05, 0x05, - 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x05, 0x02, 0x00, 0x00, 0x06, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x05, 0x05, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x00, 0x00, 0x08, 0x02, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, - 0x03, 0x00, 0x00, 0x03, 0x02, 0x02, 0x00, 0x00, 0x03, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x08, - 0x00, 0x17, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x08, 0x00, 0x00, 0x03, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x05, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x05, 0x05, 0x0d, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0b, 0x05, 0x05, 0x09, 0x04, - 0x13, 0x10, 0x05, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// ************************************************************************* -// PORTRAIT -// ************************************************************************* - -unsigned char item_toolbarPortrait_colors[] = { - 0x00, 0x00, 0x00, - 0x04, 0x02, 0x04, - 0x0c, 0x02, 0x04, - 0x24, 0x06, 0x04, - 0x84, 0x16, 0x14, - 0x9c, 0x1a, 0x1c, - 0x74, 0x16, 0x14, - 0x1c, 0x06, 0x04, - 0x5c, 0x0e, 0x0c, - 0x4c, 0x0e, 0x0c, - 0x44, 0x0a, 0x0c, - 0x64, 0x12, 0x14, - 0x8c, 0x1a, 0x1c, - 0xc4, 0x22, 0x24, - 0xb4, 0x1e, 0x1c, - 0x0c, 0x06, 0x04, - 0xa4, 0x1e, 0x1c, - 0x34, 0x0a, 0x0c, - 0x14, 0x16, 0x14, - 0x64, 0x66, 0x64, - 0x1c, 0x16, 0x1c, - 0x1c, 0x1a, 0x1c, - 0x3c, 0x3e, 0x3c, - 0x34, 0x36, 0x34, - 0x34, 0x32, 0x34, - 0x6c, 0x6a, 0x6c, - 0xb4, 0xb2, 0xb4, - 0x4c, 0x4e, 0x4c, - 0x94, 0x92, 0x94, - 0x94, 0x96, 0x94, - 0x7c, 0x7e, 0x7c, - 0x9c, 0x9e, 0x9c, - 0x0c, 0x0a, 0x0c, - 0x44, 0x46, 0x44, - 0x5c, 0x5a, 0x5c, - 0x74, 0x76, 0x74, - 0xc4, 0xc2, 0xc4, - 0x84, 0x82, 0x84, - 0x9c, 0x9a, 0x9c, - 0x74, 0x72, 0x74, - 0x24, 0x26, 0x24, - 0xa4, 0xa6, 0xa4, - 0x3c, 0x3a, 0x3c, - 0x8c, 0x8e, 0x8c, - 0x2c, 0x7e, 0xb4, - 0xbc, 0xbe, 0xbc, - 0x6c, 0x6e, 0x6c, - 0x1c, 0x1e, 0x1c, - 0x2c, 0x5e, 0x7c, - 0xac, 0xaa, 0xac, - 0x5c, 0x5e, 0x5c, - 0xa4, 0xa2, 0xa4, - 0xd4, 0xd6, 0xd4, - 0xac, 0xae, 0xac, - 0xec, 0xee, 0xec, - 0xe4, 0xe6, 0xe4, - 0xfc, 0xfa, 0xfc, - 0x1c, 0x0a, 0x0c, - 0x2c, 0x0e, 0x0c, - 0x24, 0x0a, 0x0c, - 0x14, 0x06, 0x04, - 0x34, 0x0e, 0x0c, - 0xcc, 0xce, 0xcc, - 0xf4, 0xf2, 0xf4, - 0x0c, 0x0a, 0x04, - 0x24, 0x1a, 0x0c, - 0x2c, 0x1e, 0x14, - 0x24, 0x1e, 0x0c, - 0x24, 0x1e, 0x14, - 0x1c, 0x16, 0x0c, - 0x14, 0x0e, 0x04, - 0x04, 0x06, 0x04, - 0x14, 0x12, 0x0c, - 0x5c, 0x1a, 0x1c, - 0x94, 0x26, 0x24, - 0xb4, 0x2e, 0x2c, - 0xd4, 0x3a, 0x3c, - 0xcc, 0x36, 0x34, - 0xa4, 0x2e, 0x2c, - 0x54, 0x16, 0x14, - 0x4c, 0x16, 0x14, - 0x7c, 0x22, 0x24, - 0x9c, 0x2a, 0x2c, - 0xbc, 0x36, 0x34, - 0xb4, 0x32, 0x34, - 0xac, 0x2e, 0x2c, - 0x2c, 0x0a, 0x0c, - 0xa4, 0x2a, 0x2c, - 0x6c, 0x1e, 0x1c, - 0x64, 0x1e, 0x1c, - 0x94, 0x2a, 0x2c, - 0x34, 0x22, 0x24, - 0x64, 0x4a, 0x24, - 0xc4, 0x96, 0x4c, - 0xd4, 0xa2, 0x54, - 0xcc, 0x9e, 0x54, - 0x84, 0x66, 0x34, - 0x14, 0x0e, 0x0c, - 0xec, 0xb2, 0x5c, - 0xdc, 0xaa, 0x5c, - 0x94, 0x72, 0x3c, - 0xe4, 0xb2, 0x5c, - 0x4c, 0x3a, 0x1c, - 0xc4, 0x36, 0x34, - 0xbc, 0x32, 0x34, - 0xc4, 0x32, 0x34, - 0x8c, 0x26, 0x24, - 0x44, 0x12, 0x14, - 0x74, 0x1e, 0x1c, - 0x5c, 0x16, 0x14, - 0xb4, 0x86, 0x44, - 0xfc, 0xc6, 0x6c, - 0xf4, 0xbe, 0x64, - 0xf4, 0xba, 0x64, - 0xfc, 0xbe, 0x64, - 0xec, 0xb6, 0x64, - 0x2c, 0x22, 0x14, - 0xfc, 0xce, 0x6c, - 0xfc, 0xc2, 0x64, - 0xcc, 0x9a, 0x54, - 0xdc, 0xa6, 0x54, - 0xfc, 0xd2, 0x6c, - 0x5c, 0x46, 0x24, - 0xcc, 0x3a, 0x3c, - 0x84, 0x22, 0x24, - 0x84, 0x26, 0x24, - 0xdc, 0xde, 0xdc, - 0xe4, 0xe2, 0xe4, - 0x5c, 0x4a, 0x2c, - 0xec, 0xb6, 0x5c, - 0x9c, 0x7a, 0x3c, - 0xfc, 0xc6, 0x64, - 0x34, 0x26, 0x14, - 0x4c, 0x12, 0x14, - 0x64, 0x1a, 0x1c, - 0x54, 0x3e, 0x24, - 0xf4, 0xb6, 0x64, - 0x6c, 0x56, 0x2c, - 0x3c, 0x2a, 0x14, - 0x44, 0x32, 0x1c, - 0xac, 0x32, 0x34, - 0x54, 0x1a, 0x1c, - 0x3c, 0x12, 0x14, - 0xe4, 0xae, 0x5c, - 0x6c, 0x52, 0x2c, - 0x74, 0x5a, 0x34, - 0xc4, 0x9a, 0x54, - 0x7c, 0x62, 0x34, - 0x84, 0x62, 0x34, - 0xbc, 0xba, 0xbc, - 0x7c, 0x5e, 0x34, - 0x8c, 0x66, 0x34, - 0x9c, 0x76, 0x3c, - 0x94, 0x6e, 0x3c, - 0x8c, 0x6a, 0x3c, - 0x74, 0x22, 0x24, - 0xbc, 0x8e, 0x4c, - 0xb4, 0x8a, 0x4c, - 0xb4, 0x8e, 0x4c, - 0x44, 0x36, 0x1c, - 0x7c, 0x5a, 0x34, - 0x8c, 0x6a, 0x34, - 0x74, 0x56, 0x2c, - 0x5c, 0x4a, 0x24, - 0xbc, 0x92, 0x4c, - 0xe4, 0xaa, 0x5c, - 0x64, 0x4e, 0x2c, - 0x54, 0x3e, 0x1c, - 0x8c, 0x6e, 0x3c, - 0x0c, 0x06, 0x0c, - 0xa4, 0x7e, 0x44, - 0x94, 0x76, 0x3c, - 0x9c, 0x2e, 0x34, - 0x8c, 0x2a, 0x2c, - 0x8c, 0x8a, 0x8c, - 0x54, 0x42, 0x24, - 0x4c, 0x3e, 0x1c, - 0xd4, 0xa6, 0x54, - 0x1c, 0x1a, 0x0c, - 0x2c, 0x2e, 0x2c, - 0xac, 0x82, 0x44 - -}; -unsigned char item_toolbarPortrait[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x06, 0x07, 0x01, 0x01, 0x01, 0x01, 0x02, 0x08, - 0x06, 0x04, 0x05, 0x08, 0x09, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x07, 0x08, 0x04, 0x04, 0x04, 0x06, - 0x0a, 0x01, 0x0b, 0x04, 0x05, 0x04, 0x01, 0x01, 0x01, - 0x08, 0x04, 0x04, 0x05, 0x03, 0x03, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x0c, 0x04, 0x0c, 0x08, 0x03, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x04, 0x05, 0x04, 0x05, 0x0b, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, - 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0f, - 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x0d, 0x0e, 0x0d, - 0x0d, 0x10, 0x03, 0x01, 0x01, 0x01, 0x02, 0x06, 0x0d, - 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x05, 0x01, 0x04, 0x0d, - 0x0d, 0x0e, 0x01, 0x01, 0x11, 0x0d, 0x0d, 0x0d, 0x08, - 0x01, 0x03, 0x0d, 0x0e, 0x0d, 0x0d, 0x0e, 0x0d, 0x0d, - 0x0e, 0x08, 0x11, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, - 0x0d, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x11, 0x0d, 0x0d, 0x05, 0x11, - 0x0a, 0x0e, 0x0d, 0x0e, 0x08, 0x01, 0x06, 0x0e, 0x0d, - 0x0d, 0x0e, 0x04, 0x0e, 0x0e, 0x0d, 0x0d, 0x0e, 0x02, - 0x01, 0x01, 0x05, 0x0e, 0x0d, 0x0d, 0x0e, 0x05, 0x04, - 0x04, 0x04, 0x01, 0x05, 0x0e, 0x0d, 0x0d, 0x01, 0x02, - 0x0e, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x11, 0x0d, 0x0d, - 0x0d, 0x0b, 0x08, 0x08, 0x08, 0x08, 0x11, 0x02, 0x08, - 0x08, 0x08, 0x0d, 0x0d, 0x0e, 0x06, 0x08, 0x08, 0x0a, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x11, 0x0e, 0x0d, 0x04, 0x01, 0x01, 0x04, 0x0d, 0x0d, - 0x08, 0x11, 0x0d, 0x0d, 0x0d, 0x04, 0x02, 0x01, 0x01, - 0x0a, 0x0d, 0x0e, 0x0d, 0x06, 0x01, 0x08, 0x0e, 0x0d, - 0x0d, 0x06, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, - 0x0d, 0x0d, 0x0e, 0x01, 0x06, 0x0d, 0x0d, 0x0e, 0x02, - 0x01, 0x01, 0x11, 0x0e, 0x0d, 0x0d, 0x11, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0e, 0x0d, - 0x0d, 0x11, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x12, 0x12, 0x12, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x0d, 0x0d, 0x04, - 0x01, 0x03, 0x0d, 0x0d, 0x0e, 0x0a, 0x0b, 0x0d, 0x0e, - 0x0d, 0x02, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0d, - 0x0e, 0x01, 0x05, 0x0d, 0x0d, 0x10, 0x02, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0d, 0x0e, 0x08, - 0x0d, 0x0d, 0x0e, 0x03, 0x01, 0x01, 0x01, 0x11, 0x0d, - 0x0d, 0x0e, 0x05, 0x05, 0x04, 0x0c, 0x09, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x0d, 0x0d, 0x0d, 0x03, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x13, 0x13, 0x14, 0x12, 0x15, 0x16, - 0x17, 0x18, 0x12, 0x14, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x0d, 0x0e, 0x0b, 0x10, 0x0d, 0x0d, 0x0e, - 0x05, 0x01, 0x04, 0x0d, 0x0d, 0x04, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x08, 0x0e, 0x0d, 0x0d, 0x01, 0x0d, 0x0d, - 0x0e, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x04, 0x0d, 0x0d, 0x04, 0x10, 0x0d, 0x0e, 0x05, 0x01, - 0x01, 0x01, 0x01, 0x03, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, - 0x0e, 0x0d, 0x08, 0x01, 0x01, 0x01, 0x01, 0x03, 0x0e, - 0x0d, 0x0d, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x13, 0x19, 0x13, 0x1a, - 0x19, 0x1b, 0x13, 0x1c, 0x1d, 0x1e, 0x18, 0x17, 0x18, - 0x13, 0x19, 0x13, 0x19, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x0d, 0x0d, - 0x08, 0x06, 0x0e, 0x0e, 0x06, 0x02, 0x01, 0x04, 0x0d, - 0x0d, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x0d, - 0x0e, 0x0e, 0x01, 0x0e, 0x0d, 0x0d, 0x08, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0d, 0x0e, 0x05, - 0x0a, 0x0d, 0x0d, 0x0d, 0x0a, 0x01, 0x01, 0x01, 0x08, - 0x0d, 0x0d, 0x0d, 0x0b, 0x08, 0x08, 0x08, 0x03, 0x01, - 0x01, 0x01, 0x01, 0x11, 0x0d, 0x0d, 0x0e, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x19, - 0x19, 0x1a, 0x1f, 0x1f, 0x1e, 0x20, 0x21, 0x22, 0x23, - 0x24, 0x1a, 0x25, 0x13, 0x19, 0x1f, 0x1f, 0x1a, 0x1a, - 0x19, 0x19, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x08, 0x0d, 0x0e, 0x08, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x03, 0x01, - 0x01, 0x01, 0x02, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x05, - 0x0e, 0x0d, 0x0e, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x05, 0x0d, 0x0d, 0x04, 0x01, 0x04, 0x0d, 0x0e, - 0x0e, 0x02, 0x01, 0x01, 0x08, 0x0d, 0x0e, 0x0d, 0x11, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, - 0x0d, 0x0d, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x26, 0x1a, 0x1f, 0x27, 0x27, - 0x28, 0x01, 0x18, 0x18, 0x17, 0x13, 0x1f, 0x1a, 0x29, - 0x1c, 0x2a, 0x2b, 0x1f, 0x26, 0x1a, 0x1f, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x0e, - 0x0d, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, - 0x0d, 0x0d, 0x0d, 0x0e, 0x08, 0x11, 0x09, 0x0e, 0x0d, - 0x0e, 0x0d, 0x03, 0x01, 0x08, 0x0d, 0x0d, 0x0e, 0x10, - 0x09, 0x0a, 0x03, 0x08, 0x03, 0x01, 0x0d, 0x0d, 0x0d, - 0x04, 0x01, 0x02, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x01, - 0x08, 0x0d, 0x0d, 0x0e, 0x08, 0x03, 0x11, 0x11, 0x08, - 0x01, 0x01, 0x01, 0x01, 0x08, 0x0d, 0x0d, 0x0e, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x2a, 0x1f, 0x29, 0x1c, 0x1d, 0x01, 0x01, 0x17, 0x2c, - 0x18, 0x18, 0x2d, 0x1e, 0x1a, 0x2b, 0x01, 0x29, 0x29, - 0x2b, 0x1f, 0x17, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x08, 0x0d, 0x0d, 0x08, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x0a, 0x0d, 0x0d, 0x0e, - 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, 0x09, 0x01, 0x01, - 0x01, 0x0b, 0x0d, 0x0d, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, - 0x11, 0x01, 0x0e, 0x0d, 0x0d, 0x04, 0x01, 0x01, 0x08, - 0x0d, 0x0e, 0x0d, 0x08, 0x01, 0x06, 0x0e, 0x0d, 0x0d, - 0x0d, 0x0d, 0x0d, 0x0e, 0x0d, 0x01, 0x01, 0x01, 0x01, - 0x08, 0x0d, 0x0e, 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x26, 0x26, - 0x1a, 0x2e, 0x2f, 0x18, 0x30, 0x17, 0x18, 0x31, 0x32, - 0x1a, 0x2b, 0x27, 0x1a, 0x1f, 0x2b, 0x1c, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, - 0x0d, 0x0e, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x03, 0x06, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, - 0x04, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x05, - 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x02, 0x01, 0x0d, 0x0e, - 0x0d, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x0e, 0x0d, 0x0e, - 0x03, 0x04, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, 0x0e, 0x0d, - 0x05, 0x01, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x0d, 0x0e, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x18, 0x1c, 0x1f, 0x26, 0x33, 0x16, - 0x18, 0x17, 0x1f, 0x34, 0x35, 0x1a, 0x27, 0x1a, 0x1f, - 0x2b, 0x2b, 0x18, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x03, 0x11, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x11, 0x03, 0x11, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x2e, 0x2b, 0x1c, 0x23, 0x21, 0x17, 0x1f, 0x36, 0x37, - 0x34, 0x1e, 0x1e, 0x26, 0x2b, 0x1c, 0x18, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x15, 0x1c, 0x2b, 0x2b, - 0x2b, 0x29, 0x34, 0x38, 0x36, 0x2d, 0x1d, 0x2b, 0x1c, - 0x2b, 0x2e, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x07, - 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x39, 0x39, 0x02, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3c, - 0x07, 0x3b, 0x3d, 0x3a, 0x3d, 0x3b, 0x07, 0x39, 0x01, - 0x01, 0x01, 0x07, 0x39, 0x03, 0x39, 0x3b, 0x39, 0x3c, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x3b, 0x39, 0x39, 0x03, - 0x39, 0x07, 0x0f, 0x01, 0x01, 0x02, 0x07, 0x3b, 0x39, - 0x39, 0x07, 0x3b, 0x39, 0x07, 0x02, 0x01, 0x01, 0x01, - 0x3c, 0x3b, 0x07, 0x39, 0x07, 0x3b, 0x07, 0x39, 0x03, - 0x01, 0x01, 0x01, 0x3c, 0x3b, 0x07, 0x3b, 0x39, 0x03, - 0x39, 0x39, 0x3b, 0x01, 0x01, 0x01, 0x01, 0x07, 0x39, - 0x03, 0x39, 0x2e, 0x2b, 0x1a, 0x3e, 0x3f, 0x3f, 0x38, - 0x38, 0x37, 0x3e, 0x31, 0x2b, 0x1c, 0x15, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x40, 0x41, 0x42, 0x43, 0x43, - 0x43, 0x44, 0x45, 0x01, 0x43, 0x44, 0x41, 0x43, 0x44, - 0x41, 0x43, 0x42, 0x46, 0x47, 0x01, 0x01, 0x48, 0x43, - 0x43, 0x41, 0x43, 0x44, 0x41, 0x42, 0x43, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x07, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4c, - 0x4d, 0x4b, 0x4e, 0x4f, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x3b, 0x50, 0x51, 0x52, 0x53, 0x4d, 0x4c, - 0x4d, 0x54, 0x55, 0x4e, 0x56, 0x01, 0x01, 0x54, 0x55, - 0x57, 0x4e, 0x4e, 0x4b, 0x58, 0x02, 0x01, 0x01, 0x01, - 0x59, 0x57, 0x4e, 0x55, 0x57, 0x4e, 0x57, 0x50, 0x01, - 0x01, 0x4f, 0x54, 0x57, 0x4e, 0x55, 0x57, 0x4e, 0x57, - 0x4e, 0x4f, 0x01, 0x01, 0x07, 0x5a, 0x55, 0x4e, 0x55, - 0x4e, 0x57, 0x55, 0x57, 0x55, 0x01, 0x01, 0x01, 0x58, - 0x55, 0x57, 0x4e, 0x4e, 0x4e, 0x55, 0x4e, 0x4b, 0x56, - 0x01, 0x01, 0x02, 0x55, 0x55, 0x57, 0x4e, 0x5b, 0x1c, - 0x1a, 0x36, 0x38, 0x38, 0x38, 0x38, 0x38, 0x34, 0x1a, - 0x2b, 0x27, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x5e, 0x5e, 0x60, 0x61, - 0x62, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x63, 0x64, - 0x40, 0x01, 0x01, 0x64, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, - 0x5e, 0x5f, 0x65, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x4e, 0x4d, - 0x67, 0x67, 0x68, 0x68, 0x69, 0x68, 0x67, 0x4d, 0x6a, - 0x3c, 0x01, 0x01, 0x01, 0x01, 0x02, 0x50, 0x4e, 0x4c, - 0x4d, 0x67, 0x69, 0x68, 0x68, 0x69, 0x67, 0x67, 0x4d, - 0x6b, 0x01, 0x01, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x4d, - 0x51, 0x01, 0x01, 0x01, 0x01, 0x6c, 0x53, 0x67, 0x67, - 0x67, 0x67, 0x68, 0x6d, 0x01, 0x01, 0x58, 0x4c, 0x67, - 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x6c, 0x01, 0x01, - 0x3d, 0x67, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, - 0x4c, 0x01, 0x01, 0x01, 0x6c, 0x4c, 0x67, 0x67, 0x69, - 0x67, 0x67, 0x67, 0x4c, 0x50, 0x01, 0x01, 0x50, 0x67, - 0x67, 0x67, 0x67, 0x67, 0x2b, 0x1a, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x38, 0x34, 0x1a, 0x2b, 0x32, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x40, 0x6e, 0x6f, 0x70, 0x71, - 0x72, 0x70, 0x73, 0x74, 0x43, 0x75, 0x71, 0x70, 0x71, - 0x70, 0x72, 0x71, 0x76, 0x77, 0x48, 0x01, 0x01, 0x78, - 0x70, 0x70, 0x71, 0x72, 0x71, 0x70, 0x72, 0x79, 0x7a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x52, 0x67, 0x68, 0x68, 0x68, 0x53, 0x68, - 0x53, 0x68, 0x68, 0x7b, 0x7c, 0x3c, 0x01, 0x01, 0x01, - 0x3c, 0x7d, 0x4d, 0x67, 0x4b, 0x69, 0x68, 0x53, 0x68, - 0x53, 0x68, 0x68, 0x68, 0x67, 0x6b, 0x01, 0x3b, 0x67, - 0x68, 0x68, 0x67, 0x68, 0x7b, 0x6d, 0x01, 0x01, 0x01, - 0x01, 0x6c, 0x68, 0x67, 0x4b, 0x53, 0x68, 0x54, 0x3d, - 0x01, 0x01, 0x51, 0x67, 0x67, 0x4b, 0x68, 0x67, 0x68, - 0x53, 0x68, 0x4a, 0x01, 0x01, 0x49, 0x4c, 0x4b, 0x53, - 0x68, 0x68, 0x53, 0x68, 0x68, 0x4b, 0x01, 0x01, 0x02, - 0x4a, 0x67, 0x68, 0x67, 0x53, 0x68, 0x68, 0x68, 0x4d, - 0x49, 0x01, 0x01, 0x7c, 0x53, 0x68, 0x68, 0x53, 0x68, - 0x68, 0x26, 0x7e, 0x38, 0x38, 0x38, 0x38, 0x7f, 0x2d, - 0x1a, 0x1c, 0x80, 0x46, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x66, 0x63, 0x71, 0x81, 0x71, 0x81, 0x71, 0x82, 0x01, - 0x7a, 0x83, 0x71, 0x81, 0x71, 0x81, 0x73, 0x81, 0x71, - 0x65, 0x46, 0x01, 0x84, 0x70, 0x71, 0x81, 0x71, 0x81, - 0x71, 0x81, 0x81, 0x70, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x68, 0x68, - 0x53, 0x69, 0x68, 0x68, 0x67, 0x4d, 0x4d, 0x7b, 0x4d, - 0x6a, 0x3c, 0x01, 0x01, 0x02, 0x51, 0x4d, 0x53, 0x69, - 0x53, 0x68, 0x53, 0x69, 0x67, 0x4d, 0x7b, 0x4d, 0x4d, - 0x4c, 0x86, 0x01, 0x3d, 0x4d, 0x68, 0x53, 0x4b, 0x67, - 0x4d, 0x49, 0x01, 0x01, 0x01, 0x01, 0x7c, 0x4b, 0x67, - 0x68, 0x68, 0x69, 0x55, 0x3d, 0x01, 0x02, 0x6c, 0x4d, - 0x53, 0x68, 0x53, 0x4b, 0x67, 0x68, 0x68, 0x54, 0x01, - 0x02, 0x7d, 0x67, 0x68, 0x68, 0x68, 0x67, 0x68, 0x68, - 0x67, 0x4a, 0x01, 0x01, 0x02, 0x52, 0x67, 0x68, 0x4b, - 0x67, 0x68, 0x67, 0x68, 0x67, 0x7c, 0x0f, 0x01, 0x55, - 0x68, 0x67, 0x68, 0x68, 0x67, 0x68, 0x2b, 0x7e, 0x38, - 0x38, 0x38, 0x38, 0x34, 0x1a, 0x1d, 0x2b, 0x65, 0x87, - 0x01, 0x01, 0x01, 0x01, 0x47, 0x64, 0x72, 0x81, 0x71, - 0x81, 0x73, 0x62, 0x43, 0x01, 0x7a, 0x6f, 0x81, 0x88, - 0x81, 0x88, 0x81, 0x71, 0x81, 0x75, 0x74, 0x01, 0x89, - 0x71, 0x81, 0x88, 0x81, 0x73, 0x81, 0x71, 0x70, 0x78, - 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x58, 0x68, 0x67, 0x4b, 0x53, 0x67, 0x68, - 0x7d, 0x6d, 0x49, 0x58, 0x4a, 0x5a, 0x07, 0x01, 0x01, - 0x86, 0x4d, 0x67, 0x68, 0x68, 0x68, 0x68, 0x67, 0x54, - 0x7c, 0x86, 0x6d, 0x49, 0x6c, 0x7d, 0x4f, 0x01, 0x3d, - 0x67, 0x68, 0x68, 0x68, 0x68, 0x7b, 0x6d, 0x01, 0x01, - 0x01, 0x01, 0x55, 0x53, 0x68, 0x68, 0x53, 0x68, 0x55, - 0x3a, 0x01, 0x02, 0x51, 0x4d, 0x68, 0x69, 0x68, 0x67, - 0x68, 0x68, 0x53, 0x4b, 0x0f, 0x3c, 0x4b, 0x69, 0x68, - 0x53, 0x67, 0x4b, 0x53, 0x68, 0x67, 0x4a, 0x01, 0x01, - 0x02, 0x4a, 0x69, 0x68, 0x68, 0x67, 0x4b, 0x53, 0x68, - 0x67, 0x4a, 0x02, 0x3b, 0x68, 0x67, 0x4b, 0x68, 0x67, - 0x4b, 0x53, 0x68, 0x2d, 0x7e, 0x38, 0x38, 0x38, 0x34, - 0x1a, 0x1c, 0x73, 0x81, 0x64, 0x01, 0x01, 0x01, 0x01, - 0x8b, 0x78, 0x70, 0x88, 0x81, 0x71, 0x76, 0x60, 0x01, - 0x01, 0x7a, 0x76, 0x71, 0x81, 0x71, 0x81, 0x71, 0x81, - 0x88, 0x6f, 0x66, 0x01, 0x6e, 0x73, 0x71, 0x81, 0x71, - 0x81, 0x88, 0x81, 0x70, 0x63, 0x8a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x68, - 0x53, 0x68, 0x69, 0x4b, 0x54, 0x85, 0x01, 0x01, 0x01, - 0x3c, 0x3d, 0x02, 0x01, 0x07, 0x8c, 0x68, 0x4b, 0x67, - 0x68, 0x68, 0x67, 0x4a, 0x3d, 0x0f, 0x01, 0x01, 0x01, - 0x01, 0x02, 0x3c, 0x01, 0x3d, 0x67, 0x68, 0x53, 0x68, - 0x67, 0x67, 0x8d, 0x01, 0x01, 0x01, 0x01, 0x57, 0x68, - 0x67, 0x68, 0x68, 0x69, 0x55, 0x8e, 0x01, 0x0f, 0x7c, - 0x67, 0x68, 0x53, 0x68, 0x4b, 0x67, 0x68, 0x68, 0x54, - 0x3d, 0x3a, 0x7b, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, - 0x68, 0x67, 0x4a, 0x01, 0x01, 0x01, 0x55, 0x67, 0x68, - 0x53, 0x68, 0x68, 0x68, 0x68, 0x67, 0x68, 0x0f, 0x86, - 0x53, 0x68, 0x53, 0x67, 0x68, 0x68, 0x68, 0x68, 0x1a, - 0x34, 0x38, 0x38, 0x38, 0x7e, 0x1a, 0x2b, 0x73, 0x81, - 0x5f, 0x01, 0x01, 0x01, 0x01, 0x60, 0x76, 0x88, 0x81, - 0x71, 0x81, 0x8f, 0x46, 0x01, 0x01, 0x90, 0x83, 0x73, - 0x81, 0x88, 0x81, 0x81, 0x73, 0x81, 0x76, 0x91, 0x46, - 0x73, 0x81, 0x88, 0x81, 0x73, 0x81, 0x71, 0x81, 0x70, - 0x63, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3d, 0x69, 0x68, 0x68, 0x53, 0x68, - 0x68, 0x4a, 0x56, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x6d, 0x4b, 0x53, 0x68, 0x53, 0x68, 0x53, 0x52, 0x07, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x6b, 0x67, 0x68, 0x68, 0x68, 0x67, 0x55, 0x09, 0x01, - 0x01, 0x01, 0x01, 0x4e, 0x67, 0x4b, 0x53, 0x68, 0x53, - 0x4e, 0x07, 0x01, 0x07, 0x5a, 0x67, 0x68, 0x68, 0x68, - 0x52, 0x68, 0x68, 0x53, 0x4b, 0x85, 0x49, 0x4d, 0x53, - 0x69, 0x4e, 0x55, 0x69, 0x68, 0x53, 0x69, 0x4a, 0x01, - 0x01, 0x3c, 0x67, 0x68, 0x68, 0x68, 0x55, 0x55, 0x67, - 0x68, 0x68, 0x4d, 0x01, 0x6a, 0x69, 0x68, 0x68, 0x54, - 0x4a, 0x69, 0x53, 0x68, 0x1a, 0x34, 0x38, 0x38, 0x7e, - 0x34, 0x1a, 0x2b, 0x81, 0x71, 0x78, 0x84, 0x01, 0x01, - 0x43, 0x92, 0x76, 0x81, 0x73, 0x81, 0x76, 0x93, 0x01, - 0x01, 0x47, 0x60, 0x72, 0x71, 0x81, 0x71, 0x5e, 0x78, - 0x71, 0x73, 0x76, 0x94, 0x66, 0x81, 0x73, 0x81, 0x65, - 0x5d, 0x71, 0x88, 0x81, 0x70, 0x78, 0x8a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x7c, 0x67, 0x68, 0x68, 0x68, 0x67, 0x67, 0x57, 0x50, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x51, 0x53, 0x69, 0x68, - 0x68, 0x68, 0x68, 0x4f, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x67, 0x68, 0x53, - 0x68, 0x67, 0x54, 0x6b, 0x01, 0x01, 0x01, 0x01, 0x57, - 0x68, 0x68, 0x69, 0x68, 0x67, 0x57, 0x0f, 0x01, 0x07, - 0x4a, 0x67, 0x68, 0x67, 0x67, 0x6a, 0x54, 0x53, 0x68, - 0x68, 0x58, 0x7d, 0x67, 0x68, 0x67, 0x6a, 0x6a, 0x67, - 0x68, 0x68, 0x67, 0x5a, 0x01, 0x01, 0x01, 0x4d, 0x67, - 0x68, 0x53, 0x57, 0x52, 0x53, 0x68, 0x53, 0x4d, 0x8e, - 0x4b, 0x53, 0x68, 0x68, 0x6a, 0x5a, 0x67, 0x68, 0x68, - 0x26, 0x95, 0x7e, 0x38, 0x7e, 0x34, 0x1a, 0x1c, 0x81, - 0x71, 0x65, 0x96, 0x01, 0x01, 0x90, 0x70, 0x81, 0x71, - 0x81, 0x71, 0x8f, 0x45, 0x01, 0x01, 0x47, 0x97, 0x76, - 0x73, 0x81, 0x70, 0x92, 0x77, 0x71, 0x81, 0x72, 0x98, - 0x99, 0x73, 0x81, 0x71, 0x8f, 0x9a, 0x76, 0x81, 0x71, - 0x71, 0x78, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x3c, 0x6a, 0x4d, 0x53, - 0x68, 0x53, 0x4b, 0x67, 0x68, 0x86, 0x01, 0x01, 0x01, - 0x01, 0x4e, 0x4b, 0x68, 0x67, 0x68, 0x53, 0x4e, 0x07, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x49, 0x67, 0x68, 0x68, 0x68, 0x68, 0x4b, 0x3d, - 0x01, 0x01, 0x01, 0x3c, 0x4e, 0x69, 0x68, 0x53, 0x68, - 0x53, 0x57, 0x3c, 0x01, 0x3b, 0x52, 0x67, 0x68, 0x68, - 0x67, 0x58, 0x4b, 0x68, 0x67, 0x4b, 0x7d, 0x4b, 0x68, - 0x68, 0x69, 0x86, 0x51, 0x4d, 0x53, 0x68, 0x68, 0x4a, - 0x01, 0x01, 0x3b, 0x4d, 0x68, 0x68, 0x67, 0x57, 0x6a, - 0x55, 0x69, 0x68, 0x67, 0x9b, 0x4b, 0x68, 0x53, 0x54, - 0x6d, 0x4a, 0x67, 0x68, 0x53, 0x2b, 0x1a, 0x7e, 0x7e, - 0x34, 0x95, 0x1d, 0x2b, 0x81, 0x71, 0x81, 0x9c, 0x01, - 0x45, 0x9d, 0x76, 0x71, 0x81, 0x71, 0x76, 0x64, 0x01, - 0x01, 0x01, 0x47, 0x82, 0x72, 0x71, 0x81, 0x70, 0x6e, - 0x9e, 0x72, 0x81, 0x70, 0x6e, 0x5f, 0x81, 0x71, 0x81, - 0x5d, 0x7a, 0x83, 0x73, 0x81, 0x70, 0x63, 0x8a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x3c, 0x51, 0x4d, 0x68, 0x67, 0x68, 0x68, - 0x67, 0x67, 0x86, 0x01, 0x01, 0x01, 0x4e, 0x68, 0x53, - 0x4b, 0x67, 0x68, 0x4e, 0x0f, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x67, 0x68, - 0x53, 0x68, 0x67, 0x54, 0x6b, 0x01, 0x01, 0x01, 0x3c, - 0x55, 0x53, 0x68, 0x68, 0x68, 0x68, 0x4e, 0x3c, 0x01, - 0x3d, 0x55, 0x69, 0x68, 0x53, 0x4d, 0x3b, 0x4b, 0x53, - 0x68, 0x53, 0x55, 0x68, 0x53, 0x69, 0x4e, 0x49, 0x7c, - 0x67, 0x68, 0x68, 0x67, 0x4a, 0x01, 0x01, 0x3d, 0x4d, - 0x53, 0x68, 0x67, 0x5a, 0x4f, 0x52, 0x67, 0x68, 0x67, - 0x55, 0x68, 0x68, 0x68, 0x4b, 0x3a, 0x69, 0x68, 0x68, - 0x69, 0x1c, 0x1d, 0x95, 0x34, 0x95, 0x1d, 0x2b, 0x1c, - 0x88, 0x81, 0x71, 0x5f, 0x46, 0x9f, 0x76, 0x71, 0x81, - 0x88, 0x81, 0x76, 0x84, 0x01, 0x01, 0x01, 0x40, 0x5d, - 0x71, 0x81, 0x71, 0x76, 0xa0, 0xa1, 0x76, 0x73, 0x71, - 0x5e, 0x81, 0x88, 0x81, 0x73, 0x99, 0xa2, 0x6f, 0x88, - 0x81, 0x70, 0x78, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, - 0x6c, 0x67, 0x68, 0x68, 0x67, 0x68, 0x68, 0x67, 0x50, - 0x01, 0x01, 0x52, 0x68, 0x69, 0x68, 0x67, 0x68, 0x55, - 0x3b, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x7d, 0x69, 0x68, 0x68, 0x68, 0x67, 0x4b, - 0x3d, 0x01, 0x01, 0x01, 0x3a, 0x4b, 0x68, 0x68, 0x69, - 0x53, 0x67, 0x4e, 0x3c, 0x01, 0x8e, 0x55, 0x67, 0x68, - 0x68, 0x4c, 0x02, 0x4e, 0x68, 0x68, 0x68, 0x68, 0x68, - 0x68, 0x67, 0x6a, 0x6b, 0x5a, 0x67, 0x68, 0x69, 0x67, - 0x58, 0x01, 0x01, 0x8e, 0x4d, 0x68, 0x68, 0x67, 0x6a, - 0x85, 0x5a, 0x67, 0x68, 0x67, 0x4b, 0x53, 0x68, 0x53, - 0x4e, 0x02, 0x4c, 0x68, 0x53, 0x1d, 0x2b, 0x2b, 0x1a, - 0x34, 0x1a, 0x2b, 0x1c, 0x35, 0x81, 0x71, 0x81, 0x63, - 0x5c, 0x9a, 0x83, 0x88, 0x81, 0x73, 0x76, 0x82, 0x0f, - 0x01, 0x01, 0x01, 0x40, 0x5d, 0x70, 0x88, 0x81, 0x6f, - 0x5c, 0x89, 0x72, 0x71, 0x81, 0x73, 0x81, 0x73, 0x81, - 0x8f, 0xa3, 0x9a, 0x76, 0x81, 0x71, 0x72, 0x9d, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x50, 0x67, 0x68, - 0x4b, 0x67, 0x68, 0x4d, 0x4a, 0x07, 0x01, 0x6c, 0x53, - 0x68, 0x53, 0x4b, 0x67, 0x68, 0x6c, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x6a, 0x67, - 0x53, 0x69, 0x68, 0x53, 0x68, 0x6b, 0x01, 0x01, 0x01, - 0x3d, 0x54, 0x68, 0x67, 0x53, 0x4b, 0x67, 0x4a, 0x01, - 0x01, 0x3d, 0x69, 0x53, 0x68, 0x53, 0x4d, 0x3c, 0x7c, - 0x53, 0x68, 0x67, 0x53, 0x68, 0x68, 0x4d, 0x6c, 0x39, - 0x4a, 0x67, 0x68, 0x53, 0x67, 0x86, 0x01, 0x01, 0x4f, - 0x67, 0x69, 0x53, 0x69, 0x4a, 0x3d, 0x51, 0x67, 0x68, - 0x68, 0x68, 0x68, 0x69, 0x4b, 0x86, 0x3c, 0x4d, 0x67, - 0x1d, 0x1a, 0x2b, 0x1c, 0x1a, 0x95, 0x1a, 0x2b, 0x2b, - 0x1a, 0x1d, 0x81, 0x71, 0x65, 0xa4, 0x5e, 0x71, 0x81, - 0x71, 0x71, 0x70, 0x84, 0x01, 0x01, 0x01, 0x01, 0x40, - 0xa5, 0x71, 0x81, 0x71, 0x83, 0xa6, 0xa7, 0x65, 0x81, - 0x71, 0x81, 0x71, 0x81, 0x71, 0x8f, 0x46, 0xa8, 0x76, - 0x88, 0x81, 0x76, 0x9d, 0x45, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x03, 0x01, - 0x01, 0x01, 0x02, 0x7c, 0x4d, 0x53, 0x68, 0x68, 0x67, - 0x55, 0x3b, 0x01, 0x50, 0x4b, 0x68, 0x68, 0x53, 0x68, - 0x67, 0x4b, 0x6c, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x3a, 0x07, 0x01, 0x4a, 0x67, 0x4b, 0x68, 0x67, 0x68, - 0x67, 0x51, 0x01, 0x01, 0x01, 0x6a, 0x68, 0x67, 0x4b, - 0x69, 0x68, 0x53, 0x52, 0x01, 0x01, 0x4f, 0x4c, 0x68, - 0x68, 0x69, 0x4d, 0x3c, 0x49, 0x4b, 0x67, 0x4b, 0x68, - 0x68, 0x53, 0x68, 0x50, 0x3c, 0x52, 0x67, 0x68, 0x68, - 0x4d, 0x6d, 0x01, 0x01, 0x86, 0x67, 0x68, 0x68, 0x67, - 0x52, 0x39, 0x58, 0x4d, 0x53, 0x68, 0x67, 0x68, 0x53, - 0x68, 0x3d, 0x3c, 0x4c, 0x1d, 0x1a, 0x1a, 0x35, 0x2b, - 0x1d, 0x19, 0x19, 0x1c, 0x35, 0x1a, 0x1a, 0x1d, 0x81, - 0x73, 0x81, 0x73, 0x81, 0x88, 0x81, 0x83, 0x82, 0x46, - 0x01, 0x01, 0x01, 0x01, 0x46, 0x6f, 0x81, 0x71, 0x81, - 0x6f, 0x90, 0x74, 0x5e, 0x71, 0x81, 0x88, 0x81, 0x71, - 0x81, 0x6e, 0x01, 0x64, 0x76, 0x73, 0x81, 0x76, 0x6e, - 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x54, 0x4b, 0x68, 0x7d, 0x7c, 0x4a, 0x67, - 0x68, 0x68, 0x69, 0x53, 0x67, 0x52, 0x07, 0x01, 0x01, - 0x4e, 0x68, 0x53, 0x68, 0x68, 0x68, 0x53, 0x53, 0x4b, - 0x52, 0x7c, 0x7c, 0x55, 0x68, 0x67, 0x07, 0x01, 0x6c, - 0x67, 0x68, 0x53, 0x4b, 0x67, 0x67, 0x67, 0x4e, 0x7c, - 0x55, 0x68, 0x53, 0x67, 0x68, 0x53, 0x68, 0x68, 0x6c, - 0x01, 0x01, 0x50, 0x4d, 0x68, 0x53, 0x68, 0x67, 0x02, - 0x50, 0x68, 0x68, 0x68, 0x67, 0x68, 0x67, 0x57, 0x3a, - 0x07, 0x52, 0x67, 0x68, 0x53, 0x67, 0x86, 0x01, 0x01, - 0x86, 0x67, 0x68, 0x68, 0x67, 0x4a, 0x3c, 0x86, 0x4d, - 0x68, 0x68, 0x4b, 0x67, 0x68, 0x4b, 0x01, 0x3c, 0x1f, - 0x1a, 0x1a, 0x1d, 0x1d, 0x13, 0xa9, 0x47, 0x01, 0x13, - 0x19, 0x1a, 0x1a, 0x1a, 0x1f, 0x71, 0x81, 0x81, 0x88, - 0x81, 0x71, 0x71, 0x8a, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x46, 0x6f, 0x81, 0x88, 0x81, 0x76, 0x5c, 0x41, 0x92, - 0x70, 0x73, 0x81, 0x71, 0x81, 0x73, 0xa2, 0x01, 0x64, - 0x76, 0x81, 0x88, 0x76, 0x9d, 0x45, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x69, - 0x53, 0x69, 0x53, 0x68, 0x53, 0x68, 0x53, 0x68, 0x68, - 0x4d, 0x6c, 0x02, 0x01, 0x01, 0x8e, 0x4b, 0x69, 0x53, - 0x68, 0x67, 0x4b, 0x69, 0x68, 0x53, 0x69, 0x53, 0x68, - 0x68, 0x4d, 0x02, 0x01, 0x85, 0x67, 0x68, 0x68, 0x68, - 0x67, 0x4b, 0x68, 0x68, 0x67, 0x67, 0x68, 0x67, 0x4b, - 0x68, 0x68, 0x68, 0x55, 0x56, 0x01, 0x01, 0x86, 0x7b, - 0x68, 0x68, 0x67, 0x4e, 0x02, 0x3a, 0x68, 0x53, 0x68, - 0x68, 0x68, 0x67, 0x6a, 0x01, 0x07, 0x4a, 0x67, 0x68, - 0x68, 0x67, 0x86, 0x01, 0x01, 0x51, 0x67, 0x53, 0x68, - 0x67, 0x7c, 0x01, 0x6b, 0x4b, 0x67, 0x68, 0x53, 0x68, - 0x68, 0x7c, 0x01, 0x07, 0x1a, 0x1a, 0x13, 0x13, 0x13, - 0x50, 0x01, 0x01, 0x01, 0x47, 0x32, 0x19, 0x13, 0x1c, - 0xaa, 0x81, 0x88, 0x71, 0x81, 0x71, 0x76, 0xab, 0x46, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x84, 0x76, 0x71, 0x81, - 0x71, 0x8f, 0x66, 0x01, 0x9d, 0x72, 0x81, 0x71, 0x81, - 0x73, 0x81, 0x74, 0x0f, 0x64, 0x76, 0x71, 0x73, 0x72, - 0x6e, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x54, 0x68, 0x68, 0x68, 0x68, 0x69, - 0x68, 0x68, 0x69, 0x53, 0x67, 0x4e, 0x03, 0x01, 0x01, - 0x01, 0x01, 0x3d, 0x54, 0x4b, 0x67, 0x68, 0x68, 0x53, - 0x68, 0x68, 0x68, 0x68, 0x68, 0x67, 0x52, 0x02, 0x01, - 0x01, 0x7c, 0x67, 0x53, 0x68, 0x53, 0x68, 0x53, 0x53, - 0x68, 0x4b, 0x67, 0x68, 0x53, 0x68, 0x53, 0x4b, 0x50, - 0x01, 0x01, 0x02, 0x6c, 0x4d, 0x68, 0x68, 0x67, 0x57, - 0x02, 0x02, 0x4b, 0x68, 0x68, 0x53, 0x68, 0x67, 0x59, - 0x01, 0x56, 0x57, 0x67, 0x68, 0x68, 0x67, 0x86, 0x01, - 0x01, 0x4a, 0x69, 0x68, 0x68, 0x67, 0x7d, 0x01, 0x3d, - 0x4e, 0x69, 0x68, 0x68, 0x68, 0x67, 0x50, 0x01, 0x3b, - 0xac, 0xad, 0xae, 0xae, 0xae, 0x1e, 0x01, 0x01, 0x01, - 0x01, 0xae, 0xae, 0xae, 0x5f, 0x71, 0x81, 0x81, 0x81, - 0x73, 0x81, 0x88, 0x8b, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0xaf, 0x76, 0x88, 0x81, 0x71, 0x8f, 0xb0, 0x01, - 0x82, 0x72, 0x81, 0x71, 0x81, 0x81, 0xb1, 0x01, 0x40, - 0xaa, 0x76, 0x81, 0x81, 0x76, 0x9d, 0x45, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, - 0x69, 0x53, 0x69, 0x68, 0x68, 0x68, 0x53, 0x53, 0x4b, - 0x52, 0x56, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3c, - 0x7c, 0x54, 0x68, 0x68, 0x68, 0x68, 0x68, 0x69, 0x53, - 0x69, 0x67, 0x6a, 0x01, 0x01, 0x01, 0x01, 0x6d, 0x54, - 0x4b, 0x68, 0x68, 0x67, 0x4b, 0x69, 0x53, 0x68, 0x53, - 0x68, 0x4b, 0x52, 0x3d, 0x01, 0x01, 0x01, 0x02, 0x7c, - 0x4d, 0x53, 0x67, 0x67, 0x57, 0x3c, 0x01, 0x54, 0x67, - 0x67, 0x68, 0x53, 0x55, 0x09, 0x01, 0x6b, 0x54, 0x67, - 0x67, 0x53, 0x67, 0x86, 0x01, 0x01, 0x55, 0x67, 0x67, - 0x67, 0x4d, 0x7c, 0x01, 0x07, 0x4e, 0x69, 0x53, 0x67, - 0x53, 0x68, 0x07, 0x01, 0x50, 0x4d, 0x53, 0x54, 0x2b, - 0x2a, 0x16, 0x01, 0x01, 0x01, 0x01, 0x2a, 0x16, 0x2a, - 0x71, 0x81, 0x71, 0x71, 0x71, 0x71, 0x83, 0xab, 0x46, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x5c, 0x76, 0x70, - 0x81, 0x70, 0x8f, 0xa7, 0x01, 0x64, 0x76, 0x71, 0x71, - 0x71, 0x71, 0xa1, 0x01, 0x48, 0x5e, 0x70, 0x71, 0x71, - 0x76, 0x9d, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x58, 0x4a, 0x52, 0x4e, 0x55, - 0x4e, 0x55, 0x57, 0x6a, 0x85, 0x02, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x59, 0x4a, - 0x4e, 0x4e, 0x55, 0x4e, 0x57, 0x57, 0x4a, 0x50, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x4f, 0x7c, 0x57, 0x4e, - 0x57, 0x4e, 0x57, 0x57, 0x52, 0x6c, 0x6b, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x3c, 0x6c, 0x4e, 0x52, 0x4a, 0x4e, - 0x7c, 0x02, 0x01, 0x6c, 0x52, 0x4a, 0x4e, 0x52, 0x7c, - 0x07, 0x01, 0x3d, 0x4a, 0x52, 0x4a, 0x4e, 0x57, 0x4f, - 0x01, 0x01, 0x4e, 0x52, 0x4a, 0x52, 0x57, 0x58, 0x01, - 0x02, 0x6c, 0x4e, 0x52, 0x4a, 0x57, 0x7d, 0x01, 0x01, - 0x3d, 0xb3, 0x18, 0xb3, 0x2a, 0x18, 0x18, 0xb3, 0x01, - 0x01, 0xb3, 0x18, 0x18, 0x18, 0xb3, 0x18, 0xb3, 0x5d, - 0x5d, 0x77, 0x5d, 0x8b, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x90, 0x5f, 0x5d, 0x5d, 0x5f, 0x9c, 0x8b, - 0x01, 0x7a, 0x5d, 0x5d, 0x5d, 0x5d, 0x77, 0x9f, 0x01, - 0x46, 0xb4, 0x77, 0x5d, 0x5d, 0x5e, 0x64, 0x46, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x02, 0x3c, 0x3c, 0x3c, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 0x3c, 0x3c, - 0x3c, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01 -}; - -// Keyboard - -unsigned char item_keyboardPortrait_colors[] = { - 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, - 0x39, 0x39, 0x39, - 0x31, 0x31, 0x31, - 0x29, 0x29, 0x29, - 0x21, 0x21, 0x21, - 0x42, 0x42, 0x42, - 0x63, 0x63, 0x63, - 0x7b, 0x7b, 0x7b, - 0x73, 0x73, 0x73, - 0x6b, 0x6b, 0x6b, - 0x4a, 0x4a, 0x4a, - 0x94, 0x94, 0x94, - 0x9c, 0x9c, 0x9c, - 0xa5, 0xa5, 0xa5, - 0xbd, 0xbd, 0xbd, - 0x5a, 0x5a, 0x5a, - 0x52, 0x52, 0x52, - 0x84, 0x84, 0x84, - 0xad, 0xad, 0xad, - 0xc6, 0xc6, 0xc6, - 0xb5, 0xb5, 0xb5, - 0x8c, 0x8c, 0x8c, - 0x10, 0x10, 0x10, - 0x08, 0x08, 0x08 - -}; -unsigned char item_keyboardPortrait[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x07, 0x08, 0x06, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x09, 0x08, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x08, 0x07, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x0b, 0x0c, 0x0d, 0x0d, - 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x0e, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x0f, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0d, 0x0e, - 0x0d, 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x0d, 0x0e, 0x0d, 0x11, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, - 0x0d, 0x0d, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x10, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x0d, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x0d, 0x07, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x0b, 0x0e, 0x13, 0x08, 0x08, 0x06, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x07, 0x12, - 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x08, 0x09, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x08, 0x12, 0x0f, 0x10, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x0f, - 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x10, 0x12, 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, - 0x08, 0x08, 0x0d, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x07, 0x08, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, - 0x14, 0x08, 0x12, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, 0x11, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x0d, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x0f, 0x07, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x0f, 0x07, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x06, 0x06, 0x0f, 0x07, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, - 0x06, 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x06, 0x06, 0x06, 0x06, 0x08, 0x0d, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x07, 0x14, - 0x06, 0x06, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x07, 0x0f, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, - 0x11, 0x13, 0x07, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x10, 0x0f, 0x0f, 0x14, 0x0e, 0x06, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, - 0x0e, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x11, 0x0e, 0x0f, 0x14, 0x0f, - 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x12, 0x0f, 0x0f, 0x0e, 0x13, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x14, - 0x12, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x10, 0x0f, 0x0f, 0x0f, 0x15, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, - 0x0e, 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x12, 0x0e, 0x12, 0x15, 0x0f, 0x0e, 0x06, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x15, 0x0f, - 0x0f, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x0d, 0x0f, 0x14, 0x15, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, - 0x06, 0x06, 0x09, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, 0x10, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0d, - 0x0d, 0x0f, 0x0e, 0x0e, 0x15, 0x07, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x08, 0x0d, 0x03, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x08, 0x0d, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x0c, 0x13, 0x06, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x11, 0x13, 0x0f, 0x07, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x07, 0x07, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0c, 0x07, 0x0a, 0x15, - 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, - 0x13, 0x13, 0x07, 0x10, 0x10, 0x0b, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, - 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x09, 0x15, 0x08, 0x07, 0x09, 0x0f, 0x0a, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x09, - 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x13, - 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x10, 0x07, 0x0f, 0x07, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x11, 0x07, 0x09, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x0c, 0x15, 0x11, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x0e, 0x15, 0x09, 0x0f, 0x0e, - 0x16, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x08, - 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x0b, 0x12, 0x12, 0x08, 0x13, - 0x16, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x07, - 0x0f, 0x06, 0x06, 0x12, 0x0d, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, - 0x08, 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0c, - 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0b, - 0x13, 0x0f, 0x0f, 0x09, 0x10, 0x11, 0x11, 0x11, 0x0b, - 0x0b, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x10, 0x12, 0x08, 0x08, 0x13, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, - 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x0b, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x0f, 0x10, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, - 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x12, 0x0e, 0x06, 0x02, 0x02, 0x0d, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x10, 0x0f, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, - 0x0e, 0x0d, 0x13, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x10, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x0d, 0x12, 0x06, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x03, - 0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x0f, 0x10, 0x11, 0x10, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x08, 0x15, 0x0d, 0x0e, 0x0d, 0x0d, - 0x0b, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x11, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x0d, - 0x13, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x0f, 0x0f, 0x13, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x10, 0x15, 0x0f, 0x0f, 0x0e, - 0x0e, 0x0d, 0x0e, 0x0d, 0x0d, 0x0c, 0x06, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x11, - 0x0f, 0x0d, 0x0d, 0x0d, 0x14, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x14, - 0x10, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, - 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, - 0x02, 0x06, 0x02, 0x10, 0x0f, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x08, 0x0f, 0x0f, 0x0c, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x0d, 0x08, 0x02, 0x0f, - 0x10, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x08, - 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, - 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x11, 0x0d, 0x0d, 0x0d, 0x13, 0x15, 0x06, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0c, 0x0f, - 0x0f, 0x14, 0x0f, 0x0f, 0x0f, 0x0e, 0x02, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x11, 0x15, 0x0f, 0x07, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x0e, 0x02, 0x02, 0x02, - 0x16, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x06, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x08, - 0x08, 0x08, 0x08, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, - 0x02, 0x02, 0x0b, 0x13, 0x08, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x08, - 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, - 0x0f, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x13, 0x10, 0x15, 0x0c, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, - 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x0d, 0x08, 0x02, 0x14, 0x10, 0x11, 0x0f, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x11, 0x15, - 0x10, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, - 0x09, 0x13, 0x10, 0x10, 0x07, 0x13, 0x0d, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0f, 0x16, 0x10, - 0x0a, 0x15, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x06, 0x13, 0x0e, 0x10, 0x11, 0x11, 0x06, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x15, 0x0a, - 0x10, 0x0c, 0x0f, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x03, 0x0a, 0x15, 0x0a, 0x10, 0x11, 0x10, 0x02, - 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, - 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x06, 0x15, 0x13, 0x0d, 0x0f, 0x15, - 0x09, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, - 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, - 0x10, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x02, 0x02, 0x03, 0x02, 0x11, 0x14, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x06, - 0x0e, 0x0c, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x02, - 0x0f, 0x10, 0x11, 0x0f, 0x03, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x03, 0x06, 0x10, 0x10, 0x0f, 0x0a, - 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, - 0x08, 0x13, 0x10, 0x11, 0x10, 0x11, 0x02, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x03, 0x02, 0x06, 0x10, 0x10, 0x10, - 0x11, 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x02, 0x02, 0x02, 0x03, 0x08, 0x0d, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x07, 0x16, 0x10, - 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0b, 0x02, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, 0x0f, - 0x15, 0x0d, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x09, 0x0e, 0x0e, 0x0f, 0x0f, 0x08, 0x04, 0x03, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0e, - 0x0f, 0x14, 0x0f, 0x0c, 0x04, 0x04, 0x04, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0e, 0x0a, - 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0a, - 0x15, 0x0f, 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0b, 0x03, 0x03, - 0x04, 0x03, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x06, 0x09, 0x08, 0x11, 0x0d, 0x09, 0x04, 0x04, 0x04, - 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, 0x03, - 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x15, 0x0f, 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x11, 0x0f, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x09, 0x0c, 0x03, 0x03, 0x06, 0x0e, 0x09, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0f, - 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x0c, 0x09, 0x03, 0x15, 0x0b, 0x0b, 0x15, - 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x0c, 0x03, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x14, - 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, - 0x03, 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x0a, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x09, 0x0c, 0x03, 0x04, 0x04, 0x04, 0x00, 0x03, - 0x03, 0x03, 0x0b, 0x0c, 0x0f, 0x14, 0x0f, 0x15, 0x0b, - 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x0c, 0x09, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x09, 0x06, 0x03, 0x11, 0x14, 0x04, 0x04, - 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x09, 0x09, 0x09, 0x0c, 0x14, 0x06, 0x04, 0x05, - 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x15, 0x0d, - 0x09, 0x0c, 0x13, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x0c, 0x0d, 0x0d, - 0x0c, 0x02, 0x04, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x06, 0x0c, 0x0d, 0x0c, 0x06, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x06, 0x0b, 0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x10, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x06, 0x0a, 0x0d, 0x11, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, - 0x0d, 0x0d, 0x0d, 0x12, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x11, 0x0e, 0x0d, 0x0d, 0x0b, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, - 0x0e, 0x0d, 0x0d, 0x0d, 0x07, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x11, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x0b, 0x07, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x0a, 0x0b, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x13, 0x0b, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0b, - 0x06, 0x06, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x08, 0x13, 0x12, 0x08, 0x08, 0x0e, 0x0d, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, - 0x0f, 0x12, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x12, 0x13, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, - 0x13, 0x12, 0x08, 0x12, 0x13, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x0b, 0x13, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, - 0x13, 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, - 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x11, - 0x11, 0x11, 0x07, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, - 0x06, 0x06, 0x06, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x0f, 0x10, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, - 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x0b, 0x13, 0x0f, 0x08, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x12, 0x0f, 0x13, 0x06, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x08, 0x15, 0x0f, 0x0e, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x12, 0x0f, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x13, 0x0f, 0x15, - 0x11, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x12, 0x0f, 0x0f, 0x0e, 0x0e, 0x09, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x10, 0x13, - 0x14, 0x13, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x11, 0x13, 0x0f, 0x14, 0x0f, 0x13, 0x0b, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0f, 0x0f, - 0x0f, 0x0f, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x0c, 0x09, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, - 0x06, 0x06, 0x06, 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x15, 0x10, 0x06, 0x06, 0x06, 0x02, - 0x15, 0x0b, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, - 0x13, 0x0b, 0x06, 0x0b, 0x0e, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, - 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x08, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x08, - 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x07, 0x0f, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x08, - 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x12, 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, - 0x13, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x10, 0x12, 0x12, 0x12, 0x12, 0x08, 0x12, 0x08, - 0x08, 0x07, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x12, - 0x0f, 0x13, 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x09, 0x0f, 0x08, 0x07, 0x09, - 0x13, 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x12, 0x0f, 0x0d, 0x06, 0x0c, 0x0f, 0x0b, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x08, 0x07, - 0x16, 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x12, 0x13, 0x15, 0x12, 0x10, 0x0d, 0x0c, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x15, 0x07, - 0x07, 0x10, 0x16, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x11, 0x09, 0x14, 0x07, 0x10, 0x11, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, - 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x12, - 0x0d, 0x03, 0x03, 0x03, 0x00, 0x06, 0x06, 0x06, 0x0f, - 0x07, 0x06, 0x06, 0x02, 0x02, 0x0f, 0x11, 0x03, 0x03, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x13, 0x0e, 0x06, 0x0d, - 0x0e, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x12, 0x0d, 0x06, 0x06, 0x02, 0x12, 0x0d, 0x03, 0x03, - 0x03, 0x00, 0x06, 0x06, 0x06, 0x11, 0x07, 0x07, 0x07, - 0x12, 0x0f, 0x07, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x07, 0x15, 0x12, 0x03, 0x03, 0x03, - 0x00, 0x06, 0x06, 0x06, 0x11, 0x16, 0x0f, 0x12, 0x0f, - 0x12, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x0d, 0x0e, 0x0d, 0x0e, 0x15, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, - 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x06, 0x06, 0x06, 0x11, 0x0e, 0x0f, 0x0f, 0x14, 0x08, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0c, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x06, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0f, 0x14, - 0x0e, 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x15, - 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x06, 0x08, 0x13, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, - 0x02, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x15, 0x11, - 0x02, 0x02, 0x07, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x11, 0x15, 0x13, 0x08, 0x06, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x07, - 0x0f, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, 0x0d, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, - 0x14, 0x0b, 0x06, 0x02, 0x13, 0x0a, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x13, 0x09, 0x06, 0x15, 0x11, - 0x0b, 0x0f, 0x06, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x0b, 0x15, 0x15, 0x15, 0x06, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, 0x0b, 0x06, - 0x02, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x07, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x12, - 0x13, 0x12, 0x08, 0x08, 0x08, 0x0b, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0a, 0x0f, - 0x07, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x0c, 0x14, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x14, 0x0f, - 0x13, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x12, 0x0f, 0x0f, 0x0f, 0x0c, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, - 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, - 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x0b, - 0x08, 0x13, 0x15, 0x12, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x10, 0x0f, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x10, - 0x0f, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x02, 0x0e, 0x16, 0x02, 0x0a, - 0x15, 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x0d, 0x08, 0x02, 0x0f, 0x10, 0x10, 0x0f, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x08, 0x0f, - 0x08, 0x03, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x02, 0x13, 0x12, 0x02, 0x0a, 0x15, 0x06, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0a, - 0x0f, 0x07, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, - 0x15, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, - 0x02, 0x06, 0x02, 0x0f, 0x09, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, - 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x06, 0x02, 0x06, 0x0c, 0x0f, 0x0f, - 0x08, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, - 0x06, 0x0c, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x08, 0x14, 0x0f, - 0x0c, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x02, 0x06, 0x11, 0x02, 0x11, - 0x13, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, - 0x02, 0x02, 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, - 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, - 0x0a, 0x04, 0x03, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x10, 0x14, 0x02, 0x02, 0x06, 0x06, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x10, 0x14, 0x02, 0x02, 0x02, - 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x10, 0x0f, 0x06, 0x0e, 0x08, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x16, 0x11, 0x0f, - 0x09, 0x07, 0x15, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x11, 0x15, 0x12, 0x15, 0x0b, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, - 0x02, 0x0e, 0x12, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x0a, 0x0f, 0x0a, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, - 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x0c, 0x0f, 0x08, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0e, - 0x06, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x08, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x0b, 0x0d, 0x0e, 0x10, 0x07, 0x15, 0x0b, 0x04, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, - 0x10, 0x0a, 0x0f, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x03, 0x08, 0x0f, 0x0c, 0x02, 0x16, 0x0f, 0x0b, - 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x14, - 0x0a, 0x10, 0x0c, 0x14, 0x09, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, - 0x12, 0x10, 0x10, 0x11, 0x13, 0x09, 0x04, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0f, 0x07, 0x11, - 0x0e, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x11, 0x0f, 0x07, 0x0a, 0x13, 0x0f, 0x08, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x13, 0x0c, - 0x0f, 0x06, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x07, 0x15, 0x15, 0x0d, 0x0f, 0x13, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x06, 0x15, 0x12, - 0x02, 0x12, 0x15, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x03, 0x02, 0x06, 0x15, 0x0e, 0x0f, 0x06, 0x03, - 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x0f, - 0x12, 0x10, 0x11, 0x11, 0x06, 0x04, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x10, 0x10, - 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, - 0x02, 0x02, 0x03, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, 0x13, 0x10, - 0x11, 0x10, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x03, 0x02, 0x02, 0x03, 0x02, 0x03, 0x0e, 0x08, - 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, - 0x11, 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x02, 0x02, - 0x16, 0x08, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, - 0x02, 0x02, 0x03, 0x02, 0x06, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x08, 0x0c, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x03, 0x02, 0x09, 0x0f, 0x13, 0x0d, - 0x0e, 0x15, 0x11, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, - 0x02, 0x03, 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x08, 0x15, 0x0f, 0x15, 0x08, 0x04, - 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x13, - 0x15, 0x0f, 0x15, 0x0b, 0x04, 0x03, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0d, - 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x09, - 0x0c, 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x0b, 0x13, 0x0f, 0x0f, 0x14, - 0x0d, 0x02, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x04, - 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0c, 0x0f, 0x15, - 0x08, 0x0c, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x10, 0x0f, 0x16, 0x03, 0x04, 0x03, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0e, - 0x03, 0x12, 0x0f, 0x0b, 0x04, 0x04, 0x04, 0x00, 0x03, - 0x03, 0x03, 0x09, 0x0e, 0x03, 0x03, 0x03, 0x0e, 0x0a, - 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x10, 0x13, 0x16, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, - 0x09, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, - 0x03, 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x15, 0x0b, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x0f, 0x15, 0x0b, - 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x0b, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, - 0x03, 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x14, 0x15, - 0x0b, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0b, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x11, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x02, 0x09, 0x0c, 0x06, 0x02, 0x02, 0x03, 0x04, - 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x09, 0x0d, 0x02, 0x11, 0x02, 0x03, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x0d, 0x09, 0x04, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0f, 0x0b, 0x03, - 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x09, - 0x0d, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x04, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x0c, 0x09, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x06, - 0x09, 0x0d, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x11, 0x09, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x09, 0x11, 0x05, 0x05, - 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x04, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x11, 0x0d, 0x0d, 0x11, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; -// ************************************************************************* -// LANDSCAPE -// ************************************************************************* - -// Panel - -unsigned char item_toolbar_colors[] = { - 0x04, 0x02, 0x04, - 0x0c, 0x02, 0x04, - 0x24, 0x06, 0x04, - 0x84, 0x16, 0x14, - 0x9c, 0x1a, 0x1c, - 0x74, 0x16, 0x14, - 0x1c, 0x06, 0x04, - 0x5c, 0x0e, 0x0c, - 0x4c, 0x0e, 0x0c, - 0x44, 0x0a, 0x0c, - 0x64, 0x12, 0x14, - 0x8c, 0x1a, 0x1c, - 0xc4, 0x22, 0x24, - 0xb4, 0x1e, 0x1c, - 0x0c, 0x06, 0x04, - 0xa4, 0x1e, 0x1c, - 0x34, 0x0a, 0x0c, - 0x14, 0x16, 0x14, - 0x64, 0x66, 0x64, - 0x1c, 0x16, 0x1c, - 0x1c, 0x1a, 0x1c, - 0x3c, 0x3e, 0x3c, - 0x34, 0x36, 0x34, - 0x34, 0x32, 0x34, - 0x6c, 0x6a, 0x6c, - 0xb4, 0xb2, 0xb4, - 0x4c, 0x4e, 0x4c, - 0x94, 0x92, 0x94, - 0x94, 0x96, 0x94, - 0x7c, 0x7e, 0x7c, - 0x9c, 0x9e, 0x9c, - 0x0c, 0x0a, 0x0c, - 0x44, 0x46, 0x44, - 0x5c, 0x5a, 0x5c, - 0x74, 0x76, 0x74, - 0xc4, 0xc2, 0xc4, - 0x84, 0x82, 0x84, - 0x9c, 0x9a, 0x9c, - 0x74, 0x72, 0x74, - 0x24, 0x26, 0x24, - 0xa4, 0xa6, 0xa4, - 0x3c, 0x3a, 0x3c, - 0x8c, 0x8e, 0x8c, - 0x2c, 0x7e, 0xb4, - 0xbc, 0xbe, 0xbc, - 0x6c, 0x6e, 0x6c, - 0x1c, 0x1e, 0x1c, - 0x2c, 0x5e, 0x7c, - 0xac, 0xaa, 0xac, - 0x5c, 0x5e, 0x5c, - 0xa4, 0xa2, 0xa4, - 0xd4, 0xd6, 0xd4, - 0xac, 0xae, 0xac, - 0xec, 0xee, 0xec, - 0xe4, 0xe6, 0xe4, - 0xfc, 0xfa, 0xfc, - 0x1c, 0x0a, 0x0c, - 0x2c, 0x0e, 0x0c, - 0x24, 0x0a, 0x0c, - 0x14, 0x06, 0x04, - 0x34, 0x0e, 0x0c, - 0xcc, 0xce, 0xcc, - 0xf4, 0xf2, 0xf4, - 0x0c, 0x0a, 0x04, - 0x24, 0x1a, 0x0c, - 0x2c, 0x1e, 0x14, - 0x24, 0x1e, 0x0c, - 0x24, 0x1e, 0x14, - 0x1c, 0x16, 0x0c, - 0x14, 0x0e, 0x04, - 0x04, 0x06, 0x04, - 0x14, 0x12, 0x0c, - 0x5c, 0x1a, 0x1c, - 0x94, 0x26, 0x24, - 0xb4, 0x2e, 0x2c, - 0xd4, 0x3a, 0x3c, - 0xcc, 0x36, 0x34, - 0xa4, 0x2e, 0x2c, - 0x54, 0x16, 0x14, - 0x4c, 0x16, 0x14, - 0x7c, 0x22, 0x24, - 0x9c, 0x2a, 0x2c, - 0xbc, 0x36, 0x34, - 0xb4, 0x32, 0x34, - 0xac, 0x2e, 0x2c, - 0x2c, 0x0a, 0x0c, - 0xa4, 0x2a, 0x2c, - 0x6c, 0x1e, 0x1c, - 0x64, 0x1e, 0x1c, - 0x94, 0x2a, 0x2c, - 0x34, 0x22, 0x24, - 0x64, 0x4a, 0x24, - 0xc4, 0x96, 0x4c, - 0xd4, 0xa2, 0x54, - 0xcc, 0x9e, 0x54, - 0x84, 0x66, 0x34, - 0x14, 0x0e, 0x0c, - 0xec, 0xb2, 0x5c, - 0xdc, 0xaa, 0x5c, - 0x94, 0x72, 0x3c, - 0xe4, 0xb2, 0x5c, - 0x4c, 0x3a, 0x1c, - 0xc4, 0x36, 0x34, - 0xbc, 0x32, 0x34, - 0xc4, 0x32, 0x34, - 0x8c, 0x26, 0x24, - 0x44, 0x12, 0x14, - 0x74, 0x1e, 0x1c, - 0x5c, 0x16, 0x14, - 0xb4, 0x86, 0x44, - 0xfc, 0xc6, 0x6c, - 0xf4, 0xbe, 0x64, - 0xf4, 0xba, 0x64, - 0xfc, 0xbe, 0x64, - 0xec, 0xb6, 0x64, - 0x2c, 0x22, 0x14, - 0xfc, 0xce, 0x6c, - 0xfc, 0xc2, 0x64, - 0xcc, 0x9a, 0x54, - 0xdc, 0xa6, 0x54, - 0xfc, 0xd2, 0x6c, - 0x5c, 0x46, 0x24, - 0xcc, 0x3a, 0x3c, - 0x84, 0x22, 0x24, - 0x84, 0x26, 0x24, - 0xdc, 0xde, 0xdc, - 0xe4, 0xe2, 0xe4, - 0x5c, 0x4a, 0x2c, - 0xec, 0xb6, 0x5c, - 0x9c, 0x7a, 0x3c, - 0xfc, 0xc6, 0x64, - 0x34, 0x26, 0x14, - 0x4c, 0x12, 0x14, - 0x64, 0x1a, 0x1c, - 0x54, 0x3e, 0x24, - 0xf4, 0xb6, 0x64, - 0x6c, 0x56, 0x2c, - 0x3c, 0x2a, 0x14, - 0x44, 0x32, 0x1c, - 0xac, 0x32, 0x34, - 0x54, 0x1a, 0x1c, - 0x3c, 0x12, 0x14, - 0xe4, 0xae, 0x5c, - 0x6c, 0x52, 0x2c, - 0x74, 0x5a, 0x34, - 0xc4, 0x9a, 0x54, - 0x7c, 0x62, 0x34, - 0x84, 0x62, 0x34, - 0xbc, 0xba, 0xbc, - 0x7c, 0x5e, 0x34, - 0x8c, 0x66, 0x34, - 0x9c, 0x76, 0x3c, - 0x94, 0x6e, 0x3c, - 0x8c, 0x6a, 0x3c, - 0x74, 0x22, 0x24, - 0xbc, 0x8e, 0x4c, - 0xb4, 0x8a, 0x4c, - 0xb4, 0x8e, 0x4c, - 0x44, 0x36, 0x1c, - 0x7c, 0x5a, 0x34, - 0x8c, 0x6a, 0x34, - 0x74, 0x56, 0x2c, - 0x5c, 0x4a, 0x24, - 0xbc, 0x92, 0x4c, - 0xe4, 0xaa, 0x5c, - 0x64, 0x4e, 0x2c, - 0x54, 0x3e, 0x1c, - 0x8c, 0x6e, 0x3c, - 0x0c, 0x06, 0x0c, - 0xa4, 0x7e, 0x44, - 0x94, 0x76, 0x3c, - 0x9c, 0x2e, 0x34, - 0x8c, 0x2a, 0x2c, - 0x8c, 0x8a, 0x8c, - 0x54, 0x42, 0x24, - 0x4c, 0x3e, 0x1c, - 0xd4, 0xa6, 0x54, - 0x1c, 0x1a, 0x0c, - 0x2c, 0x2e, 0x2c, - 0xac, 0x82, 0x44 - -}; -unsigned char item_toolbar[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, - 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x05, - 0x03, 0x04, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x07, 0x03, 0x03, 0x03, 0x05, 0x09, - 0x00, 0x0a, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x07, - 0x03, 0x03, 0x04, 0x02, 0x02, 0x04, 0x03, 0x04, 0x03, - 0x04, 0x0b, 0x03, 0x0b, 0x07, 0x02, 0x03, 0x04, 0x03, - 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, - 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0e, 0x00, - 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, - 0x0f, 0x02, 0x00, 0x00, 0x00, 0x01, 0x05, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x00, 0x03, 0x0c, 0x0c, - 0x0d, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0c, 0x07, 0x00, - 0x02, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0d, - 0x07, 0x10, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, - 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x04, 0x10, 0x09, - 0x0d, 0x0c, 0x0d, 0x07, 0x00, 0x05, 0x0d, 0x0c, 0x0c, - 0x0d, 0x03, 0x0d, 0x0d, 0x0c, 0x0c, 0x0d, 0x01, 0x00, - 0x00, 0x04, 0x0d, 0x0c, 0x0c, 0x0d, 0x04, 0x03, 0x03, - 0x03, 0x00, 0x04, 0x0d, 0x0c, 0x0c, 0x00, 0x01, 0x0d, - 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0c, - 0x0a, 0x07, 0x07, 0x07, 0x07, 0x10, 0x01, 0x07, 0x07, - 0x07, 0x0c, 0x0c, 0x0d, 0x05, 0x07, 0x07, 0x09, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, - 0x0d, 0x0c, 0x03, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x07, - 0x10, 0x0c, 0x0c, 0x0c, 0x03, 0x01, 0x00, 0x00, 0x09, - 0x0c, 0x0d, 0x0c, 0x05, 0x00, 0x07, 0x0d, 0x0c, 0x0c, - 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, - 0x0c, 0x0d, 0x00, 0x05, 0x0c, 0x0c, 0x0d, 0x01, 0x00, - 0x00, 0x10, 0x0d, 0x0c, 0x0c, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0c, 0x0c, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x03, 0x00, - 0x02, 0x0c, 0x0c, 0x0d, 0x09, 0x0a, 0x0c, 0x0d, 0x0c, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x0d, - 0x00, 0x04, 0x0c, 0x0c, 0x0f, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0c, 0x0d, 0x07, 0x0c, - 0x0c, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x0c, - 0x0d, 0x04, 0x04, 0x03, 0x0b, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x12, 0x13, 0x11, 0x14, 0x15, 0x16, - 0x17, 0x11, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x0c, 0x0d, 0x0a, 0x0f, 0x0c, 0x0c, 0x0d, 0x04, - 0x00, 0x03, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x0d, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x0d, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x0c, 0x0c, 0x03, 0x0f, 0x0c, 0x0d, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x0d, - 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0d, 0x0c, - 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x12, 0x18, 0x12, 0x19, 0x18, - 0x1a, 0x12, 0x1b, 0x1c, 0x1d, 0x17, 0x16, 0x17, 0x12, - 0x18, 0x12, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x07, - 0x05, 0x0d, 0x0d, 0x05, 0x01, 0x00, 0x03, 0x0c, 0x0c, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0c, 0x0d, - 0x0d, 0x00, 0x0d, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x0d, 0x04, 0x09, - 0x0c, 0x0c, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x07, 0x0c, - 0x0c, 0x0c, 0x0a, 0x07, 0x07, 0x07, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x0c, 0x0c, 0x0d, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, - 0x19, 0x1e, 0x1e, 0x1d, 0x1f, 0x20, 0x21, 0x22, 0x23, - 0x19, 0x24, 0x12, 0x18, 0x1e, 0x1e, 0x19, 0x19, 0x18, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x0c, 0x0d, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x02, 0x00, 0x00, - 0x00, 0x01, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x04, 0x0d, - 0x0c, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x0c, 0x0c, 0x03, 0x00, 0x03, 0x0c, 0x0d, 0x0d, - 0x01, 0x00, 0x00, 0x07, 0x0c, 0x0d, 0x0c, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, - 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x25, 0x19, 0x1e, 0x26, 0x26, 0x27, - 0x00, 0x17, 0x17, 0x16, 0x12, 0x1e, 0x19, 0x28, 0x1b, - 0x29, 0x2a, 0x1e, 0x25, 0x19, 0x1e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0d, 0x0c, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, - 0x0c, 0x0c, 0x0d, 0x07, 0x10, 0x08, 0x0d, 0x0c, 0x0d, - 0x0c, 0x02, 0x00, 0x07, 0x0c, 0x0c, 0x0d, 0x0f, 0x08, - 0x09, 0x02, 0x07, 0x02, 0x00, 0x0c, 0x0c, 0x0c, 0x03, - 0x00, 0x01, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x07, - 0x0c, 0x0c, 0x0d, 0x07, 0x02, 0x10, 0x10, 0x07, 0x00, - 0x00, 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x0d, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, - 0x1e, 0x28, 0x1b, 0x1c, 0x00, 0x00, 0x16, 0x2b, 0x17, - 0x17, 0x2c, 0x1d, 0x19, 0x2a, 0x00, 0x28, 0x28, 0x2a, - 0x1e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x09, 0x0c, 0x0c, 0x0d, 0x0c, - 0x0d, 0x0c, 0x0d, 0x0c, 0x0c, 0x08, 0x00, 0x00, 0x00, - 0x0a, 0x0c, 0x0c, 0x0c, 0x0d, 0x0c, 0x0c, 0x0c, 0x10, - 0x00, 0x0d, 0x0c, 0x0c, 0x03, 0x00, 0x00, 0x07, 0x0c, - 0x0d, 0x0c, 0x07, 0x00, 0x05, 0x0d, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x0c, 0x0d, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x25, 0x25, 0x19, - 0x2d, 0x2e, 0x17, 0x2f, 0x16, 0x17, 0x30, 0x31, 0x19, - 0x2a, 0x26, 0x19, 0x1e, 0x2a, 0x1b, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, - 0x0d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x05, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x03, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0d, 0x01, 0x00, 0x0c, 0x0d, 0x0c, - 0x03, 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x0c, 0x0d, 0x02, - 0x03, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x0d, 0x0c, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x0d, 0x0c, 0x0d, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x1b, 0x1e, 0x25, 0x32, 0x15, 0x17, - 0x16, 0x1e, 0x33, 0x34, 0x19, 0x26, 0x19, 0x1e, 0x2a, - 0x2a, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, - 0x2a, 0x1b, 0x22, 0x20, 0x16, 0x1e, 0x35, 0x36, 0x33, - 0x1d, 0x1d, 0x25, 0x2a, 0x1b, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x14, 0x1b, 0x2a, 0x2a, 0x2a, - 0x28, 0x33, 0x37, 0x35, 0x2c, 0x1c, 0x2a, 0x1b, 0x2a, - 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, - 0x39, 0x39, 0x39, 0x3a, 0x38, 0x38, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x06, - 0x3a, 0x3c, 0x39, 0x3c, 0x3a, 0x06, 0x38, 0x00, 0x00, - 0x00, 0x06, 0x38, 0x02, 0x38, 0x3a, 0x38, 0x3b, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x3a, 0x38, 0x38, 0x02, 0x38, - 0x06, 0x0e, 0x00, 0x00, 0x01, 0x06, 0x3a, 0x38, 0x38, - 0x06, 0x3a, 0x38, 0x06, 0x01, 0x00, 0x00, 0x00, 0x3b, - 0x3a, 0x06, 0x38, 0x06, 0x3a, 0x06, 0x38, 0x02, 0x00, - 0x00, 0x00, 0x3b, 0x3a, 0x06, 0x3a, 0x38, 0x02, 0x38, - 0x38, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0x02, - 0x38, 0x2d, 0x2a, 0x19, 0x3d, 0x3e, 0x3e, 0x37, 0x37, - 0x36, 0x3d, 0x30, 0x2a, 0x1b, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3f, 0x40, 0x41, 0x42, 0x42, 0x42, - 0x43, 0x44, 0x00, 0x42, 0x43, 0x40, 0x42, 0x43, 0x40, - 0x42, 0x41, 0x45, 0x46, 0x00, 0x00, 0x47, 0x42, 0x42, - 0x40, 0x42, 0x43, 0x40, 0x41, 0x42, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4b, 0x4c, - 0x4a, 0x4d, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3a, 0x4f, 0x50, 0x51, 0x52, 0x4c, 0x4b, 0x4c, - 0x53, 0x54, 0x4d, 0x55, 0x00, 0x00, 0x53, 0x54, 0x56, - 0x4d, 0x4d, 0x4a, 0x57, 0x01, 0x00, 0x00, 0x00, 0x58, - 0x56, 0x4d, 0x54, 0x56, 0x4d, 0x56, 0x4f, 0x00, 0x00, - 0x4e, 0x53, 0x56, 0x4d, 0x54, 0x56, 0x4d, 0x56, 0x4d, - 0x4e, 0x00, 0x00, 0x06, 0x59, 0x54, 0x4d, 0x54, 0x4d, - 0x56, 0x54, 0x56, 0x54, 0x00, 0x00, 0x00, 0x57, 0x54, - 0x56, 0x4d, 0x4d, 0x4d, 0x54, 0x4d, 0x4a, 0x55, 0x00, - 0x00, 0x01, 0x54, 0x54, 0x56, 0x4d, 0x5a, 0x1b, 0x19, - 0x35, 0x37, 0x37, 0x37, 0x37, 0x37, 0x33, 0x19, 0x2a, - 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, - 0x5c, 0x5d, 0x5d, 0x5e, 0x5d, 0x5d, 0x5f, 0x60, 0x61, - 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x62, 0x63, 0x3f, - 0x00, 0x00, 0x63, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, 0x5d, - 0x5e, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x4d, 0x4c, 0x66, - 0x66, 0x67, 0x67, 0x68, 0x67, 0x66, 0x4c, 0x69, 0x3b, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x4f, 0x4d, 0x4b, 0x4c, - 0x66, 0x68, 0x67, 0x67, 0x68, 0x66, 0x66, 0x4c, 0x6a, - 0x00, 0x00, 0x4c, 0x66, 0x66, 0x66, 0x66, 0x4c, 0x50, - 0x00, 0x00, 0x00, 0x00, 0x6b, 0x52, 0x66, 0x66, 0x66, - 0x66, 0x67, 0x6c, 0x00, 0x00, 0x57, 0x4b, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x6b, 0x00, 0x00, 0x3c, - 0x66, 0x4c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x4b, - 0x00, 0x00, 0x00, 0x6b, 0x4b, 0x66, 0x66, 0x68, 0x66, - 0x66, 0x66, 0x4b, 0x4f, 0x00, 0x00, 0x4f, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x2a, 0x19, 0x37, 0x37, 0x37, 0x37, - 0x37, 0x37, 0x33, 0x19, 0x2a, 0x31, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3f, 0x6d, 0x6e, 0x6f, 0x70, 0x71, - 0x6f, 0x72, 0x73, 0x42, 0x74, 0x70, 0x6f, 0x70, 0x6f, - 0x71, 0x70, 0x75, 0x76, 0x47, 0x00, 0x00, 0x77, 0x6f, - 0x6f, 0x70, 0x71, 0x70, 0x6f, 0x71, 0x78, 0x79, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3b, 0x51, 0x66, 0x67, 0x67, 0x67, 0x52, 0x67, 0x52, - 0x67, 0x67, 0x7a, 0x7b, 0x3b, 0x00, 0x00, 0x00, 0x3b, - 0x7c, 0x4c, 0x66, 0x4a, 0x68, 0x67, 0x52, 0x67, 0x52, - 0x67, 0x67, 0x67, 0x66, 0x6a, 0x00, 0x3a, 0x66, 0x67, - 0x67, 0x66, 0x67, 0x7a, 0x6c, 0x00, 0x00, 0x00, 0x00, - 0x6b, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x53, 0x3c, 0x00, - 0x00, 0x50, 0x66, 0x66, 0x4a, 0x67, 0x66, 0x67, 0x52, - 0x67, 0x49, 0x00, 0x00, 0x48, 0x4b, 0x4a, 0x52, 0x67, - 0x67, 0x52, 0x67, 0x67, 0x4a, 0x00, 0x00, 0x01, 0x49, - 0x66, 0x67, 0x66, 0x52, 0x67, 0x67, 0x67, 0x4c, 0x48, - 0x00, 0x00, 0x7b, 0x52, 0x67, 0x67, 0x52, 0x67, 0x67, - 0x25, 0x7d, 0x37, 0x37, 0x37, 0x37, 0x7e, 0x2c, 0x19, - 0x1b, 0x7f, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, - 0x62, 0x70, 0x80, 0x70, 0x80, 0x70, 0x81, 0x00, 0x79, - 0x82, 0x70, 0x80, 0x70, 0x80, 0x72, 0x80, 0x70, 0x64, - 0x45, 0x00, 0x83, 0x6f, 0x70, 0x80, 0x70, 0x80, 0x70, - 0x80, 0x80, 0x6f, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x67, 0x67, 0x52, - 0x68, 0x67, 0x67, 0x66, 0x4c, 0x4c, 0x7a, 0x4c, 0x69, - 0x3b, 0x00, 0x00, 0x01, 0x50, 0x4c, 0x52, 0x68, 0x52, - 0x67, 0x52, 0x68, 0x66, 0x4c, 0x7a, 0x4c, 0x4c, 0x4b, - 0x85, 0x00, 0x3c, 0x4c, 0x67, 0x52, 0x4a, 0x66, 0x4c, - 0x48, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x4a, 0x66, 0x67, - 0x67, 0x68, 0x54, 0x3c, 0x00, 0x01, 0x6b, 0x4c, 0x52, - 0x67, 0x52, 0x4a, 0x66, 0x67, 0x67, 0x53, 0x00, 0x01, - 0x7c, 0x66, 0x67, 0x67, 0x67, 0x66, 0x67, 0x67, 0x66, - 0x49, 0x00, 0x00, 0x01, 0x51, 0x66, 0x67, 0x4a, 0x66, - 0x67, 0x66, 0x67, 0x66, 0x7b, 0x0e, 0x00, 0x54, 0x67, - 0x66, 0x67, 0x67, 0x66, 0x67, 0x2a, 0x7d, 0x37, 0x37, - 0x37, 0x37, 0x33, 0x19, 0x1c, 0x2a, 0x64, 0x86, 0x00, - 0x00, 0x00, 0x00, 0x46, 0x63, 0x71, 0x80, 0x70, 0x80, - 0x72, 0x61, 0x42, 0x00, 0x79, 0x6e, 0x80, 0x87, 0x80, - 0x87, 0x80, 0x70, 0x80, 0x74, 0x73, 0x00, 0x88, 0x70, - 0x80, 0x87, 0x80, 0x72, 0x80, 0x70, 0x6f, 0x77, 0x89, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x67, 0x66, 0x4a, 0x52, 0x66, 0x67, 0x7c, - 0x6c, 0x48, 0x57, 0x49, 0x59, 0x06, 0x00, 0x00, 0x85, - 0x4c, 0x66, 0x67, 0x67, 0x67, 0x67, 0x66, 0x53, 0x7b, - 0x85, 0x6c, 0x48, 0x6b, 0x7c, 0x4e, 0x00, 0x3c, 0x66, - 0x67, 0x67, 0x67, 0x67, 0x7a, 0x6c, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x52, 0x67, 0x67, 0x52, 0x67, 0x54, 0x39, - 0x00, 0x01, 0x50, 0x4c, 0x67, 0x68, 0x67, 0x66, 0x67, - 0x67, 0x52, 0x4a, 0x0e, 0x3b, 0x4a, 0x68, 0x67, 0x52, - 0x66, 0x4a, 0x52, 0x67, 0x66, 0x49, 0x00, 0x00, 0x01, - 0x49, 0x68, 0x67, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x66, - 0x49, 0x01, 0x3a, 0x67, 0x66, 0x4a, 0x67, 0x66, 0x4a, - 0x52, 0x67, 0x2c, 0x7d, 0x37, 0x37, 0x37, 0x33, 0x19, - 0x1b, 0x72, 0x80, 0x63, 0x00, 0x00, 0x00, 0x00, 0x8a, - 0x77, 0x6f, 0x87, 0x80, 0x70, 0x75, 0x5f, 0x00, 0x00, - 0x79, 0x75, 0x70, 0x80, 0x70, 0x80, 0x70, 0x80, 0x87, - 0x6e, 0x65, 0x00, 0x6d, 0x72, 0x70, 0x80, 0x70, 0x80, - 0x87, 0x80, 0x6f, 0x62, 0x89, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x67, 0x52, - 0x67, 0x68, 0x4a, 0x53, 0x84, 0x00, 0x00, 0x00, 0x3b, - 0x3c, 0x01, 0x00, 0x06, 0x8b, 0x67, 0x4a, 0x66, 0x67, - 0x67, 0x66, 0x49, 0x3c, 0x0e, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x3b, 0x00, 0x3c, 0x66, 0x67, 0x52, 0x67, 0x66, - 0x66, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x56, 0x67, 0x66, - 0x67, 0x67, 0x68, 0x54, 0x8d, 0x00, 0x0e, 0x7b, 0x66, - 0x67, 0x52, 0x67, 0x4a, 0x66, 0x67, 0x67, 0x53, 0x3c, - 0x39, 0x7a, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, - 0x66, 0x49, 0x00, 0x00, 0x00, 0x54, 0x66, 0x67, 0x52, - 0x67, 0x67, 0x67, 0x67, 0x66, 0x67, 0x0e, 0x85, 0x52, - 0x67, 0x52, 0x66, 0x67, 0x67, 0x67, 0x67, 0x19, 0x33, - 0x37, 0x37, 0x37, 0x7d, 0x19, 0x2a, 0x72, 0x80, 0x5e, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x75, 0x87, 0x80, 0x70, - 0x80, 0x8e, 0x45, 0x00, 0x00, 0x8f, 0x82, 0x72, 0x80, - 0x87, 0x80, 0x80, 0x72, 0x80, 0x75, 0x90, 0x45, 0x72, - 0x80, 0x87, 0x80, 0x72, 0x80, 0x70, 0x80, 0x6f, 0x62, - 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x68, 0x67, 0x67, 0x52, 0x67, 0x67, - 0x49, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, - 0x4a, 0x52, 0x67, 0x52, 0x67, 0x52, 0x51, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, - 0x66, 0x67, 0x67, 0x67, 0x66, 0x54, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x4d, 0x66, 0x4a, 0x52, 0x67, 0x52, 0x4d, - 0x06, 0x00, 0x06, 0x59, 0x66, 0x67, 0x67, 0x67, 0x51, - 0x67, 0x67, 0x52, 0x4a, 0x84, 0x48, 0x4c, 0x52, 0x68, - 0x4d, 0x54, 0x68, 0x67, 0x52, 0x68, 0x49, 0x00, 0x00, - 0x3b, 0x66, 0x67, 0x67, 0x67, 0x54, 0x54, 0x66, 0x67, - 0x67, 0x4c, 0x00, 0x69, 0x68, 0x67, 0x67, 0x53, 0x49, - 0x68, 0x52, 0x67, 0x19, 0x33, 0x37, 0x37, 0x7d, 0x33, - 0x19, 0x2a, 0x80, 0x70, 0x77, 0x83, 0x00, 0x00, 0x42, - 0x91, 0x75, 0x80, 0x72, 0x80, 0x75, 0x92, 0x00, 0x00, - 0x46, 0x5f, 0x71, 0x70, 0x80, 0x70, 0x5d, 0x77, 0x70, - 0x72, 0x75, 0x93, 0x65, 0x80, 0x72, 0x80, 0x64, 0x5c, - 0x70, 0x87, 0x80, 0x6f, 0x77, 0x89, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, - 0x66, 0x67, 0x67, 0x67, 0x66, 0x66, 0x56, 0x4f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x50, 0x52, 0x68, 0x67, 0x67, - 0x67, 0x67, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x6c, 0x66, 0x67, 0x52, 0x67, - 0x66, 0x53, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x56, 0x67, - 0x67, 0x68, 0x67, 0x66, 0x56, 0x0e, 0x00, 0x06, 0x49, - 0x66, 0x67, 0x66, 0x66, 0x69, 0x53, 0x52, 0x67, 0x67, - 0x57, 0x7c, 0x66, 0x67, 0x66, 0x69, 0x69, 0x66, 0x67, - 0x67, 0x66, 0x59, 0x00, 0x00, 0x00, 0x4c, 0x66, 0x67, - 0x52, 0x56, 0x51, 0x52, 0x67, 0x52, 0x4c, 0x8d, 0x4a, - 0x52, 0x67, 0x67, 0x69, 0x59, 0x66, 0x67, 0x67, 0x25, - 0x94, 0x7d, 0x37, 0x7d, 0x33, 0x19, 0x1b, 0x80, 0x70, - 0x64, 0x95, 0x00, 0x00, 0x8f, 0x6f, 0x80, 0x70, 0x80, - 0x70, 0x8e, 0x44, 0x00, 0x00, 0x46, 0x96, 0x75, 0x72, - 0x80, 0x6f, 0x91, 0x76, 0x70, 0x80, 0x71, 0x97, 0x98, - 0x72, 0x80, 0x70, 0x8e, 0x99, 0x75, 0x80, 0x70, 0x70, - 0x77, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3b, 0x69, 0x4c, 0x52, 0x67, - 0x52, 0x4a, 0x66, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, - 0x4d, 0x4a, 0x67, 0x66, 0x67, 0x52, 0x4d, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x66, 0x67, 0x67, 0x67, 0x67, 0x4a, 0x3c, 0x00, - 0x00, 0x00, 0x3b, 0x4d, 0x68, 0x67, 0x52, 0x67, 0x52, - 0x56, 0x3b, 0x00, 0x3a, 0x51, 0x66, 0x67, 0x67, 0x66, - 0x57, 0x4a, 0x67, 0x66, 0x4a, 0x7c, 0x4a, 0x67, 0x67, - 0x68, 0x85, 0x50, 0x4c, 0x52, 0x67, 0x67, 0x49, 0x00, - 0x00, 0x3a, 0x4c, 0x67, 0x67, 0x66, 0x56, 0x69, 0x54, - 0x68, 0x67, 0x66, 0x9a, 0x4a, 0x67, 0x52, 0x53, 0x6c, - 0x49, 0x66, 0x67, 0x52, 0x2a, 0x19, 0x7d, 0x7d, 0x33, - 0x94, 0x1c, 0x2a, 0x80, 0x70, 0x80, 0x9b, 0x00, 0x44, - 0x9c, 0x75, 0x70, 0x80, 0x70, 0x75, 0x63, 0x00, 0x00, - 0x00, 0x46, 0x81, 0x71, 0x70, 0x80, 0x6f, 0x6d, 0x9d, - 0x71, 0x80, 0x6f, 0x6d, 0x5e, 0x80, 0x70, 0x80, 0x5c, - 0x79, 0x82, 0x72, 0x80, 0x6f, 0x62, 0x89, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3b, 0x50, 0x4c, 0x67, 0x66, 0x67, 0x67, 0x66, - 0x66, 0x85, 0x00, 0x00, 0x00, 0x4d, 0x67, 0x52, 0x4a, - 0x66, 0x67, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x66, 0x67, 0x52, - 0x67, 0x66, 0x53, 0x6a, 0x00, 0x00, 0x00, 0x3b, 0x54, - 0x52, 0x67, 0x67, 0x67, 0x67, 0x4d, 0x3b, 0x00, 0x3c, - 0x54, 0x68, 0x67, 0x52, 0x4c, 0x3a, 0x4a, 0x52, 0x67, - 0x52, 0x54, 0x67, 0x52, 0x68, 0x4d, 0x48, 0x7b, 0x66, - 0x67, 0x67, 0x66, 0x49, 0x00, 0x00, 0x3c, 0x4c, 0x52, - 0x67, 0x66, 0x59, 0x4e, 0x51, 0x66, 0x67, 0x66, 0x54, - 0x67, 0x67, 0x67, 0x4a, 0x39, 0x68, 0x67, 0x67, 0x68, - 0x1b, 0x1c, 0x94, 0x33, 0x94, 0x1c, 0x2a, 0x1b, 0x87, - 0x80, 0x70, 0x5e, 0x45, 0x9e, 0x75, 0x70, 0x80, 0x87, - 0x80, 0x75, 0x83, 0x00, 0x00, 0x00, 0x3f, 0x5c, 0x70, - 0x80, 0x70, 0x75, 0x9f, 0xa0, 0x75, 0x72, 0x70, 0x5d, - 0x80, 0x87, 0x80, 0x72, 0x98, 0xa1, 0x6e, 0x87, 0x80, - 0x6f, 0x77, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x6b, - 0x66, 0x67, 0x67, 0x66, 0x67, 0x67, 0x66, 0x4f, 0x00, - 0x00, 0x51, 0x67, 0x68, 0x67, 0x66, 0x67, 0x54, 0x3a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7c, 0x68, 0x67, 0x67, 0x67, 0x66, 0x4a, 0x3c, - 0x00, 0x00, 0x00, 0x39, 0x4a, 0x67, 0x67, 0x68, 0x52, - 0x66, 0x4d, 0x3b, 0x00, 0x8d, 0x54, 0x66, 0x67, 0x67, - 0x4b, 0x01, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, - 0x66, 0x69, 0x6a, 0x59, 0x66, 0x67, 0x68, 0x66, 0x57, - 0x00, 0x00, 0x8d, 0x4c, 0x67, 0x67, 0x66, 0x69, 0x84, - 0x59, 0x66, 0x67, 0x66, 0x4a, 0x52, 0x67, 0x52, 0x4d, - 0x01, 0x4b, 0x67, 0x52, 0x1c, 0x2a, 0x2a, 0x19, 0x33, - 0x19, 0x2a, 0x1b, 0x34, 0x80, 0x70, 0x80, 0x62, 0x5b, - 0x99, 0x82, 0x87, 0x80, 0x72, 0x75, 0x81, 0x0e, 0x00, - 0x00, 0x00, 0x3f, 0x5c, 0x6f, 0x87, 0x80, 0x6e, 0x5b, - 0x88, 0x71, 0x70, 0x80, 0x72, 0x80, 0x72, 0x80, 0x8e, - 0xa2, 0x99, 0x75, 0x80, 0x70, 0x71, 0x9c, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x66, 0x67, 0x4a, - 0x66, 0x67, 0x4c, 0x49, 0x06, 0x00, 0x6b, 0x52, 0x67, - 0x52, 0x4a, 0x66, 0x67, 0x6b, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x66, 0x52, - 0x68, 0x67, 0x52, 0x67, 0x6a, 0x00, 0x00, 0x00, 0x3c, - 0x53, 0x67, 0x66, 0x52, 0x4a, 0x66, 0x49, 0x00, 0x00, - 0x3c, 0x68, 0x52, 0x67, 0x52, 0x4c, 0x3b, 0x7b, 0x52, - 0x67, 0x66, 0x52, 0x67, 0x67, 0x4c, 0x6b, 0x38, 0x49, - 0x66, 0x67, 0x52, 0x66, 0x85, 0x00, 0x00, 0x4e, 0x66, - 0x68, 0x52, 0x68, 0x49, 0x3c, 0x50, 0x66, 0x67, 0x67, - 0x67, 0x67, 0x68, 0x4a, 0x85, 0x3b, 0x4c, 0x66, 0x1c, - 0x19, 0x2a, 0x1b, 0x19, 0x94, 0x19, 0x2a, 0x2a, 0x19, - 0x1c, 0x80, 0x70, 0x64, 0xa3, 0x5d, 0x70, 0x80, 0x70, - 0x70, 0x6f, 0x83, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xa4, - 0x70, 0x80, 0x70, 0x82, 0xa5, 0xa6, 0x64, 0x80, 0x70, - 0x80, 0x70, 0x80, 0x70, 0x8e, 0x45, 0xa7, 0x75, 0x87, - 0x80, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4e, 0x58, 0x02, 0x00, 0x00, - 0x00, 0x01, 0x7b, 0x4c, 0x52, 0x67, 0x67, 0x66, 0x54, - 0x3a, 0x00, 0x4f, 0x4a, 0x67, 0x67, 0x52, 0x67, 0x66, - 0x4a, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, - 0x06, 0x00, 0x49, 0x66, 0x4a, 0x67, 0x66, 0x67, 0x66, - 0x50, 0x00, 0x00, 0x00, 0x69, 0x67, 0x66, 0x4a, 0x68, - 0x67, 0x52, 0x51, 0x00, 0x00, 0x4e, 0x4b, 0x67, 0x67, - 0x68, 0x4c, 0x3b, 0x48, 0x4a, 0x66, 0x4a, 0x67, 0x67, - 0x52, 0x67, 0x4f, 0x3b, 0x51, 0x66, 0x67, 0x67, 0x4c, - 0x6c, 0x00, 0x00, 0x85, 0x66, 0x67, 0x67, 0x66, 0x51, - 0x38, 0x57, 0x4c, 0x52, 0x67, 0x66, 0x67, 0x52, 0x67, - 0x3c, 0x3b, 0x4b, 0x1c, 0x19, 0x19, 0x34, 0x2a, 0x1c, - 0x18, 0x18, 0x1b, 0x34, 0x19, 0x19, 0x1c, 0x80, 0x72, - 0x80, 0x72, 0x80, 0x87, 0x80, 0x82, 0x81, 0x45, 0x00, - 0x00, 0x00, 0x00, 0x45, 0x6e, 0x80, 0x70, 0x80, 0x6e, - 0x8f, 0x73, 0x5d, 0x70, 0x80, 0x87, 0x80, 0x70, 0x80, - 0x6d, 0x00, 0x63, 0x75, 0x72, 0x80, 0x75, 0x6d, 0x44, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x53, 0x4a, 0x67, 0x7c, 0x7b, 0x49, 0x66, 0x67, - 0x67, 0x68, 0x52, 0x66, 0x51, 0x06, 0x00, 0x00, 0x4d, - 0x67, 0x52, 0x67, 0x67, 0x67, 0x52, 0x52, 0x4a, 0x51, - 0x7b, 0x7b, 0x54, 0x67, 0x66, 0x06, 0x00, 0x6b, 0x66, - 0x67, 0x52, 0x4a, 0x66, 0x66, 0x66, 0x4d, 0x7b, 0x54, - 0x67, 0x52, 0x66, 0x67, 0x52, 0x67, 0x67, 0x6b, 0x00, - 0x00, 0x4f, 0x4c, 0x67, 0x52, 0x67, 0x66, 0x01, 0x4f, - 0x67, 0x67, 0x67, 0x66, 0x67, 0x66, 0x56, 0x39, 0x06, - 0x51, 0x66, 0x67, 0x52, 0x66, 0x85, 0x00, 0x00, 0x85, - 0x66, 0x67, 0x67, 0x66, 0x49, 0x3b, 0x85, 0x4c, 0x67, - 0x67, 0x4a, 0x66, 0x67, 0x4a, 0x00, 0x3b, 0x1e, 0x19, - 0x19, 0x1c, 0x1c, 0x12, 0xa8, 0x46, 0x00, 0x12, 0x18, - 0x19, 0x19, 0x19, 0x1e, 0x70, 0x80, 0x80, 0x87, 0x80, - 0x70, 0x70, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, - 0x6e, 0x80, 0x87, 0x80, 0x75, 0x5b, 0x40, 0x91, 0x6f, - 0x72, 0x80, 0x70, 0x80, 0x72, 0xa1, 0x00, 0x63, 0x75, - 0x80, 0x87, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x4a, 0x68, 0x52, - 0x68, 0x52, 0x67, 0x52, 0x67, 0x52, 0x67, 0x67, 0x4c, - 0x6b, 0x01, 0x00, 0x00, 0x8d, 0x4a, 0x68, 0x52, 0x67, - 0x66, 0x4a, 0x68, 0x67, 0x52, 0x68, 0x52, 0x67, 0x67, - 0x4c, 0x01, 0x00, 0x84, 0x66, 0x67, 0x67, 0x67, 0x66, - 0x4a, 0x67, 0x67, 0x66, 0x66, 0x67, 0x66, 0x4a, 0x67, - 0x67, 0x67, 0x54, 0x55, 0x00, 0x00, 0x85, 0x7a, 0x67, - 0x67, 0x66, 0x4d, 0x01, 0x39, 0x67, 0x52, 0x67, 0x67, - 0x67, 0x66, 0x69, 0x00, 0x06, 0x49, 0x66, 0x67, 0x67, - 0x66, 0x85, 0x00, 0x00, 0x50, 0x66, 0x52, 0x67, 0x66, - 0x7b, 0x00, 0x6a, 0x4a, 0x66, 0x67, 0x52, 0x67, 0x67, - 0x7b, 0x00, 0x06, 0x19, 0x19, 0x12, 0x12, 0x12, 0x4f, - 0x00, 0x00, 0x00, 0x46, 0x31, 0x18, 0x12, 0x1b, 0xa9, - 0x80, 0x87, 0x70, 0x80, 0x70, 0x75, 0xaa, 0x45, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x83, 0x75, 0x70, 0x80, 0x70, - 0x8e, 0x65, 0x00, 0x9c, 0x71, 0x80, 0x70, 0x80, 0x72, - 0x80, 0x73, 0x0e, 0x63, 0x75, 0x70, 0x72, 0x71, 0x6d, - 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x53, 0x67, 0x67, 0x67, 0x67, 0x68, 0x67, - 0x67, 0x68, 0x52, 0x66, 0x4d, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x53, 0x4a, 0x66, 0x67, 0x67, 0x52, 0x67, - 0x67, 0x67, 0x67, 0x67, 0x66, 0x51, 0x01, 0x00, 0x00, - 0x7b, 0x66, 0x52, 0x67, 0x52, 0x67, 0x52, 0x52, 0x67, - 0x4a, 0x66, 0x67, 0x52, 0x67, 0x52, 0x4a, 0x4f, 0x00, - 0x00, 0x01, 0x6b, 0x4c, 0x67, 0x67, 0x66, 0x56, 0x01, - 0x01, 0x4a, 0x67, 0x67, 0x52, 0x67, 0x66, 0x58, 0x00, - 0x55, 0x56, 0x66, 0x67, 0x67, 0x66, 0x85, 0x00, 0x00, - 0x49, 0x68, 0x67, 0x67, 0x66, 0x7c, 0x00, 0x3c, 0x4d, - 0x68, 0x67, 0x67, 0x67, 0x66, 0x4f, 0x00, 0x3a, 0xab, - 0xac, 0xad, 0xad, 0xad, 0x1d, 0x00, 0x00, 0x00, 0x00, - 0xad, 0xad, 0xad, 0x5e, 0x70, 0x80, 0x80, 0x80, 0x72, - 0x80, 0x87, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xae, 0x75, 0x87, 0x80, 0x70, 0x8e, 0xaf, 0x00, 0x81, - 0x71, 0x80, 0x70, 0x80, 0x80, 0xb0, 0x00, 0x3f, 0xa9, - 0x75, 0x80, 0x80, 0x75, 0x9c, 0x44, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x4d, 0x68, - 0x52, 0x68, 0x67, 0x67, 0x67, 0x52, 0x52, 0x4a, 0x51, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x7b, - 0x53, 0x67, 0x67, 0x67, 0x67, 0x67, 0x68, 0x52, 0x68, - 0x66, 0x69, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x53, 0x4a, - 0x67, 0x67, 0x66, 0x4a, 0x68, 0x52, 0x67, 0x52, 0x67, - 0x4a, 0x51, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x7b, 0x4c, - 0x52, 0x66, 0x66, 0x56, 0x3b, 0x00, 0x53, 0x66, 0x66, - 0x67, 0x52, 0x54, 0x08, 0x00, 0x6a, 0x53, 0x66, 0x66, - 0x52, 0x66, 0x85, 0x00, 0x00, 0x54, 0x66, 0x66, 0x66, - 0x4c, 0x7b, 0x00, 0x06, 0x4d, 0x68, 0x52, 0x66, 0x52, - 0x67, 0x06, 0x00, 0x4f, 0x4c, 0x52, 0x53, 0x2a, 0x29, - 0x15, 0x00, 0x00, 0x00, 0x00, 0x29, 0x15, 0x29, 0x70, - 0x80, 0x70, 0x70, 0x70, 0x70, 0x82, 0xaa, 0x45, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x75, 0x6f, 0x80, - 0x6f, 0x8e, 0xa6, 0x00, 0x63, 0x75, 0x70, 0x70, 0x70, - 0x70, 0xa0, 0x00, 0x47, 0x5d, 0x6f, 0x70, 0x70, 0x75, - 0x9c, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x57, 0x49, 0x51, 0x4d, 0x54, 0x4d, - 0x54, 0x56, 0x69, 0x84, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x58, 0x49, 0x4d, - 0x4d, 0x54, 0x4d, 0x56, 0x56, 0x49, 0x4f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x4e, 0x7b, 0x56, 0x4d, 0x56, - 0x4d, 0x56, 0x56, 0x51, 0x6b, 0x6a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3b, 0x6b, 0x4d, 0x51, 0x49, 0x4d, 0x7b, - 0x01, 0x00, 0x6b, 0x51, 0x49, 0x4d, 0x51, 0x7b, 0x06, - 0x00, 0x3c, 0x49, 0x51, 0x49, 0x4d, 0x56, 0x4e, 0x00, - 0x00, 0x4d, 0x51, 0x49, 0x51, 0x56, 0x57, 0x00, 0x01, - 0x6b, 0x4d, 0x51, 0x49, 0x56, 0x7c, 0x00, 0x00, 0x3c, - 0xb2, 0x17, 0xb2, 0x29, 0x17, 0x17, 0xb2, 0x00, 0x00, - 0xb2, 0x17, 0x17, 0x17, 0xb2, 0x17, 0xb2, 0x5c, 0x5c, - 0x76, 0x5c, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x8f, 0x5e, 0x5c, 0x5c, 0x5e, 0x9b, 0x8a, 0x00, - 0x79, 0x5c, 0x5c, 0x5c, 0x5c, 0x76, 0x9e, 0x00, 0x45, - 0xb3, 0x76, 0x5c, 0x5c, 0x5d, 0x63, 0x45, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x3b, 0x3b, 0x3b, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x3b, 0x3b, 0x3b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 -}; - -// Keyboard - -unsigned char item_keyboard_colors[] = { - 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, - 0x39, 0x39, 0x39, - 0x31, 0x31, 0x31, - 0x29, 0x29, 0x29, - 0x21, 0x21, 0x21, - 0x42, 0x42, 0x42, - 0x63, 0x63, 0x63, - 0x7b, 0x7b, 0x7b, - 0x73, 0x73, 0x73, - 0x6b, 0x6b, 0x6b, - 0x4a, 0x4a, 0x4a, - 0x94, 0x94, 0x94, - 0x9c, 0x9c, 0x9c, - 0xa5, 0xa5, 0xa5, - 0xbd, 0xbd, 0xbd, - 0x5a, 0x5a, 0x5a, - 0x52, 0x52, 0x52, - 0x84, 0x84, 0x84, - 0xad, 0xad, 0xad, - 0xc6, 0xc6, 0xc6, - 0xb5, 0xb5, 0xb5, - 0x8c, 0x8c, 0x8c, - 0x10, 0x10, 0x10, - 0x08, 0x08, 0x08 - -}; -unsigned char item_keyboard[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x07, 0x08, 0x06, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x09, 0x08, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x08, 0x07, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x0b, 0x0c, 0x0d, 0x0d, 0x0b, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x0e, 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, - 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x08, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0d, 0x0e, 0x0d, - 0x0b, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x0a, - 0x0d, 0x0e, 0x0d, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, - 0x0d, 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x10, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x0d, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x10, 0x0d, 0x0d, 0x0d, 0x0d, 0x07, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x0e, 0x13, 0x08, 0x08, 0x06, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, - 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x07, 0x12, 0x0b, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x0b, 0x06, 0x06, 0x08, 0x09, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x08, 0x12, 0x0f, 0x10, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x0f, 0x10, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x10, 0x12, 0x12, 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, 0x12, 0x12, 0x08, - 0x08, 0x0d, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x07, 0x08, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x14, - 0x08, 0x12, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x11, 0x11, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x0f, 0x07, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x0f, 0x07, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x06, 0x06, 0x0f, 0x07, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, 0x06, - 0x06, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x06, 0x06, 0x06, 0x06, 0x08, 0x0d, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x07, 0x14, 0x06, - 0x06, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x07, 0x0f, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x0b, - 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x11, - 0x13, 0x07, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x10, 0x0f, 0x0f, 0x14, 0x0e, 0x06, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0e, - 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x11, 0x0e, 0x0f, 0x14, 0x0f, 0x0c, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, - 0x0f, 0x0f, 0x0e, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x14, 0x12, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x10, - 0x0f, 0x0f, 0x0f, 0x15, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x0f, 0x0f, 0x0e, - 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x12, 0x0e, 0x12, 0x15, 0x0f, 0x0e, 0x06, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x15, 0x0f, 0x0f, - 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x0d, 0x0f, 0x14, 0x15, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, 0x06, - 0x06, 0x09, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, 0x10, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0d, 0x0d, - 0x0f, 0x0e, 0x0e, 0x15, 0x07, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0f, - 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x08, 0x0d, 0x03, 0x03, 0x03, 0x00, 0x06, - 0x06, 0x0b, 0x07, 0x0f, 0x06, 0x06, 0x08, 0x0d, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, - 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x0c, 0x13, 0x06, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x11, 0x13, 0x0f, 0x07, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, - 0x07, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x12, 0x0f, 0x0c, 0x07, 0x0a, 0x15, 0x0a, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x13, - 0x13, 0x07, 0x10, 0x10, 0x0b, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x09, - 0x15, 0x08, 0x07, 0x09, 0x0f, 0x0a, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x14, 0x09, 0x11, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x09, 0x15, 0x09, 0x07, 0x16, 0x0f, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x13, 0x09, - 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x10, 0x07, 0x0f, 0x07, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x11, - 0x07, 0x09, 0x0f, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x12, 0x0d, 0x06, 0x0c, 0x15, 0x11, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x0e, 0x15, 0x09, 0x0f, 0x0e, 0x16, - 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x14, 0x10, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x11, 0x08, 0x12, - 0x08, 0x08, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x0b, 0x12, 0x12, 0x08, 0x13, 0x16, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x07, 0x0f, - 0x06, 0x06, 0x12, 0x0d, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x08, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x0f, - 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0b, 0x13, - 0x0f, 0x0f, 0x09, 0x10, 0x11, 0x11, 0x11, 0x0b, 0x0b, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x10, 0x12, 0x08, 0x08, 0x13, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, - 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x12, 0x13, 0x0b, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, - 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x0f, 0x10, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x12, 0x0e, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x0f, 0x10, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x10, 0x0f, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x0e, - 0x0d, 0x13, 0x11, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x10, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x0d, - 0x12, 0x06, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x03, 0x03, - 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x0f, 0x10, 0x11, 0x10, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x08, 0x15, 0x0d, 0x0e, 0x0d, 0x0d, 0x0b, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x11, - 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x07, 0x0f, 0x12, 0x08, 0x0d, 0x13, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x10, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x0f, 0x0f, 0x13, 0x06, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x10, 0x15, 0x0f, 0x0f, 0x0e, 0x0e, - 0x0d, 0x0e, 0x0d, 0x0d, 0x0c, 0x06, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x11, 0x0f, - 0x0d, 0x0d, 0x0d, 0x14, 0x09, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, - 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x14, 0x10, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, - 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, - 0x06, 0x02, 0x10, 0x0f, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x02, 0x06, 0x08, 0x0f, 0x0f, 0x0c, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, - 0x02, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x0d, 0x08, 0x02, 0x0f, 0x10, - 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x06, 0x02, 0x02, 0x06, 0x0f, 0x10, 0x08, 0x0d, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, 0x08, - 0x0d, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x11, - 0x0d, 0x0d, 0x0d, 0x13, 0x15, 0x06, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x02, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x0c, 0x0f, 0x0f, - 0x14, 0x0f, 0x0f, 0x0f, 0x0e, 0x02, 0x03, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x11, 0x15, 0x0f, 0x07, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x08, 0x0e, 0x02, 0x02, 0x02, 0x16, - 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, - 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x06, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x08, 0x08, - 0x08, 0x08, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, - 0x02, 0x0b, 0x13, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x08, 0x0d, - 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x0f, 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, 0x0f, - 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, - 0x13, 0x10, 0x15, 0x0c, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x0d, 0x08, 0x02, 0x14, 0x10, 0x11, 0x0f, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x0f, 0x10, 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x08, - 0x0d, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x11, 0x15, 0x10, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x09, - 0x13, 0x10, 0x10, 0x07, 0x13, 0x0d, 0x04, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x0f, 0x16, 0x10, 0x0a, - 0x15, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x06, 0x13, 0x0e, 0x10, 0x11, 0x11, 0x06, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x15, 0x0a, 0x10, - 0x0c, 0x0f, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x0a, 0x15, 0x0a, 0x10, 0x11, 0x10, 0x02, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x0f, - 0x10, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x06, 0x15, 0x13, 0x0d, 0x0f, 0x15, 0x09, - 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x0d, - 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x03, 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, - 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, - 0x02, 0x03, 0x02, 0x11, 0x14, 0x03, 0x04, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x06, 0x0e, - 0x0c, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x02, 0x0b, 0x10, 0x0f, 0x0a, 0x10, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x02, 0x0f, - 0x10, 0x11, 0x0f, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x03, 0x06, 0x10, 0x10, 0x0f, 0x0a, 0x16, - 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, - 0x13, 0x10, 0x11, 0x10, 0x11, 0x02, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x03, 0x02, 0x06, 0x10, 0x10, 0x10, 0x11, - 0x16, 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x02, 0x02, 0x02, 0x03, 0x08, 0x0d, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x03, 0x02, 0x07, 0x16, 0x10, 0x10, - 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x03, 0x02, 0x0b, 0x0b, 0x02, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, 0x0f, 0x15, - 0x0d, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x09, 0x0e, 0x0e, 0x0f, 0x0f, 0x08, 0x04, 0x03, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, 0x0e, 0x0f, - 0x14, 0x0f, 0x0c, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0e, 0x0a, 0x03, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x0a, 0x15, - 0x0f, 0x0f, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x15, 0x0b, 0x03, 0x03, 0x04, - 0x03, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x06, - 0x09, 0x08, 0x11, 0x0d, 0x09, 0x04, 0x04, 0x04, 0x00, - 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, 0x03, 0x0a, - 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x15, 0x0f, 0x14, 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x11, - 0x0f, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x09, 0x0c, 0x03, 0x03, 0x06, 0x0e, 0x09, 0x04, 0x04, - 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0f, 0x14, - 0x0f, 0x0f, 0x06, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x0c, 0x09, 0x03, 0x15, 0x0b, 0x0b, 0x15, 0x04, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, - 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x0c, 0x03, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x14, 0x0f, - 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, - 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x0a, 0x04, 0x04, - 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x09, 0x0c, 0x03, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, - 0x03, 0x0b, 0x0c, 0x0f, 0x14, 0x0f, 0x15, 0x0b, 0x03, - 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0c, - 0x09, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x09, 0x06, 0x03, 0x11, 0x14, 0x04, 0x04, 0x05, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, - 0x09, 0x09, 0x09, 0x0c, 0x14, 0x06, 0x04, 0x05, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x15, 0x0d, 0x09, - 0x0c, 0x13, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x04, 0x0c, 0x0d, 0x0d, 0x0c, - 0x02, 0x04, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x06, 0x0c, 0x0d, 0x0c, 0x06, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, - 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, - 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, - 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, - 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, - 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x01, - 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x03, 0x01, 0x00, 0x05, 0x02, 0x06, - 0x02, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, - 0x01, 0x00, 0x00, 0x00, 0x05, 0x02, 0x06, 0x02, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x06, - 0x0b, 0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x10, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, - 0x0a, 0x0d, 0x11, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, 0x0d, - 0x0d, 0x0d, 0x12, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x11, 0x0e, 0x0d, 0x0d, 0x0b, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, 0x0d, 0x0e, - 0x0d, 0x0d, 0x0d, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x11, 0x0d, 0x0e, 0x0d, 0x0d, 0x0d, 0x06, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x0b, 0x07, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x0a, 0x0b, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x02, 0x11, 0x13, 0x0b, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, 0x0b, 0x06, - 0x06, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x08, 0x13, 0x12, 0x08, 0x08, 0x0e, 0x0d, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, 0x0f, - 0x12, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x12, 0x13, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x13, - 0x12, 0x08, 0x12, 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x0b, - 0x13, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, 0x13, - 0x0b, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, - 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, - 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x11, 0x11, - 0x11, 0x07, 0x06, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, - 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x07, 0x14, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, - 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x02, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x06, 0x06, - 0x06, 0x06, 0x08, 0x0d, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x07, 0x14, 0x06, 0x0f, 0x10, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0e, - 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, 0x06, 0x02, 0x0d, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x0b, 0x0b, 0x0b, 0x0b, 0x13, 0x0f, 0x08, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x0b, 0x0b, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x0b, 0x12, 0x0f, 0x13, 0x06, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, - 0x0b, 0x0b, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x0b, 0x08, 0x0d, 0x08, 0x15, 0x0f, 0x0e, 0x06, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, - 0x0f, 0x0f, 0x14, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x12, 0x13, 0x13, 0x0f, 0x15, 0x11, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, - 0x12, 0x0f, 0x0f, 0x0e, 0x0e, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x10, 0x13, 0x14, - 0x13, 0x0b, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, - 0x11, 0x13, 0x0f, 0x14, 0x0f, 0x13, 0x0b, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0f, 0x0f, 0x0f, - 0x0f, 0x15, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x0c, 0x09, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, - 0x06, 0x06, 0x09, 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x15, 0x10, 0x06, 0x06, 0x06, 0x02, 0x15, - 0x0b, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, 0x13, - 0x0b, 0x06, 0x0b, 0x0e, 0x09, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x08, 0x0d, 0x06, 0x06, 0x06, 0x09, - 0x0c, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x08, - 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x12, 0x0d, 0x06, - 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, 0x02, 0x08, 0x0d, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x07, - 0x0f, 0x06, 0x0f, 0x10, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x0b, 0x12, 0x13, 0x12, 0x08, 0x08, 0x13, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x12, - 0x0e, 0x06, 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x11, 0x13, - 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x10, 0x12, 0x12, 0x12, 0x12, 0x08, 0x12, 0x08, 0x08, - 0x07, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x12, - 0x0f, 0x0f, 0x13, 0x06, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x0b, 0x06, 0x0b, 0x06, 0x06, - 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0f, - 0x13, 0x09, 0x10, 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x09, 0x0f, 0x08, 0x07, 0x09, 0x13, - 0x0a, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, - 0x0f, 0x0d, 0x06, 0x0c, 0x0f, 0x0b, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x09, 0x15, 0x08, 0x07, 0x16, - 0x0f, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, - 0x12, 0x13, 0x15, 0x12, 0x10, 0x0d, 0x0c, 0x03, 0x03, - 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x15, 0x07, 0x07, - 0x10, 0x16, 0x07, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, - 0x06, 0x11, 0x09, 0x14, 0x07, 0x10, 0x11, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, - 0x06, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x06, - 0x06, 0x06, 0x12, 0x0e, 0x06, 0x06, 0x02, 0x12, 0x0d, - 0x03, 0x03, 0x03, 0x00, 0x06, 0x06, 0x06, 0x0f, 0x07, - 0x06, 0x06, 0x02, 0x02, 0x0f, 0x11, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x13, 0x0e, 0x06, 0x0d, 0x0e, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x12, - 0x0d, 0x06, 0x06, 0x02, 0x12, 0x0d, 0x03, 0x03, 0x03, - 0x00, 0x06, 0x06, 0x06, 0x11, 0x07, 0x07, 0x07, 0x12, - 0x0f, 0x07, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x07, 0x15, 0x12, 0x03, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x06, 0x11, 0x16, 0x0f, 0x12, 0x0f, 0x12, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x06, 0x0a, - 0x0d, 0x0e, 0x0d, 0x0e, 0x15, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x12, 0x0d, 0x06, 0x06, 0x06, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, - 0x06, 0x06, 0x11, 0x0e, 0x0f, 0x0f, 0x14, 0x08, 0x02, - 0x03, 0x03, 0x04, 0x00, 0x06, 0x06, 0x0c, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x06, 0x03, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x12, 0x0f, 0x0f, 0x14, 0x0e, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x11, 0x15, 0x0b, - 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x06, 0x06, 0x08, 0x13, 0x06, 0x02, 0x02, 0x0d, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, - 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, - 0x13, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x06, 0x06, 0x12, 0x15, 0x11, 0x02, - 0x02, 0x07, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, - 0x06, 0x11, 0x15, 0x13, 0x08, 0x06, 0x02, 0x02, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, 0x07, 0x0f, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x06, 0x06, 0x12, 0x13, 0x06, 0x02, 0x02, 0x0d, 0x08, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, - 0x0b, 0x06, 0x02, 0x13, 0x0a, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x13, 0x09, 0x06, 0x15, 0x11, 0x0b, - 0x0f, 0x06, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x0b, 0x15, 0x15, 0x15, 0x06, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x11, 0x14, 0x0b, 0x06, 0x02, - 0x13, 0x09, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x07, 0x14, 0x07, 0x02, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x12, 0x13, - 0x12, 0x08, 0x08, 0x08, 0x0b, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0a, 0x0f, 0x07, - 0x02, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x08, - 0x15, 0x0d, 0x0d, 0x0d, 0x15, 0x09, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, - 0x12, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x0c, - 0x14, 0x0f, 0x0f, 0x08, 0x02, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x06, 0x06, 0x0c, 0x14, 0x0f, 0x14, 0x0f, 0x13, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x06, 0x06, - 0x12, 0x0f, 0x0f, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x02, 0x02, 0x11, 0x15, 0x0b, 0x03, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x06, 0x08, - 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x08, 0x0d, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x02, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, - 0x06, 0x08, 0x0d, 0x06, 0x02, 0x02, 0x02, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x0b, 0x08, - 0x13, 0x15, 0x12, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, - 0x02, 0x06, 0x02, 0x10, 0x0f, 0x02, 0x02, 0x02, 0x03, - 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x10, 0x0f, - 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x0e, 0x16, 0x02, 0x0a, 0x15, - 0x06, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, 0x0d, - 0x08, 0x02, 0x0f, 0x10, 0x10, 0x0f, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x08, 0x0f, 0x08, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x02, 0x13, 0x12, 0x02, 0x0a, 0x15, 0x06, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x02, 0x02, 0x0a, 0x0f, - 0x07, 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x06, 0x08, 0x15, 0x0d, 0x0d, 0x0d, 0x15, - 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x02, - 0x06, 0x02, 0x0f, 0x09, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x06, 0x02, 0x08, 0x0d, 0x06, 0x02, 0x02, - 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x02, 0x02, 0x06, - 0x02, 0x02, 0x06, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x03, - 0x04, 0x00, 0x02, 0x02, 0x06, 0x08, 0x0d, 0x06, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x06, 0x02, 0x06, 0x0c, 0x0f, 0x0f, 0x08, - 0x03, 0x03, 0x03, 0x04, 0x00, 0x02, 0x06, 0x02, 0x06, - 0x0c, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x03, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x06, 0x02, 0x08, 0x14, 0x0f, 0x0c, - 0x02, 0x03, 0x03, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x06, 0x02, 0x02, 0x06, 0x11, 0x02, 0x11, 0x13, - 0x0b, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x13, 0x02, 0x02, - 0x02, 0x0e, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0e, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x08, 0x0d, 0x02, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, - 0x04, 0x03, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x10, - 0x14, 0x02, 0x02, 0x06, 0x06, 0x03, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x02, 0x10, 0x14, 0x02, 0x02, 0x02, 0x0e, - 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x10, 0x0f, 0x06, 0x0e, 0x08, 0x03, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x0d, 0x16, 0x11, 0x0f, 0x09, - 0x07, 0x15, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x11, 0x15, 0x12, 0x15, 0x0b, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x02, - 0x0e, 0x12, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x0a, 0x0f, 0x0a, 0x02, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x08, - 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f, 0x10, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x0d, 0x08, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x02, 0x08, 0x0d, 0x02, 0x02, 0x02, 0x0d, 0x08, 0x03, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x0c, 0x0f, 0x08, 0x03, 0x03, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0e, 0x06, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, 0x02, - 0x02, 0x08, 0x0f, 0x0c, 0x02, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x0b, - 0x0d, 0x0e, 0x10, 0x07, 0x15, 0x0b, 0x04, 0x04, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, - 0x08, 0x0d, 0x02, 0x03, 0x03, 0x08, 0x0d, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x02, 0x0a, 0x15, 0x0a, 0x10, - 0x0a, 0x0f, 0x07, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x08, 0x0f, 0x0c, 0x02, 0x16, 0x0f, 0x0b, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x0a, 0x14, 0x0a, - 0x10, 0x0c, 0x14, 0x09, 0x03, 0x04, 0x04, 0x00, 0x02, - 0x02, 0x03, 0x08, 0x0d, 0x02, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x12, - 0x10, 0x10, 0x11, 0x13, 0x09, 0x04, 0x04, 0x04, 0x00, - 0x02, 0x02, 0x03, 0x02, 0x0b, 0x0f, 0x07, 0x11, 0x0e, - 0x0d, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x11, - 0x0f, 0x07, 0x0a, 0x13, 0x0f, 0x08, 0x04, 0x04, 0x04, - 0x00, 0x02, 0x02, 0x03, 0x02, 0x02, 0x13, 0x0c, 0x0f, - 0x06, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, - 0x07, 0x15, 0x15, 0x0d, 0x0f, 0x13, 0x08, 0x03, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x03, 0x06, 0x15, 0x12, 0x02, - 0x12, 0x15, 0x02, 0x03, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x02, 0x06, 0x15, 0x0e, 0x0f, 0x06, 0x03, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x07, 0x0f, 0x12, - 0x10, 0x11, 0x11, 0x06, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x10, 0x10, 0x11, - 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, - 0x02, 0x03, 0x02, 0x0f, 0x10, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x03, 0x02, 0x08, 0x13, 0x10, 0x11, - 0x10, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, - 0x03, 0x02, 0x02, 0x03, 0x02, 0x03, 0x0e, 0x08, 0x04, - 0x04, 0x04, 0x00, 0x02, 0x02, 0x03, 0x08, 0x13, 0x11, - 0x10, 0x11, 0x0e, 0x08, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x03, 0x02, 0x03, 0x02, 0x02, 0x16, - 0x08, 0x03, 0x04, 0x04, 0x04, 0x00, 0x02, 0x03, 0x02, - 0x02, 0x03, 0x02, 0x06, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x02, 0x02, 0x03, 0x02, 0x08, 0x0c, 0x02, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, - 0x02, 0x02, 0x03, 0x02, 0x09, 0x0f, 0x13, 0x0d, 0x0e, - 0x15, 0x11, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, 0x03, 0x02, - 0x03, 0x0a, 0x0c, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x08, 0x15, 0x0f, 0x15, 0x08, 0x04, 0x03, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x08, 0x13, 0x15, - 0x0f, 0x15, 0x0b, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x08, 0x0f, 0x0f, 0x0c, 0x0d, 0x09, - 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x09, 0x0c, - 0x03, 0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x0b, 0x13, 0x0f, 0x0f, 0x14, 0x0d, - 0x02, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x12, 0x0f, 0x0f, 0x13, 0x06, 0x03, 0x04, 0x04, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x0c, 0x0f, 0x15, 0x08, - 0x0c, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x10, 0x0f, 0x16, 0x03, 0x04, 0x03, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x15, 0x0e, 0x03, - 0x12, 0x0f, 0x0b, 0x04, 0x04, 0x04, 0x00, 0x03, 0x03, - 0x03, 0x09, 0x0e, 0x03, 0x03, 0x03, 0x0e, 0x0a, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x10, - 0x13, 0x16, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x09, 0x0f, 0x0f, 0x14, 0x0f, 0x0f, 0x09, - 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x09, 0x0f, 0x0f, 0x0f, 0x14, 0x0f, 0x09, 0x04, 0x04, - 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, - 0x0b, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x0f, 0x15, 0x0b, 0x04, - 0x04, 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x0b, 0x0f, 0x09, 0x04, 0x04, 0x04, 0x00, 0x03, - 0x03, 0x03, 0x11, 0x15, 0x0f, 0x0f, 0x14, 0x15, 0x0b, - 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x0b, 0x03, 0x04, 0x04, - 0x04, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x03, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x11, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, - 0x04, 0x05, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x02, 0x09, 0x0c, 0x06, 0x02, 0x02, 0x03, 0x04, 0x04, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x09, 0x0d, 0x02, 0x11, 0x02, 0x03, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x0d, 0x09, 0x04, 0x04, 0x05, 0x00, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x05, 0x05, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x06, 0x0f, 0x0b, 0x03, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x00, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x00, 0x00, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x09, 0x0d, - 0x03, 0x04, 0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x0c, - 0x09, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x06, 0x09, - 0x0d, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, - 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, - 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x00, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x00, 0x04, - 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x03, 0x04, - 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x11, 0x09, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x09, 0x11, 0x05, 0x05, 0x17, - 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x04, 0x17, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x11, 0x0d, 0x0d, 0x11, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, 0x01, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, - 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, - 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x04, 0x05, - 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, - 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, - 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x05, 0x05, - 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x17, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x01, 0x17, 0x00, 0x00, 0x00, - 0x00, 0x00 -}; - -// ************************************************************************* -// ICONS -// ************************************************************************* - -// File - -unsigned char item_disk_colors[] = { - 0x00, 0x00, 0x00, - 0x93, 0x7d, 0x2d, - 0x7b, 0x68, 0x25, - 0xc1, 0xaf, 0x6b, - 0xa3, 0x94, 0x59, - 0x05, 0x04, 0x00, - 0x55, 0x48, 0x15, - 0xa0, 0x87, 0x2f, - 0xa3, 0x8b, 0x33, - 0xdf, 0xcc, 0x88, - 0xe4, 0xd0, 0x89, - 0xc7, 0xaf, 0x62, - 0xab, 0x9a, 0x51, - 0x16, 0x10, 0x01, - 0x0a, 0x09, 0x00, - 0x7a, 0x67, 0x24, - 0xac, 0x93, 0x3b, - 0xb0, 0x97, 0x3f, - 0xf1, 0xdc, 0x94, - 0xd9, 0xc2, 0x73, - 0xdb, 0xc3, 0x6a, - 0xca, 0xb2, 0x54, - 0xaa, 0x99, 0x4e, - 0x90, 0x79, 0x2a, - 0x9d, 0x84, 0x2d, - 0xe2, 0xcc, 0x72, - 0xf3, 0xda, 0x77, - 0xe3, 0xcc, 0x69, - 0xe3, 0xca, 0x62, - 0xdb, 0xc3, 0x64, - 0xc8, 0xad, 0x59, - 0xa1, 0x90, 0x53, - 0x75, 0x62, 0x21, - 0x8d, 0x76, 0x28, - 0x96, 0x7e, 0x2a, - 0xde, 0xc5, 0x5a, - 0xe7, 0xd1, 0x64, - 0xe5, 0xcb, 0x5e, - 0xd2, 0xb8, 0x69, - 0xbd, 0xa9, 0x62, - 0x9c, 0x8c, 0x53, - 0x8a, 0x74, 0x26, - 0x09, 0x09, 0x04, - 0xd4, 0xbb, 0x64, - 0xe0, 0xc5, 0x5e, - 0xe3, 0xc7, 0x64, - 0xd6, 0xc0, 0x67, - 0xcd, 0xb3, 0x64, - 0xbd, 0xa9, 0x5b, - 0x9d, 0x8d, 0x4e, - 0x72, 0x60, 0x1e, - 0xd0, 0xba, 0x72, - 0xd3, 0xb8, 0x51, - 0xd1, 0xb5, 0x59, - 0xe0, 0xc7, 0x6e, - 0x8f, 0x78, 0x25, - 0x88, 0x71, 0x23, - 0xc4, 0xb0, 0x65, - 0xd4, 0xba, 0x5c, - 0xc4, 0xae, 0x5b, - 0x98, 0x7f, 0x23, - 0x84, 0x6e, 0x21, - 0x8e, 0x76, 0x24, - 0x93, 0x7a, 0x24, - 0x86, 0x70, 0x21, - 0x71, 0x5e, 0x1d, - 0xba, 0xa5, 0x5d, - 0xb6, 0xa1, 0x5a, - 0xbf, 0xa8, 0x52, - 0xc3, 0xac, 0x52, - 0xc5, 0xac, 0x4b, - 0x5a, 0x4b, 0x16, - 0x75, 0x61, 0x1d, - 0x89, 0x71, 0x1d, - 0x6d, 0x61, 0x35, - 0x77, 0x69, 0x3a, - 0x83, 0x74, 0x40, - 0x94, 0x84, 0x48, - 0xb1, 0x9e, 0x53, - 0xb8, 0xa4, 0x52, - 0xc5, 0xab, 0x47, - 0x34, 0x2b, 0x0d, - 0x7a, 0x65, 0x1d, - 0x84, 0x6c, 0x1d, - 0x89, 0x70, 0x1b, - 0x8c, 0x74, 0x1e, - 0x66, 0x54, 0x18, - 0x16, 0x14, 0x0b, - 0x38, 0x31, 0x1b, - 0x63, 0x56, 0x2e, - 0x89, 0x78, 0x40, - 0xb6, 0xa1, 0x4f, - 0xbb, 0xa3, 0x4d, - 0xc1, 0xa7, 0x4a, - 0xbf, 0xa5, 0x4b, - 0xb3, 0x9c, 0x46, - 0xc2, 0xc2, 0xc2, - 0x4e, 0x4e, 0x4e, - 0x57, 0x4c, 0x23, - 0x81, 0x69, 0x15, - 0x83, 0x6d, 0x20, - 0x23, 0x1d, 0x08, - 0x3d, 0x36, 0x1a, - 0x6f, 0x62, 0x2f, - 0xac, 0x97, 0x48, - 0xa8, 0x93, 0x42, - 0xb8, 0xa1, 0x47, - 0xb8, 0xa0, 0x48, - 0xb6, 0x9f, 0x49, - 0xaf, 0x99, 0x47, - 0xff, 0xff, 0xff, - 0x85, 0x6d, 0x19, - 0x6f, 0x5c, 0x1b, - 0x11, 0x4d, 0x81, - 0x26, 0x71, 0xa5, - 0x26, 0x6e, 0xa4, - 0x1c, 0x5e, 0x94, - 0x0b, 0x3d, 0x69, - 0x45, 0x3d, 0x1d, - 0xaa, 0x95, 0x49, - 0xac, 0x97, 0x47, - 0xaa, 0x94, 0x45, - 0xa8, 0x93, 0x45, - 0x28, 0x79, 0xa9, - 0x35, 0x81, 0xb4, - 0x3e, 0x87, 0xb9, - 0x33, 0x7b, 0xaf, - 0x21, 0x65, 0x9e, - 0x21, 0x61, 0x9c, - 0x1e, 0x5b, 0x98, - 0x15, 0x4e, 0x8a, - 0x44, 0x3b, 0x1e, - 0x99, 0x84, 0x39, - 0xa2, 0x8d, 0x41, - 0x9e, 0x89, 0x3d, - 0x32, 0x29, 0x0a, - 0x81, 0x69, 0x19, - 0x2d, 0x80, 0xb0, - 0x3b, 0x89, 0xbb, - 0x65, 0xa5, 0xd0, - 0x58, 0x9d, 0xcc, - 0x4a, 0x8f, 0xc2, - 0x2f, 0x71, 0xaa, - 0x1d, 0x58, 0x96, - 0x19, 0x51, 0x82, - 0x0e, 0x42, 0x85, - 0x7a, 0x6a, 0x31, - 0x95, 0x7f, 0x35, - 0x9d, 0x87, 0x3c, - 0xa1, 0x8b, 0x40, - 0x88, 0x6f, 0x1b, - 0x59, 0x49, 0x12, - 0x7f, 0x69, 0x1e, - 0x0e, 0x62, 0x91, - 0x4b, 0x98, 0xcb, - 0xd1, 0xf0, 0xfe, - 0x93, 0xda, 0xfe, - 0x56, 0x9a, 0xd0, - 0x38, 0x78, 0xb2, - 0x28, 0x65, 0xa2, - 0x1c, 0x54, 0x94, - 0x1c, 0x55, 0x7d, - 0x2a, 0x55, 0x76, - 0x13, 0x24, 0x3e, - 0x8b, 0x75, 0x2b, - 0x99, 0x83, 0x37, - 0x95, 0x7f, 0x32, - 0x30, 0x27, 0x09, - 0x70, 0x5c, 0x16, - 0x3e, 0x89, 0xbd, - 0x52, 0x9d, 0xd1, - 0x7c, 0xc3, 0xfa, - 0x6e, 0xb2, 0xeb, - 0x51, 0x92, 0xcc, - 0x39, 0x77, 0xb2, - 0x20, 0x5e, 0x9b, - 0x1b, 0x52, 0x93, - 0x2b, 0x55, 0x70, - 0x32, 0x55, 0x67, - 0x13, 0x29, 0x4e, - 0x23, 0x1e, 0x0e, - 0x7c, 0x67, 0x1e, - 0x91, 0x7a, 0x2d, - 0x63, 0x51, 0x12, - 0x80, 0x6b, 0x23, - 0x2a, 0x77, 0xaa, - 0x45, 0x88, 0xc1, - 0x44, 0x84, 0xbf, - 0x3a, 0x78, 0xb4, - 0x2c, 0x67, 0xa4, - 0x1c, 0x53, 0x81, - 0x2f, 0x56, 0x69, - 0x31, 0x52, 0x65, - 0x11, 0x32, 0x6b, - 0x05, 0x0d, 0x1c, - 0x0e, 0x0c, 0x05, - 0x75, 0x61, 0x1a, - 0x2e, 0x25, 0x07, - 0x6e, 0x5a, 0x13, - 0x27, 0x74, 0xa7, - 0x2a, 0x6d, 0xa6, - 0x2d, 0x6c, 0xa7, - 0x21, 0x5a, 0x99, - 0x23, 0x53, 0x8c, - 0x18, 0x57, 0x77, - 0x2b, 0x54, 0x68, - 0x2f, 0x4f, 0x6d, - 0x0c, 0x34, 0x7f, - 0x7c, 0x64, 0x13, - 0x54, 0x44, 0x0d, - 0x0a, 0x55, 0x89, - 0x24, 0x6d, 0xa2, - 0x1f, 0x5d, 0x99, - 0x1c, 0x53, 0x94, - 0x16, 0x5a, 0x73, - 0x13, 0x5c, 0x6a, - 0x23, 0x4d, 0x6a, - 0x20, 0x38, 0x6a, - 0x02, 0x26, 0x70, - 0x53, 0x44, 0x13, - 0x76, 0x5f, 0x11, - 0x5d, 0x4d, 0x15, - 0x07, 0x4d, 0x84, - 0x17, 0x62, 0x84, - 0x15, 0x60, 0x7d, - 0x13, 0x63, 0x71, - 0x11, 0x5e, 0x6c, - 0x0b, 0x52, 0x6d, - 0x13, 0x43, 0x64, - 0x17, 0x33, 0x6d, - 0x1f, 0x1a, 0x09, - 0x32, 0x2a, 0x0c, - 0x6e, 0x5b, 0x18, - 0x6a, 0x55, 0x0d, - 0x44, 0x38, 0x0e, - 0x17, 0x55, 0x92, - 0x16, 0x50, 0x8f, - 0x0f, 0x51, 0x7a, - 0x0a, 0x4a, 0x75, - 0x05, 0x43, 0x6f, - 0x02, 0x32, 0x6e, - 0x05, 0x2d, 0x77, - 0x3d, 0x32, 0x0e, - 0x4d, 0x3f, 0x0f, - 0x67, 0x55, 0x14, - 0x79, 0x62, 0x13, - 0x54, 0x45, 0x12, - 0x02, 0x38, 0x77, - 0x08, 0x3c, 0x7e, - 0x03, 0x32, 0x76, - 0x02, 0x2c, 0x72, - 0x7e, 0x68, 0x19, - 0x50, 0x41, 0x0f, - 0x2d, 0x25, 0x09 - -}; -unsigned char item_disk[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x04, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x07, 0x08, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, - 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x08, 0x10, - 0x11, 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x12, 0x13, 0x14, 0x14, 0x15, 0x16, 0x0e, 0x00, - 0x00, 0x17, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x13, 0x19, 0x1a, - 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x20, 0x21, - 0x22, 0x18, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x05, 0x13, 0x1b, 0x23, 0x24, 0x25, 0x24, 0x1d, - 0x26, 0x27, 0x28, 0x00, 0x00, 0x20, 0x29, 0x29, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x26, 0x2b, - 0x2c, 0x23, 0x25, 0x1c, 0x2d, 0x2e, 0x26, 0x2f, 0x30, - 0x31, 0x05, 0x00, 0x32, 0x29, 0x29, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x33, 0x2f, 0x1d, 0x34, 0x1c, 0x34, - 0x1d, 0x35, 0x36, 0x14, 0x2b, 0x0b, 0x30, 0x31, 0x00, - 0x00, 0x37, 0x22, 0x38, 0x32, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x39, 0x1e, 0x3a, 0x3a, 0x35, 0x3a, 0x35, 0x15, 0x3a, - 0x35, 0x15, 0x1e, 0x3b, 0x3c, 0x00, 0x3d, 0x3e, 0x3f, - 0x3f, 0x40, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x42, 0x43, 0x42, 0x3b, 0x44, - 0x1e, 0x45, 0x45, 0x3a, 0x15, 0x34, 0x46, 0x35, 0x45, - 0x3c, 0x05, 0x47, 0x48, 0x40, 0x49, 0x3f, 0x3f, 0x3f, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x44, 0x45, 0x45, - 0x46, 0x50, 0x46, 0x46, 0x44, 0x3c, 0x05, 0x00, 0x51, - 0x52, 0x53, 0x54, 0x37, 0x55, 0x56, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x45, 0x5d, 0x5d, 0x5e, - 0x5f, 0x3c, 0x05, 0x60, 0x61, 0x00, 0x62, 0x40, 0x63, - 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x3f, 0x05, 0x6e, - 0x6e, 0x6e, 0x00, 0x6f, 0x49, 0x70, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x72, 0x73, - 0x74, 0x71, 0x75, 0x00, 0x00, 0x76, 0x77, 0x78, 0x79, - 0x79, 0x7a, 0x55, 0x00, 0x6e, 0x6e, 0x60, 0x00, 0x6f, - 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, - 0x00, 0x00, 0x83, 0x84, 0x85, 0x85, 0x86, 0x49, 0x00, - 0x6e, 0x6e, 0x61, 0x87, 0x88, 0x32, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x8a, 0x8b, 0x8c, - 0x8d, 0x8e, 0x80, 0x8f, 0x90, 0x91, 0x00, 0x00, 0x92, - 0x93, 0x94, 0x95, 0x96, 0x00, 0x6e, 0x60, 0x00, 0x97, - 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x99, 0x7b, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, - 0xa1, 0xa2, 0xa3, 0x00, 0x62, 0xa4, 0xa5, 0xa6, 0x6f, - 0x00, 0x6e, 0x61, 0xa7, 0xa8, 0x56, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0xa9, 0xaa, 0xab, - 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0x00, - 0xb4, 0xb5, 0xa6, 0xb6, 0x63, 0x00, 0x60, 0x00, 0xb7, - 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7b, 0xb9, 0xa9, 0xba, 0xbb, 0xbc, 0xbd, 0xa0, - 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0x21, 0xb6, - 0x63, 0x00, 0x61, 0xc5, 0xc6, 0x56, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x73, 0x73, - 0xc8, 0xc9, 0x9f, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0x00, 0x2a, 0x47, 0x38, 0x3d, 0xd0, 0x00, 0x00, 0xd1, - 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xd2, 0xd3, 0x7f, 0x80, 0xd4, 0x8f, 0xd5, - 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0x00, 0xc3, 0xdb, 0xc4, - 0x38, 0xdc, 0x00, 0xc5, 0xdd, 0x56, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, - 0x7f, 0xaf, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, - 0x00, 0x00, 0xe6, 0xe7, 0xe8, 0x88, 0xe9, 0x00, 0xea, - 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0xec, 0x82, 0xed, - 0xee, 0xef, 0xf0, 0xf1, 0x00, 0x00, 0x00, 0x00, 0xf2, - 0xf3, 0xf4, 0xf5, 0x00, 0xf6, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf7, 0xf8, 0xf9, 0xfa, 0xfa, 0xda, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0xfb, 0x06, - 0xfc, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Skip - -unsigned char item_skip_colors[] = { - 0x04, 0x02, 0x04, - 0xa4, 0xa6, 0xa4, - 0x1c, 0x1a, 0x1c, - 0x1c, 0x1e, 0x1c, - 0x14, 0x16, 0x14, - 0x9c, 0x9a, 0x9c, - 0x94, 0x92, 0x94, - 0x9c, 0x9e, 0x9c, - 0x94, 0x96, 0x94, - 0x8c, 0x8e, 0x8c, - 0xdc, 0xda, 0xdc, - 0xac, 0xae, 0xac, - 0xac, 0xfe, 0x04, - 0xbc, 0xba, 0xbc, - 0x3c, 0x3a, 0x3c, - 0x9c, 0xe6, 0x0c, - 0x8c, 0x8a, 0x8c, - 0x74, 0xae, 0x04, - 0x8c, 0xce, 0x0c, - 0x9c, 0xe2, 0x0c, - 0x84, 0x86, 0x84, - 0xfc, 0xd6, 0x8c, - 0xfc, 0xd2, 0x8c, - 0x74, 0xaa, 0x0c, - 0x8c, 0xc6, 0x0c, - 0x9c, 0xde, 0x0c, - 0xa4, 0xa2, 0xa4, - 0x7c, 0x7e, 0x7c, - 0x64, 0x66, 0x64, - 0xf4, 0xb2, 0x1c, - 0xf4, 0xba, 0x44, - 0x74, 0xa6, 0x0c, - 0x94, 0xd6, 0x14, - 0xfc, 0xb2, 0x24, - 0xf4, 0xaa, 0x1c, - 0xf4, 0xa6, 0x14, - 0x6c, 0x9e, 0x14, - 0x84, 0xc2, 0x04, - 0x94, 0xce, 0x14, - 0x94, 0xd2, 0x14, - 0xcc, 0xca, 0xcc, - 0xfc, 0xb6, 0x24, - 0xec, 0xa6, 0x14, - 0xdc, 0x92, 0x04, - 0xec, 0xae, 0x3c, - 0x74, 0xa2, 0x0c, - 0x84, 0xba, 0x14, - 0x8c, 0xca, 0x14, - 0xa4, 0xfa, 0x04, - 0xf4, 0xae, 0x1c, - 0xec, 0x9e, 0x0c, - 0xdc, 0x96, 0x04, - 0xec, 0xaa, 0x3c, - 0xa4, 0xee, 0x04, - 0x74, 0x72, 0x74, - 0xc4, 0xc2, 0xc4, - 0xe4, 0x9e, 0x0c, - 0xdc, 0x8e, 0x04, - 0xd4, 0x8a, 0x04, - 0xcc, 0x82, 0x04, - 0xdc, 0xa2, 0x3c, - 0xfc, 0xce, 0x84, - 0x94, 0xda, 0x04, - 0x5c, 0x5a, 0x5c, - 0xec, 0xa2, 0x0c, - 0xe4, 0x9a, 0x04, - 0xcc, 0x7e, 0x04, - 0xc4, 0x7a, 0x04, - 0xd4, 0x92, 0x24, - 0x24, 0x22, 0x24, - 0x2c, 0x2a, 0x2c, - 0xb4, 0xb2, 0xb4, - 0xd4, 0x8e, 0x04, - 0xbc, 0x76, 0x04, - 0xf4, 0xc6, 0x7c, - 0x54, 0x56, 0x54, - 0x2c, 0x2e, 0x2c, - 0x34, 0x32, 0x34, - 0xd4, 0x86, 0x04, - 0xc4, 0x7e, 0x04, - 0xbc, 0x72, 0x04, - 0xec, 0xbe, 0x6c, - 0x64, 0x9a, 0x04, - 0x6c, 0x6e, 0x6c, - 0xac, 0xaa, 0xac, - 0xcc, 0x86, 0x04, - 0xe4, 0xb2, 0x5c, - 0x4c, 0x4a, 0x4c, - 0xdc, 0xa6, 0x4c, - 0x6c, 0x6a, 0x6c, - 0x5c, 0x5e, 0x5c, - 0x0c, 0x0e, 0x0c, - 0x84, 0x82, 0x84, - 0x14, 0x12, 0x14, - 0x64, 0x62, 0x64, - 0x34, 0x36, 0x34, - 0x74, 0x76, 0x74, - 0x7c, 0x7a, 0x7c - -}; -unsigned char item_skip[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x02, 0x04, 0x05, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x02, 0x07, 0x08, 0x07, 0x09, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x04, 0x05, 0x07, - 0x05, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, - 0x04, 0x0d, 0x04, 0x0e, 0x0e, 0x07, 0x05, 0x07, 0x05, - 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x0f, 0x0c, 0x0c, 0x00, 0x00, 0x04, 0x0b, - 0x06, 0x0e, 0x0e, 0x08, 0x05, 0x05, 0x07, 0x08, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x12, 0x13, - 0x13, 0x0c, 0x0c, 0x00, 0x00, 0x07, 0x01, 0x09, 0x0e, - 0x0e, 0x09, 0x09, 0x06, 0x14, 0x02, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x15, 0x16, 0x00, 0x00, 0x17, 0x18, 0x19, 0x19, 0x0c, - 0x0c, 0x00, 0x00, 0x07, 0x1a, 0x14, 0x0e, 0x0e, 0x1b, - 0x1c, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x1e, 0x16, 0x16, - 0x00, 0x00, 0x1f, 0x18, 0x20, 0x20, 0x0c, 0x0c, 0x00, - 0x00, 0x08, 0x05, 0x14, 0x0e, 0x0e, 0x04, 0x03, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x21, 0x22, 0x23, 0x1e, 0x15, 0x16, 0x00, 0x00, - 0x24, 0x25, 0x26, 0x27, 0x0c, 0x0c, 0x00, 0x06, 0x08, - 0x05, 0x10, 0x04, 0x28, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x1d, 0x23, - 0x2a, 0x2b, 0x2c, 0x16, 0x15, 0x00, 0x00, 0x2d, 0x2e, - 0x2f, 0x30, 0x00, 0x1b, 0x14, 0x06, 0x07, 0x02, 0x0a, - 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x31, 0x22, 0x2a, 0x32, 0x33, 0x2b, 0x2b, - 0x34, 0x15, 0x16, 0x00, 0x00, 0x2f, 0x35, 0x00, 0x36, - 0x1b, 0x10, 0x09, 0x02, 0x04, 0x37, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x2a, - 0x32, 0x38, 0x2b, 0x2b, 0x39, 0x3a, 0x3b, 0x3c, 0x16, - 0x3d, 0x00, 0x3e, 0x00, 0x3f, 0x36, 0x1b, 0x09, 0x02, - 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x2a, 0x40, 0x41, 0x41, 0x2b, 0x39, - 0x3a, 0x3b, 0x42, 0x43, 0x44, 0x3d, 0x00, 0x25, 0x00, - 0x45, 0x46, 0x1c, 0x10, 0x04, 0x47, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x33, 0x33, 0x2b, 0x39, 0x48, 0x3b, 0x42, 0x49, - 0x42, 0x4a, 0x00, 0x11, 0x00, 0x4b, 0x1c, 0x4c, 0x4d, - 0x04, 0x0b, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, - 0x48, 0x4e, 0x4f, 0x42, 0x50, 0x43, 0x51, 0x00, 0x52, - 0x00, 0x4b, 0x1c, 0x53, 0x10, 0x02, 0x04, 0x54, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x4f, 0x43, - 0x50, 0x50, 0x56, 0x00, 0x00, 0x57, 0x4b, 0x1c, 0x36, - 0x10, 0x04, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4f, 0x50, 0x50, 0x58, 0x00, - 0x4c, 0x57, 0x3f, 0x59, 0x1b, 0x08, 0x04, 0x54, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5b, - 0x00, 0x00, 0x50, 0x44, 0x00, 0x03, 0x45, 0x57, 0x1c, - 0x5c, 0x08, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x5c, 0x1b, 0x5d, 0x5a, 0x00, 0x00, - 0x4b, 0x3f, 0x57, 0x46, 0x4d, 0x5a, 0x06, 0x04, 0x02, - 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x5b, 0x53, 0x1c, 0x5e, 0x5e, 0x1c, 0x59, 0x53, - 0x5a, 0x5f, 0x0e, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, - 0x53, 0x53, 0x53, 0x60, 0x60, 0x1b, 0x5c, 0x5c, 0x02, - 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x60, 0x61, - 0x1b, 0x1b, 0x09, 0x09, 0x02, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5e, 0x1b, 0x08, 0x05, 0x06, - 0x04, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x53, 0x06, 0x08, 0x02, 0x02, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x53, 0x02, 0x09, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Sound - -unsigned char item_soundOff_colors[] = { - 0x04, 0x02, 0x04, - 0xac, 0xae, 0xac, - 0xe4, 0xe2, 0xdc, - 0xe4, 0xde, 0xdc, - 0xac, 0xaa, 0xa4, - 0xf4, 0xee, 0xec, - 0xf4, 0xf6, 0xf4, - 0xec, 0xee, 0xec, - 0xdc, 0xda, 0xd4, - 0xa4, 0xa6, 0xa4, - 0xf4, 0xf2, 0xec, - 0xdc, 0xd6, 0xd4, - 0x9c, 0x9e, 0x9c, - 0xac, 0xaa, 0x9c, - 0xd4, 0xd2, 0xcc, - 0xdc, 0xde, 0xd4, - 0xcc, 0xce, 0xc4, - 0x9c, 0x9a, 0x94, - 0x74, 0x72, 0x5c, - 0xcc, 0xca, 0xc4, - 0xc4, 0xc6, 0xbc, - 0x94, 0x96, 0x94, - 0xec, 0xea, 0xe4, - 0x6c, 0x6a, 0x54, - 0xa4, 0xa2, 0x94, - 0xcc, 0xc6, 0xbc, - 0xc4, 0xc2, 0xbc, - 0xbc, 0xbe, 0xb4, - 0x94, 0x92, 0x8c, - 0x6c, 0x66, 0x54, - 0x64, 0x62, 0x54, - 0x6c, 0x62, 0x4c, - 0x9c, 0x9e, 0x8c, - 0xc4, 0xc2, 0xb4, - 0xbc, 0xba, 0xb4, - 0x8c, 0x8a, 0x84, - 0xd4, 0xd6, 0xcc, - 0x64, 0x5e, 0x4c, - 0xb4, 0xb6, 0xac, - 0x9c, 0x9a, 0x8c, - 0xbc, 0xb6, 0xac, - 0x54, 0x56, 0x44, - 0x5c, 0x56, 0x44, - 0xb4, 0xb2, 0xac, - 0x5c, 0x5a, 0x44, - 0x44, 0x46, 0x44, - 0x54, 0x52, 0x3c, - 0xbc, 0xba, 0xac, - 0x5c, 0x5a, 0x4c, - 0xac, 0xae, 0xa4, - 0xb4, 0xb2, 0xa4, - 0x4c, 0x4a, 0x4c, - 0x1c, 0x1a, 0x14, - 0x44, 0x42, 0x34, - 0xa4, 0xa2, 0x9c, - 0x54, 0x52, 0x44, - 0xb4, 0xb6, 0xb4, - 0x2c, 0x2e, 0x2c, - 0x2c, 0x2a, 0x24, - 0x84, 0x82, 0x7c, - 0x4c, 0x4a, 0x3c, - 0x54, 0x4e, 0x3c, - 0xb4, 0xae, 0xa4, - 0x74, 0x76, 0x74, - 0x3c, 0x3a, 0x2c, - 0xac, 0xa6, 0x9c, - 0x9c, 0x9e, 0x94, - 0x94, 0x92, 0x94, - 0x64, 0x5e, 0x54, - 0x4c, 0x4e, 0x44, - 0x6c, 0x66, 0x5c, - 0x94, 0x92, 0x84, - 0x6c, 0x6a, 0x64, - 0x64, 0x66, 0x64, - 0x64, 0x62, 0x5c, - 0x8c, 0x8a, 0x7c, - 0x84, 0x86, 0x84, - 0x74, 0x72, 0x6c, - 0x6c, 0x6e, 0x6c, - 0x9c, 0x96, 0x8c, - 0x84, 0x82, 0x74, - 0x7c, 0x7a, 0x7c, - 0x6c, 0x6e, 0x64, - 0xa4, 0xa6, 0x9c, - 0x84, 0x86, 0x7c, - 0x7c, 0x7a, 0x6c, - 0x5c, 0x5a, 0x54, - 0xa4, 0x9e, 0x94, - 0x74, 0x72, 0x64, - 0x54, 0x56, 0x54, - 0x3c, 0x3e, 0x3c, - 0x84, 0x7e, 0x7c, - 0xfc, 0x6a, 0x6c, - 0xbc, 0x02, 0x04, - 0xfc, 0x02, 0x04, - 0x94, 0x96, 0x8c, - 0x94, 0x8e, 0x84, - 0x8c, 0x8e, 0x84, - 0x54, 0x56, 0x4c, - 0x74, 0x76, 0x6c, - 0x34, 0x36, 0x2c - -}; -unsigned char item_soundOff[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x0a, 0x0a, 0x02, 0x02, 0x0b, 0x0c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, 0x0d, 0x0e, - 0x0f, 0x0b, 0x02, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0x07, 0x12, 0x12, 0x0d, 0x10, 0x10, 0x0e, - 0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x05, 0x17, - 0x10, 0x17, 0x17, 0x18, 0x08, 0x13, 0x19, 0x1a, 0x1b, - 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x08, 0x17, 0x1d, 0x19, 0x14, 0x1e, - 0x1f, 0x20, 0x1a, 0x1a, 0x21, 0x22, 0x22, 0x23, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x13, - 0x25, 0x26, 0x25, 0x25, 0x1b, 0x1a, 0x25, 0x25, 0x27, - 0x22, 0x22, 0x28, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2a, 0x2b, 0x2b, - 0x25, 0x25, 0x1b, 0x1b, 0x2c, 0x2c, 0x28, 0x26, 0x2b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, - 0x2d, 0x00, 0x15, 0x2e, 0x29, 0x2b, 0x2f, 0x30, 0x2c, - 0x22, 0x2a, 0x28, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x34, 0x35, 0x15, - 0x36, 0x2a, 0x2a, 0x22, 0x26, 0x2a, 0x37, 0x2b, 0x32, - 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x2d, - 0x00, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x31, 0x32, 0x2a, - 0x2a, 0x26, 0x2e, 0x31, 0x3e, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3f, 0x33, 0x40, 0x35, - 0x1c, 0x36, 0x29, 0x2a, 0x26, 0x32, 0x37, 0x37, 0x41, - 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x00, 0x3f, 0x44, 0x45, 0x46, 0x3c, 0x2e, 0x3e, 0x2b, - 0x37, 0x37, 0x3e, 0x3d, 0x31, 0x42, 0x47, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x48, 0x49, 0x4a, - 0x1c, 0x11, 0x3b, 0x37, 0x37, 0x32, 0x2b, 0x3d, 0x3c, - 0x41, 0x18, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4c, 0x00, 0x48, 0x4d, 0x4e, 0x1c, 0x42, 0x04, 0x31, - 0x4b, 0x3d, 0x3d, 0x31, 0x3c, 0x4f, 0x11, 0x50, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x49, 0x52, - 0x3b, 0x1c, 0x53, 0x0d, 0x3e, 0x3e, 0x31, 0x54, 0x3c, - 0x35, 0x27, 0x27, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x4a, 0x00, 0x56, 0x49, 0x55, 0x1c, 0x36, 0x0d, - 0x04, 0x31, 0x0d, 0x0d, 0x57, 0x55, 0x18, 0x47, 0x58, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x5a, - 0x4a, 0x5b, 0x1c, 0x11, 0x53, 0x04, 0x41, 0x53, 0x18, - 0x18, 0x27, 0x57, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, - 0x00, 0x00, 0x5c, 0x00, 0x00, 0x5a, 0x4d, 0x23, 0x57, - 0x36, 0x0d, 0x18, 0x57, 0x18, 0x57, 0x1c, 0x47, 0x4b, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, 0x5d, 0x5e, 0x5c, - 0x00, 0x00, 0x00, 0x46, 0x5f, 0x18, 0x18, 0x36, 0x57, - 0x42, 0x27, 0x60, 0x47, 0x4b, 0x44, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, - 0x5e, 0x5d, 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x53, 0x18, 0x57, 0x27, 0x47, 0x61, 0x50, - 0x50, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x27, 0x20, 0x60, 0x50, 0x60, 0x50, 0x62, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5d, 0x5e, 0x5e, 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x61, 0x47, - 0x50, 0x50, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5d, 0x5e, 0x5c, 0x00, 0x5d, - 0x5e, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x55, 0x63, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -unsigned char item_soundOn_colors[] = { - 0x04, 0x02, 0x04, - 0xac, 0xae, 0xac, - 0xe4, 0xe2, 0xdc, - 0xe4, 0xde, 0xdc, - 0xac, 0xaa, 0xa4, - 0xf4, 0xee, 0xec, - 0xf4, 0xf6, 0xf4, - 0xec, 0xee, 0xec, - 0xdc, 0xda, 0xd4, - 0xa4, 0xa6, 0xa4, - 0xf4, 0xf2, 0xec, - 0xdc, 0xd6, 0xd4, - 0x9c, 0x9e, 0x9c, - 0xac, 0xaa, 0x9c, - 0xd4, 0xd2, 0xcc, - 0xdc, 0xde, 0xd4, - 0xcc, 0xce, 0xc4, - 0x9c, 0x9a, 0x94, - 0x74, 0x72, 0x5c, - 0xcc, 0xca, 0xc4, - 0xc4, 0xc6, 0xbc, - 0x94, 0x96, 0x94, - 0xec, 0xea, 0xe4, - 0x6c, 0x6a, 0x54, - 0xa4, 0xa2, 0x94, - 0xcc, 0xc6, 0xbc, - 0xc4, 0xc2, 0xbc, - 0xbc, 0xbe, 0xb4, - 0x94, 0x92, 0x8c, - 0x6c, 0x66, 0x54, - 0x64, 0x62, 0x54, - 0x6c, 0x62, 0x4c, - 0x9c, 0x9e, 0x8c, - 0xc4, 0xc2, 0xb4, - 0xbc, 0xba, 0xb4, - 0x8c, 0x8a, 0x84, - 0xd4, 0xd6, 0xcc, - 0x64, 0x5e, 0x4c, - 0xb4, 0xb6, 0xac, - 0x9c, 0x9a, 0x8c, - 0xbc, 0xb6, 0xac, - 0x54, 0x56, 0x44, - 0x5c, 0x56, 0x44, - 0xb4, 0xb2, 0xac, - 0x5c, 0x5a, 0x44, - 0x44, 0x46, 0x44, - 0x54, 0x52, 0x3c, - 0xbc, 0xba, 0xac, - 0x5c, 0x5a, 0x4c, - 0xac, 0xae, 0xa4, - 0xb4, 0xb2, 0xa4, - 0x4c, 0x4a, 0x4c, - 0x1c, 0x1a, 0x14, - 0x44, 0x42, 0x34, - 0xa4, 0xa2, 0x9c, - 0x54, 0x52, 0x44, - 0xb4, 0xb6, 0xb4, - 0x2c, 0x2e, 0x2c, - 0x2c, 0x2a, 0x24, - 0x84, 0x82, 0x7c, - 0x4c, 0x4a, 0x3c, - 0x54, 0x4e, 0x3c, - 0xb4, 0xae, 0xa4, - 0x74, 0x76, 0x74, - 0x3c, 0x3a, 0x2c, - 0xac, 0xa6, 0x9c, - 0x9c, 0x9e, 0x94, - 0x94, 0x92, 0x94, - 0x64, 0x5e, 0x54, - 0x4c, 0x4e, 0x44, - 0x6c, 0x66, 0x5c, - 0x94, 0x92, 0x84, - 0x6c, 0x6a, 0x64, - 0x64, 0x66, 0x64, - 0x64, 0x62, 0x5c, - 0x8c, 0x8a, 0x7c, - 0x84, 0x86, 0x84, - 0x74, 0x72, 0x6c, - 0x6c, 0x6e, 0x6c, - 0x9c, 0x96, 0x8c, - 0x84, 0x82, 0x74, - 0x7c, 0x7a, 0x74, - 0x6c, 0x6e, 0x64, - 0xa4, 0xa6, 0x9c, - 0x84, 0x86, 0x7c, - 0x7c, 0x7a, 0x6c, - 0x64, 0x62, 0x64, - 0x5c, 0x5a, 0x54, - 0xa4, 0x9e, 0x94, - 0x74, 0x72, 0x64, - 0x54, 0x56, 0x54, - 0x3c, 0x3e, 0x3c, - 0x84, 0x7e, 0x7c, - 0xf4, 0xf2, 0xf4, - 0xac, 0xaa, 0xac, - 0x94, 0x96, 0x8c, - 0x94, 0x8e, 0x84, - 0x8c, 0x8e, 0x84, - 0x34, 0x32, 0x34, - 0x54, 0x56, 0x4c, - 0x74, 0x76, 0x6c, - 0x34, 0x36, 0x2c - -}; -unsigned char item_soundOn[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x0a, 0x0a, 0x02, 0x02, 0x0b, 0x0c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, 0x0d, 0x0e, - 0x0f, 0x0b, 0x02, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0x07, 0x12, 0x12, 0x0d, 0x10, 0x10, 0x0e, - 0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x05, 0x17, - 0x10, 0x17, 0x17, 0x18, 0x08, 0x13, 0x19, 0x1a, 0x1b, - 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x08, 0x17, 0x1d, 0x19, 0x14, 0x1e, - 0x1f, 0x20, 0x1a, 0x1a, 0x21, 0x22, 0x22, 0x23, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x13, - 0x25, 0x26, 0x25, 0x25, 0x1b, 0x1a, 0x25, 0x25, 0x27, - 0x22, 0x22, 0x28, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2a, 0x2b, 0x2b, - 0x25, 0x25, 0x1b, 0x1b, 0x2c, 0x2c, 0x28, 0x26, 0x2b, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, - 0x2d, 0x00, 0x15, 0x2e, 0x29, 0x2b, 0x2f, 0x30, 0x2c, - 0x22, 0x2a, 0x28, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x34, 0x35, 0x15, - 0x36, 0x2a, 0x2a, 0x22, 0x26, 0x2a, 0x37, 0x2b, 0x32, - 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x2d, - 0x00, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x31, 0x32, 0x2a, - 0x2a, 0x26, 0x2e, 0x31, 0x3e, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3f, 0x33, 0x40, 0x35, - 0x1c, 0x36, 0x29, 0x2a, 0x26, 0x32, 0x37, 0x37, 0x41, - 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, - 0x00, 0x3f, 0x44, 0x45, 0x46, 0x3c, 0x2e, 0x3e, 0x2b, - 0x37, 0x37, 0x3e, 0x3d, 0x31, 0x42, 0x47, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x48, 0x49, 0x4a, - 0x1c, 0x11, 0x3b, 0x37, 0x37, 0x32, 0x2b, 0x3d, 0x3c, - 0x41, 0x18, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4c, 0x00, 0x48, 0x4d, 0x4e, 0x1c, 0x42, 0x04, 0x31, - 0x4b, 0x3d, 0x3d, 0x31, 0x3c, 0x4f, 0x11, 0x50, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x49, 0x52, - 0x3b, 0x1c, 0x53, 0x0d, 0x3e, 0x3e, 0x31, 0x54, 0x3c, - 0x35, 0x27, 0x27, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x56, 0x00, 0x57, 0x49, 0x55, 0x1c, 0x36, 0x0d, - 0x04, 0x31, 0x0d, 0x0d, 0x58, 0x55, 0x18, 0x47, 0x59, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x5b, - 0x4a, 0x5c, 0x1c, 0x11, 0x53, 0x04, 0x41, 0x53, 0x18, - 0x18, 0x27, 0x58, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, - 0x43, 0x5a, 0x5b, 0x00, 0x00, 0x5b, 0x4d, 0x23, 0x58, - 0x36, 0x0d, 0x18, 0x58, 0x18, 0x58, 0x1c, 0x47, 0x4b, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x4c, 0x5d, 0x5e, 0x4e, 0x5b, 0x00, - 0x00, 0x00, 0x00, 0x46, 0x5f, 0x18, 0x18, 0x36, 0x58, - 0x42, 0x27, 0x60, 0x47, 0x4b, 0x44, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, - 0x5e, 0x5e, 0x4e, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x53, 0x18, 0x58, 0x27, 0x47, 0x61, 0x50, - 0x50, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5a, 0x4e, 0x4e, 0x62, 0x62, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x27, 0x20, 0x60, 0x50, 0x60, 0x50, 0x63, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x5b, 0x62, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x61, 0x47, - 0x50, 0x50, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x55, 0x64, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Mode - -unsigned char item_monkeyLandscape_colors[] = { - 0x00, 0x00, 0x00, - 0x0e, 0x16, 0x00, - 0x04, 0x02, 0x04, - 0x3c, 0x3a, 0x3c, - 0x9c, 0x9a, 0x9c, - 0x6c, 0x6a, 0x6c, - 0x1c, 0x0a, 0x0c, - 0x34, 0x36, 0x34, - 0x9c, 0x9e, 0x9c, - 0xb4, 0xb2, 0xb4, - 0x24, 0x06, 0x04, - 0x34, 0x32, 0x34, - 0xa4, 0xa6, 0xa4, - 0x64, 0x66, 0x64, - 0x2c, 0x2e, 0x2c, - 0x1c, 0x1a, 0x1c, - 0x6c, 0x6e, 0x6c, - 0x94, 0x92, 0x94, - 0x74, 0x72, 0x74, - 0x94, 0x96, 0x94, - 0x8c, 0x8e, 0x8c, - 0x8c, 0x8a, 0x8c, - 0x24, 0x26, 0x24, - 0x7c, 0x7e, 0x7c, - 0x74, 0x76, 0x74, - 0xa4, 0xa2, 0xa4, - 0x1c, 0x1e, 0x1c, - 0x0c, 0x0a, 0x0c, - 0xac, 0xae, 0xac, - 0xbc, 0xbe, 0xbc, - 0xdc, 0xde, 0xdc, - 0xfc, 0xfa, 0xfc, - 0xec, 0xee, 0xec, - 0xcc, 0xce, 0xcc, - 0x44, 0x46, 0x44, - 0x3c, 0x3e, 0x3c, - 0x4c, 0x4e, 0x4c, - 0x1c, 0x16, 0x1c, - 0xbc, 0xba, 0xbc, - 0xd4, 0xd6, 0xd4, - 0xf4, 0xf2, 0xf4, - 0x2c, 0x5e, 0x7c, - 0x2c, 0x7e, 0xb4, - 0x5c, 0x5a, 0x5c, - 0x14, 0x16, 0x14, - 0x0c, 0x06, 0x0c, - 0x04, 0x06, 0x04, - 0xc4, 0xc2, 0xc4, - 0xe4, 0xe6, 0xe4, - 0xac, 0xaa, 0xac, - 0xe4, 0xe2, 0xe4, - 0x5c, 0x5e, 0x5c, - 0x84, 0x82, 0x84, - 0x14, 0x0e, 0x04, - 0x34, 0x26, 0x14 - -}; -unsigned char item_monkeyLandscape[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x02, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x02, 0x02, 0x02, - 0x07, 0x08, 0x09, 0x05, 0x02, 0x02, 0x02, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x0a, 0x02, 0x02, 0x0b, 0x04, 0x0c, 0x08, 0x09, - 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x01, - 0x09, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x0f, 0x10, - 0x11, 0x04, 0x11, 0x12, 0x08, 0x05, 0x02, 0x02, 0x00, - 0x00, 0x00, 0x0b, 0x01, 0x01, 0x09, 0x09, 0x13, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x10, 0x11, 0x14, 0x08, 0x09, 0x13, 0x12, - 0x08, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x01, - 0x15, 0x0d, 0x09, 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, 0x11, 0x14, 0x14, - 0x11, 0x04, 0x10, 0x02, 0x16, 0x17, 0x09, 0x0d, 0x02, - 0x00, 0x00, 0x00, 0x03, 0x14, 0x15, 0x0d, 0x13, 0x09, - 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, - 0x04, 0x09, 0x09, 0x09, 0x14, 0x18, 0x19, 0x1a, 0x02, - 0x02, 0x1b, 0x05, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x0b, - 0x03, 0x15, 0x0d, 0x13, 0x1c, 0x14, 0x14, 0x11, 0x14, - 0x04, 0x09, 0x09, 0x1d, 0x1e, 0x1e, 0x1f, 0x20, 0x21, - 0x14, 0x22, 0x23, 0x0b, 0x07, 0x0b, 0x22, 0x24, 0x25, - 0x02, 0x00, 0x00, 0x00, 0x0b, 0x23, 0x17, 0x01, 0x0d, - 0x14, 0x11, 0x14, 0x13, 0x09, 0x26, 0x27, 0x27, 0x1e, - 0x1f, 0x1f, 0x1f, 0x1f, 0x28, 0x0c, 0x07, 0x0b, 0x29, - 0x2a, 0x0b, 0x2b, 0x0d, 0x2c, 0x02, 0x00, 0x00, 0x00, - 0x0e, 0x02, 0x02, 0x01, 0x2d, 0x13, 0x09, 0x09, 0x26, - 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, - 0x28, 0x27, 0x08, 0x07, 0x07, 0x0b, 0x07, 0x18, 0x11, - 0x0f, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, - 0x2e, 0x05, 0x26, 0x27, 0x27, 0x1e, 0x1f, 0x1f, 0x1f, - 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x20, 0x08, - 0x0b, 0x0b, 0x0d, 0x2f, 0x13, 0x23, 0x2c, 0x00, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x05, 0x09, 0x09, - 0x26, 0x27, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, - 0x1f, 0x1f, 0x20, 0x30, 0x27, 0x31, 0x1d, 0x08, 0x09, - 0x17, 0x07, 0x2c, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x02, - 0x2e, 0x0d, 0x11, 0x14, 0x14, 0x13, 0x26, 0x27, 0x27, - 0x1e, 0x27, 0x27, 0x32, 0x1f, 0x1f, 0x30, 0x1d, 0x27, - 0x1c, 0x33, 0x17, 0x09, 0x34, 0x0b, 0x0b, 0x2c, 0x00, - 0x00, 0x00, 0x0b, 0x03, 0x15, 0x33, 0x05, 0x1c, 0x14, - 0x11, 0x14, 0x13, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1d, - 0x27, 0x27, 0x21, 0x13, 0x17, 0x09, 0x09, 0x09, 0x0c, - 0x0d, 0x07, 0x2c, 0x02, 0x00, 0x00, 0x00, 0x0b, 0x23, - 0x15, 0x05, 0x09, 0x09, 0x09, 0x1c, 0x11, 0x14, 0x11, - 0x14, 0x14, 0x11, 0x13, 0x09, 0x09, 0x09, 0x31, 0x14, - 0x17, 0x12, 0x14, 0x14, 0x11, 0x05, 0x0b, 0x25, 0x02, - 0x00, 0x00, 0x00, 0x0b, 0x03, 0x15, 0x0d, 0x09, 0x09, - 0x13, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x14, - 0x11, 0x14, 0x14, 0x14, 0x11, 0x04, 0x09, 0x12, 0x02, - 0x03, 0x08, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0e, - 0x01, 0x01, 0x11, 0x09, 0x13, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x33, 0x12, 0x11, - 0x14, 0x14, 0x08, 0x09, 0x0c, 0x14, 0x08, 0x05, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x01, 0x01, 0x08, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x35, 0x02, 0x02, 0x0f, 0x10, 0x11, 0x14, 0x08, - 0x0c, 0x08, 0x09, 0x0d, 0x02, 0x02, 0x00, 0x00, 0x00, - 0x0e, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x36, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x0b, 0x14, 0x14, 0x14, 0x04, 0x09, 0x05, - 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0b, - 0x11, 0x08, 0x09, 0x05, 0x02, 0x02, 0x02, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, 0x08, 0x05, - 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -unsigned char item_monkeyPortrait_colors[] = { - 0x00, 0x00, 0x00, - 0x04, 0x02, 0x04, - 0x14, 0x16, 0x14, - 0x64, 0x66, 0x64, - 0x1c, 0x16, 0x1c, - 0x1c, 0x1a, 0x1c, - 0x3c, 0x3e, 0x3c, - 0x34, 0x36, 0x34, - 0x34, 0x32, 0x34, - 0x6c, 0x6a, 0x6c, - 0xb4, 0xb2, 0xb4, - 0x4c, 0x4e, 0x4c, - 0x94, 0x92, 0x94, - 0x94, 0x96, 0x94, - 0x7c, 0x7e, 0x7c, - 0x9c, 0x9e, 0x9c, - 0x0c, 0x0a, 0x0c, - 0x44, 0x46, 0x44, - 0x5c, 0x5a, 0x5c, - 0x74, 0x76, 0x74, - 0xc4, 0xc2, 0xc4, - 0x84, 0x82, 0x84, - 0x9c, 0x9a, 0x9c, - 0x74, 0x72, 0x74, - 0x24, 0x26, 0x24, - 0xa4, 0xa6, 0xa4, - 0x3c, 0x3a, 0x3c, - 0x8c, 0x8e, 0x8c, - 0x2c, 0x7e, 0xb4, - 0xbc, 0xbe, 0xbc, - 0x6c, 0x6e, 0x6c, - 0x1c, 0x1e, 0x1c, - 0x2c, 0x5e, 0x7c, - 0xac, 0xaa, 0xac, - 0x5c, 0x5e, 0x5c, - 0xa4, 0xa2, 0xa4, - 0xd4, 0xd6, 0xd4, - 0xac, 0xae, 0xac, - 0xec, 0xee, 0xec, - 0xe4, 0xe6, 0xe4, - 0xfc, 0xfa, 0xfc, - 0x0e, 0x16, 0x00, - 0x1c, 0x0a, 0x0c, - 0x24, 0x06, 0x04, - 0xcc, 0xce, 0xcc, - 0xf4, 0xf2, 0xf4, - 0xdc, 0xde, 0xdc, - 0xe4, 0xe2, 0xe4, - 0x14, 0x0e, 0x04, - 0x34, 0x26, 0x14, - 0xbc, 0xba, 0xbc, - 0x0c, 0x06, 0x0c, - 0x04, 0x06, 0x04, - 0x8c, 0x8a, 0x8c, - 0x2c, 0x2e, 0x2c - -}; -unsigned char item_monkeyPortrait[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x03, 0x03, 0x04, 0x02, 0x05, 0x06, 0x07, - 0x08, 0x02, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, 0x01, 0x03, 0x09, 0x03, 0x0a, 0x09, - 0x0b, 0x03, 0x0c, 0x0d, 0x0e, 0x08, 0x07, 0x08, 0x03, - 0x09, 0x03, 0x09, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x09, 0x09, - 0x0a, 0x0f, 0x0f, 0x0e, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x0a, 0x15, 0x03, 0x09, 0x0f, 0x0f, 0x0a, 0x0a, 0x09, - 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x01, 0x16, 0x0a, 0x0f, 0x17, 0x17, 0x18, - 0x01, 0x08, 0x08, 0x07, 0x03, 0x0f, 0x0a, 0x19, 0x0c, - 0x1a, 0x1b, 0x0f, 0x16, 0x0a, 0x0f, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x1a, - 0x0f, 0x19, 0x0c, 0x0d, 0x01, 0x01, 0x07, 0x1c, 0x08, - 0x08, 0x1d, 0x0e, 0x0a, 0x1b, 0x01, 0x19, 0x19, 0x1b, - 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x01, 0x07, 0x16, 0x16, 0x0a, - 0x1e, 0x1f, 0x08, 0x20, 0x07, 0x08, 0x21, 0x22, 0x0a, - 0x1b, 0x17, 0x0a, 0x0f, 0x1b, 0x0c, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, - 0x01, 0x01, 0x08, 0x0c, 0x0f, 0x16, 0x23, 0x06, 0x08, - 0x07, 0x0f, 0x24, 0x25, 0x0a, 0x17, 0x0a, 0x0f, 0x1b, - 0x1b, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1e, - 0x1b, 0x0c, 0x13, 0x11, 0x07, 0x0f, 0x26, 0x27, 0x24, - 0x0e, 0x0e, 0x16, 0x1b, 0x0c, 0x08, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x05, 0x0c, 0x1b, 0x1b, 0x1b, - 0x19, 0x24, 0x28, 0x26, 0x1d, 0x0d, 0x1b, 0x0c, 0x1b, - 0x1e, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x2a, 0x2b, - 0x2a, 0x1e, 0x1b, 0x0a, 0x2c, 0x2d, 0x2d, 0x28, 0x28, - 0x27, 0x2c, 0x21, 0x1b, 0x0c, 0x05, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0c, 0x0a, - 0x26, 0x28, 0x28, 0x28, 0x28, 0x28, 0x24, 0x0a, 0x1b, - 0x17, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x1b, 0x0a, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x24, 0x0a, 0x1b, 0x22, 0x01, 0x01, 0x01, - 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x16, 0x2e, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x1d, 0x0a, - 0x0c, 0x29, 0x30, 0x01, 0x01, 0x29, 0x29, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x1b, 0x2e, 0x28, 0x28, - 0x28, 0x28, 0x24, 0x0a, 0x0d, 0x1b, 0x29, 0x29, 0x01, - 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x1d, 0x2e, 0x28, 0x28, 0x28, 0x24, 0x0a, - 0x0c, 0x29, 0x29, 0x29, 0x01, 0x29, 0x29, 0x29, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0a, 0x24, - 0x28, 0x28, 0x28, 0x2e, 0x0a, 0x1b, 0x29, 0x29, 0x29, - 0x01, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x0a, 0x24, 0x28, 0x28, 0x2e, 0x24, - 0x0a, 0x1b, 0x29, 0x29, 0x29, 0x31, 0x29, 0x29, 0x29, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x16, - 0x32, 0x2e, 0x28, 0x2e, 0x24, 0x0a, 0x0c, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x1b, 0x0a, 0x2e, 0x2e, 0x24, - 0x32, 0x0d, 0x1b, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x0c, 0x0d, 0x32, 0x24, 0x32, 0x0d, 0x1b, 0x0c, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x0d, 0x1b, 0x1b, 0x0a, 0x24, - 0x0a, 0x1b, 0x0c, 0x25, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0d, - 0x0a, 0x1b, 0x0c, 0x0a, 0x32, 0x0a, 0x1b, 0x1b, 0x0a, - 0x0d, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x0d, 0x0a, 0x0a, 0x25, 0x1b, 0x0d, - 0x09, 0x09, 0x0c, 0x25, 0x0a, 0x0a, 0x0d, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x0f, 0x0a, - 0x0a, 0x0d, 0x0d, 0x03, 0x33, 0x34, 0x01, 0x03, 0x09, - 0x0a, 0x0a, 0x0a, 0x0f, 0x29, 0x29, 0x29, 0x29, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x0a, 0x0a, 0x03, 0x03, 0x03, 0x29, - 0x29, 0x01, 0x01, 0x34, 0x22, 0x09, 0x03, 0x0c, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x35, 0x35, 0x35, 0x0e, 0x01, 0x01, 0x01, 0x01, - 0x35, 0x35, 0x35, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x1b, 0x1a, - 0x06, 0x01, 0x01, 0x01, 0x01, 0x1a, 0x06, 0x1a, 0x29, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x36, 0x08, 0x36, 0x1a, 0x08, 0x08, 0x36, 0x01, 0x01, - 0x36, 0x08, 0x08, 0x08, 0x36, 0x08, 0x36, 0x29, 0x29, - 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -#endif \ No newline at end of file diff --git a/wince/findgame.cpp b/wince/findgame.cpp deleted file mode 100644 index 3157397d54..0000000000 --- a/wince/findgame.cpp +++ /dev/null @@ -1,556 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifdef _WIN32_WCE - -// Browse directories to locate SCUMM games - -#include "stdafx.h" -#include -#include -#include -#include "resource.h" -#include "scumm.h" -#include "config-file.h" - -extern Config *scummcfg; - -#define MAX_GAMES 20 - -struct ScummGame { - const char *gamename; - const char *description; - const char *directory; - const char *check_file_1; - const char *check_file_2; - const char *filename; - unsigned char next_demo; -}; - -struct InstalledScummGame { - unsigned char reference; - TCHAR directory[MAX_PATH]; -}; - -static const ScummGame GameList[] = { - { - "Simon The Sorcerer 1 (dos)", - "Completable", - "", "1631.VGA", "GAMEPC", - "simon1dos", - 0 - }, - { - "Simon The Sorcerer 1 (win)", - "Completable", - "", "SIMON.GME", "GAMEPC", - "simon1win", - 0 - }, - { - "Simon The Sorcerer 2 (win)", - "To be tested", - "", "SIMON2.GME", "GSPTR30", - "simon2win", - 0 - }, - { - "Indiana Jones 3 (new)", - "Buggy, playable a bit", - "indy3", "", "", - "indy3", - 0 - }, - { - "Zak Mc Kracken (new)", - "Completable", - "zak256", "", "", - "zak256", - 0 - }, - { - "Loom (old)", - "Not working", - "loom", "", "", - "loom", - 0 - }, - { - "Monkey Island 1 (EGA)", - "Not tested", - "monkeyEGA", "", "", - "monkeyEGA", - 0 - }, - { - "Loom (VGA)", - "Completable, MP3 audio", - "loomcd", "", "", - "loomcd", - 0 - }, - { - "Monkey Island 1 (VGA)", - "Completable, MP3 music", - "", "MONKEY.000", "MONKEY.001", - "monkey", - 0 - }, - { - "Monkey Island 2 (VGA)", - "Completable", - "", "MONKEY2.000", "MONKEY2.001", - "monkey2", - 0 - }, - { - "Indiana Jones 4", - "Completable", - "", "ATLANTIS.000", "ATLANTIS.001", - "atlantis", - 1 - }, - { - "Indiana Jones 4 demo", - "Completable", - "", "PLAYFATE.000", "PLAYFATE.001", - "playfate", - 0 - }, - { - "Day of the Tentacle", - "Completable", - "", "TENTACLE.000", "TENTACLE.001", - "tentacle", - 1 - }, - { - "Day of the Tentacle demo", - "Completable", - "", "DOTTDEMO.000", "DOTTDEMO.001", - "dottdemo", - 0 - }, - { - "Sam & Max", - "Completable, music glitches", - "", "SAMNMAX.000", "SAMNMAX.001", - "samnmax", - 1 - }, - { - "Sam & Max demo", - "Completable", - "", "SNMDEMO.000", "SNMDEMO.001", - "snmdemo", - 0 - }, - { - "Full Throttle", - "Partially working", - "", "FT.LA0", "FT.LA1", - "ft", - 0 - }, - { - "The Dig", - "Partially working", - "", "DIG.LA0", "DIG.LA1", - "dig", - 0 - }, - { - NULL, NULL, NULL, NULL, NULL, NULL, 0 - } -}; - -void findGame(TCHAR*); -int displayFoundGames(void); -void doScan(); -void startFindGame(); - -char gamesFound[MAX_GAMES]; -unsigned char listIndex[MAX_GAMES]; -InstalledScummGame gamesInstalled[MAX_GAMES]; -int installedGamesNumber; -HWND hwndDlg; -TCHAR basePath[MAX_PATH]; -TCHAR old_basePath[MAX_PATH]; -BOOL prescanning; - -BOOL isPrescanning() { - return prescanning; -} - -void setFindGameDlgHandle(HWND x) { - hwndDlg = x; -} - -bool loadGameSettings() { - int index; - int i; - const char *current; - - prescanning = FALSE; - - current = scummcfg->get("GamesInstalled", "wince"); - if (!current) - return FALSE; - index = atoi(current); - - installedGamesNumber = index; - - current = scummcfg->get("GamesReferences", "wince"); - if (!current) - return FALSE; - for (i=0; iget("BasePath", "wince"); - if (!current) - return FALSE; - MultiByteToWideChar(CP_ACP, 0, current, strlen(current) + 1, basePath, sizeof(basePath)); - - for (i=0; iget(keyName, "wince"); - if (!current) - return FALSE; - MultiByteToWideChar(CP_ACP, 0, current, strlen(current) + 1, gamesInstalled[i].directory, sizeof(gamesInstalled[i].directory)); - } - - displayFoundGames(); - - return TRUE; -} - -int countGameReferenced(int reference, int *infos) { - int i; - int number = 0; - - for (i=0; iset("GamesInstalled", index, "wince"); - - tempo[0] = '\0'; - for (i=0; iset("GamesReferences", tempo, "wince"); - - WideCharToMultiByte(CP_ACP, 0, basePath, wcslen(basePath) + 1, workdir, sizeof(workdir), NULL, NULL); - - scummcfg->set("BasePath", workdir, "wince"); - - for (i=0; iset(keyName, workdir, "wince"); - } - - scummcfg->flush(); - - SetDlgItemText(hwndDlg, IDC_FILEPATH, TEXT("Scan finished")); - -} - -void getSelectedGame(int result, char *id, TCHAR *directory) { - ScummGame game; - - game = GameList[gamesInstalled[listIndex[result]].reference]; - strcpy(id, game.filename); - wcscpy(directory, gamesInstalled[listIndex[result]].directory); -} - -void displayGameInfo() { - int item; - TCHAR work[400]; - ScummGame game; - - item = SendMessage(GetDlgItem(hwndDlg, IDC_LISTAVAILABLE), LB_GETCURSEL, 0, 0); - if (item == LB_ERR) - return; - - game = GameList[gamesInstalled[listIndex[item]].reference]; - wcscpy(work, TEXT("File path : ...")); - wcscat(work, wcsrchr(gamesInstalled[listIndex[item]].directory, '\\')); - SetDlgItemText(hwndDlg, IDC_FILEPATH, work); - MultiByteToWideChar(CP_ACP, 0, game.description, strlen(game.description) + 1, work, sizeof(work)); - SetDlgItemText(hwndDlg, IDC_GAMEDESC, work); -} - -void findGame(TCHAR *directory) { - TCHAR fileName[MAX_PATH]; - TCHAR newDirectory[MAX_PATH]; - WIN32_FIND_DATA desc; - HANDLE x; - int i; - - // Check for games in the current directory - - //MessageBox(NULL, directory, TEXT("Current"), MB_OK); - - for (i = 0 ; i < MAX_GAMES ; i++) { - ScummGame current_game; - - current_game = GameList[i]; - if (!current_game.filename) - break; - - if (strlen(current_game.directory)) { - // see if the last directory matches - TCHAR *work; - char curdir[MAX_PATH]; - - - work = wcsrchr(directory, '\\'); - WideCharToMultiByte(CP_ACP, 0, work + 1, wcslen(work + 1) + 1, curdir, sizeof(curdir), NULL, NULL); - if (stricmp(curdir, current_game.directory) == 0) { - - //MessageBox(NULL, TEXT("Match directory !"), TEXT("..."), MB_OK); - - gamesFound[i] = 1; - gamesInstalled[installedGamesNumber].reference = i; - wcscpy(gamesInstalled[installedGamesNumber].directory, directory); - installedGamesNumber++; - } - } - else - { - TCHAR work[MAX_PATH]; - TCHAR checkfile[MAX_PATH]; - - - MultiByteToWideChar(CP_ACP, 0, current_game.check_file_1, strlen(current_game.check_file_1) + 1, checkfile, sizeof(checkfile)); - wsprintf(work, TEXT("%s\\%s"), directory, checkfile); - //MessageBox(NULL, work, TEXT("Checking file"), MB_OK); - - if (GetFileAttributes(work) == 0xFFFFFFFF) - continue; - - //MessageBox(NULL, TEXT("Check OK"), TEXT("Checking file"), MB_OK); - MultiByteToWideChar(CP_ACP, 0, current_game.check_file_2, strlen(current_game.check_file_2) + 1, checkfile, sizeof(checkfile)); - wsprintf(work, TEXT("%s\\%s"), directory, checkfile); - if (GetFileAttributes(work) == 0xFFFFFFFF) - continue; - - //MessageBox(NULL, TEXT("Match file !"), TEXT("..."), MB_OK); - gamesFound[i] = 1; - gamesInstalled[installedGamesNumber].reference = i; - wcscpy(gamesInstalled[installedGamesNumber].directory, directory); - installedGamesNumber++; - - } - } - - // Recurse - - wsprintf(fileName, TEXT("%s\\*"), directory); - - x = FindFirstFile(fileName, &desc); - if (x == INVALID_HANDLE_VALUE) - return; - if (desc.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - wsprintf(newDirectory, TEXT("%s\\%s"), directory, desc.cFileName); - findGame(newDirectory); - } - while (FindNextFile(x, &desc)) - if (desc.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - wsprintf(newDirectory, TEXT("%s\\%s"), directory, desc.cFileName); - findGame(newDirectory); - } - FindClose(x); -} - -#endif \ No newline at end of file diff --git a/wince/gapi_keys.cpp b/wince/gapi_keys.cpp deleted file mode 100644 index a4d2677573..0000000000 --- a/wince/gapi_keys.cpp +++ /dev/null @@ -1,341 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifdef _WIN32_WCE - -// Handle mapping of actions to hardware keys - -#include "stdafx.h" -#include -#include -#include -#include -#include - -#include "gapi_keys.h" - -#include "screen.h" - -struct oneAction _actions[NUMBER_ACTIONS]; -struct GXKeyList _portrait_keys; -struct GXKeyList _landscape_keys; -pAction *_action_functions; - -const char* ActionsText[] = { - "None", - "Pause", - "Save", - "Quit", - "Skip", - "Hide", - "Keyboard", - "Sound", - "Right click", - "Cursor on/off", - "Subtitles on/off", - "Boss" -}; - -bool _typeExists(int x) { - int i; - - for (i=0; i TOTAL_ACTIONS) - current = 1; - if (!_typeExists(current)) { - _actions[action].action_type = current; - return; - } - } -} - -void setPreviousType(int action) { - int start = _actions[action].action_type; - int current = start; - for (;;) { - current--; - if (current == start) - return; - if (current <= 0) - current = TOTAL_ACTIONS; - if (!_typeExists(current)) { - _actions[action].action_type = current; - return; - } - } -} - - - -void setActionKeys(int *actionKeys) { - int i; - - for (i=0; i -#include -#include -#include "sys/stat.h" -#include "sys/time.h" -#include "time.h" -#include "dirent.h" - -/* forward declaration */ -char *strdup(const char *strSource); - -/* Limited dirent implementation. Used by UI.C and DEVICES.C */ -static WIN32_FIND_DATA wfd; - -DIR* opendir(const char* fname) -{ - DIR* pdir; - char fnameMask[MAX_PATH+1]; - TCHAR fnameUnc[MAX_PATH+1]; - char nameFound[MAX_PATH+1]; - - if(fname == NULL) - return NULL; - - strcpy(fnameMask, fname); - if(!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\') - strncat(fnameMask, "\\", MAX_PATH-strlen(fnameMask)-1); - strncat(fnameMask, "*.*", MAX_PATH-strlen(fnameMask)-4); - - pdir = (DIR*)malloc(sizeof(DIR)+strlen(fname)); - pdir->dd_dir.d_ino = 0; - pdir->dd_dir.d_reclen = 0; - pdir->dd_dir.d_name = 0; - pdir->dd_dir.d_namlen = 0; - - pdir->dd_handle = 0; - pdir->dd_stat = 0; - strcpy(pdir->dd_name, fname); /* it has exactly enough space for fname and nul char */ - - MultiByteToWideChar(CP_ACP, 0, fnameMask, -1, fnameUnc, MAX_PATH); - if((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE) - { - free(pdir); - return NULL; - } - else - { - WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL); - - pdir->dd_dir.d_name = strdup(nameFound); - pdir->dd_dir.d_namlen = strlen(nameFound); - } - return pdir; -} - -struct dirent* readdir(DIR* dir) -{ - char nameFound[MAX_PATH+1]; - static struct dirent dummy; - - if(dir->dd_stat == 0) - { - dummy.d_name = "."; - dummy.d_namlen = 1; - dir->dd_stat ++; - return &dummy; - } - else if(dir->dd_stat == 1) - { - dummy.d_name = ".."; - dummy.d_namlen = 2; - dir->dd_stat ++; - return &dummy; - } - else if(dir->dd_stat == 2) - { - dir->dd_stat++; - return &dir->dd_dir; - } - else - { - if(FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0) - { - dir->dd_stat = -1; - return NULL; - } - WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL); - - if(dir->dd_dir.d_name) - free(dir->dd_dir.d_name); - - dir->dd_dir.d_name = strdup(nameFound); - dir->dd_dir.d_namlen = strlen(nameFound); - - dir->dd_stat ++; - - return &dir->dd_dir; - } -} - -int closedir(DIR* dir) -{ - if(dir == NULL) - return 0; - - if(dir->dd_handle) - FindClose((HANDLE)dir->dd_handle); - - if(dir->dd_dir.d_name) - free(dir->dd_dir.d_name); - free(dir); - return 1; -} - -/* Very limited implementation of stat. Used by UI.C, MEMORY-P.C (latter is not critical) */ -int stat(const char *fname, struct stat *ss) -{ - TCHAR fnameUnc[MAX_PATH+1]; - HANDLE handle; - int len; - - if(fname == NULL || ss == NULL) - return -1; - - /* Special case (dummy on WinCE) */ - len = strlen(fname); - if(len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' && - (len == 2 || fname[len-3] == '\\')) - { - /* That's everything implemented so far */ - memset(ss, 0, sizeof(struct stat)); - ss->st_size = 1024; - ss->st_mode |= S_IFDIR; - return 0; - } - - MultiByteToWideChar(CP_ACP, 0, fname, -1, fnameUnc, MAX_PATH); - handle = FindFirstFile(fnameUnc, &wfd); - if(handle == INVALID_HANDLE_VALUE) - return -1; - else - { - /* That's everything implemented so far */ - memset(ss, 0, sizeof(struct stat)); - ss->st_size = wfd.nFileSizeLow; - if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - ss->st_mode |= S_IFDIR; - - FindClose(handle); - } - return 0; -} - -/* Remove file by name */ -int remove(const char* path) -{ - TCHAR pathUnc[MAX_PATH+1]; - MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); - return !DeleteFile(pathUnc); -} - -/* in our case unlink is the same as remove */ -int unlink(const char* path) -{ - return remove(path); -} - -/* Make directory, Unix style */ -void mkdir(char* dirname, int mode) -{ - char path[MAX_PATH+1]; - TCHAR pathUnc[MAX_PATH+1]; - char* ptr; - strncpy(path, dirname, MAX_PATH); - if(*path == '/') - *path = '\\'; - /* Run through the string and attempt creating all subdirs on the path */ - for(ptr = path+1; *ptr; ptr ++) - { - if(*ptr == '\\' || *ptr == '/') - { - *ptr = 0; - MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); - CreateDirectory(pathUnc, 0); - *ptr = '\\'; - } - } - MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); - CreateDirectory(pathUnc, 0); -} - -/* Used in DEVICES.C and UI.C for some purpose. Not critical in this port */ -int system(const char* path) { return 0; } - - -char *tmpnam(char *string) -{ - TCHAR pTemp[MAX_PATH+1]; - static char buffer[MAX_PATH+1]; - GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp); - WideCharToMultiByte(CP_ACP, 0, pTemp, -1, buffer, MAX_PATH, NULL, NULL); - - if(string) - { - strcpy(string, buffer); - return string; - } - else - return buffer; -} - -FILE *tmpfile() -{ - TCHAR pTemp[MAX_PATH+1]; - if(!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp)) - return _wfopen(pTemp, TEXT("w+b")); - else - return 0; -} - -void rewind(FILE *stream) -{ - fseek(stream, 0, SEEK_SET); -} - - -char *strdup(const char *strSource) -{ - char* buffer; - buffer = (char*)malloc(strlen(strSource)+1); - if(buffer) - strcpy(buffer, strSource); - return buffer; -} - -/* Used in UI.C */ -char cwd[MAX_PATH+1] = ""; -char *getcwd(char *buffer, int maxlen) -{ - TCHAR fileUnc[MAX_PATH+1]; - char* plast; - - if(cwd[0] == 0) - { - GetModuleFileName(NULL, fileUnc, MAX_PATH); - WideCharToMultiByte(CP_ACP, 0, fileUnc, -1, cwd, MAX_PATH, NULL, NULL); - plast = strrchr(cwd, '\\'); - if(plast) - *plast = 0; - /* Special trick to keep start menu clean... */ - if(_stricmp(cwd, "\\windows\\start menu") == 0) - strcpy(cwd, "\\Apps"); - } - if(buffer) - strncpy(buffer, cwd, maxlen); - return cwd; -} - -/* Limited implementation of time.h. time_t formula is possibly incorrect. */ -time_t time(time_t* res) -{ - time_t t; - SYSTEMTIME st; - GetLocalTime(&st); - - t = (time_t)(((((((st.wYear-1970)*12+st.wMonth)*31+st.wDay)*7+st.wDayOfWeek)*24+st.wHour)*60+st.wMinute)*60+st.wSecond); - - if(res) - *res = t; - return t; -} - -struct tm* localtime(time_t* timer) -{ - static struct tm tmLocalTime; - unsigned long rem = *timer; - - tmLocalTime.tm_sec = (short)(rem % 60); - rem /= 60; - tmLocalTime.tm_min = (short)(rem % 60); - rem /= 60; - tmLocalTime.tm_hour = (short)(rem % 24); - rem /= 24; - tmLocalTime.tm_mday = (short)(rem % 7); - rem /= 7; - tmLocalTime.tm_mday = (short)(rem % 31); - rem /= 31; - tmLocalTime.tm_mon = (short)(rem % 12); - rem /= 12; - tmLocalTime.tm_year = (short)(rem+1970); - - return &tmLocalTime; -} - -/* Very limited implementation of sys/time.h */ -void gettimeofday(struct timeval* tp, void* dummy) -{ - DWORD dt = GetTickCount(); - tp->tv_sec = dt/1000; - tp->tv_usec = dt*1000; -} - -void usleep(long usec) -{ - long msec = usec/1000; - if(msec <= 0) - Sleep(0); - else - Sleep(msec); -} - -/* -Windows CE fopen has non-standard behavior -- not -fully qualified paths refer to root folder rather -than current folder (concept not implemented in CE). -*/ -#undef fopen - -FILE* wce_fopen(const char* fname, const char* fmode) -{ - char fullname[MAX_PATH+1]; - - if(!fname || fname[0] == '\0') - return NULL; - if(fname[0] != '\\' && fname[0] != '/') - { - getcwd(fullname, MAX_PATH); - strncat(fullname, "\\", MAX_PATH-strlen(fullname)-1); - strncat(fullname, fname, MAX_PATH-strlen(fullname)-strlen(fname)); - return fopen(fullname, fmode); - } - else - return fopen(fname, fmode); -} - -/* This may provide for better sync mechanism */ -unsigned int clock() -{ - return GetTickCount(); -} - -/* And why do people use this? */ -void abort() -{ - exit(1); -} - -/* -IMHO, no project should use this one, it is not portable at all. This implementation -at least allows some projects to work. -*/ -char* getenv(char* name) -{ - static char buffer[MAX_PATH+1]; - if(strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0) - { - getcwd(buffer, MAX_PATH); - return buffer; - } - else - return ""; -} - -void *bsearch(const void *key, const void *base, size_t nmemb, - size_t size, int (*compar)(const void *, const void *)) { - size_t i; - - for (i=0; i - -struct stat { - _dev_t st_dev; - _ino_t st_ino; - unsigned short st_mode; - short st_nlink; - short st_uid; - short st_gid; - _dev_t st_rdev; - _off_t st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - - -#define _S_IFDIR 0040000 /* directory */ -#define S_IFDIR _S_IFDIR - -int stat(const char *, struct stat *); diff --git a/wince/missing/sys/time.h b/wince/missing/sys/time.h deleted file mode 100644 index ded29bb009..0000000000 --- a/wince/missing/sys/time.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -struct timeval -{ - int tv_sec; - int tv_usec; -}; - -void gettimeofday(struct timeval* tp, void* dummy); -void usleep(long usec); diff --git a/wince/missing/sys/types.h b/wince/missing/sys/types.h deleted file mode 100644 index b6c05e3958..0000000000 --- a/wince/missing/sys/types.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -typedef unsigned short _ino_t; -typedef unsigned int _dev_t; -typedef long _off_t; diff --git a/wince/missing/time.h b/wince/missing/time.h deleted file mode 100644 index 40c2894dca..0000000000 --- a/wince/missing/time.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -#ifndef A800_TIME_H -#define A800_TIME_H - -#include - -struct tm -{ - short tm_year; - short tm_mon; - short tm_mday; - short tm_wday; - short tm_hour; - short tm_min; - short tm_sec; -}; - -time_t time(time_t* dummy); -struct tm* localtime(time_t* dummy); - -unsigned int clock(); - -#endif diff --git a/wince/missing/unistd.h b/wince/missing/unistd.h deleted file mode 100644 index 7ee9f5e5ba..0000000000 --- a/wince/missing/unistd.h +++ /dev/null @@ -1 +0,0 @@ -/* Header is not present in Windows CE SDK */ diff --git a/wince/newres.h b/wince/newres.h deleted file mode 100644 index 57f429fa45..0000000000 --- a/wince/newres.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __NEWRES_H__ -#define __NEWRES_H__ - -#if !defined(UNDER_CE) -#define UNDER_CE _WIN32_WCE -#endif - -#if defined(_WIN32_WCE) - #if !defined(WCEOLE_ENABLE_DIALOGEX) - #define DIALOGEX DIALOG DISCARDABLE - #endif - #include - #define SHMENUBAR RCDATA - #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300) - #include - #define AFXCE_IDR_SCRATCH_SHMENU 28700 - #else - #define I_IMAGENONE (-2) - #define NOMENU 0xFFFF - #define IDS_SHNEW 1 - - #define IDM_SHAREDNEW 10 - #define IDM_SHAREDNEWDEFAULT 11 - #endif // _WIN32_WCE_PSPC - #define AFXCE_IDD_SAVEMODIFIEDDLG 28701 -#endif // _WIN32_WCE - -#ifdef RC_INVOKED -#ifndef _INC_WINDOWS -#define _INC_WINDOWS - #include "winuser.h" // extract from windows header - #include "winver.h" -#endif -#endif - -#ifdef IDC_STATIC -#undef IDC_STATIC -#endif -#define IDC_STATIC (-1) - -#endif //__NEWRES_H__ diff --git a/wince/pocketpc.cpp b/wince/pocketpc.cpp deleted file mode 100644 index 0162d14e28..0000000000 --- a/wince/pocketpc.cpp +++ /dev/null @@ -1,1490 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include - -#include "scumm.h" -#include "debug.h" -#include "screen.h" -#include "gui.h" -#include "sound/mididrv.h" -#include "gameDetector.h" -#include "simon/simon.h" -#include "gapi_keys.h" -#include "config-file.h" - - -#include "commctrl.h" -#include -#include -#include -#include -#include -#include -#include "resource.h" - -#include "SDL.h" -#include "SDL_audio.h" -#include "SDL_timer.h" -#include "SDL_thread.h" - -#define MAX(a,b) (((a)<(b)) ? (b) : (a)) -#define MIN(a,b) (((a)>(b)) ? (b) : (a)) -#define POCKETSCUMM_BUILD "080502" - -#define VERSION "Build " POCKETSCUMM_BUILD " (VM " SCUMMVM_CVS ")" - -typedef int (*tTimeCallback)(int); -typedef void SoundProc(void *param, byte *buf, int len); - -GameDetector detector; -Config *scummcfg; -tTimeCallback timer_callback; -int timer_interval; - -extern void Cls(); - -extern BOOL isPrescanning(); -extern void changeScanPath(); -extern void startScan(); -extern void endScanPath(); -extern void abortScanPath(); - -void load_key_mapping(); -void keypad_init(); - -extern void Cls(); - -extern BOOL isPrescanning(); -extern void changeScanPath(); -extern void startScan(); -extern void endScanPath(); -extern void abortScanPath(); - -void keypad_init(); - -class OSystem_WINCE3 : public OSystem { -public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Add a new callback timer - void set_timer(int timer, int (*callback)(int)); - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - static OSystem *create(int gfx_mode, bool full_screen); - - // Added for hardware keys mapping - - void addEventKeyPressed(int ascii_code); - - void addEventRightButtonClicked(); - - // Mutex functions - - void* create_mutex(); - void lock_mutex(void*); - void unlock_mutex(void*); - void delete_mutex(void*); - -private: - // Windows callbacks & stuff - //bool handleMessage(); - static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - - - byte *_gfx_buf; - uint32 _start_time; - Event _event; - HMODULE hInst; - HWND hWnd; - bool _display_cursor; - - enum { - DF_FORCE_FULL_ON_PALETTE = 1, - DF_WANT_RECT_OPTIM = 2, - DF_2xSAI = 4, - DF_SEPARATE_HWSCREEN = 8, - DF_UPDATE_EXPAND_1_PIXEL = 16, - }; - - int _mode; - bool _full_screen; - bool _mouse_visible; - bool _mouse_drawn; - uint32 _mode_flags; - - byte _internal_scaling; - - bool force_full; //Force full redraw on next update_screen - bool cksum_valid; - - enum { - NUM_DIRTY_RECT = 100, - SCREEN_WIDTH = 320, - SCREEN_HEIGHT = 200, - CKSUM_NUM = (SCREEN_WIDTH*SCREEN_HEIGHT/(8*8)), - - MAX_MOUSE_W = 40, - MAX_MOUSE_H = 40, - MAX_SCALING = 3, - - TMP_SCREEN_OFFS = 320*2 + 8, - }; - - /* CD Audio */ - int cd_track, cd_num_loops, cd_start_frame, cd_end_frame; - Uint32 cd_end_time, cd_stop_time, cd_next_second; - - struct MousePos { - int16 x,y,w,h; - }; - - byte *_ms_buf; - byte *_ms_backup; - MousePos _ms_cur; - MousePos _ms_old; - int16 _ms_hotspot_x; - int16 _ms_hotspot_y; - int _current_shake_pos; - - - static void fill_sound(void *userdata, Uint8 * stream, int len); - - - void draw_mouse(); - void undraw_mouse(); - - void load_gfx_mode(); - void unload_gfx_mode(); - - void hotswap_gfx_mode(); - - void get_320x200_image(byte *buf); -}; - -/************* WinCE Specifics *****************/ -byte veryFastMode; - -bool sound_activated, terminated; -HWND hWnd_MainMenu; -HWND hWnd_Window; - -void drawAllToolbar(bool); -void redrawSoundItem(); -ToolbarSelected getToolbarSelection(int, int); - -extern bool toolbar_drawn; -extern bool draw_keyboard; -bool hide_toolbar; -bool hide_cursor; - -bool get_key_mapping; -static char _directory[MAX_PATH]; - -SoundProc *real_soundproc; - -const char KEYBOARD_MAPPING_ALPHA_HIGH[] = {"ABCDEFGHIJKLM"}; -const char KEYBOARD_MAPPING_NUMERIC_HIGH[] = {"12345"}; -const char KEYBOARD_MAPPING_ALPHA_LOW[] = {"NOPQRSTUVWXYZ"}; -const char KEYBOARD_MAPPING_NUMERIC_LOW[] = {"67890"}; - -extern void startFindGame(); -extern void displayGameInfo(); -extern bool loadGameSettings(void); -extern void setFindGameDlgHandle(HWND); -extern void getSelectedGame(int, char*, TCHAR*); - -extern void palette_update(); - -extern void own_soundProc(void *buffer, byte *samples, int len); - -//#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU) - -/* Monkey2 keyboard stuff */ -bool monkey2_keyboard; - -void do_quit() { - scummcfg->set("Sound", sound_activated, "wince"); - scummcfg->set("DisplayMode", GetScreenMode(), "wince"); - scummcfg->flush(); - GXCloseInput(); - GXCloseDisplay(); - SDL_AudioQuit(); - exit(1); -} - -void Error(LPCTSTR msg) -{ - OutputDebugString(msg); - MessageBox(HWND_DESKTOP, msg, TEXT("Error"), MB_ICONSTOP); - exit(1); -} - -void Warning(LPCTSTR msg) -{ - OutputDebugString(msg); - MessageBox(HWND_DESKTOP, msg, TEXT("Error"), MB_ICONSTOP); -} - -int mapKey(int key) { - if (key>=VK_F1 && key<=VK_F9) { - return key - VK_F1 + 315; - } - return key; -} - -BOOL CALLBACK SelectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - { - TCHAR work[1024]; - RECT rc; GetWindowRect(hwndDlg, &rc); - MoveWindow(hwndDlg, - (GetSystemMetrics(SM_CXSCREEN)-rc.right+rc.left)/2, - (GetSystemMetrics(SM_CYSCREEN)-rc.bottom+rc.top)/2, - rc.right-rc.left, rc.bottom-rc.top, TRUE); - BringWindowToTop(hwndDlg); - setFindGameDlgHandle(hwndDlg); - MultiByteToWideChar(CP_ACP, 0, VERSION, strlen(VERSION) + 1, work, sizeof(work)); - SetDlgItemText(hwndDlg, IDC_GAMEDESC, work); - loadGameSettings(); - } - return TRUE; - - case WM_COMMAND: - - if (LOWORD(wParam) == IDC_LISTAVAILABLE && HIWORD(wParam) == LBN_SELCHANGE) { - if (!isPrescanning()) - displayGameInfo(); - else - changeScanPath(); - } - - if (wParam == IDC_SCAN) { - if (!isPrescanning()) - startScan(); - else - endScanPath(); - } - - if (wParam == IDC_PLAY) { - int item; - - item = SendMessage(GetDlgItem(hwndDlg, IDC_LISTAVAILABLE), LB_GETCURSEL, 0, 0); - if (item == LB_ERR) { - MessageBox(hwndDlg, TEXT("Please select a game"), TEXT("Error"), MB_OK); - } - else - EndDialog(hwndDlg, item + 1000); - } - - if (wParam == IDC_EXIT) { - if (!isPrescanning()) - EndDialog(hwndDlg, 0); - else - abortScanPath(); - } - return TRUE; - default: - return FALSE; - } -} - -char* GameSelector() -{ - TCHAR directory[MAX_PATH]; - static char id[100]; - - DWORD result = DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_GAMESELECT), HWND_DESKTOP, SelectDlgProc); - if (result < 1000) - return NULL; - result -= 1000; - - getSelectedGame(result, id, directory); - - WideCharToMultiByte(CP_ACP, 0, directory, wcslen(directory) + 1, _directory, sizeof(_directory), NULL, NULL); - - strcat(_directory, "\\"); - - return id; - -} - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) -{ - - int argc = 3; - char* argv[3]; - char argdir[MAX_PATH]; - char *game_name; - const char *sound; - - hide_toolbar = false; - - scummcfg = new Config("scummvm.ini", "scummvm"); - scummcfg->set_writing(true); - - sound = scummcfg->get("Sound", "wince"); - if (sound) - sound_activated = (atoi(sound) == 1); - else - sound_activated = true; - - game_name = GameSelector(); - if (!game_name) - return 0; - - argv[0] = NULL; - sprintf(argdir, "-p%s", _directory); - argv[1] = argdir; - argv[2] = game_name; - - if (!argv[2]) - return 0; - - // No default toolbar for zak256 - /* - if (strcmp(game_name, "zak256") == 0) - hide_toolbar = true; - */ - - // Keyboard activated for Monkey Island 2 - if (strcmp(game_name, "monkey2") == 0) { - draw_keyboard = true; - monkey2_keyboard = true; - } - - if (detector.detectMain(argc, argv)) - return (-1); - - OSystem *system = detector.createSystem(); - - // Create the game engine - Engine *engine = Engine::createFromDetector(&detector, system); - - keypad_init(); - load_key_mapping(); - - hide_cursor = TRUE; - if (detector._gameId == GID_SAMNMAX || detector._gameId == GID_FT || detector._gameId == GID_DIG) - hide_cursor = FALSE; - - // Run the game engine - engine->go(); - - return 0; -} - - - -LRESULT CALLBACK OSystem_WINCE3::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - static SHACTIVATEINFO sai; - - OSystem_WINCE3 *wm = (OSystem_WINCE3*)GetWindowLong(hWnd, GWL_USERDATA); - - if (monkey2_keyboard && g_scumm->_vars[g_scumm->VAR_ROOM] != 108) { - monkey2_keyboard = false; - draw_keyboard = false; - toolbar_drawn = false; - } - - switch (message) - { - case WM_CREATE: - memset(&sai, 0, sizeof(sai)); - SHSipPreference(hWnd, SIP_FORCEDOWN); -// SHSipPreference(hWnd, SIP_INPUTDIALOG); - - return 0; - - case WM_DESTROY: - case WM_CLOSE: - GraphicsOff(); - PostQuitMessage(0); - break; - - case WM_ERASEBKGND: - { - - RECT rc; - HDC hDC; - if (!GetScreenMode()) { - GetClientRect(hWnd, &rc); - rc.top = 200; - hDC = GetDC(hWnd); - if(rc.top < rc.bottom) - FillRect(hDC, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH)); - ReleaseDC(hWnd, hDC); - } - } - return 1; - - case WM_PAINT: - { - HDC hDC; - PAINTSTRUCT ps; - hDC = BeginPaint (hWnd, &ps); - EndPaint (hWnd, &ps); - if (!hide_toolbar) - toolbar_drawn = false; - - /* - if(!GetScreenMode()) { - SHSipPreference(hWnd, SIP_UP); - } else { - SHSipPreference(hWnd, SIP_FORCEDOWN); - } - */ - SHSipPreference(hWnd, SIP_FORCEDOWN); - } -// SHSipPreference(hWnd, SIP_UP); /* Hack! */ - /* It does not happen often but I don't want to see tooltip traces */ - wm->update_screen(); - return 0; - - case WM_ACTIVATE: - case WM_SETFOCUS: - GraphicsResume(); - if (!hide_toolbar) - toolbar_drawn = false; -// SHHandleWMActivate(hWnd, wParam, lParam, &sai, SHA_INPUTDIALOG); - - SHSipPreference(hWnd, SIP_FORCEDOWN); - SHFullScreen(hWnd, SHFS_HIDETASKBAR); - MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); - SetCapture(hWnd); - - /* - if (LOWORD(wParam) == WA_ACTIVE) { - if (GetScreenMode()) { - SHSipPreference(hWnd, SIP_FORCEDOWN); - SHFullScreen(hWnd, SHFS_HIDETASKBAR); - MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); - SetCapture(hWnd); - } - else { - SHFullScreen(hWnd, SHFS_SHOWTASKBAR); - MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CYSCREEN), GetSystemMetrics(SM_CXSCREEN), TRUE); - } - } - */ - - return 0; - - case WM_HIBERNATE: - case WM_KILLFOCUS: - GraphicsSuspend(); - if (!hide_toolbar) - toolbar_drawn = false; - return 0; - - case WM_SETTINGCHANGE: - SHHandleWMSettingChange(hWnd, wParam, lParam, &sai); - if (!hide_toolbar) - toolbar_drawn = false; - return 0; - - - case WM_COMMAND: - /* - switch(wParam) - { - case IDC_OPTIONS: - wm->_event.kbd.ascii = KEY_SET_OPTIONS; - wm->_event.event_code = EVENT_KEYDOWN; - break; - case IDC_EXIT: - DestroyWindow(hWnd); - do_quit(); - break; - case IDC_SKIP: - if (detector._gameId >= GID_SIMON_FIRST && - detector._gameId <= GID_SIMON_LAST) { - g_simon->_exit_cutscene = true; - break; - } - if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) - wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]; - else - wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]; - break; - case IDC_LOADSAVE: - if (detector._gameId >= GID_SIMON_FIRST && - detector._gameId <= GID_SIMON_LAST) { - break; - } - if (GetScreenMode()) { - draw_keyboard = true; - if (!hide_toolbar) - toolbar_drawn = false; - } - wm->_event.kbd.ascii = mapKey(VK_F5); - wm->_event.event_code = EVENT_KEYDOWN; - break; - - case IDC_SOUND: - sound_activated = !sound_activated; - CheckMenuItem ( - SHMenuBar_GetMenu (hWnd_MainMenu, IDM_POCKETSCUMM), - IDC_SOUND, - MF_BYCOMMAND | (sound_activated ? MF_CHECKED : MF_UNCHECKED)); - if (detector._gameId >= GID_SIMON_FIRST && - detector._gameId <= GID_SIMON_LAST) { - g_mixer->pause(!sound_activated); - } - else - g_scumm->pauseSounds(!sound_activated); - - break; - - break; - - case IDC_LANDSCAPE: - //HWND taskbar; - //SHFullScreen (hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); - //InvalidateRect(HWND_DESKTOP, NULL, TRUE); - SetScreenMode(!GetScreenMode()); - //SHSipPreference(hWnd,SIP_FORCEDOWN); - //MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); - //SetCapture(hWnd); // to prevent input panel from getting taps - /*taskbar = FindWindow(TEXT("HHTaskBar"), NULL); - if (taskbar) - ShowWindow(taskbar, SW_HIDE);*/ - /*SHSipPreference(hWnd, SIP_FORCEDOWN); - SHFullScreen(hWnd, SHFS_HIDETASKBAR);*/ - /* - SetForegroundWindow(hWnd); - MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), TRUE); - SetCapture(hWnd); - UpdateWindow(hWnd); - if (!hide_toolbar) - toolbar_drawn = false; - break; - - } - */ - - return 0; - - case WM_KEYDOWN: - if(wParam && wParam != 0x84) { // WHAT THE ??? - - /* - unsigned char GAPI_key; - - GAPI_key = getGAPIKeyMapping((short)wParam); - if (GAPI_key) { - */ - if (get_key_mapping) { - wm->_event.kbd.ascii = GAPI_KEY_BASE + GAPIKeysTranslate((int)wParam); - wm->_event.event_code = EVENT_KEYDOWN; - break; - } - /* - else - processAction((short)wParam); - */ - /*}*/ - if (!processAction(GAPIKeysTranslate((int)wParam))) - /*else*/ { - wm->_event.kbd.ascii = mapKey(wParam); - wm->_event.event_code = EVENT_KEYDOWN; - } - } - - break; - - case WM_KEYUP: - break; - - case WM_MOUSEMOVE: - { - int x = ((int16*)&lParam)[0]; - int y = ((int16*)&lParam)[1]; - Translate(&x, &y); - wm->_event.event_code = EVENT_MOUSEMOVE; - wm->_event.mouse.x = x; - wm->_event.mouse.y = y; - } - break; - case WM_LBUTTONDOWN: - { - ToolbarSelected toolbar_selection; - int x = ((int16*)&lParam)[0]; - int y = ((int16*)&lParam)[1]; - - //FILE *toto; - - Translate(&x, &y); - - /* - fprintf(toto, "Non translated %d %d Translated %d %d\n", - ((int16*)&lParam)[0], ((int16*)&lParam)[1], - x, y); - fclose(toto); - */ - - - if (draw_keyboard) { - // Handle keyboard selection - int offset_y; - int saved_x = x; - int saved_y = y; - - /* - if (!GetScreenMode()) { - x = ((int16*)&lParam)[0]; - y = ((int16*)&lParam)[1]; - } - */ - - offset_y = (GetScreenMode() ? 0 : 40 + 22); - - if (x<185 && y>=(200 + offset_y)) { - //Alpha selection - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = - (y <= (220 + offset_y)? KEYBOARD_MAPPING_ALPHA_HIGH[((x + 10) / 14) - 1] : - KEYBOARD_MAPPING_ALPHA_LOW[((x + 10) / 14) - 1]); - break; - } - else - if (x>=186 && y>=(200 + offset_y) && x<=255) { - // Numeric selection - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = - (y <= (220 + offset_y) ? KEYBOARD_MAPPING_NUMERIC_HIGH[((x - 187 + 10) / 14) - 1] : - KEYBOARD_MAPPING_NUMERIC_LOW[((x - 187 + 10) / 14) - 1]); - break; - } - else - if (x>=302 && x <= 316 && y >= (200 + offset_y) && y <= (220 + offset_y)) { - // Backspace - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = mapKey(VK_BACK); - break; - } - else - if (x>=302 && x<= 316 && y >= (220 + offset_y)) { - // Enter - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = mapKey(VK_RETURN); - break; - } - - x = saved_x; - y = saved_y; - - wm->_event.event_code = EVENT_LBUTTONDOWN; - wm->_event.mouse.x = x; - wm->_event.mouse.y = y; - break; - - } - - - toolbar_selection = (hide_toolbar || get_key_mapping ? ToolbarNone : - getToolbarSelection( - (GetScreenMode() ? x : ((int16*)&lParam)[0]), - (GetScreenMode() ? y : ((int16*)&lParam)[1]))); - if (toolbar_selection == ToolbarNone) { - wm->_event.event_code = EVENT_LBUTTONDOWN; - wm->_event.mouse.x = x; - wm->_event.mouse.y = y; - - /* - if(y > 200 && !hide_toolbar) - { - if(x<160) { - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = mapKey(VK_ESCAPE); - } - else - { - HDC hDC; - PAINTSTRUCT ps; - - SetScreenMode(0); // restore normal tap logic - //SHSipPreference(hWnd,SIP_UP); - ReleaseCapture(); - //InvalidateRect(HWND_DESKTOP, NULL, TRUE); - SHFullScreen(hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); - MoveWindow(hWnd, 0, 0, GetSystemMetrics(SM_CYSCREEN), GetSystemMetrics(SM_CXSCREEN), TRUE); - SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - SetForegroundWindow(hWnd); - hDC = BeginPaint (hWnd, &ps); - EndPaint (hWnd, &ps); - } - } - */ - } - else { - switch(toolbar_selection) { - case ToolbarSaveLoad: - if (detector._gameId >= GID_SIMON_FIRST && - detector._gameId <= GID_SIMON_LAST) { - break; - } - /*if (GetScreenMode()) {*/ - /* - draw_keyboard = true; - if (!hide_toolbar) - toolbar_drawn = false; - */ - /*}*/ - wm->_event.event_code = EVENT_KEYDOWN; - wm->_event.kbd.ascii = mapKey(VK_F5); - break; - case ToolbarMode: - SetScreenMode(!GetScreenMode()); - if (!hide_toolbar) - toolbar_drawn = false; - break; - case ToolbarSkip: - if (detector._gameId >= GID_SIMON_FIRST && - detector._gameId <= GID_SIMON_LAST) { - // Fake a right click to abort the current cut scene - wm->_event.event_code = EVENT_RBUTTONDOWN; - wm->_event.mouse.x = x; - wm->_event.mouse.y = y; - break; - } - wm->_event.event_code = EVENT_KEYDOWN; - if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) - wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]; - else - wm->_event.kbd.ascii = g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]; - break; - case ToolbarSound: - sound_activated = !sound_activated; - redrawSoundItem(); - break; - default: - break; - } - } - } - break; - case WM_LBUTTONUP: - { - // pinched from the SDL code. Distinguishes between taps and not - int x = ((int16*)&lParam)[0]; - int y = ((int16*)&lParam)[1]; - Translate(&x, &y); - wm->_event.event_code = EVENT_LBUTTONUP; - wm->_event.mouse.x = x; - wm->_event.mouse.y = y; - } - break; - case WM_LBUTTONDBLCLK: // doesn't seem to work right now - //wm->_scumm->_rightBtnPressed |= msClicked | msDown; - break; - case WM_TIMER: - timer_callback(timer_interval); - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - return 0; -} - -/*************** Specific config support ***********/ - -void load_key_mapping() { - unsigned char actions[NUMBER_ACTIONS]; - int actions_keys[NUMBER_ACTIONS]; - const char *current; - const char *version; - int i; - - memset(actions_keys, 0, sizeof(actions_keys)); - - version = scummcfg->get("KeysVersion", "wince"); - - current = scummcfg->get("ActionKeys", "wince"); - if (current && version) { - for (i=0; iget("ActionTypes", "wince"); - if (current && version) { - for (i=0; iset("KeysVersion", "2", "wince"); - scummcfg->flush(); - } -} - -void save_key_mapping() { - char tempo[1024]; - const int *work_keys; - const unsigned char *work; - int i; - - tempo[0] = '\0'; - work_keys = getActionKeys(); - for (i=0; iset("ActionKeys", tempo, "wince"); - tempo[0] = '\0'; - work = getActionTypes(); - for (i=0; iset("ActionTypes", tempo, "wince"); - - scummcfg->flush(); -} - -/*************** Hardware keys support ***********/ - -void OSystem_WINCE3::addEventKeyPressed(int ascii_code) { - _event.event_code = EVENT_KEYDOWN; - _event.kbd.ascii = ascii_code; -} - -void OSystem_WINCE3::addEventRightButtonClicked() { - OSystem_WINCE3* system; - system = (OSystem_WINCE3*)g_scumm->_system; - - system->addEventKeyPressed(9); -} - -void action_right_click() { - OSystem_WINCE3* system; - system = (OSystem_WINCE3*)g_scumm->_system; - - system->addEventRightButtonClicked(); -} - -void action_pause() { - OSystem_WINCE3* system; - system = (OSystem_WINCE3*)g_scumm->_system; - - system->addEventKeyPressed(mapKey(VK_SPACE)); -} - -void action_save() { - OSystem_WINCE3* system; - system = (OSystem_WINCE3*)g_scumm->_system; - - /*if (GetScreenMode()) {*/ - /* - draw_keyboard = true; - if (!hide_toolbar) - toolbar_drawn = false; - */ - /*}*/ - - system->addEventKeyPressed(mapKey(VK_F5)); -} - -void action_quit() { - do_quit(); -} - -void action_boss() { - SHELLEXECUTEINFO se; - - scummcfg->set("Sound", sound_activated, "wince"); - scummcfg->set("DisplayMode", GetScreenMode(), "wince"); - scummcfg->flush(); - sound_activated = false; - toolbar_drawn = false; - hide_toolbar = true; - Cls(); - g_scumm->_saveLoadSlot = 0; - g_scumm->_saveLoadCompatible = false; - g_scumm->_saveLoadFlag = 1; - strcpy(g_scumm->_saveLoadName, "BOSS"); - g_scumm->saveState(g_scumm->_saveLoadSlot, g_scumm->_saveLoadCompatible); - GXCloseInput(); - GXCloseDisplay(); - SDL_AudioQuit(); - memset(&se, 0, sizeof(se)); - se.cbSize = sizeof(se); - se.hwnd = NULL; - se.lpFile = TEXT("tasks.exe"); - se.lpVerb = TEXT("open"); - se.lpDirectory = TEXT("\\windows"); - ShellExecuteEx(&se); - exit(1); -} - -void action_skip() { - OSystem_WINCE3* system; - system = (OSystem_WINCE3*)g_scumm->_system; - - if (g_scumm->vm.cutScenePtr[g_scumm->vm.cutSceneStackPointer]) - system->addEventKeyPressed(g_scumm->_vars[g_scumm->VAR_CUTSCENEEXIT_KEY]); - else - system->addEventKeyPressed(g_scumm->_vars[g_scumm->VAR_TALKSTOP_KEY]); -} - -void do_hide(bool hide_state) { - hide_toolbar = hide_state; - if (hide_toolbar) - RestoreScreenGeometry(); - else - LimitScreenGeometry(); - Cls(); - toolbar_drawn = hide_toolbar; - g_scumm->_system->update_screen(); -} - -void action_hide() { - do_hide(!hide_toolbar); -} - -void action_keyboard() { - /*if (GetScreenMode()) {*/ - draw_keyboard = !draw_keyboard; - if (!hide_toolbar) - toolbar_drawn = false; - /*}*/ -} - -void action_sound() { - sound_activated = !sound_activated; -} - -void action_cursoronoff() { - hide_cursor = !hide_cursor; -} - -void action_subtitleonoff() { - g_scumm->_noSubtitles = !g_scumm->_noSubtitles; -} - -void keypad_init() { - static pAction actions[TOTAL_ACTIONS] = - { action_pause, action_save, action_quit, action_skip, action_hide, - action_keyboard, action_sound, action_right_click, action_cursoronoff, - action_subtitleonoff, action_boss - }; - - GAPIKeysInit(actions); - -} - -void keypad_close() { - GXCloseInput(); -} - - -/************* OSystem Main **********************/ -OSystem *OSystem_WINCE3::create(int gfx_mode, bool full_screen) { - const char *display_mode; - OSystem_WINCE3 *syst = new OSystem_WINCE3(); - syst->_mode = gfx_mode; - syst->_full_screen = full_screen; - syst->_event.event_code = -1; - syst->_start_time = GetTickCount(); - - /* Retrieve the handle of this module */ - syst->hInst = GetModuleHandle(NULL); - - /* Register the window class */ - WNDCLASS wcex; - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = (WNDPROC)WndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = syst->hInst; - wcex.hIcon = 0; - wcex.hCursor = NULL; - wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); - wcex.lpszMenuName = 0; - wcex.lpszClassName = TEXT("ScummVM"); - if (!RegisterClass(&wcex)) - Error(TEXT("Cannot register window class!")); - - syst->hWnd = CreateWindow(TEXT("ScummVM"), TEXT("ScummVM"), WS_VISIBLE, - 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, syst->hInst, NULL); - hWnd_Window = syst->hWnd; - SetWindowLong(syst->hWnd, GWL_USERDATA, (long)syst); - - ShowWindow(syst->hWnd, SW_SHOW); - UpdateWindow(syst->hWnd); - - /* - SHMENUBARINFO smbi; - smbi.cbSize = sizeof(smbi); - smbi.hwndParent = syst->hWnd; - smbi.dwFlags = 0; - smbi.nToolBarId = IDM_MENU; - smbi.hInstRes = GetModuleHandle(NULL); - smbi.nBmpId = 0; - smbi.cBmpImages = 0; - smbi.hwndMB = NULL; - BOOL res = SHCreateMenuBar(&smbi); - hWnd_MainMenu = smbi.hwndMB; - */ - - /* Sound is activated on default - initialize it in the menu */ - /* - CheckMenuItem((HMENU)SHMenuBar_GetMenu (hWnd_MainMenu, IDM_POCKETSCUMM), - IDC_SOUND, MF_BYCOMMAND | MF_CHECKED); - */ - - GraphicsOn(syst->hWnd); - - SetWindowPos(syst->hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - SetForegroundWindow(syst->hWnd); - SHFullScreen(syst->hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON); - - - // Mini SDL init - - if (SDL_Init(SDL_INIT_AUDIO)==-1) { - exit(1); - } - - Cls(); - drawWait(); - - // Set mode, portrait or landscape - display_mode = scummcfg->get("DisplayMode", "wince"); - if (display_mode) - SetScreenMode(atoi(display_mode)); - - return syst; -} - -OSystem *OSystem_WINCE3_create() { - return OSystem_WINCE3::create(0, 0); -} - -void OSystem_WINCE3::set_timer(int timer, int (*callback)(int)) { - SetTimer(hWnd, 1, timer, NULL); - timer_interval = timer; - timer_callback = callback; -} - -void OSystem_WINCE3::set_palette(const byte *colors, uint start, uint num) { - const byte *b = colors; - uint i; - for(i=0;i!=num;i++) { - SetPalEntry(i + start, b[0], b[1], b[2]); - b += 4; - } - - palette_update(); -} - -void OSystem_WINCE3::load_gfx_mode() { - force_full = true; - - _gfx_buf = (byte*)malloc((320 * 240) * sizeof(byte)); - _ms_backup = (byte*)malloc((40 * 40 * 3) * sizeof(byte)); -} - -void OSystem_WINCE3::unload_gfx_mode() { - // FIXME: Free the _gfx_buf here -} - -void OSystem_WINCE3::init_size(uint w, uint h) { - load_gfx_mode(); - SetScreenGeometry(w, h); -} - -void OSystem_WINCE3::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) { - byte *dst; - - if (!hide_cursor && _mouse_drawn) - undraw_mouse(); - - dst = _gfx_buf + y * 320 + x; - do { - memcpy(dst, buf, w); - dst += 320; - buf += pitch; - } while (--h); -} - -void OSystem_WINCE3::update_screen() { - - if (!hide_cursor) - draw_mouse(); - - Blt(_gfx_buf); -} - -bool OSystem_WINCE3::show_mouse(bool visible) { - if (_mouse_visible == visible) - return visible; - - bool last = _mouse_visible; - _mouse_visible = visible; - - return last; -} - -// From X11 port - -void OSystem_WINCE3::draw_mouse() { - if (_mouse_drawn || !_mouse_visible) - return; - _mouse_drawn = true; - - int xdraw = _ms_cur.x - _ms_hotspot_x; - int ydraw = _ms_cur.y - _ms_hotspot_y; - int w = _ms_cur.w; - int h = _ms_cur.h; - int real_w; - int real_h; - int real_h_2; - - byte *dst; - byte *dst2; - const byte *buf = _ms_buf; - byte *bak = _ms_backup; - - assert(w <= 40 && h <= 40); - - if (ydraw < 0) { - real_h = h + ydraw; - buf += (-ydraw) * w; - ydraw = 0; - } else { - real_h = (ydraw + h) > 200 ? (200 - ydraw) : h; - } - if (xdraw < 0) { - real_w = w + xdraw; - buf += (-xdraw); - xdraw = 0; - } else { - real_w = (xdraw + w) > 320 ? (320 - xdraw) : w; - } - - dst = _gfx_buf + (ydraw * 320) + xdraw; - dst2 = dst; - - if ((real_h == 0) || (real_w == 0)) { - _mouse_drawn = false; - return; - } - - _ms_old.x = xdraw; - _ms_old.y = ydraw; - _ms_old.w = real_w; - _ms_old.h = real_h; - - real_h_2 = real_h; - while (real_h_2 > 0) { - memcpy(bak, dst, real_w); - bak += 40; - dst += 320; - real_h_2--; - } - while (real_h > 0) { - int width = real_w; - while (width > 0) { - byte color = *buf; - if (color != 0xFF) { - *dst2 = color; - } - buf++; - dst2++; - width--; - } - buf += w - real_w; - dst2 += 320 - real_w; - real_h--; - } -} - -void OSystem_WINCE3::undraw_mouse() { - if (!_mouse_drawn) - return; - _mouse_drawn = false; - - int old_h = _ms_old.h; - - byte *dst = _gfx_buf + (_ms_old.y * 320) + _ms_old.x; - byte *bak = _ms_backup; - - while (old_h > 0) { - memcpy(dst, bak, _ms_old.w); - bak += 40; - dst += 320; - old_h--; - } -} - - -void OSystem_WINCE3::set_mouse_pos(int x, int y) { - if (x != _ms_cur.x || y != _ms_cur.y) { - _ms_cur.x = x; - _ms_cur.y = y; - } -} - -void OSystem_WINCE3::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { - _ms_cur.w = w; - _ms_cur.h = h; - - _ms_hotspot_x = hotspot_x; - _ms_hotspot_y = hotspot_y; - - _ms_buf = (byte*)buf; - - // Refresh mouse cursor - - if (!hide_cursor) { - undraw_mouse(); - draw_mouse(); - } -} - -void OSystem_WINCE3::set_shake_pos(int shake_pos) {;} - -uint32 OSystem_WINCE3::get_msecs() { - return GetTickCount() - _start_time; -} - -void OSystem_WINCE3::delay_msecs(uint msecs) { - //handleMessage(); - Sleep(msecs); -} - -void *OSystem_WINCE3::create_thread(ThreadProc *proc, void *param) { - // needed for emulated MIDI support (Sam'n'Max) - return CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)proc, param, 0, NULL); -} - -int mapKey(int key, byte mod) -{ - if (key>=VK_F1 && key<=VK_F9) { - return key - VK_F1 + 315; - } - return key; -} - -bool OSystem_WINCE3::poll_event(Event *event) { - - for (;;) { - MSG msg; - - _event.event_code = -1; - - if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - return false; - - if (msg.message==WM_QUIT) { - terminated=true; - do_quit(); - return false; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - - *event = _event; - - return true; - } - - return false; -} - -void own_soundProc(void *buffer, byte *samples, int len) { - - (*real_soundproc)(buffer, samples, len); - - if (!sound_activated) - memset(samples, 0, len); -} - -bool OSystem_WINCE3::set_sound_proc(void *param, SoundProc *proc, byte format) { - SDL_AudioSpec desired; - - /* only one format supported at the moment */ - - real_soundproc = proc; - desired.freq = SAMPLES_PER_SEC; - desired.format = AUDIO_S16SYS; - desired.channels = 2; - desired.samples = 128; - desired.callback = own_soundProc; - desired.userdata = param; - if (SDL_OpenAudio(&desired, NULL) != 0) { - return false; - } - SDL_PauseAudio(0); - return true; -} - -/* Hotswap graphics modes */ -void OSystem_WINCE3::get_320x200_image(byte *buf) {;} -void OSystem_WINCE3::hotswap_gfx_mode() {;} -uint32 OSystem_WINCE3::property(int param, Property *value) { - switch(param) { - - case PROP_TOGGLE_FULLSCREEN: - return 1; - - case PROP_SET_WINDOW_CAPTION: - return 1; - - case PROP_OPEN_CD: - break; - - case PROP_SET_GFX_MODE: - return 1; - - case PROP_SHOW_DEFAULT_CURSOR: - break; - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - } - - return 0; -} - -void OSystem_WINCE3::quit() { - unload_gfx_mode(); - exit(1); -} - -/* CDRom Audio */ -void OSystem_WINCE3::stop_cdrom() {;} -void OSystem_WINCE3::play_cdrom(int track, int num_loops, int start_frame, int end_frame) { - /* Reset sync count */ - g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0; -} - -bool OSystem_WINCE3::poll_cdrom() {return 0;} -void OSystem_WINCE3::update_cdrom() {;} - -void ScummDebugger::attach(Scumm *s) {;} - -/* Mutex stuff */ -void* OSystem_WINCE3::create_mutex() { - return (void*)CreateMutex(NULL, FALSE, NULL); -} -void OSystem_WINCE3::lock_mutex(void *handle) { - WaitForSingleObject((HANDLE)handle, INFINITE); -} - -void OSystem_WINCE3::unlock_mutex(void *handle) { - ReleaseMutex((HANDLE)handle); -} - -void OSystem_WINCE3::delete_mutex(void *handle) { - CloseHandle((HANDLE)handle); -} \ No newline at end of file diff --git a/wince/pocketscumm.ico b/wince/pocketscumm.ico deleted file mode 100644 index 1bc0dae683..0000000000 Binary files a/wince/pocketscumm.ico and /dev/null differ diff --git a/wince/resource.h b/wince/resource.h deleted file mode 100644 index d0099cbc86..0000000000 --- a/wince/resource.h +++ /dev/null @@ -1,58 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by PocketSCUMM.rc -// -#define IDD_GAMESELECT 105 -#define IDD_SOUND_DIALOG 106 -#define IDB_SKIP 113 -#define IDB_DISK 115 -#define IDB_EXIT 116 -#define IDB_SOUND_ON 117 -#define IDB_SOUND_OFF 118 -#define IDB_PANEL 119 -#define IDI_POCKETSCUMM 127 -#define IDB_KEYBOARD 129 -#define IDL_POCKETSCUMM 130 -#define IDB_MENUTITLE 133 -#define IDD_DIALOG1 134 -#define IDM_MENU 1000 -#define IDC_ABOUT 1000 -#define IDC_MONKEY 1000 -#define IDC_OPTIONS 1000 -#define IDC_EXIT 1001 -#define IDC_MONKEY2 1001 -#define IDD_SLIDERMUSIC 1001 -#define IDC_ATLANTIS 1002 -#define IDD_SLIDERSFX 1002 -#define IDC_PLAYFATE 1003 -#define IDC_TENTACLE 1004 -#define IDC_DOTTDEMO 1005 -#define IDC_SAMNMAX 1006 -#define IDC_SNMDEMO 1007 -#define IDC_DISABLE_SOUND 1008 -#define IDC_SLOW_SOUND 1009 -#define IDC_FT 1010 -#define IDC_LISTAVAILABLE 1011 -#define IDC_GAMEDESC 1014 -#define IDC_PLAY 1015 -#define IDC_FILEPATH 1016 -#define IDC_SCAN 1018 -#define ID_POCKETSCUMM 40005 -#define IDS_CAP_POCKETSCUMM 40006 -#define IDC_LANDSCAPE 40007 -#define IDC_SKIP 40008 -#define IDC_LOADSAVE 40009 -#define IDC_SOUND 40011 -#define IDC_SOUNDVOL 40012 -#define IDM_POCKETSCUMM 40013 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 135 -#define _APS_NEXT_COMMAND_VALUE 40014 -#define _APS_NEXT_CONTROL_VALUE 1016 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/wince/screen.cpp b/wince/screen.cpp deleted file mode 100644 index 7dac8759ba..0000000000 --- a/wince/screen.cpp +++ /dev/null @@ -1,1588 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifdef _WIN32_WCE - -/* Original GFX code by Vasyl Tsvirkunov */ - -#include -#include -#include "gx.h" -#include "screen.h" -#include "resource.h" - -#define COLORCONV565(r,g,b) \ -(((r&0xf8)<<(11-3))|((g&0xfc)<<(5-2))|((b&0xf8)>>3)) -#define COLORCONV555(r,g,b) \ -(((r&0xf8)<<(10-3))|((g&0xf8)<<(5-2))|((b&0xf8)>>3)) -#define COLORCONVMONO(r,g,b) ((((3*r>>3)+(g>>1)+(b>>3))>>colorscale)^invert) - -#define MAX_CLR 0x100 -static UBYTE palRed[MAX_CLR]; -static UBYTE palGreen[MAX_CLR]; -static UBYTE palBlue[MAX_CLR]; -static unsigned short pal[MAX_CLR]; - /* First 10 and last 10 colors on palettized devices require special treatment */ -static UBYTE staticTranslate[20]; -static UBYTE invert = 0; -static int colorscale = 0; - -extern UBYTE item_toolbar[]; -extern UBYTE item_toolbar_colors[]; -extern UBYTE item_toolbarPortrait[]; -extern UBYTE item_toolbarPortrait_colors[]; -extern UBYTE item_keyboard[]; -extern UBYTE item_keyboard_colors[]; -extern UBYTE item_keyboardPortrait[]; -extern UBYTE item_keyboardPortrait_colors[]; -extern UBYTE item_disk[]; -extern UBYTE item_disk_colors[]; -extern UBYTE item_skip[]; -extern UBYTE item_skip_colors[]; -extern UBYTE item_soundOn[]; -extern UBYTE item_soundOn_colors[]; -extern UBYTE item_soundOff[]; -extern UBYTE item_soundOff_colors[]; -extern UBYTE item_monkeyLandscape[]; -extern UBYTE item_monkeyLandscape_colors[]; -extern UBYTE item_monkeyPortrait[]; -extern UBYTE item_monkeyPortrait_colors[]; -extern UBYTE item_loading[]; -extern UBYTE item_loading_colors[]; - - -extern bool sound_activated; -extern bool hide_toolbar; -bool toolbar_drawn; -bool draw_keyboard; - -GXDisplayProperties gxdp; -int active; - -struct tScreenGeometry -{ - long width; - long height; - long startoffset; - long sourceoffset; - long linestep; - long pixelstep; - long xSkipMask; - long xLimit; - long lineLimit; -}; - - -tScreenGeometry geom[3]; - -int currentScreenMode = 0; -int useMode = 0; -int maxMode = 2; -int filter_available; -int smooth_filter; -int toolbar_available; - -UBYTE *toolbar = NULL; - -/* Using vectorized function to save on branches */ -typedef void (*tCls)(); -typedef void (*tBlt)(UBYTE*); -typedef void (*tBlt_part)(UBYTE*,int, int, int, int, UBYTE*); - -void mono_Cls(); -void mono_Blt(UBYTE*); -void mono_Blt_part(UBYTE*, int, int, int, int, UBYTE*); - -void palette_Cls(); -void palette_Blt(UBYTE*); -void palette_Blt_part(UBYTE*, int, int, int, int, UBYTE*); - -void hicolor_Cls(); -void hicolor555_Blt(UBYTE*); -void hicolor555_Blt_part(UBYTE*, int, int, int, int, UBYTE*); -void hicolor565_Blt(UBYTE*); -void hicolor565_Blt_part(UBYTE*, int, int, int, int, UBYTE*); - -void palette_update(); - -static tCls pCls = NULL; -static tBlt pBlt = NULL; -static tBlt_part pBlt_part = NULL; - -static int _geometry_w; -static int _geometry_h; -static int _saved_geometry_h; - -HWND hWndMain; - - -void SetScreenMode(int mode) -{ - currentScreenMode = mode; - if(currentScreenMode > maxMode) - currentScreenMode = 0; -} - -int GetScreenMode() -{ - return currentScreenMode; -} - -void GraphicsSuspend() -{ - if(active) - { - active = 0; - GXSuspend(); - } -} - -void GraphicsResume() -{ - if(!active) - { - active = 1; - GXResume(); - } - - palette_update(); -} - -void GraphicsOff(void) -{ - GXCloseDisplay(); - active = 0; -} - -void SetScreenGeometry(int w, int h) { - // Complain (loudly) if w > 320 and h > 240 ... - if (w != 320 || h > 240) { - MessageBox(NULL, TEXT("Unsupported screen geometry !"), TEXT("Error"), MB_OK); - exit(1); - } - - _geometry_w = w; - _geometry_h = h; - _saved_geometry_h = h; - RestoreScreenGeometry(); -} - -void LimitScreenGeometry() { - - if (_geometry_h > 200) { - geom[0].lineLimit = _geometry_w*200; - geom[1].lineLimit = _geometry_w*200; - geom[1].lineLimit = _geometry_w*200; - _geometry_h = 200; - } -} - -void RestoreScreenGeometry() { - _geometry_h = _saved_geometry_h; - geom[0].lineLimit = _geometry_w * _geometry_h; - geom[1].lineLimit = _geometry_w * _geometry_h; - geom[2].lineLimit = _geometry_w * _geometry_h; -} - -int GraphicsOn(HWND hWndMain_param) -{ - hWndMain = hWndMain_param; - GXOpenDisplay(hWndMain, GX_FULLSCREEN); - - gxdp = GXGetDisplayProperties(); - - if(gxdp.ffFormat & kfDirect565) - { - pCls = hicolor_Cls; - pBlt = hicolor565_Blt; - pBlt_part = hicolor565_Blt_part; - filter_available = 1; - smooth_filter = 1; - toolbar_available = 1; - } - else if(gxdp.ffFormat & kfDirect555) - { - pCls = hicolor_Cls; - pBlt = hicolor555_Blt; - pBlt_part = hicolor555_Blt_part; - filter_available = 1; - smooth_filter = 1; - toolbar_available = 1; - } - else if((gxdp.ffFormat & kfDirect) && (gxdp.cBPP <= 8)) - { - pCls = mono_Cls; - pBlt = mono_Blt; - pBlt_part = mono_Blt_part; - - if(gxdp.ffFormat & kfDirectInverted) - invert = (1<= 4) - filter_available = 1; - - toolbar_available = 1; - } - else if(gxdp.ffFormat & kfPalette) - { - pCls = palette_Cls; - pBlt = palette_Blt; - pBlt_part = palette_Blt_part; - - toolbar_available = 1; - } - - - if(!pCls || !pBlt || gxdp.cxWidth < 240 || gxdp.cyHeight < -240) - { - // I don't believe there are devices that end up here - GraphicsOff(); - return 1; - } - - // portrait - geom[0].width = gxdp.cxWidth; // 240 - geom[0].height = gxdp.cyHeight; // 320 - geom[0].startoffset = 0; - geom[0].sourceoffset = 0; - geom[0].linestep = gxdp.cbyPitch; - geom[0].pixelstep = gxdp.cbxPitch; - geom[0].xSkipMask = gxdp.cxWidth < 320 ? 0x00000003 : 0xffffffff; - geom[0].xLimit = 320; // skip 1/4 - geom[0].lineLimit = 320*200; - - // left handed landscape - geom[1].width = gxdp.cyHeight; // 320 - geom[1].height = gxdp.cxWidth; // 240 - geom[1].startoffset = gxdp.cbyPitch*(gxdp.cyHeight-1); - geom[1].sourceoffset = 0; - geom[1].linestep = gxdp.cbxPitch; - geom[1].pixelstep = -gxdp.cbyPitch; - geom[1].xSkipMask = 0xffffffff; - geom[1].xLimit = 320; // no skip - geom[1].lineLimit = 320*200; - - // right handed landscape - geom[2].width = gxdp.cyHeight; // 320 - geom[2].height = gxdp.cxWidth; // 240 - geom[2].startoffset = gxdp.cbxPitch*(gxdp.cxWidth-1); - geom[2].sourceoffset = 0; - geom[2].linestep = -gxdp.cbxPitch; - geom[2].pixelstep = gxdp.cbyPitch; - geom[2].xSkipMask = 0xffffffff; - geom[2].xLimit = 320; // no skip - geom[2].lineLimit = 320*200; - - if(gxdp.cyHeight < 320) - maxMode = 0; // portrait only! - - /* - for(int i = 0; i < MAX_CLR; i++) - { - SetPalEntry(i, (colortable[i] >> 16) & 0xff, - (colortable[i] >> 8) & 0xff, - (colortable[i]) & 0xff); - } - */ - - //palette_update(); - - active = 1; - return 0; -} - -/* Find the best color match in the palette (limited to 'limit' entries) */ - UBYTE best_match(UBYTE r, UBYTE g, UBYTE b, int limit) - { - UBYTE best = 0; - int distance = 768; - int i, d; - for(i=0; ipalVersion = 0x300; - ple->palNumEntries = 256; - for(int i=0; i<236; i++) // first 10 and last ten belong to the system! - { - ple->palPalEntry[i+10].peBlue = palBlue[i]; - ple->palPalEntry[i+10].peGreen = palGreen[i]; - ple->palPalEntry[i+10].peRed = palRed[i]; - ple->palPalEntry[i+10].peFlags = PC_RESERVED; - } - HDC hDC = GetDC(hWndMain); - GetSystemPaletteEntries(hDC, 0, 10, &(ple->palPalEntry[0])); - GetSystemPaletteEntries(hDC, 246, 10, &(ple->palPalEntry[246])); - HPALETTE hpal = CreatePalette(ple); - SelectPalette(hDC, hpal, FALSE); - RealizePalette(hDC); - DeleteObject((HGDIOBJ)hpal); - ReleaseDC(hWndMain, hDC); - free((void*)ple); - - for(i=0; i<20; i++) - staticTranslate[i] = best_match(palRed[i+236], palGreen[i+236], palBlue[i+236], 236)+10; - - } -} - -void SetPalEntry(int ent, UBYTE r, UBYTE g, UBYTE b) -{ - if (ent >= MAX_CLR) - return; - - palRed[ent] = r; - palGreen[ent] = g; - palBlue[ent] = b; - - if(gxdp.ffFormat & kfDirect565) - pal[ent] = COLORCONV565(r,g,b); - else if(gxdp.ffFormat & kfDirect555) - pal[ent] = COLORCONV555(r,g,b); - else if(gxdp.ffFormat & kfDirect) - pal[ent] = COLORCONVMONO(r,g,b); -} - -/* *************** CLS IMPLEMENTATIONS ****************** */ - -void mono_Cls() -{ - int x, y; - UBYTE* dst; - UBYTE *scraddr; - int linestep, pixelstep; - UBYTE fillcolor; - - fillcolor = (gxdp.ffFormat & kfDirectInverted) ? 0xff : 0x00; - - pixelstep = geom[0].pixelstep; - if(pixelstep == 0) - return; - linestep = (pixelstep > 0) ? -1 : 1; - - scraddr = (UBYTE*)GXBeginDraw(); - if(scraddr) - { - for(y=0; y= x1 && y >= y1) && (x <= x2 && y <= y2)); -} - -ToolbarSelected getToolbarSelection (int x, int y) { - int test_x, test_y; - - /* - if (!currentScreenMode) - return ToolbarNone; - */ - - if (!(x >= 10 && y >= 204)) - return ToolbarNone; - - test_x = 10; - test_y = (currentScreenMode ? 204 : 240); - if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) - return ToolbarSaveLoad; - test_x += 40; - if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) - return ToolbarSkip; - test_x += 40; - if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) - return ToolbarSound; - test_x += 40; - if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32)) - return ToolbarMode; - return ToolbarNone; -} - -/* ************************** BLT IMPLEMENTATION **************************** */ - -void Blt(UBYTE * scr_ptr) -{ - pBlt(scr_ptr); - - //if (toolbar_available && currentScreenMode && !toolbar_drawn) - if (toolbar_available && !toolbar_drawn && !hide_toolbar) - drawAllToolbar(); - -} - - -#define ADVANCE_PARTIAL(address, step) \ - bitshift += gxdp.cBPP; \ - if(bitshift >= 8) \ - { \ - bitshift = 0; \ - bitmask = (1<>= gxdp.cBPP; - - -void mono_Blt(UBYTE *src_ptr) { - mono_Blt_part(src_ptr, 0, 0, _geometry_w, _geometry_h, NULL); -} - - -void mono_Blt_part(UBYTE * scr_ptr, int x, int y, int width, int height, - UBYTE * own_palette) -{ -// Mono blit routines contain good deal of voodoo - static UBYTE *src; - static UBYTE *dst; - static UBYTE *scraddr; - static UBYTE *scr_ptr_limit; - static UBYTE *src_limit; - static long pixelstep; - static long linestep; - static long skipmask; - -// Special code is used to deal with packed pixels in monochrome mode - static UBYTE bitmask; - static int bitshift; - - if(!active) - { - Sleep(100); - return; - } - - /* Update screen mode, also thread protection by doing this */ - if(useMode != currentScreenMode) - { - useMode = currentScreenMode; - pCls(); - } - - pixelstep = geom[useMode].pixelstep; - linestep = geom[useMode].linestep; - skipmask = geom[useMode].xSkipMask; - - scraddr = (UBYTE*)GXBeginDraw(); - - if(pixelstep) - { - // this will work on mono iPAQ and @migo, don't know about any others - linestep = (pixelstep > 0) ? -1 : 1; - - bitshift = 0; - bitmask = (1<= 4) - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - while(src < src_limit) - { - UBYTE r, g, b; - - if (!own_palette) { - r = (3*palRed[*(src+0)] + palRed[*(src+1)])>>2; - g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; - b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; - } else { - r = (3 * own_palette[3 * *(src + 0)] + - own_palette[3 * *(src + 1)]) >> 2; - g = (3 * own_palette[3 * *(src + 0) + 1] + - own_palette[3 * *(src + 1) + 1]) >> 2; - b = (3 * own_palette[3 * *(src + 0) + 2] + - own_palette[3 * *(src + 1) + 2]) >> 2; - } - - - *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)<>1; - g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; - b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; - } - else { - r = (own_palette[3 * *(src + 1)] + - own_palette[3 * *(src + 2)]) >> 2; - g = (own_palette[3 * *(src + 1) + 1] + - own_palette[3 * *(src + 2) + 1]) >> 2; - b = (own_palette[3 * *(src + 1) + 2] + - own_palette[3 * *(src + 2) + 2]) >> 2; - } - - *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)<>2; - g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; - b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; - } - else { - r = (own_palette[3 * *(src + 2)] + - 3 * own_palette[3 * *(src + 3)]) >> 2; - g = (own_palette[3 * *(src + 2) + 1] + - 3 * own_palette[3 * *(src + 3) + 1]) >> 2; - b = (own_palette[3 * *(src + 2) + 2] + - 3 * own_palette[3 * *(src + 3) + 2]) >> 2; - - } - - *dst = (*dst & ~bitmask) | (COLORCONVMONO(r,g,b)< 0) ? 1 : -1; - - if(scraddr) - { - - scraddr += geom[useMode].startoffset; - scr_ptr += geom[useMode].sourceoffset; - //scr_ptr_limit = scr_ptr + geom[useMode].lineLimit; - //src_limit = scr_ptr + geom[useMode].xLimit; - - /* Update offsets to the current line */ - scraddr += y * linestep; - scr_ptr_limit = scr_ptr + width * height; - src_limit = scr_ptr + width; - - if(skipmask != 0xffffffff) - { - if(pixelstep > 0) - { - bitshift = 8-gxdp.cBPP; - bitmask = ((1< 0) - { - bitshift = 8-gxdp.cBPP; - bitmask = ((1<>2; - g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; - b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; - } else { - r = (3 * own_palette[3 * *(src + 0)] + - own_palette[3 * *(src + 1)]) >> 2; - g = (3 * own_palette[3 * *(src + 0) + 1] + - own_palette[3 * *(src + 1) + 1]) >> 2; - b = (3 * own_palette[3 * *(src + 0) + 2] + - own_palette[3 * *(src + 1) + 2]) >> 2; - } - - *(unsigned short*)dst = COLORCONV555(r,g,b); - - dst += pixelstep; - - if (!own_palette) { - r = (palRed[*(src+1)] + palRed[*(src+2)])>>1; - g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; - b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; - } - else { - r = (own_palette[3 * *(src + 1)] + - own_palette[3 * *(src + 2)]) >> 2; - g = (own_palette[3 * *(src + 1) + 1] + - own_palette[3 * *(src + 2) + 1]) >> 2; - b = (own_palette[3 * *(src + 1) + 2] + - own_palette[3 * *(src + 2) + 2]) >> 2; - } - - *(unsigned short*)dst = COLORCONV555(r,g,b); - - dst += pixelstep; - - if (!own_palette) { - r = (palRed[*(src+2)] + 3*palRed[*(src+3)])>>2; - g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; - b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; - } - else { - r = (own_palette[3 * *(src + 2)] + - 3 * own_palette[3 * *(src + 3)]) >> 2; - g = (own_palette[3 * *(src + 2) + 1] + - 3 * own_palette[3 * *(src + 3) + 1]) >> 2; - b = (own_palette[3 * *(src + 2) + 2] + - 3 * own_palette[3 * *(src + 3) + 2]) >> 2; - - } - - *(unsigned short*)dst = COLORCONV555(r,g,b); - - dst += pixelstep; - - src += 4; - } - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - else if(skipmask != 0xffffffff) - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - - while(src < src_limit) - { - if((long)src & skipmask) - { - if (!own_palette) - *(unsigned short*)dst = pal[*src]; - else - *(unsigned short*)dst = - COLORCONV555(own_palette[3 * *src], - own_palette[(3 * *src) + 1], - own_palette[(3 * *src) + 2]); - dst += pixelstep; - } - src ++; - } - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - else - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - - while(src < src_limit) - { - if (!own_palette) - *(unsigned short*)dst = pal[*src]; - else - *(unsigned short*)dst = - COLORCONV565(own_palette[3 * *src], - own_palette[(3 * *src) + 1], - own_palette[(3 * *src) + 2]); - dst += pixelstep; - src ++; - } - - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - - GXEndDraw(); - } -} - -void hicolor565_Blt(UBYTE *src_ptr) { - hicolor565_Blt_part(src_ptr, 0, 0, _geometry_w, _geometry_h, NULL); -} - -void hicolor565_Blt_part(UBYTE * scr_ptr, int x, int y, int width, int height, - UBYTE * own_palette) -{ - static UBYTE *src; - static UBYTE *dst; - static UBYTE *scraddr; - static UBYTE *scr_ptr_limit; - static UBYTE *src_limit; - static long pixelstep; - static long linestep; - static long skipmask; - - if(!active) - { - Sleep(100); - return; - } - - /* Update screen mode, also thread protection by doing this */ - if(useMode != currentScreenMode) - { - useMode = currentScreenMode; - pCls(); - } - - pixelstep = geom[useMode].pixelstep; - linestep = geom[useMode].linestep; - skipmask = geom[useMode].xSkipMask; - - scraddr = (UBYTE*)GXBeginDraw(); - if(scraddr) - { - - scraddr += geom[useMode].startoffset; - scr_ptr += geom[useMode].sourceoffset; - //scr_ptr_limit = scr_ptr + geom[useMode].lineLimit; - //src_limit = scr_ptr + geom[useMode].xLimit; - - /* Update offsets to the current line */ - scraddr += y * linestep; - scr_ptr_limit = scr_ptr + width * height; - src_limit = scr_ptr + width; - - /* Internal pixel loops */ - if(skipmask == 3 && smooth_filter) - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - while(src < src_limit) - { - UBYTE r, g, b; - if (!own_palette) { - r = (3*palRed[*(src+0)] + palRed[*(src+1)])>>2; - g = (3*palGreen[*(src+0)] + palGreen[*(src+1)])>>2; - b = (3*palBlue[*(src+0)] + palBlue[*(src+1)])>>2; - } else { - r = (3 * own_palette[3 * *(src + 0)] + - own_palette[3 * *(src + 1)]) >> 2; - g = (3 * own_palette[3 * *(src + 0) + 1] + - own_palette[3 * *(src + 1) + 1]) >> 2; - b = (3 * own_palette[3 * *(src + 0) + 2] + - own_palette[3 * *(src + 1) + 2]) >> 2; - } - - *(unsigned short*)dst = COLORCONV565(r,g,b); - - dst += pixelstep; - - if (!own_palette) { - r = (palRed[*(src+1)] + palRed[*(src+2)])>>1; - g = (palGreen[*(src+1)] + palGreen[*(src+2)])>>1; - b = (palBlue[*(src+1)] + palBlue[*(src+2)])>>1; - } - else { - r = (own_palette[3 * *(src + 1)] + - own_palette[3 * *(src + 2)]) >> 1; - g = (own_palette[3 * *(src + 1) + 1] + - own_palette[3 * *(src + 2) + 1]) >> 1; - b = (own_palette[3 * *(src + 1) + 2] + - own_palette[3 * *(src + 2) + 2]) >> 1; - } - - *(unsigned short*)dst = COLORCONV565(r,g,b); - - dst += pixelstep; - - if (!own_palette) { - r = (palRed[*(src+2)] + 3*palRed[*(src+3)])>>2; - g = (palGreen[*(src+2)] + 3*palGreen[*(src+3)])>>2; - b = (palBlue[*(src+2)] + 3*palBlue[*(src+3)])>>2; - } - else { - r = (own_palette[3 * *(src + 2)] + - 3 * own_palette[3 * *(src + 3)]) >> 2; - g = (own_palette[3 * *(src + 2) + 1] + - 3 * own_palette[3 * *(src + 3) + 1]) >> 2; - b = (own_palette[3 * *(src + 2) + 2] + - 3 * own_palette[3 * *(src + 3) + 2]) >> 2; - - } - - *(unsigned short*)dst = COLORCONV565(r,g,b); - - dst += pixelstep; - - src += 4; - } - - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - else if(skipmask != 0xffffffff) - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - while(src < src_limit) - { - if((long)src & skipmask) - { - if (!own_palette) - *(unsigned short*)dst = pal[*src]; - else - *(unsigned short*)dst = - COLORCONV565(own_palette[3 * *src], - own_palette[(3 * *src) + 1], - own_palette[(3 * *src) + 2]); - dst += pixelstep; - } - src ++; - } - - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - else - { - while(scr_ptr < scr_ptr_limit) - { - int i; - - src = scr_ptr; - dst = scraddr; - - /* skip non updated pixels for this line */ - for (i=0; i < x; i++) - dst += pixelstep; - - while(src < src_limit) - { - if (!own_palette) - *(unsigned short*)dst = pal[*src]; - else - *(unsigned short*)dst = - COLORCONV565(own_palette[3 * *src], - own_palette[(3 * *src) + 1], - own_palette[(3 * *src) + 2]); - dst += pixelstep; - src ++; - } - - scraddr += linestep; - scr_ptr += width; - src_limit += width; - } - } - - GXEndDraw(); - } -} - - -void Translate(int* px, int* py) -{ - int x, y; - - switch(currentScreenMode) - { - case 0: /* portrait */ - *px = *px*4/3; - break; - case 1: /* landscape left */ - x = 320 - *py; - y = *px; - *px = x; - *py = y; - break; - case 2: /* landscape right */ - x = *py; - y = 240 - *px; - *px = x; - *py = y; - break; - } -} - -#endif diff --git a/wince/screen.h b/wince/screen.h deleted file mode 100644 index c7eb2b3af5..0000000000 --- a/wince/screen.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -/* Original code by Vasyl Tsvirkunov */ - -#ifndef SCREEN_H -#define SCREEN_H - -#ifndef UBYTE -#define UBYTE unsigned char -#endif - -void SetScreenGeometry(int w, int h); -void LimitScreenGeometry(); -void RestoreScreenGeometry(); -int GraphicsOn(HWND hWndMain); -void GraphicsOff(); -void GraphicsSuspend(); -void GraphicsResume(); - -void SetPalEntry(int ent, UBYTE r, UBYTE g, UBYTE b); -void Blt(UBYTE * scr_ptr); - -/* meaning: 0 - portrait, 1 - left hand landscape, 2 - right hand landscape */ -void SetScreenMode(int mode); -int GetScreenMode(); -void drawWait(); - -void Translate(int* x, int* y); - -typedef enum ToolbarSelected { - ToolbarNone, - ToolbarSaveLoad, - ToolbarMode, - ToolbarSkip, - ToolbarSound -} ToolbarSelected; - - -#endif diff --git a/x11.cpp b/x11.cpp deleted file mode 100644 index 2ebbe96193..0000000000 --- a/x11.cpp +++ /dev/null @@ -1,990 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001/2002 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -/* The bare pure X11 port done by Lionel 'BBrox' Ulmer */ - -#include "stdafx.h" -#include "scumm.h" -#include "mididrv.h" -#include "gameDetector.h" - -#include -#include - -#include -#include - -#include -#include -#include -#ifdef USE_XV_SCALING -#include -#include -#endif -#include - -#include -#include - -#include -#include -#include -#include - -class OSystem_X11:public OSystem { -public: - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - void init_size(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - void update_screen(); - - // Either show or hide the mouse cursor - bool show_mouse(bool visible); - - // Set the position of the mouse cursor - void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); - - // Shaking is used in SCUMM. Set current shake position. - void set_shake_pos(int shake_pos); - - // Get the number of milliseconds since the program was started. - uint32 get_msecs(); - - // Delay for a specified amount of milliseconds - void delay_msecs(uint msecs); - - // Create a thread - void *create_thread(ThreadProc *proc, void *param); - - // Get the next event. - // Returns true if an event was retrieved. - bool poll_event(Event *event); - - // Set function that generates samples - bool set_sound_proc(void *param, SoundProc *proc, byte sound); - - // Poll cdrom status - // Returns true if cd audio is playing - bool poll_cdrom(); - - // Play cdrom audio track - void play_cdrom(int track, int num_loops, int start_frame, int end_frame); - - // Stop cdrom audio track - void stop_cdrom(); - - // Update cdrom audio status - void update_cdrom(); - - // Quit - void quit(); - - // Set a parameter - uint32 property(int param, Property *value); - - // Add a callback timer - void set_timer(int timer, int (*callback) (int)); - - // Mutex handling - void *create_mutex(void); - void lock_mutex(void *mutex); - void unlock_mutex(void *mutex); - void delete_mutex(void *mutex); - - static OSystem *create(int gfx_mode, bool full_screen); - -private: - OSystem_X11(); - - typedef struct { - int x, y, w, h; - } dirty_square; - - void create_empty_cursor(); - void undraw_mouse(); - void draw_mouse(); - void update_screen_helper(const dirty_square * d, dirty_square * dout); - - unsigned char *local_fb; - - int window_width, window_height; - int fb_width, fb_height; - int scumm_x, scumm_y; - -#ifdef USE_XV_SCALING - unsigned int *palette; -#else - unsigned short *palette; -#endif - bool _palette_changed; - Display *display; - int screen; - Window window; - GC black_gc; -#ifdef USE_XV_SCALING - XvImage *image; -#else - XImage *image; -#endif - pthread_t sound_thread; - - int fake_right_mouse; - int report_presses; - int current_shake_pos; - int new_shake_pos; - struct timeval start_time; - - enum { - MAX_NUMBER_OF_DIRTY_SQUARES = 32, - BAK_WIDTH = 40, - BAK_HEIGHT = 40 - }; - dirty_square ds[MAX_NUMBER_OF_DIRTY_SQUARES]; - int num_of_dirty_square; - - typedef struct { - int x, y; - int w, h; - int hot_x, hot_y; - } mouse_state; - mouse_state old_state, cur_state; - const byte *_ms_buf; - byte _ms_backup[BAK_WIDTH * BAK_HEIGHT]; - bool _mouse_drawn; - bool _mouse_visible; - - unsigned int _timer_duration, _timer_next_expiry; - bool _timer_active; - int (*_timer_callback) (int); -}; - -typedef struct { - OSystem::SoundProc *sound_proc; - void *param; - byte format; -} THREAD_PARAM; - -#undef CAPTURE_SOUND - -#define FRAG_SIZE 4096 -static void *sound_and_music_thread(void *params) -{ - /* Init sound */ - int sound_fd, param, frag_size; - unsigned char sound_buffer[FRAG_SIZE]; - OSystem::SoundProc *sound_proc = ((THREAD_PARAM *) params)->sound_proc; - void *proc_param = ((THREAD_PARAM *) params)->param; - -#ifdef CAPTURE_SOUND - FILE *f = fopen("sound.raw", "wb"); -#endif - - sound_fd = open("/dev/dsp", O_WRONLY); - audio_buf_info info; - if (sound_fd < 0) { - error("Error opening sound device !\n"); - exit(1); - } - param = 0; - frag_size = FRAG_SIZE /* audio fragment size */ ; - while (frag_size) { - frag_size >>= 1; - param++; - } - param--; - param |= /* audio_fragment_num */ 3 << 16; - if (ioctl(sound_fd, SNDCTL_DSP_SETFRAGMENT, ¶m) != 0) { - error("Error in the SNDCTL_DSP_SETFRAGMENT ioctl !\n"); - exit(1); - } - param = AFMT_S16_LE; - if (ioctl(sound_fd, SNDCTL_DSP_SETFMT, ¶m) == -1) { - perror("Error in the SNDCTL_DSP_SETFMT ioctl !\n"); - exit(1); - } - if (param != AFMT_S16_LE) { - error("AFMT_S16_LE not supported !\n"); - exit(1); - } - param = 2; - if (ioctl(sound_fd, SNDCTL_DSP_CHANNELS, ¶m) == -1) { - error("Error in the SNDCTL_DSP_CHANNELS ioctl !\n"); - exit(1); - } - if (param != 2) { - error("Stereo mode not supported !\n"); - exit(1); - } - param = 22050; - if (ioctl(sound_fd, SNDCTL_DSP_SPEED, ¶m) == -1) { - perror("Error in the SNDCTL_DSP_SPEED ioctl !\n"); - exit(1); - } - if (param != 22050) { - error("22050 kHz not supported !\n"); - exit(1); - } - if (ioctl(sound_fd, SNDCTL_DSP_GETOSPACE, &info) != 0) { - perror("SNDCTL_DSP_GETOSPACE"); - exit(-1); - } - - sched_yield(); - while (1) { - unsigned char *buf = (unsigned char *)sound_buffer; - int size, written; - - sound_proc(proc_param, (byte *)sound_buffer, FRAG_SIZE); -#ifdef CAPTURE_SOUND - fwrite(buf, 2, FRAG_SIZE >> 1, f); - fflush(f); -#endif - size = FRAG_SIZE; - while (size > 0) { - written = write(sound_fd, buf, size); - buf += written; - size -= written; - } - } - - return NULL; -} - -/* Function used to hide the mouse cursor */ -void OSystem_X11::create_empty_cursor() -{ - XColor bg; - Pixmap pixmapBits; - Cursor cursor = None; - static const char data[] = { 0 }; - - bg.red = bg.green = bg.blue = 0x0000; - pixmapBits = XCreateBitmapFromData(display, XRootWindow(display, screen), data, 1, 1); - if (pixmapBits) { - cursor = XCreatePixmapCursor(display, pixmapBits, pixmapBits, &bg, &bg, 0, 0); - XFreePixmap(display, pixmapBits); - } - XDefineCursor(display, window, cursor); -} - -OSystem *OSystem_X11_create(void) -{ - return OSystem_X11::create(0, 0); -} - -OSystem *OSystem_X11::create(int gfx_mode, bool full_screen) -{ - OSystem_X11 *syst = new OSystem_X11(); - return syst; -} - -OSystem_X11::OSystem_X11() -{ - char buf[512]; - XWMHints *wm_hints; - XGCValues values; - XTextProperty window_name; - char *name = (char *)&buf; - - /* Some members initialization */ - fake_right_mouse = 0; - report_presses = 1; - current_shake_pos = 0; - new_shake_pos = 0; - _palette_changed = false; - num_of_dirty_square = MAX_NUMBER_OF_DIRTY_SQUARES; - - /* For the window title */ - sprintf(buf, "ScummVM"); - - display = XOpenDisplay(NULL); - if (display == NULL) { - error("Could not open display !\n"); - exit(1); - } - screen = DefaultScreen(display); - - window_width = 320; - window_height = 200; - scumm_x = 0; - scumm_y = 0; - window = XCreateSimpleWindow(display, XRootWindow(display, screen), 0, 0, 320, 200, 0, 0, 0); - wm_hints = XAllocWMHints(); - if (wm_hints == NULL) { - error("Not enough memory to allocate Hints !\n"); - exit(1); - } - wm_hints->flags = InputHint | StateHint; - wm_hints->input = True; - wm_hints->initial_state = NormalState; - XStringListToTextProperty(&name, 1, &window_name); - XSetWMProperties(display, window, &window_name, &window_name, - NULL /* argv */ , 0 /* argc */ , NULL /* size hints */ , - wm_hints, NULL /* class hints */ ); - XFree(wm_hints); - - XSelectInput(display, window, - ExposureMask | KeyPressMask | KeyReleaseMask | - PointerMotionMask | ButtonPressMask | ButtonReleaseMask | StructureNotifyMask); - - values.foreground = BlackPixel(display, screen); - black_gc = XCreateGC(display, window, GCForeground, &values); - - XMapWindow(display, window); - XFlush(display); - - while (1) { - XEvent event; - XNextEvent(display, &event); - switch (event.type) { - case Expose: - goto out_of_loop; - } - } -out_of_loop: - create_empty_cursor(); - - /* Initialize the timer routines */ - _timer_active = false; - - /* And finally start the local timer */ - gettimeofday(&start_time, NULL); -} - -uint32 OSystem_X11::get_msecs() -{ - struct timeval current_time; - gettimeofday(¤t_time, NULL); - return (uint32)(((current_time.tv_sec - start_time.tv_sec) * 1000) + - ((current_time.tv_usec - start_time.tv_usec) / 1000)); -} - -void OSystem_X11::init_size(uint w, uint h) -{ - static XShmSegmentInfo shminfo; - - fb_width = w; - fb_height = h; - - if ((fb_width != 320) || (fb_height != 200)) { - /* We need to change the size of the X11 window */ - XWindowChanges new_values; - - new_values.width = fb_width; - new_values.height = fb_height; - - XConfigureWindow(display, window, CWWidth | CWHeight, &new_values); - } -#ifdef USE_XV_SCALING - image = XvShmCreateImage(display, 65, 0x03, 0, fb_width, fb_height, &shminfo); - shminfo.shmid = shmget(IPC_PRIVATE, image->data_size, IPC_CREAT | 0700); -#else - image = - XShmCreateImage(display, DefaultVisual(display, screen), 16, ZPixmap, NULL, &shminfo, fb_width, - fb_height); - shminfo.shmid = shmget(IPC_PRIVATE, fb_width * fb_height * 2, IPC_CREAT | 0700); -#endif - shminfo.shmaddr = (char *)shmat(shminfo.shmid, 0, 0); - image->data = shminfo.shmaddr; - shminfo.readOnly = False; - if (XShmAttach(display, &shminfo) == 0) { - error("Could not attach shared memory segment !\n"); - exit(1); - } - shmctl(shminfo.shmid, IPC_RMID, 0); - - /* Initialize the 'local' frame buffer and the palette */ - local_fb = (unsigned char *)calloc(fb_width * fb_height, sizeof(unsigned char)); -#ifdef USE_XV_SCALING - palette = (unsigned int *)calloc(256, sizeof(unsigned int)); -#else - palette = (unsigned short *)calloc(256, sizeof(unsigned short)); -#endif -} - -bool OSystem_X11::set_sound_proc(void *param, SoundProc *proc, byte format) -{ - static THREAD_PARAM thread_param; - - /* And finally start the music thread */ - thread_param.param = param; - thread_param.sound_proc = proc; - thread_param.format = format; - - if (format == SOUND_16BIT) - pthread_create(&sound_thread, NULL, sound_and_music_thread, (void *)&thread_param); - else - warning("Only support 16 bit sound for now. Disabling sound "); - - return true; -} - -void OSystem_X11::set_palette(const byte *colors, uint start, uint num) -{ - const byte *data = colors; -#ifdef USE_XV_SCALING - unsigned int *pal = &(palette[start]); -#else - unsigned short *pal = &(palette[start]); -#endif - - do { -#ifdef USE_XV_SCALING - *pal++ = (data[0] << 16) | (data[1] << 8) | data[2]; -#else - *pal++ = ((data[0] & 0xF8) << 8) | ((data[1] & 0xFC) << 3) | (data[2] >> 3); -#endif - data += 4; - num--; - } while (num > 0); - - _palette_changed = true; -} - -#define AddDirtyRec(xi,yi,wi,hi) \ - if (num_of_dirty_square < MAX_NUMBER_OF_DIRTY_SQUARES) { \ - ds[num_of_dirty_square].x = xi; \ - ds[num_of_dirty_square].y = yi; \ - ds[num_of_dirty_square].w = wi; \ - ds[num_of_dirty_square].h = hi; \ - num_of_dirty_square++; \ - } - -void OSystem_X11::copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) -{ - unsigned char *dst; - - if (y < 0) { - h += y; - buf -= y * pitch; - y = 0; - } - if (h > (fb_height - y)) { - h = fb_height - y; - } - - dst = local_fb + fb_width * y + x; - - if (h <= 0) - return; - - if (_mouse_drawn) - undraw_mouse(); - - AddDirtyRec(x, y, w, h); - while (h-- > 0) { - memcpy(dst, buf, w); - dst += fb_width; - buf += pitch; - } -} - -void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * dout) -{ - int x, y; - unsigned char *ptr_src = local_fb + (fb_width * d->y) + d->x; -#ifdef USE_XV_SCALING - unsigned int *ptr_dst = ((unsigned int *)image->data) + (fb_width * d->y) + d->x; -#else - unsigned short *ptr_dst = ((unsigned short *)image->data) + (fb_width * d->y) + d->x; -#endif - - for (y = 0; y < d->h; y++) { - for (x = 0; x < d->w; x++) { - *ptr_dst++ = palette[*ptr_src++]; - } - ptr_dst += fb_width - d->w; - ptr_src += fb_width - d->w; - } - if (d->x < dout->x) - dout->x = d->x; - if (d->y < dout->y) - dout->y = d->y; - if ((d->x + d->w) > dout->w) - dout->w = d->x + d->w; - if ((d->y + d->h) > dout->h) - dout->h = d->y + d->h; -} - -void OSystem_X11::update_screen() -{ - bool full_redraw = false; - bool need_redraw = false; - static const dirty_square ds_full = { 0, 0, fb_width, fb_height }; - dirty_square dout = { fb_width, fb_height, 0, 0 }; - - /* First make sure the mouse is drawn, if it should be drawn. */ - draw_mouse(); - - if (_palette_changed) { - full_redraw = true; - num_of_dirty_square = 0; - _palette_changed = false; - } else if (num_of_dirty_square >= MAX_NUMBER_OF_DIRTY_SQUARES) { - full_redraw = true; - num_of_dirty_square = 0; - } - - if (full_redraw) { - update_screen_helper(&ds_full, &dout); - need_redraw = true; - } else if (num_of_dirty_square > 0) { - need_redraw = true; - while (num_of_dirty_square > 0) { - num_of_dirty_square--; - update_screen_helper(&(ds[num_of_dirty_square]), &dout); - } - } - - if (current_shake_pos != new_shake_pos) { - /* Redraw first the 'black borders' in case of resize */ - if (current_shake_pos < new_shake_pos) - XFillRectangle(display, window, black_gc, 0, current_shake_pos, window_width, new_shake_pos); - else - XFillRectangle(display, window, black_gc, 0, window_height - current_shake_pos, - window_width, window_height - new_shake_pos); -#ifndef USE_XV_SCALING - XShmPutImage(display, window, DefaultGC(display, screen), image, - 0, 0, scumm_x, scumm_y + new_shake_pos, fb_width, fb_height, 0); -#endif - current_shake_pos = new_shake_pos; - } else if (need_redraw == true) { -#ifdef USE_XV_SCALING - XvShmPutImage(display, 65, window, DefaultGC(display, screen), image, - 0, 0, fb_width, fb_height, 0, 0, window_width, window_height, 0); -#else - XShmPutImage(display, window, DefaultGC(display, screen), image, - dout.x, dout.y, scumm_x + dout.x, scumm_y + dout.y + current_shake_pos, - dout.w - dout.x, dout.h - dout.y, 0); -#endif - XFlush(display); - } -} - -bool OSystem_X11::show_mouse(bool visible) -{ - if (_mouse_visible == visible) - return visible; - - bool last = _mouse_visible; - _mouse_visible = visible; - - if (visible) - draw_mouse(); - else - undraw_mouse(); - - return last; -} - -void OSystem_X11::quit() -{ - exit(1); -} - -void OSystem_X11::draw_mouse() -{ - if (_mouse_drawn || !_mouse_visible) - return; - _mouse_drawn = true; - - int xdraw = cur_state.x - cur_state.hot_x; - int ydraw = cur_state.y - cur_state.hot_y; - int w = cur_state.w; - int h = cur_state.h; - int real_w; - int real_h; - int real_h_2; - - byte *dst; - byte *dst2; - const byte *buf = _ms_buf; - byte *bak = _ms_backup; - - assert(w <= BAK_WIDTH && h <= BAK_HEIGHT); - - if (ydraw < 0) { - real_h = h + ydraw; - buf += (-ydraw) * w; - ydraw = 0; - } else { - real_h = (ydraw + h) > fb_height ? (fb_height - ydraw) : h; - } - if (xdraw < 0) { - real_w = w + xdraw; - buf += (-xdraw); - xdraw = 0; - } else { - real_w = (xdraw + w) > fb_width ? (fb_width - xdraw) : w; - } - - dst = local_fb + (ydraw * fb_width) + xdraw; - dst2 = dst; - - if ((real_h == 0) || (real_w == 0)) { - _mouse_drawn = false; - return; - } - - AddDirtyRec(xdraw, ydraw, real_w, real_h); - old_state.x = xdraw; - old_state.y = ydraw; - old_state.w = real_w; - old_state.h = real_h; - - real_h_2 = real_h; - while (real_h_2 > 0) { - memcpy(bak, dst, real_w); - bak += BAK_WIDTH; - dst += fb_width; - real_h_2--; - } - while (real_h > 0) { - int width = real_w; - while (width > 0) { - byte color = *buf; - if (color != 0xFF) { - *dst2 = color; - } - buf++; - dst2++; - width--; - } - buf += w - real_w; - dst2 += fb_width - real_w; - real_h--; - } -} - -void OSystem_X11::undraw_mouse() -{ - if (!_mouse_drawn) - return; - _mouse_drawn = false; - - int old_h = old_state.h; - - AddDirtyRec(old_state.x, old_state.y, old_state.w, old_state.h); - - byte *dst = local_fb + (old_state.y * fb_width) + old_state.x; - byte *bak = _ms_backup; - - while (old_h > 0) { - memcpy(dst, bak, old_state.w); - bak += BAK_WIDTH; - dst += fb_width; - old_h--; - } -} - -void OSystem_X11::set_mouse_pos(int x, int y) -{ - if ((x != cur_state.x) || (y != cur_state.y)) { - cur_state.x = x; - cur_state.y = y; - undraw_mouse(); - } -} - -void OSystem_X11::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) -{ - cur_state.w = w; - cur_state.h = h; - cur_state.hot_x = hotspot_x; - cur_state.hot_y = hotspot_y; - _ms_buf = (byte *)buf; - - undraw_mouse(); -} - -void OSystem_X11::set_shake_pos(int shake_pos) -{ - new_shake_pos = shake_pos; -} - -void *OSystem_X11::create_thread(ThreadProc *proc, void *param) -{ - pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); - if (pthread_create(thread, NULL, (void *(*)(void *))proc, param)) - return NULL; - else - return thread; -} - -uint32 OSystem_X11::property(int param, Property *value) -{ - switch (param) { - case PROP_GET_SAMPLE_RATE: - return 22050; - case PROP_GET_FULLSCREEN: - return 0; - } - warning("Property not implemented yet (%d) ", param); - return 0; -} - -bool OSystem_X11::poll_cdrom() -{ - return false; -} - -void OSystem_X11::play_cdrom(int track, int num_loops, int start_frame, int end_frame) -{ -} - -void OSystem_X11::stop_cdrom() -{ -} - -void OSystem_X11::update_cdrom() -{ -} - -void OSystem_X11::delay_msecs(uint msecs) -{ - usleep(msecs * 1000); -} - -bool OSystem_X11::poll_event(Event *scumm_event) -{ - /* First, handle timers */ - uint32 current_msecs = get_msecs(); - - if (_timer_active && (current_msecs >= _timer_next_expiry)) { - _timer_duration = _timer_callback(_timer_duration); - _timer_next_expiry = current_msecs + _timer_duration; - } - - while (XPending(display)) { - XEvent event; - - XNextEvent(display, &event); - switch (event.type) { - case Expose:{ - int real_w, real_h; - int real_x, real_y; - real_x = event.xexpose.x; - real_y = event.xexpose.y; - real_w = event.xexpose.width; - real_h = event.xexpose.height; - if (real_x < scumm_x) { - real_w -= scumm_x - real_x; - real_x = 0; - } else { - real_x -= scumm_x; - } - if (real_y < scumm_y) { - real_h -= scumm_y - real_y; - real_y = 0; - } else { - real_y -= scumm_y; - } - if ((real_h <= 0) || (real_w <= 0)) - break; - if ((real_x >= fb_width) || (real_y >= fb_height)) - break; - - if ((real_x + real_w) >= fb_width) { - real_w = fb_width - real_x; - } - if ((real_y + real_h) >= fb_height) { - real_h = fb_height - real_y; - } - - /* Compute the intersection of the expose event with the real ScummVM display zone */ - AddDirtyRec(real_x, real_y, real_w, real_h); - } - break; - - case KeyPress: - switch (event.xkey.keycode) { - case 132: - report_presses = 0; - break; - - case 133: - fake_right_mouse = 1; - break; - } - break; - - case KeyRelease:{ - /* I am using keycodes here and NOT keysyms to be sure that even if the user - remaps his iPAQ's keyboard, it will still work. - */ - int keycode = -1; - int ascii = -1; - byte mode = 0; - - if (event.xkey.state & 0x01) - mode |= KBD_SHIFT; - if (event.xkey.state & 0x04) - mode |= KBD_CTRL; - if (event.xkey.state & 0x08) - mode |= KBD_ALT; - switch (event.xkey.keycode) { - case 9: /* Escape on my PC */ - case 130: /* Calendar on the iPAQ */ - keycode = 27; - break; - - case 71: /* F5 on my PC */ - case 128: /* Record on the iPAQ */ - keycode = 319; - break; - - case 65: /* Space on my PC */ - case 131: /* Schedule on the iPAQ */ - keycode = 32; - break; - - case 132: /* 'Q' on the iPAQ */ - report_presses = 1; - break; - - case 133: /* Arrow on the iPAQ */ - fake_right_mouse = 0; - break; - - default:{ - KeySym xsym; - xsym = XKeycodeToKeysym(display, event.xkey.keycode, 0); - keycode = xsym; - if ((xsym >= 'a') && (xsym <= 'z') && (event.xkey.state & 0x01)) - xsym &= ~0x20; /* Handle shifted keys */ - ascii = xsym; - } - } - if (keycode != -1) { - scumm_event->event_code = EVENT_KEYDOWN; - scumm_event->kbd.keycode = keycode; - scumm_event->kbd.ascii = (ascii != -1 ? ascii : keycode); - scumm_event->kbd.flags = mode; - return true; - } - } - break; - - case ButtonPress: - if (report_presses != 0) { - if (event.xbutton.button == 1) { - if (fake_right_mouse == 0) { - scumm_event->event_code = EVENT_LBUTTONDOWN; - } else { - scumm_event->event_code = EVENT_RBUTTONDOWN; - } - } else if (event.xbutton.button == 3) - scumm_event->event_code = EVENT_RBUTTONDOWN; - scumm_event->mouse.x = event.xbutton.x - scumm_x; - scumm_event->mouse.y = event.xbutton.y - scumm_y; - return true; - } - break; - - case ButtonRelease: - if (report_presses != 0) { - if (event.xbutton.button == 1) { - if (fake_right_mouse == 0) { - scumm_event->event_code = EVENT_LBUTTONUP; - } else { - scumm_event->event_code = EVENT_RBUTTONUP; - } - } else if (event.xbutton.button == 3) - scumm_event->event_code = EVENT_RBUTTONUP; - scumm_event->mouse.x = event.xbutton.x - scumm_x; - scumm_event->mouse.y = event.xbutton.y - scumm_y; - return true; - } - break; - - case MotionNotify: - scumm_event->event_code = EVENT_MOUSEMOVE; - scumm_event->mouse.x = event.xmotion.x - scumm_x; - scumm_event->mouse.y = event.xmotion.y - scumm_y; - return true; - - case ConfigureNotify:{ - if ((window_width != event.xconfigure.width) || (window_height != event.xconfigure.height)) { - window_width = event.xconfigure.width; - window_height = event.xconfigure.height; - scumm_x = (window_width - fb_width) / 2; - scumm_y = (window_height - fb_height) / 2; - XFillRectangle(display, window, black_gc, 0, 0, window_width, window_height); - } - } - break; - - default: - printf("Unhandled event : %d\n", event.type); - break; - } - } - - return false; -} - -void OSystem_X11::set_timer(int timer, int (*callback) (int)) -{ - if (callback != NULL) { - _timer_duration = timer; - _timer_next_expiry = get_msecs() + timer; - _timer_callback = callback; - _timer_active = true; - } else { - _timer_active = false; - } -} - -void *OSystem_X11::create_mutex(void) -{ - pthread_mutex_t *mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); - pthread_mutex_init(mutex, NULL); - return (void *)mutex; -} - -void OSystem_X11::lock_mutex(void *mutex) -{ - pthread_mutex_lock((pthread_mutex_t *) mutex); -} - -void OSystem_X11::unlock_mutex(void *mutex) -{ - pthread_mutex_unlock((pthread_mutex_t *) mutex); -} - -void OSystem_X11::delete_mutex(void *mutex) -{ - pthread_mutex_destroy((pthread_mutex_t *) mutex); - free(mutex); -} -- cgit v1.2.3